Commit 933f622f authored by Rob Clark's avatar Rob Clark Committed by Daniel Vetter

drm: use mode_object_find helpers

Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 417009fb
...@@ -2405,7 +2405,6 @@ int drm_mode_setplane(struct drm_device *dev, void *data, ...@@ -2405,7 +2405,6 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
struct drm_file *file_priv) struct drm_file *file_priv)
{ {
struct drm_mode_set_plane *plane_req = data; struct drm_mode_set_plane *plane_req = data;
struct drm_mode_object *obj;
struct drm_plane *plane; struct drm_plane *plane;
struct drm_crtc *crtc = NULL; struct drm_crtc *crtc = NULL;
struct drm_framebuffer *fb = NULL; struct drm_framebuffer *fb = NULL;
...@@ -2428,14 +2427,12 @@ int drm_mode_setplane(struct drm_device *dev, void *data, ...@@ -2428,14 +2427,12 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
* First, find the plane, crtc, and fb objects. If not available, * First, find the plane, crtc, and fb objects. If not available,
* we don't bother to call the driver. * we don't bother to call the driver.
*/ */
obj = drm_mode_object_find(dev, plane_req->plane_id, plane = drm_plane_find(dev, plane_req->plane_id);
DRM_MODE_OBJECT_PLANE); if (!plane) {
if (!obj) {
DRM_DEBUG_KMS("Unknown plane ID %d\n", DRM_DEBUG_KMS("Unknown plane ID %d\n",
plane_req->plane_id); plane_req->plane_id);
return -ENOENT; return -ENOENT;
} }
plane = obj_to_plane(obj);
if (plane_req->fb_id) { if (plane_req->fb_id) {
fb = drm_framebuffer_lookup(dev, plane_req->fb_id); fb = drm_framebuffer_lookup(dev, plane_req->fb_id);
...@@ -2445,14 +2442,12 @@ int drm_mode_setplane(struct drm_device *dev, void *data, ...@@ -2445,14 +2442,12 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
return -ENOENT; return -ENOENT;
} }
obj = drm_mode_object_find(dev, plane_req->crtc_id, crtc = drm_crtc_find(dev, plane_req->crtc_id);
DRM_MODE_OBJECT_CRTC); if (!crtc) {
if (!obj) {
DRM_DEBUG_KMS("Unknown crtc ID %d\n", DRM_DEBUG_KMS("Unknown crtc ID %d\n",
plane_req->crtc_id); plane_req->crtc_id);
return -ENOENT; return -ENOENT;
} }
crtc = obj_to_crtc(obj);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment