summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/drm
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-11-23 18:33:54 +0100
committerMarek Olšák <[email protected]>2012-12-02 00:19:02 +0100
commit3039addf9363dbae1bbad1cd75d32e0013038c08 (patch)
tree9549dea5f50009cd168a216b237325aab23b7ec3 /src/gallium/state_trackers/dri/drm
parent4003961fbf7e59de4b95448eada569adb91e5852 (diff)
st/dri: implement new driver hook flush_with_flags
v2: added documentation for dri_flush as per Brian's request
Diffstat (limited to 'src/gallium/state_trackers/dri/drm')
-rw-r--r--src/gallium/state_trackers/dri/drm/dri2.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index 2f83dabf165..c346e3b161c 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -46,17 +46,7 @@
static void
dri2_flush_drawable(__DRIdrawable *dPriv)
{
- struct dri_context *ctx = dri_get_current(dPriv->driScreenPriv);
- struct dri_drawable *drawable = dri_drawable(dPriv);
-
- struct pipe_resource *ptex = drawable->textures[ST_ATTACHMENT_BACK_LEFT];
-
- if (ctx) {
- if (ptex && ctx->pp && drawable->textures[ST_ATTACHMENT_DEPTH_STENCIL])
- pp_run(ctx->pp, ptex, ptex, drawable->textures[ST_ATTACHMENT_DEPTH_STENCIL]);
-
- ctx->st->flush(ctx->st, 0, NULL);
- }
+ dri_flush(dPriv->driContextPriv, dPriv, __DRI2_FLUSH_DRAWABLE, 0);
}
static void
@@ -74,6 +64,7 @@ static const __DRI2flushExtension dri2FlushExtension = {
{ __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
dri2_flush_drawable,
dri2_invalidate_drawable,
+ dri_flush,
};
/**
@@ -756,14 +747,6 @@ static const __DRIextension *dri_screen_extensions[] = {
&dri2FlushExtension.base,
&dri2ImageExtension.base,
&dri2ConfigQueryExtension.base,
- NULL
-};
-
-static const __DRIextension *dri_screen_extensions_throttle[] = {
- &driTexBufferExtension.base,
- &dri2FlushExtension.base,
- &dri2ImageExtension.base,
- &dri2ConfigQueryExtension.base,
&dri2ThrottleExtension.base,
NULL
};
@@ -795,10 +778,11 @@ dri2_init_screen(__DRIscreen * sPriv)
throttle_ret = driver_descriptor.configuration(DRM_CONF_THROTTLE);
if (throttle_ret && throttle_ret->val.val_int != -1) {
- sPriv->extensions = dri_screen_extensions_throttle;
+ screen->throttling_enabled = TRUE;
screen->default_throttle_frames = throttle_ret->val.val_int;
- } else
- sPriv->extensions = dri_screen_extensions;
+ }
+
+ sPriv->extensions = dri_screen_extensions;
/* dri_init_screen_helper checks pscreen for us */