Let vendor choose which framebuffer ioctl (FBIOPUT_VSCREENINFO or
FBIOPAN_DISPLAY) is best suited to do page-flip on its target platform.
Neither API is well documented about their usage and most of the
time it really depends on the respective framebuffer driver implementation.
* Default ioctl to do page-flip is FBIOPUT_VSCREENINFO.
* Set "TARGET_USE_PAN_DISPLAY=true" in board config file to use FBIOPAN_DISPLAY.
Change-Id: Ic3a50bd0f5fe37ac0149e11649c4abdadea85529
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
private_handle_t's memory layout must be consistent between the 32-bit
and 64-bit gralloc, in case buffers are passed between processes.
Replace the (variably sized) uintptr_t base with a fixed size uint64_t,
and enforce 8-byte alignment for architectures where uint64_t alignment
varies between 32-bit and 64-bit.
Change-Id: I06cb31d4b9620ea18e5b50d3a3142b5adb2d2a14
Signed-off-by: Greg Hackmann <ghackmann@google.com>
A constant sNumInts with a value of 6 was being assigned to the numInts
attribute in the private_handle_t constructor, and was also used in the
validate method. That constant value is appropriate for 32-bit systems
but is not appropriate for a 64-bit system where uintptr_t used for
base attribute will be 64-bit.
sNumInts is now changed to a static inline function that calculates
numInts.
Change-Id: I482ddb5915c9ff55fb2e2a87887a0ec2dc2299ed
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
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
Note: The code under hardware/libhardware/modules/gralloc/ is only used
when running the system under the emulator.
Change-Id: I022978aeaacc5137c9917cd2ef6952dd3897ece4
This patch avoids a division-by-0 when the system is running
under emulation (the kernel driver reports pixclock as 0, for
some reason). Which results in a SIGFPE during the boot sequence.
Change-Id: Idb6bcdd58999ea9231f2411481c25929d5d02f1d
Some devices have low-level bugs in their page-flip.
Disabling it at this level gives us more flexibility
than trying to control it elsewhere.
Bug: 3097357
Change-Id: Icc6ae172264e453bec0680e74a497a2b24299c4a
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.