dri2: Require a loader with working buffer invalidation
authorAdam Jackson <ajax@redhat.com>
Wed, 2 Jun 2021 18:40:33 +0000 (14:40 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 17 May 2022 20:31:50 +0000 (20:31 +0000)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10808>

src/gallium/frontends/dri/dri2.c
src/gallium/frontends/dri/dri_drawable.c
src/gallium/frontends/dri/dri_screen.c
src/gallium/frontends/dri/dri_screen.h
src/gallium/frontends/dri/dri_util.c

index 8ddcae0..611ac5c 100644 (file)
@@ -2477,7 +2477,6 @@ dri2_init_screen(__DRIscreen * sPriv)
 
    screen->can_share_buffer = true;
    screen->auto_fake_front = dri_with_format(sPriv);
-   screen->broken_invalidate = !sPriv->dri2.useInvalidate;
    screen->lookup_egl_image = dri2_lookup_egl_image;
 
    const __DRIimageLookupExtension *loader = sPriv->dri2.image;
@@ -2540,7 +2539,6 @@ dri_kms_init_screen(__DRIscreen * sPriv)
 
    screen->can_share_buffer = false;
    screen->auto_fake_front = dri_with_format(sPriv);
-   screen->broken_invalidate = !sPriv->dri2.useInvalidate;
    screen->lookup_egl_image = dri2_lookup_egl_image;
 
    const __DRIimageLookupExtension *loader = sPriv->dri2.image;
index 2c4ba4d..2cf977e 100644 (file)
@@ -75,7 +75,7 @@ dri_st_framebuffer_validate(struct st_context_iface *stctx,
       lastStamp = drawable->dPriv->lastStamp;
       new_stamp = (drawable->texture_stamp != lastStamp);
 
-      if (new_stamp || new_mask || screen->broken_invalidate) {
+      if (new_stamp || new_mask) {
          if (new_stamp && drawable->update_drawable_info)
             drawable->update_drawable_info(drawable);
 
index 661cea4..f331057 100644 (file)
@@ -763,14 +763,7 @@ static int
 dri_get_param(struct st_manager *smapi,
               enum st_manager_param param)
 {
-   struct dri_screen *screen = (struct dri_screen *)smapi;
-
-   switch(param) {
-   case ST_MANAGER_BROKEN_INVALIDATE:
-      return screen->broken_invalidate;
-   default:
-      return 0;
-   }
+   return 0;
 }
 
 void
index 0ee2feb..fc7d636 100644 (file)
@@ -53,9 +53,6 @@ struct dri_screen
    struct st_manager base;
    struct st_api *st_api;
 
-   /* on old libGL's invalidate doesn't get called as it should */
-   boolean broken_invalidate;
-
    /* dri */
    __DRIscreen *sPriv;
    boolean throttle;
index 7d2665a..bdaedf1 100644 (file)
@@ -121,6 +121,9 @@ driCreateNewScreen2(int scrn, int fd,
     }
 
     setupLoaderExtensions(psp, extensions);
+    // dri2 drivers require working invalidate
+    if (fd != -1 && !psp->dri2.useInvalidate)
+       return NULL;
 
     psp->loaderPrivate = data;