Under KMS, the whole frame buffer is never allocated to the X server, and so
accessing the frame buffer must be done by directly mapping it using
drm_intel_gem_bo_map_gtt when it is created.

Signed-off-by: Keith Packard <kei...@keithp.com>
---
 src/drmmode_display.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e9296dc..6681e7e 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1021,6 +1021,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int 
height)
        ScreenPtr   screen = screenInfo.screens[scrn->scrnIndex];
        uint32_t    old_fb_id;
        int         i, pitch, old_width, old_height, old_pitch;
+       pointer     *data;
 
        if (scrn->virtualX == width && scrn->virtualY == height)
                return TRUE;
@@ -1052,10 +1053,21 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, 
int height)
                goto fail;
 
        i830_set_pixmap_bo(screen->GetScreenPixmap(screen), 
pI830->front_buffer->bo);
-       scrn->fbOffset = pI830->front_buffer->offset;
+       if (pI830->accel == ACCEL_UXA)
+               data = NULL;
+       else {
+               drm_intel_gem_bo_map_gtt(pI830->front_buffer->bo);
+               data = pI830->front_buffer->bo->virtual;
+       }
 
        screen->ModifyPixmapHeader(screen->GetScreenPixmap(screen),
-                                  width, height, -1, -1, pitch * pI830->cpp, 
NULL);
+                                  width, height, -1, -1, pitch * pI830->cpp,
+                                  data);
+
+       /* ick. xf86EnableDisableFBAccess smashes the screen pixmap devPrivate,
+        * so update the value it uses
+        */
+       scrn->pixmapPrivate.ptr = data;
        xf86DrvMsg(scrn->scrnIndex, X_INFO, "New front buffer at 0x%lx\n",
                   pI830->front_buffer->offset);
 
-- 
1.6.3.3


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to