[PATCH xserver] modesetting: Move GBM code inside #ifdef GLAMOR_HAS_GBM

Matt Turner mattst88 at gmail.com
Mon Apr 16 06:37:45 UTC 2018


Fixes a compilation error without Glamor.

Bugzilla: https://bugs.gentoo.org/653288
Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
Unfortunately, there's more: Xwayland fails to link without Glamor.

 hw/xfree86/drivers/modesetting/drmmode_display.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 322ef050b..79e91f0f8 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -998,18 +998,18 @@ static Bool
 drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
                   unsigned width, unsigned height, unsigned bpp)
 {
-    uint32_t format;
-
-    if (drmmode->scrn->depth == 30)
-        format = GBM_FORMAT_ARGB2101010;
-    else
-        format = GBM_FORMAT_ARGB8888;
-
     bo->width = width;
     bo->height = height;
 
 #ifdef GLAMOR_HAS_GBM
     if (drmmode->glamor) {
+        uint32_t format;
+
+        if (drmmode->scrn->depth == 30)
+            format = GBM_FORMAT_ARGB2101010;
+        else
+            format = GBM_FORMAT_ARGB8888;
+
 #ifdef GBM_BO_WITH_MODIFIERS
         uint32_t num_modifiers;
         uint64_t *modifiers = NULL;
-- 
2.16.1



More information about the xorg-devel mailing list