Commit graph

16 commits

Author SHA1 Message Date
Colin Cross
febaaa937f gralloc: fix warnings
Fix LP64 pointer casting warnings, unused parameters, and
turn off missing initializer warnings.

Change-Id: Idb70f4534282fed64ae81cb1e154d3f5b93091b0
2014-02-05 18:21:09 -08:00
Rom Lemarchand
0287721d28 gralloc: delete unused mutex declaration
Change-Id: Ibc7e70887b61f7dd885c86d412387636d3a6a867
2013-11-26 10:01:25 -08:00
Jesse Hall
0d8f81a984 Log when creating a second buffer mapping in a process
Bug: 8468756
Change-Id: Ia883f459ea9e2648ca4a0b5a6f09ded4f46f13b3
2013-03-28 16:51:25 -07:00
Jesse Hall
c71b6caece Remove pid check in register/unregister
The register/unregister gralloc calls were avoiding
mmapping/munmapping the shared memory region if the buffer was created
by the current process. This is left over from the pmem-based
implementation, where trying to map the same region twice in the same
process would fail, or would reuse a single mapping without
refcounting.

This causes problems if a buffer is
- allocated in process A,
- transferred from A to process B and registered there
- unregistered/freed in A
- transferred back from B to A and re-registered

Process A then has a new handle to the buffer, but since it originally
created the buffer it will not be mmapped, so trying to read or write
the buffer will crash.

With ashmem, mmaping a region twice in the same process creates two
distinct mappings which can be used and munmapped independently. So
we no longer need to avoid mmapping again in the allocating process.

Bug: 8468756
Change-Id: I167bec5ca07e5534c5e2115630fe8386e481388e
2013-03-28 11:21:25 -07:00
Steve Block
60d056bf29 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: I0cbe865d464a37365fa3be84948b07e5a0d181d0
2012-01-08 11:03:25 +00:00
Steve Block
cee8501c16 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I98e83cc9d22f0ea8fbf397ccccd9ce7773119551
2012-01-03 22:31:17 +00:00
Mathias Agopian
f96b2064d7 remove all references to pmem and simplify the lock/unlock hooks
this gralloc module is only used on the emulator or without a h/w
renderer. therefore there is no synchronization to do in lock/unlock
and pmem buffers are not relevant.

hopefully this will remove some of the confusion about how gralloc
should be implemented and make it more obvious that this implementation
is not intended to be used by h/w renderers.
2009-12-15 15:00:57 -08:00
Mathias Agopian
05eacf533e better logs 2009-07-13 18:32:37 -07:00
Mathias Agopian
bd80b38f29 more fixes for [1965730]. We now free (unmap) both ashmem and pmem regions. 2009-07-07 17:53:43 -07:00
Marco Nelissen
a4b587cb06 Simulator build fixes for the new GL stuff. The simulator still doesn't run, but at least it builds. 2009-07-07 09:29:00 -07:00
Mathias Agopian
8c4ab1fa14 pmem allocator in gralloc. enabled for all surfaces. currently it uses a lot more address space than needed. 2009-06-16 18:16:38 -07:00
Mathias Agopian
5115665397 with the new lock/unlock API we don't really mean reference counting on mmap/munmap because we're guaranteed to map the buffers only once within a process.
no need to track all handles anymore, which simplifies the code a lot.
2009-06-09 20:50:34 -07:00
Mathias Agopian
82f7c04155 suppress spurious debug log 2009-06-03 19:03:26 -07:00
Mathias Agopian
485e69809a better documentation and implementation for lock/unlock 2009-05-05 20:49:49 -07:00
Mathias Agopian
988b8bd553 lock will now return the vaddr of the buffer. map/umap are gone.
- make sure to return an error if a buffer is locked twice or unlocked while not locked.
- added registerBuffer() and unregisterBuffer() to the gralloc module so that we can do some cleanup when a buffer is no longer needed. this became necessary after we removed map/unmap so we have a place to unmap buffers without the need of a kernel module.
- change the constants for GRALLOC_USAGE_SW_{READ|WRITE}_NEVER to 0, so that NOT specifying them means "NEVER".
2009-05-04 14:26:56 -07:00
Mathias Agopian
a8a75166a2 Integrate from //sandbox/mathias/donut/...@145728
SurfaceFlinger rework for new EGL driver model support.
2009-04-10 14:24:31 -07:00