summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-10-04 17:02:15 -0700
committerEric Anholt <eric@anholt.net>2007-10-11 12:17:14 -0700
commit4ca3550fb7d488741f8dc1ba3c8722393277c3b8 (patch)
tree5c87e871275ef3b6e42be58bf44a59bda558607c /src/i830_driver.c
parentf393a12d21eed668cf4771f022beded9a4c547c7 (diff)
Rework DRI buffer mappings and sarea setup to allow for moving buffers.
While this has been a desired feature for some time, to allow for reallocation of the front buffer, it was made more necessary by the desire to avoid requiring a NO_MOVE buffer type in TTM because buffer objects may not be left pinned over VT switch. This is a step towards making those buffers movable and resizable.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index b3edb61a..d24c408a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3018,6 +3018,17 @@ I830EnterVT(int scrnIndex, int flags)
pI830->leaving = FALSE;
+#ifdef XF86DRI_MM
+ if (pI830->directRenderingEnabled) {
+ /* Unlock the memory manager first of all so that we can pin our
+ * buffer objects
+ */
+ if (pI830->memory_manager != NULL) {
+ drmMMUnlock(pI830->drmSubFD, DRM_BO_MEM_TT);
+ }
+ }
+#endif /* XF86DRI_MM */
+
if (I830IsPrimary(pScrn))
if (!i830_bind_all_memory(pScrn))
return FALSE;
@@ -3077,11 +3088,11 @@ I830EnterVT(int scrnIndex, int flags)
for(i = 0; i < I830_NR_TEX_REGIONS+1 ; i++)
sarea->texList[i].age = sarea->texAge;
-#ifdef XF86DRI_MM
- if (pI830->memory_manager != NULL) {
- drmMMUnlock(pI830->drmSubFD, DRM_BO_MEM_TT);
- }
-#endif /* XF86DRI_MM */
+ /* Update buffer offsets in sarea and mappings, since buffer offsets
+ * may have changed.
+ */
+ if (!i830_update_dri_buffers(pScrn))
+ FatalError("i830_update_dri_buffers() failed\n");
DPRINTF(PFX, "calling dri unlock\n");
DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);