From a93f9f343a64ce91587af66761399f9d4c180015 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 21 May 2010 20:37:23 +0100 Subject: gallium: Fix invalidate framebuffer with old libGL libraries --- src/gallium/state_trackers/dri/common/dri_drawable.c | 2 +- src/gallium/state_trackers/dri/common/dri_screen.c | 9 ++++++++- src/gallium/state_trackers/dri/common/dri_screen.h | 3 +++ src/gallium/state_trackers/dri/drm/dri2.c | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c index 25892fc7a76..2bc0faffeff 100644 --- a/src/gallium/state_trackers/dri/common/dri_drawable.c +++ b/src/gallium/state_trackers/dri/common/dri_drawable.c @@ -67,7 +67,7 @@ dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, */ new_stamp = (drawable->texture_stamp != drawable->dPriv->lastStamp); - if (new_stamp || new_mask) { + if (new_stamp || new_mask || screen->broken_invalidate) { if (new_stamp && screen->update_drawable_info) screen->update_drawable_info(drawable); diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c index f5c936e1823..5decdb23b15 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.c +++ b/src/gallium/state_trackers/dri/common/dri_screen.c @@ -341,7 +341,14 @@ static int dri_get_param(struct st_manager *smapi, enum st_manager_param param) { - return 0; + struct dri_screen *screen = (struct dri_screen *)smapi; + + switch(param) { + case ST_MANAGER_BROKEN_INVALIDATE: + return screen->broken_invalidate; + default: + return 0; + } } static void diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h index 1740fa8f426..9ff925d4bef 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.h +++ b/src/gallium/state_trackers/dri/common/dri_screen.h @@ -50,6 +50,9 @@ 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; diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c index e1216f14c0e..6c022f4bbf3 100644 --- a/src/gallium/state_trackers/dri/drm/dri2.c +++ b/src/gallium/state_trackers/dri/drm/dri2.c @@ -526,6 +526,7 @@ dri2_init_screen(__DRIscreen * sPriv) goto fail; screen->auto_fake_front = dri_with_format(sPriv); + screen->broken_invalidate = !sPriv->dri2.useInvalidate; return configs; fail: -- cgit v1.2.3