dri2: Require a loader with working buffer invalidation

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10808>
This commit is contained in:
Adam Jackson 2021-06-02 14:40:33 -04:00 committed by Marge Bot
parent 4d0179af32
commit 68aa2099fa
5 changed files with 5 additions and 14 deletions

View 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;

View 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);

View 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

View 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;

View 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;