summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy White <jwhite@codeweavers.com>2019-07-31 11:27:20 -0500
committerFrediano Ziglio <fziglio@redhat.com>2019-08-01 10:24:50 +0100
commit052b4c32efa70a67554e4d5f8ba346af664d4c71 (patch)
treec687baefd178287366ac1755e66c6661fc05b915
parent9e6987c492897e19e53af1ffea69cda749d1d225 (diff)
Provide compatibility for Glamor in Xorg 1.17.
In Xorg 1.18, X changed so that GLAMOR_USE_EGL_SCREEN was the only flag required and it implies the behavior previously requested with the GLAMOR_USE_SCREEN and GLAMORE_USE_PICTURE_SCREEN flags. Thus, if we are building against an older Xorg, we need to specify those now deprecated flags. Additionally, the compat-api header conflicts with the older glamor header file, so it needs to be moved to be included after glamor.h. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--spice-video-dummy/src/dummy.h4
-rw-r--r--spice-video-dummy/src/spicedummy_driver.c15
2 files changed, 16 insertions, 3 deletions
diff --git a/spice-video-dummy/src/dummy.h b/spice-video-dummy/src/dummy.h
index a250290..af77c17 100644
--- a/spice-video-dummy/src/dummy.h
+++ b/spice-video-dummy/src/dummy.h
@@ -11,11 +11,11 @@
#endif
#include <string.h>
-#include "compat-api.h"
-
#define GLAMOR_FOR_XORG 1
#include "glamor.h"
+#include "compat-api.h"
+
/* Supported chipsets */
typedef enum {
DUMMY_CHIP
diff --git a/spice-video-dummy/src/spicedummy_driver.c b/spice-video-dummy/src/spicedummy_driver.c
index fc355f8..1dbe87b 100644
--- a/spice-video-dummy/src/spicedummy_driver.c
+++ b/spice-video-dummy/src/spicedummy_driver.c
@@ -558,6 +558,19 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
int ret;
VisualPtr visual;
void *pixels;
+ int glamor_flags = GLAMOR_USE_EGL_SCREEN;
+
+ /* In Xorg 1.18, X changed so that GLAMOR_USE_EGL_SCREEN was the only
+ flag required and it implies the behavior previously requested
+ with the GLAMOR_USE_SCREEN and GLAMORE_USE_PICTURE_SCREEN flags.
+ Thus, if we are building against an older Xorg, we need to specify
+ those now deprecated flags. */
+#if defined(GLAMOR_USE_SCREEN)
+ glamor_flags |= GLAMOR_USE_SCREEN;
+#endif
+#if defined(GLAMOR_USE_PICTURE_SCREEN)
+ glamor_flags |= GLAMOR_USE_PICTURE_SCREEN;
+#endif
/*
* we need to get the ScrnInfoRec for this screen, so let's allocate
@@ -618,7 +631,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
/* must be after RGB ordering fixed */
fbPictureInit(pScreen, 0, 0);
- if (dPtr->glamor && !glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
+ if (dPtr->glamor && !glamor_init(pScreen, glamor_flags)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to initialise glamor at ScreenInit() time.\n");
return FALSE;