diff options
author | Zhigang Gong <zhigang.gong@linux.intel.com> | 2012-02-03 11:21:37 +0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-12-18 11:23:48 -0800 |
commit | 39d9e6c693a4c3ad12c6569f1fd56e0a87b164d2 (patch) | |
tree | 57c951c2b1a1bd5ad7b3d00bf586bfef99ccb79e /glamor/glamor_core.c | |
parent | 1817b6c0cf20aa6fc1e1aa5b68e47473f341b85a (diff) |
prepare_access: Don't use fbo after it was downloaded.
We add a new gl_fbo status GLAMOR_FBO_DOWNLOADED to indicate
the fbo was already downloaded to CPU. Then latter the access
to this pixmap will be treated as pure CPU access. In glamor,
if we fallback to DDX/fbXXX, then we fallback everything
currently. We don't support to jump into glamor acceleration
layer between a prepare_access/finish_access. Actually, fbCopyPlane
is such a function which may call to acceleration function within
it. Then we must mark the downloaded pixmap to another state
rather than a normal fbo textured pixmap, and then stick to use
it as a in-memory pixmap.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Tested-by: Peng Li <peng.li@intel.com>
Diffstat (limited to 'glamor/glamor_core.c')
-rw-r--r-- | glamor/glamor_core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c index 395e91276..01c9aeaf9 100644 --- a/glamor/glamor_core.c +++ b/glamor/glamor_core.c @@ -263,8 +263,6 @@ glamor_fini_finish_access_shaders(ScreenPtr screen) dispatch->glDeleteProgram(glamor_priv->finish_access_prog[1]); } - - void glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode) { @@ -275,7 +273,7 @@ glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode) glamor_get_screen_private(drawable->pScreen); glamor_gl_dispatch *dispatch = &glamor_priv->dispatch; - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO_DOWNLOADED(pixmap_priv)) return; if (access_mode != GLAMOR_ACCESS_RO) { @@ -293,6 +291,9 @@ glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode) free(pixmap->devPrivate.ptr); } + if (pixmap_priv->gl_fbo == GLAMOR_FBO_DOWNLOADED) + pixmap_priv->gl_fbo = GLAMOR_FBO_NORMAL; + pixmap->devPrivate.ptr = NULL; } |