aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dri3/dri3.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dri3/dri3.c')
-rw-r--r--xorg-server/dri3/dri3.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/xorg-server/dri3/dri3.c b/xorg-server/dri3/dri3.c
index 76e07b40e..385862a3b 100644
--- a/xorg-server/dri3/dri3.c
+++ b/xorg-server/dri3/dri3.c
@@ -30,6 +30,8 @@ int dri3_request;
DevPrivateKeyRec dri3_screen_private_key;
DevPrivateKeyRec dri3_window_private_key;
+static int dri3_screen_generation;
+
static Bool
dri3_close_screen(ScreenPtr screen)
{
@@ -44,6 +46,8 @@ dri3_close_screen(ScreenPtr screen)
Bool
dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info)
{
+ dri3_screen_generation = serverGeneration;
+
if (!dixRegisterPrivateKey(&dri3_screen_private_key, PRIVATE_SCREEN, 0))
return FALSE;
@@ -68,6 +72,12 @@ dri3_extension_init(void)
ExtensionEntry *extension;
int i;
+ /* If no screens support DRI3, there's no point offering the
+ * extension at all
+ */
+ if (dri3_screen_generation != serverGeneration)
+ return;
+
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return;