diff options
author | Soren Sandmann <ssp@localhost.localdomain> | 2010-04-19 09:31:08 -0400 |
---|---|---|
committer | Soren Sandmann <ssp@localhost.localdomain> | 2010-04-19 09:31:08 -0400 |
commit | 0f6f73fe6db56ab3a497c05a5ff6eaa14bc4a7af (patch) | |
tree | ebe5fbbc38e62f5dccc242eada24aa29a5ad1b5f | |
parent | 407ffe8d4fd067918479cdbaa9bc92c03a5c6fa2 (diff) |
Set correct amount of video memorymemslots
-rw-r--r-- | src/qxl_driver.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c index c45bdb4..6b54edf 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -1221,7 +1221,9 @@ qxl_check_device(ScrnInfoPtr pScrn, qxl_screen_t *qxl) qxl->draw_area_offset = rom->draw_area_offset; qxl->draw_area_size = rom->draw_area_size; - pScrn->videoRam = rom->draw_area_size / 1024; + pScrn->videoRam = (rom->num_io_pages * 4096) / 1024; + + xf86DrvMsg(scrnIndex, X_INFO, "%d KB of video RAM\n", pScrn->videoRam); return TRUE; } @@ -1264,6 +1266,7 @@ static ModeStatus qxl_valid_mode(int scrn, DisplayModePtr p, Bool flag, int pass) { ScrnInfoPtr pScrn = xf86Screens[scrn]; + int scrnIndex = pScrn->scrnIndex; qxl_screen_t *qxl = pScrn->driverPrivate; int bpp = pScrn->bitsPerPixel; int mode_idx; @@ -1272,14 +1275,21 @@ qxl_valid_mode(int scrn, DisplayModePtr p, Bool flag, int pass) * correct amount of video ram? */ if (p->HDisplay * p->VDisplay * (bpp/8) > qxl->draw_area_size) + { + xf86DrvMsg(scrnIndex, X_INFO, "rejecting mode %d x %d: insufficient memory\n", p->HDisplay, p->VDisplay); return MODE_MEM; + } mode_idx = qxl_find_native_mode (pScrn, p); if (mode_idx == -1) + { + xf86DrvMsg(scrnIndex, X_INFO, "rejecting unknown mode %d x %d\n", p->HDisplay, p->VDisplay); return MODE_NOMODE; - + } p->Private = (void *)(unsigned long)mode_idx; + xf86DrvMsg (scrnIndex, X_INFO, "accepting %d x %d\n", p->HDisplay, p->VDisplay); + return MODE_OK; } |