summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/image_manager.h
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-13 04:00:49 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-13 04:00:49 +0000
commit40245ccfa40e45cd002830cc9170fdd0b8578d00 (patch)
treefb593832c869799b0ce4249441067cda3326463a /gpu/command_buffer/service/image_manager.h
parent7300a267b737821996da4efd4b89ac216308c59e (diff)
downloadchromium_src-40245ccfa40e45cd002830cc9170fdd0b8578d00.zip
chromium_src-40245ccfa40e45cd002830cc9170fdd0b8578d00.tar.gz
chromium_src-40245ccfa40e45cd002830cc9170fdd0b8578d00.tar.bz2
[Android] Add workaround to unbind gpu memory buffer only on NVIDIA
For gralloc backed gpu memory buffer on Android, it is undefined whether locking for read/write while the buffer is bound to a texture is allowed. On nvidia devices (eg 2012 nexus 7), lock without unbind will lead to deadlocks in the driver (crbug.com/264096). However on other nexus gpu vendors (img, arm, qualcomm), unbind is very expensive since it flushes the gpu pipeline. And vendors have advised that lock while bound is allowed and is the right solution to this slowness, as long as the texture is eventually recycled or deleted. Add a workaround for nvidia to only unbind in GLImage::DidUseTexImage. BUG= Review URL: https://codereview.chromium.org/66033009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/image_manager.h')
-rw-r--r--gpu/command_buffer/service/image_manager.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/image_manager.h b/gpu/command_buffer/service/image_manager.h
index a125ae8..51e006d 100644
--- a/gpu/command_buffer/service/image_manager.h
+++ b/gpu/command_buffer/service/image_manager.h
@@ -37,6 +37,9 @@ class GPU_EXPORT ImageManager
void RemoveImage(int32 service_id);
gfx::GLImage* LookupImage(int32 service_id);
+ // For Android specific workaround.
+ void SetReleaseAfterUse();
+
private:
friend class base::RefCounted<ImageManager>;
@@ -44,6 +47,7 @@ class GPU_EXPORT ImageManager
typedef base::hash_map<uint32, scoped_refptr<gfx::GLImage> > GLImageMap;
GLImageMap gl_images_;
+ bool release_after_use_;
DISALLOW_COPY_AND_ASSIGN(ImageManager);
};