diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-03-05 12:57:21 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-03-05 12:57:21 +0100 |
commit | d717d9d566fe3c0866b06840114e1c1990bd7be0 (patch) | |
tree | aa47beddee5f32c001ad99d40870e58404d0839f /src/i830_driver.c | |
parent | 7358642e64ab6d13bc1dc1a44703ee66d715ff61 (diff) |
Fix DRM memory manager initialization.
It takes the offset and size in pages, not bytes.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r-- | src/i830_driver.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c index 373c6360..7ab2cdc8 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -2764,13 +2764,17 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) I830DRICloseScreen(pScreen); pI830->directRenderingEnabled = FALSE; } else { + unsigned long aperEnd = ROUND_DOWN_TO(pI830->memory_manager->offset + + pI830->memory_manager->size, + GTT_PAGE_SIZE) / GTT_PAGE_SIZE; + unsigned long aperStart = ROUND_TO(pI830->memory_manager->offset, + GTT_PAGE_SIZE) / GTT_PAGE_SIZE; + #ifndef XSERVER_LIBDRM_MM - if (I830DrmMMInit(pI830->drmSubFD, pI830->memory_manager->offset, - pI830->memory_manager->size, + if (I830DrmMMInit(pI830->drmSubFD, aperStart, aperEnd - aperStart, DRM_BO_MEM_TT)) { #else - if (drmMMInit(pI830->drmSubFD, pI830->memory_manager->offset, - pI830->memory_manager->size, + if (drmMMInit(pI830->drmSubFD, aperStart, aperEnd - aperStart, DRM_BO_MEM_TT)) { #endif xf86DrvMsg(pScrn->scrnIndex, X_ERROR, |