summaryrefslogtreecommitdiffstats
path: root/modules/gralloc/gralloc.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-07-07 16:30:42 -0700
committerMathias Agopian <mathias@google.com>2009-07-07 16:30:42 -0700
commit85ce19a4d3d3204cb9829dd74ac5bc2ba28ea654 (patch)
tree1cb5fb407f717d65e4ffcb436611ce170407347d /modules/gralloc/gralloc.cpp
parentbfc010a750eb091017e370640d5c1644d671c7e4 (diff)
downloadhardware_libhardware-85ce19a4d3d3204cb9829dd74ac5bc2ba28ea654.zip
hardware_libhardware-85ce19a4d3d3204cb9829dd74ac5bc2ba28ea654.tar.gz
hardware_libhardware-85ce19a4d3d3204cb9829dd74ac5bc2ba28ea654.tar.bz2
fix [1965730] Device always give force close screen and completely unusable in Éclair build ERC07,rebooted automatically
Diffstat (limited to 'modules/gralloc/gralloc.cpp')
-rw-r--r--modules/gralloc/gralloc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp
index 257bb4a..40d14dc 100644
--- a/modules/gralloc/gralloc.cpp
+++ b/modules/gralloc/gralloc.cpp
@@ -200,10 +200,16 @@ static int init_pmem_area(private_module_t* m)
pthread_mutex_lock(&m->lock);
int err = m->pmem_master;
if (err == -1) {
+ // first time, try to initialize pmem
err = init_pmem_area_locked(m);
if (err) {
m->pmem_master = err;
}
+ } else if (err < 0) {
+ // pmem couldn't be initialized, never use it
+ } else {
+ // pmem OK
+ err = 0;
}
pthread_mutex_unlock(&m->lock);
return err;