[PATCH] xserver: fix build with glamor disabled.

Dave Airlie airlied at gmail.com
Wed Jul 1 03:41:15 PDT 2015


This fixes modesetting when glamor is disabled.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 hw/xfree86/drivers/modesetting/driver.c          | 4 ++++
 hw/xfree86/drivers/modesetting/drmmode_display.c | 3 ++-
 hw/xfree86/drivers/modesetting/present.c         | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 8603338..7ee7590 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -1000,6 +1000,7 @@ msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle)
 static Bool
 msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle)
 {
+#ifdef GLAMOR
     ScreenPtr screen = ppix->drawable.pScreen;
     ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     modesettingPtr ms = modesettingPTR(scrn);
@@ -1020,6 +1021,9 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle)
         return ret;
 
     return TRUE;
+#else
+    return FALSE;
+#endif
 }
 
 static Bool
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 8dbac07..dc7d9f6 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -146,6 +146,7 @@ drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
 Bool
 drmmode_bo_for_pixmap(drmmode_ptr drmmode, drmmode_bo *bo, PixmapPtr pixmap)
 {
+#ifdef GLAMOR
     ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn);
     uint16_t pitch;
     uint32_t size;
@@ -165,9 +166,9 @@ drmmode_bo_for_pixmap(drmmode_ptr drmmode, drmmode_bo *bo, PixmapPtr pixmap)
                    "Failed to get fd for flip to new front.\n");
         return FALSE;
     }
-
     bo->dumb = dumb_get_bo_from_fd(drmmode->fd, fd, pitch, size);
     close(fd);
+#endif
 
     return bo->dumb != NULL;
 }
diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
index 0905398..bb2976b 100644
--- a/hw/xfree86/drivers/modesetting/present.c
+++ b/hw/xfree86/drivers/modesetting/present.c
@@ -641,8 +641,8 @@ static present_screen_info_rec ms_present_screen_info = {
     .flush = ms_present_flush,
 
     .capabilities = PresentCapabilityNone,
-    .check_flip = ms_present_check_flip,
 #ifdef GLAMOR
+    .check_flip = ms_present_check_flip,
     .flip = ms_present_flip,
     .unflip = ms_present_unflip,
 #endif
-- 
2.4.3



More information about the xorg-devel mailing list