diff options
author | Naseer Ahmed <naseer@codeaurora.org> | 2013-07-04 15:24:31 -0400 |
---|---|---|
committer | Naseer Ahmed <naseer@codeaurora.org> | 2013-07-04 17:09:54 -0400 |
commit | 499ab3dfdfbd85faf88036bc14fc45c540609b24 (patch) | |
tree | 47f13f80b9888761e80707ccffdd61401761c9ab /libgralloc/framebuffer.cpp | |
parent | 6e8a57ef3abbb5478b355b0aea46660847f64def (diff) | |
download | android_hardware_qcom_display-499ab3dfdfbd85faf88036bc14fc45c540609b24.tar.gz android_hardware_qcom_display-499ab3dfdfbd85faf88036bc14fc45c540609b24.tar.bz2 android_hardware_qcom_display-499ab3dfdfbd85faf88036bc14fc45c540609b24.zip |
gralloc: Do not map framebuffer memory unless needed
The SurfaceFlinger opens the framebuffer module even when it
isn't necessary. It does this for some legacy hals.
Due to this we unnecessarily mmap the fb memory in gralloc.
Do not map this unless the property to use the framebuffer
memory is set.
Change-Id: Ib4ebfdf9a63af0dabb53170342181bac0360baeb
Diffstat (limited to 'libgralloc/framebuffer.cpp')
-rw-r--r-- | libgralloc/framebuffer.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp index 382868009..185119686 100644 --- a/libgralloc/framebuffer.cpp +++ b/libgralloc/framebuffer.cpp @@ -336,9 +336,15 @@ int mapFrameBufferLocked(struct private_module_t* module) static int mapFrameBuffer(struct private_module_t* module) { - pthread_mutex_lock(&module->lock); - int err = mapFrameBufferLocked(module); - pthread_mutex_unlock(&module->lock); + int err = 0; + char property[PROPERTY_VALUE_MAX]; + if((property_get("debug.gralloc.map_fb_memory", property, NULL) > 0) && + (!strncmp(property, "1", PROPERTY_VALUE_MAX ) || + (!strncasecmp(property,"true", PROPERTY_VALUE_MAX )))) { + pthread_mutex_lock(&module->lock); + err = mapFrameBufferLocked(module); + pthread_mutex_unlock(&module->lock); + } return err; } |