diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2012-05-24 14:08:59 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-05 07:29:45 -0400 |
commit | e6a595d2db7ad403fcb2b7b168754d7551fc8c9b (patch) | |
tree | 0925ca05d909924b30d4888d4e06b9db4989ba1f /drivers | |
parent | 3a7f2f6a9e43f2c5ce45d4ca19c43bf61df3f0dd (diff) |
drm/i915: Reject page flips with changed format/offset/pitch
MI display flips can't handle some changes in the framebuffer
format or layout. Return an error in such cases.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 4d84fcdd413f..7e31f7af0de8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6438,6 +6438,19 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
6438 | unsigned long flags; | 6438 | unsigned long flags; |
6439 | int ret; | 6439 | int ret; |
6440 | 6440 | ||
6441 | /* Can't change pixel format via MI display flips. */ | ||
6442 | if (fb->pixel_format != crtc->fb->pixel_format) | ||
6443 | return -EINVAL; | ||
6444 | |||
6445 | /* | ||
6446 | * TILEOFF/LINOFF registers can't be changed via MI display flips. | ||
6447 | * Note that pitch changes could also affect these register. | ||
6448 | */ | ||
6449 | if (INTEL_INFO(dev)->gen > 3 && | ||
6450 | (fb->offsets[0] != crtc->fb->offsets[0] || | ||
6451 | fb->pitches[0] != crtc->fb->pitches[0])) | ||
6452 | return -EINVAL; | ||
6453 | |||
6441 | work = kzalloc(sizeof *work, GFP_KERNEL); | 6454 | work = kzalloc(sizeof *work, GFP_KERNEL); |
6442 | if (work == NULL) | 6455 | if (work == NULL) |
6443 | return -ENOMEM; | 6456 | return -ENOMEM; |