summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-07-10 14:49:20 -0700
committerKeith Packard <keithp@keithp.com>2009-07-10 18:26:59 -0700
commit56bfee8705f5d7d965227013b205dbc4c93e220c (patch)
tree45053912453075015740fe59408bae51a3591bf3
parent98087a0b966d5dc69faf72719153a2c878ba3de1 (diff)
Always set screen pixmap data pointer at init and resize times
For non-DRM environments, the screen pixmap will be GART allocated memory and not a libdrm buffer object and so uxa will only use devPrivate.ptr to find the associated memory. Make sure devPrivate.ptr is set each time the framebuffer is allocated so that uxa will be able to draw to it. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/i830_driver.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index ee39a1b9..e5e5fd7a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -880,7 +880,6 @@ i830_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
i830_memory *new_front, *old_front;
Bool tiled;
ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
- pointer data = NULL;
scrn->displayWidth = i830_pad_drawable_width(width, i830->cpp);
tiled = i830_tiled_width(i830, &scrn->displayWidth, i830->cpp);
@@ -900,15 +899,15 @@ i830_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
i830_set_pixmap_bo(screen->GetScreenPixmap(screen),
new_front->bo);
scrn->fbOffset = i830->front_buffer->offset;
- if (!new_front->bo)
- data = i830->FbBase + scrn->fbOffset;
+
screen->ModifyPixmapHeader(screen->GetScreenPixmap(screen),
width, height, -1, -1, scrn->displayWidth * i830->cpp,
- data);
+ i830->FbBase + scrn->fbOffset);
+
/* ick. xf86EnableDisableFBAccess smashes the screen pixmap devPrivate,
* so update the value it uses
*/
- scrn->pixmapPrivate.ptr = data;
+ scrn->pixmapPrivate.ptr = i830->FbBase + scrn->fbOffset;
xf86DrvMsg(scrn->scrnIndex, X_INFO, "New front buffer at 0x%lx\n",
i830->front_buffer->offset);
i830_set_new_crtc_bo(scrn);
@@ -2719,6 +2718,12 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (pScrn->virtualX > pScrn->displayWidth)
pScrn->displayWidth = pScrn->virtualX;
+ /* If the front buffer is not a BO, we need to
+ * set the initial framebuffer pixmap to point at
+ * it
+ */
+ pScrn->fbOffset = pI830->front_buffer->offset;
+
DPRINTF(PFX, "assert( if(!fbScreenInit(pScreen, ...) )\n");
if (!fbScreenInit(pScreen, pI830->FbBase + pScrn->fbOffset,
pScrn->virtualX, pScrn->virtualY,