diff options
author | Keith Packard <keithp@keithp.com> | 2014-10-13 10:31:52 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-11-20 14:33:00 -0800 |
commit | 65cc0982afb1d47d17e655efaef40d4a82e7574a (patch) | |
tree | 0ba5d6795d06885acff5f23a513fe68f1855c021 /glamor | |
parent | 63bb5c5ef16edf652179770294dcca4fc07dc992 (diff) |
glamor: Don't insert fbos from external objects into fbo cache
Mark fbos created from external buffers so that when the associated
pixmap is destroyed, they aren't put into the fbo cache for later
re-use and are instead freed immediately.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'glamor')
-rw-r--r-- | glamor/glamor.c | 1 | ||||
-rw-r--r-- | glamor/glamor_fbo.c | 3 | ||||
-rw-r--r-- | glamor/glamor_priv.h | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c index fc24b1bdd..d228e35ad 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -106,6 +106,7 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) ErrorF("XXX fail to create fbo.\n"); return; } + fbo->external = TRUE; glamor_pixmap_attach_fbo(pixmap, fbo); } diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c index 090dfd8e7..42738268c 100644 --- a/glamor/glamor_fbo.c +++ b/glamor/glamor_fbo.c @@ -153,7 +153,7 @@ glamor_pixmap_fbo_cache_put(glamor_pixmap_fbo *fbo) #else n_format = cache_format(fbo->format); - if (fbo->fb == 0 || n_format == -1 + if (fbo->fb == 0 || fbo->external || n_format == -1 || fbo->glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) { fbo->glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX; glamor_fbo_expire(fbo->glamor_priv); @@ -237,6 +237,7 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, fbo->tex = tex; fbo->width = w; fbo->height = h; + fbo->external = FALSE; fbo->format = format; fbo->glamor_priv = glamor_priv; diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index c089db895..885f12a6d 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -352,6 +352,7 @@ enum glamor_fbo_state { * @pbo: attached pbo. * @width: width of this fbo. * @height: height of this fbo. + * @external set when the texture was not created by glamor * @format: internal format of this fbo's texture. * @type: internal type of this fbo's texture. * @glamor_priv: point to glamor private data. @@ -365,6 +366,7 @@ typedef struct glamor_pixmap_fbo { GLuint pbo; int width; int height; + Bool external; GLenum format; GLenum type; glamor_screen_private *glamor_priv; |