xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Sun Aug 17 14:38:25 PDT 2014


 dri3/dri3.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 33aeec8a11bc75a06d32956bbdd9efb216790a02
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jan 30 16:24:35 2014 -0800

    dri3: Don't enable the DRI3 extension unless some screen supports it
    
    There's no reason to advertise this extension unless one of the
    hardware drivers actually supports it. Not listing it means it's
    slightly easier for users to tell what's going on.
    
    On the other hand, not listing it means we may have applications that
    only check for the extension and not for appropriate per-screen
    support. I don't think that's a real risk as DRI3 is only useful for
    systems with deep knowledge of the hardware.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/dri3/dri3.c b/dri3/dri3.c
index 76e07b4..385862a 100644
--- a/dri3/dri3.c
+++ b/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;


More information about the xorg-commit mailing list