diff options
author | Zhigang Gong <zhigang.gong@linux.intel.com> | 2012-01-18 19:21:36 +0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-12-18 11:23:47 -0800 |
commit | 2ff41008494e6c5909c058f1f80b4f66617dada1 (patch) | |
tree | 540d0790d6524e147676687fabfd3980750efab8 /glamor/glamor_core.c | |
parent | ca2ddd33a114fe83584b5fa9f73b7534abdb96fa (diff) |
glamor_fbo: Introduce glamor fbo to manage all the fb/tex.
This is the first patch to implement a fbo/tex pool mechanism which
is like the sna's BO cache list. We firstly need to decopule the
fbo/tex from each pixmap. The new glamor_pixmap_fbo data
structure is for that purpose. It's somehow independent to each
pixmap and can be reused latter by other pixmaps once it's detached
from the current pixmap.
And this commit also slightly change the way to create a
memory pixmap. We will not create a pixmap private data structure
by default, instead we will crete that structure when a memory
pixmap is attaching a fbo to it.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'glamor/glamor_core.c')
-rw-r--r-- | glamor/glamor_core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c index 8ce2104a1..f6f9e832c 100644 --- a/glamor/glamor_core.c +++ b/glamor/glamor_core.c @@ -49,7 +49,7 @@ glamor_get_drawable_location(const DrawablePtr drawable) glamor_get_screen_private(drawable->pScreen); if (pixmap_priv == NULL || pixmap_priv->gl_fbo == 0) return 'm'; - if (pixmap_priv->fb == glamor_priv->screen_fbo) + if (pixmap_priv->fbo->fb == glamor_priv->screen_fbo) return 's'; else return 'f'; @@ -271,13 +271,13 @@ glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode) glamor_restore_pixmap_to_texture(pixmap); } - if (pixmap_priv->pbo != 0 && pixmap_priv->pbo_valid) { + if (pixmap_priv->fbo->pbo != 0 && pixmap_priv->fbo->pbo_valid) { assert(glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP); dispatch->glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); dispatch->glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - pixmap_priv->pbo_valid = FALSE; - dispatch->glDeleteBuffers(1, &pixmap_priv->pbo); - pixmap_priv->pbo = 0; + pixmap_priv->fbo->pbo_valid = FALSE; + dispatch->glDeleteBuffers(1, &pixmap_priv->fbo->pbo); + pixmap_priv->fbo->pbo = 0; } else { free(pixmap->devPrivate.ptr); } |