Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293788
b: refs/heads/master
c: 5f61bb4
h: refs/heads/master
v: v3
  • Loading branch information
Ville Syrjälä authored and Dave Airlie committed Mar 15, 2012
1 parent d55ae38 commit 28af256
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90367bf6e98352520d15634ac4e79f0d4598cff1
refs/heads/master: 5f61bb421f01023986902200b6486978c07176f7
24 changes: 24 additions & 0 deletions trunk/drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,18 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
}

drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);

if (mode->hdisplay > fb->width ||
mode->vdisplay > fb->height ||
crtc_req->x > fb->width - mode->hdisplay ||
crtc_req->y > fb->height - mode->vdisplay) {
DRM_DEBUG_KMS("Invalid CRTC viewport %ux%u+%u+%u for fb size %ux%u.\n",
mode->hdisplay, mode->vdisplay,
crtc_req->x, crtc_req->y,
fb->width, fb->height);
ret = -ENOSPC;
goto out;
}
}

if (crtc_req->count_connectors == 0 && mode) {
Expand Down Expand Up @@ -3206,6 +3218,18 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
goto out;
fb = obj_to_fb(obj);

if (crtc->mode.hdisplay > fb->width ||
crtc->mode.vdisplay > fb->height ||
crtc->x > fb->width - crtc->mode.hdisplay ||
crtc->y > fb->height - crtc->mode.vdisplay) {
DRM_DEBUG_KMS("Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d.\n",
fb->width, fb->height,
crtc->mode.hdisplay, crtc->mode.vdisplay,
crtc->x, crtc->y);
ret = -ENOSPC;
goto out;
}

if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
ret = -ENOMEM;
spin_lock_irqsave(&dev->event_lock, flags);
Expand Down

0 comments on commit 28af256

Please sign in to comment.