diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-12-22 12:50:23 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-22 05:15:01 +0300 |
commit | 9ba8310647fc39d95c2a1ebb974fc189e74b11d4 (patch) | |
tree | 2d79d103d28da85d6a22703d39f557e1097e3901 /drivers/gpu/drm/nouveau/nv50_display.c | |
parent | 0ea5fe8a83c2d1d59bcf1a59ba685a6452c41205 (diff) | |
download | linux-9ba8310647fc39d95c2a1ebb974fc189e74b11d4.tar.xz |
drm/nv50-/kms: reject attempts at flipping to incompatible framebuffer
Looks like a userspace bug can trigger this somehow during a mode
switch, causing: EVO complaint -> semaphores get out of sync ->
entire display stalled.
We likely want to be even stricter than this (or at least deal
better if EVO rejects our request), but I'll save that for the
drm_plane/atomic conversion and just fix the bug that I already
know can be triggered.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 85cc667cfb0f..fcbbf3884781 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -550,6 +550,10 @@ nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, u32 *push; int ret; + if (crtc->primary->fb->width != fb->width || + crtc->primary->fb->height != fb->height) + return -EINVAL; + swap_interval <<= 4; if (swap_interval == 0) swap_interval |= 0x100; |