aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2009-08-11 10:05:30 -0400
committerEric Anholt <eric@anholt.net>2009-09-04 16:05:41 -0400
commitc05422d52ee6b4cff8b63eab1a7351780518fc5e (patch)
treedb39ac4f81f70cd1703c832ce9c2484cb05d2eae /drivers/gpu/drm/i915/intel_display.c
parent67cf781bea52d461b7c8b63b23be19e87c33d7bf (diff)
drm/i915: remove open-coded drm_mode_object_find
And clean up a small whitespace goof-up in the same function, while I was looking at it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 35e86196c062..f0f38f5e752c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3557,30 +3557,26 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
3557{ 3557{
3558 drm_i915_private_t *dev_priv = dev->dev_private; 3558 drm_i915_private_t *dev_priv = dev->dev_private;
3559 struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data; 3559 struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
3560 struct drm_crtc *crtc = NULL; 3560 struct drm_mode_object *drmmode_obj;
3561 int pipe = -1; 3561 struct intel_crtc *crtc;
3562 3562
3563 if (!dev_priv) { 3563 if (!dev_priv) {
3564 DRM_ERROR("called with no initialization\n"); 3564 DRM_ERROR("called with no initialization\n");
3565 return -EINVAL; 3565 return -EINVAL;
3566 } 3566 }
3567 3567
3568 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 3568 drmmode_obj = drm_mode_object_find(dev, pipe_from_crtc_id->crtc_id,
3569 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 3569 DRM_MODE_OBJECT_CRTC);
3570 if (crtc->base.id == pipe_from_crtc_id->crtc_id) {
3571 pipe = intel_crtc->pipe;
3572 break;
3573 }
3574 }
3575 3570
3576 if (pipe == -1) { 3571 if (!drmmode_obj) {
3577 DRM_ERROR("no such CRTC id\n"); 3572 DRM_ERROR("no such CRTC id\n");
3578 return -EINVAL; 3573 return -EINVAL;
3579 } 3574 }
3580 3575
3581 pipe_from_crtc_id->pipe = pipe; 3576 crtc = to_intel_crtc(obj_to_crtc(drmmode_obj));
3577 pipe_from_crtc_id->pipe = crtc->pipe;
3582 3578
3583 return 0; 3579 return 0;
3584} 3580}
3585 3581
3586struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe) 3582struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe)