aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_sprite.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-10-01 11:02:14 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-10 06:47:00 -0400
commit2afd9efd23437e2534a1caa6f8be4e70fd0d51c4 (patch)
treeadc25fb6699d1de8ef3c26be6f6fd58a5f63ffa3 /drivers/gpu/drm/i915/intel_sprite.c
parent5f3fb46bbd643ddacde33fd5fe6f4db4ca963312 (diff)
drm/i915: Do a bit of cleanup in the sprite code
Move the variable initialization to where the variables are declared, and kill a pointless to_intel_crtc() cast when we already have the casted pointer. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sprite.c')
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index b5e30b16a9cc..549243a795fa 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -631,9 +631,10 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
631 struct drm_device *dev = plane->dev; 631 struct drm_device *dev = plane->dev;
632 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 632 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
633 struct intel_plane *intel_plane = to_intel_plane(plane); 633 struct intel_plane *intel_plane = to_intel_plane(plane);
634 struct intel_framebuffer *intel_fb; 634 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
635 struct drm_i915_gem_object *obj, *old_obj; 635 struct drm_i915_gem_object *obj = intel_fb->obj;
636 int ret = 0; 636 struct drm_i915_gem_object *old_obj = intel_plane->obj;
637 int ret;
637 bool disable_primary = false; 638 bool disable_primary = false;
638 bool visible; 639 bool visible;
639 int hscale, vscale; 640 int hscale, vscale;
@@ -658,11 +659,6 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
658 .y2 = intel_crtc->active ? intel_crtc->config.pipe_src_h : 0, 659 .y2 = intel_crtc->active ? intel_crtc->config.pipe_src_h : 0,
659 }; 660 };
660 661
661 intel_fb = to_intel_framebuffer(fb);
662 obj = intel_fb->obj;
663
664 old_obj = intel_plane->obj;
665
666 intel_plane->crtc_x = crtc_x; 662 intel_plane->crtc_x = crtc_x;
667 intel_plane->crtc_y = crtc_y; 663 intel_plane->crtc_y = crtc_y;
668 intel_plane->crtc_w = crtc_w; 664 intel_plane->crtc_w = crtc_w;
@@ -852,7 +848,7 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
852 * do the pin & ref bookkeeping. 848 * do the pin & ref bookkeeping.
853 */ 849 */
854 if (old_obj != obj && intel_crtc->active) 850 if (old_obj != obj && intel_crtc->active)
855 intel_wait_for_vblank(dev, to_intel_crtc(crtc)->pipe); 851 intel_wait_for_vblank(dev, intel_crtc->pipe);
856 852
857 mutex_lock(&dev->struct_mutex); 853 mutex_lock(&dev->struct_mutex);
858 intel_unpin_fb_obj(old_obj); 854 intel_unpin_fb_obj(old_obj);