diff options
author | Thomas Hellstrom <[email protected]> | 2010-07-22 01:49:46 +0200 |
---|---|---|
committer | Thomas Hellstrom <[email protected]> | 2010-07-23 04:48:32 +0200 |
commit | a7a126bdfa386a4be9dd1f7bac1825edb7ff3fcd (patch) | |
tree | 72509a73944753d6d9e7071a093fec6a39d28fff /src/gallium/state_trackers/xorg/xorg_driver.c | |
parent | 2299ff4c6bc172cb25ea3ecb75ee3dcc2cffd7ed (diff) |
st/xorg: Add a possibility to prune modes and limit fb allocation size based on max fb size.
Signed-off-by: Thomas Hellstrom <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_driver.c')
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_driver.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index c69d75e22e8..5056bf417c1 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -190,6 +190,7 @@ drv_crtc_resize(ScrnInfoPtr pScrn, int width, int height) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); modesettingPtr ms = modesettingPTR(pScrn); + CustomizerPtr cust = ms->cust; ScreenPtr pScreen = pScrn->pScreen; int old_width, old_height; PixmapPtr rootPixmap; @@ -198,6 +199,16 @@ drv_crtc_resize(ScrnInfoPtr pScrn, int width, int height) if (width == pScrn->virtualX && height == pScrn->virtualY) return TRUE; + if (cust && cust->winsys_check_fb_size && + !cust->winsys_check_fb_size(cust, width*pScrn->bitsPerPixel / 8, + height)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Requested framebuffer size %dx%dx%d will not fit " + "in display memory.\n", + width, height, pScrn->bitsPerPixel); + return FALSE; + } + old_width = pScrn->virtualX; old_height = pScrn->virtualY; pScrn->virtualX = width; |