aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-10-01 11:02:15 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-10 06:47:00 -0400
commit098ebd6b7e3ed53bdb0a368b7c2bae29f3914c88 (patch)
treeb724839908589fd2cc0f9c09b52d2d7f1349817c /drivers/gpu/drm/i915
parent2afd9efd23437e2534a1caa6f8be4e70fd0d51c4 (diff)
drm/i915: Save user requested plane coordinates only on success
If the setplane operation fails, we shouldn't save the user's requested plane coordinates. Since we adjust the coordinates during the clipping process, make a copy of the originals, and once the operation has succeeded save them for later reuse when the plane gets re-enabled. 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')
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 549243a795fa..276c3a6a9168 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -658,15 +658,20 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
658 .x2 = intel_crtc->active ? intel_crtc->config.pipe_src_w : 0, 658 .x2 = intel_crtc->active ? intel_crtc->config.pipe_src_w : 0,
659 .y2 = intel_crtc->active ? intel_crtc->config.pipe_src_h : 0, 659 .y2 = intel_crtc->active ? intel_crtc->config.pipe_src_h : 0,
660 }; 660 };
661 661 const struct {
662 intel_plane->crtc_x = crtc_x; 662 int crtc_x, crtc_y;
663 intel_plane->crtc_y = crtc_y; 663 unsigned int crtc_w, crtc_h;
664 intel_plane->crtc_w = crtc_w; 664 uint32_t src_x, src_y, src_w, src_h;
665 intel_plane->crtc_h = crtc_h; 665 } orig = {
666 intel_plane->src_x = src_x; 666 .crtc_x = crtc_x,
667 intel_plane->src_y = src_y; 667 .crtc_y = crtc_y,
668 intel_plane->src_w = src_w; 668 .crtc_w = crtc_w,
669 intel_plane->src_h = src_h; 669 .crtc_h = crtc_h,
670 .src_x = src_x,
671 .src_y = src_y,
672 .src_w = src_w,
673 .src_h = src_h,
674 };
670 675
671 /* Don't modify another pipe's plane */ 676 /* Don't modify another pipe's plane */
672 if (intel_plane->pipe != intel_crtc->pipe) { 677 if (intel_plane->pipe != intel_crtc->pipe) {
@@ -818,6 +823,14 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
818 if (ret) 823 if (ret)
819 return ret; 824 return ret;
820 825
826 intel_plane->crtc_x = orig.crtc_x;
827 intel_plane->crtc_y = orig.crtc_y;
828 intel_plane->crtc_w = orig.crtc_w;
829 intel_plane->crtc_h = orig.crtc_h;
830 intel_plane->src_x = orig.src_x;
831 intel_plane->src_y = orig.src_y;
832 intel_plane->src_w = orig.src_w;
833 intel_plane->src_h = orig.src_h;
821 intel_plane->obj = obj; 834 intel_plane->obj = obj;
822 835
823 if (intel_crtc->active) { 836 if (intel_crtc->active) {