hardware/libhardware/include was being included with -isystem, which
hides warnings. The gralloc enum values are used as bitmasks on
unsigned types, explicitly mark them values as unsigned in order to
force the type of the resulting enum to be unsigned.
Bug: 32018017
Test: m -j
Change-Id: Iea281480574e0a7a8413273983c76c2c0f9f7049
hardware/libhardware/include was being included with -isystem, which
hides warnings. Use a macro to convert modules to hw_device_t** to call
the open function that works in C++ and C.
Bug: 32018017
Test: m -j
Change-Id: If68bf15581975f1217fcab366cef7bc784894641
map_usage_to_memtrack takes in the gralloc usage flag and returns a
const char pointer containing the memtrack tag.
This function should be used to find the appropriate memtrack tag that
needs to be used after allocating buffers. This will help in-kernel
memtrack module to classify memory into pre-defined buckets.
Bug: 27525688
Change-Id: Ieee868f9b90ab170c16ba80aceedcb3b2e3762df
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Adds GRALLOC_USAGE_FOREIGN_BUFFERS, which a consumer may set as a usage
flag if it intends to attach buffers that it has not detached from the
BufferQueue. It provides a hint to the producer (who may query the
consumer usage bits) that it may receive a buffer from another
BufferQueue, so that it can exit during initialization, hopefully with a
meaningful error message, if such buffers are not supported.
Also adds GRALLOC_USAGE_ALLOC_MASK, which is applied to usage bits
before calling alloc on the gralloc module, and prevents the module from
seeing GRALLOC_USAGE_FOREIGN_BUFFERS, since that usage flag is of no use
while allocating buffers.
Bug: 19801661
Change-Id: I17b927de94245f4df7cfd3f4483b544da3e9cd35
On many devices, hardware cursors have stricter layout constraints than
other overlays. GRALLOC_USAGE_CURSOR indicates a buffer may be used as
a cursor; byte order and padding should be chosen accordingly.
GRALLOC_USAGE_CURSOR must not cause allocation failure. If the requested
properties (dimensions, format, other usage flags, etc.) aren't compatible with
the device's cursor hardware, the implementation must allocate the buffer
anyway, acting as if GRALLOC_USAGE_CURSOR were not specified.
Change-Id: I7d66e8d7c953421d996c5def3257d408f91962f4
Signed-off-by: Greg Hackmann <ghackmann@google.com>
The existing API exposed to clients for software lock/unlock forces the gralloc
implementation to complete these operations synchronously. This change adds new
entry points for lock/unlock functionality that is suited for use with Android's
explicit synchronisation concept. This provides scope for the gralloc module
to internally optimise the work it must do for lock/unlock and to hide this cost
from the client.
Change-Id: If4b1bb5490ab2b20d796214a7da8a96427cfe52d
The existing API exposed to clients for software lock/unlock forces the gralloc
implementation to complete these operations synchronously. This change adds new
entry points for lock/unlock functionality that is suited for use with Android's
explicit synchronisation concept. This provides scope for the gralloc module
to internally optimise the work it must do for lock/unlock and to hide this cost
from the client.
Change-Id: I6c41f4a532b705fc76c7777b2f04ea293506b381
This method is meant for locking the flexible YCbCr format documented in
the system graphics header.
Bug: 8734880
Change-Id: I45ae8937dcc16d0ae8a204a136121f78b4cc51e0
This method is meant for locking the flexible YCbCr format documented in
the system graphics header.
Change-Id: I98b196bab06f1d05fce725da44760180ce487034
More dependent projects than I realized
This reverts commit 7fa4a7e706cd8da0a4fd6722ff3b00b8088a01ae
Change-Id: I813ffde0f8d602fd6d75186bf82e93c7ffed9a9a
Align camera2's management of platform-opaque formats with rest of
framework. Instead of using CAMERA2_PIXEL_FORMAT_OPAQUE, use
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED as the format for both the
camera HAL and for gralloc, and depend on the gralloc usage flags to
let the gralloc module select the appropriate real format for specific
stream endpoints.
Add a new gralloc usage for ZSL mode, where the camera service will
hold a streaming circular buffer of opaque full-resolution images
during camera preview. Since this is an opaque format that needs to be
optimized for 30fps operation, need gralloc to be aware of this use
case.
Bug: 6243944
Change-Id: If7f2516649381ce9bcffe4e319b63cbc068f643f
GRALLOC_USAGE_HW_CAMERA_WRITE is for camera outputs in the new camera HAL.
GRALLOC_USAGE_HW_CAMERA_READ is for sending previously captured camera
data back into the camera pipeline for further processing. For
example, for converting a raw sensor image into YUV or JPEG data.
Bug: 6243944
Change-Id: If9011ec320a1a804f3337704243ed7fc410fec91
This change adds a new Gralloc usage bit to indicate that a buffer will
be passed to the HW video encoder.
Change-Id: I75c3fc514906e5b18fb60345a2d9c5a606403633
This change adds a new Gralloc usage bit to indicate that the Gralloc
buffer being allocated will be passed to the HWComposer HAL module.
Change-Id: If901f886cb22fc8379811898db3a380a61c0e442
fb and gralloc are part of the same HAL for now,
but for clarity we split them into these two headers.
Change-Id: I8e9e3068e47f0d94dd7c145d72fdc2e9fff24af5
This change adds a gralloc usage flag to indicate that a buffer should
be displayed full-screen on an external display if one is present.
Change-Id: I3230a8dd2c49c89c81bf0ee9e646a448028bda2e
a new method, compostionComplete() is added to the framebuffer hal, it is used by surfaceflinger to signal the driver that the composition is complete, BEFORE it releases its client. This gives a chance to the driver to perfrom the proper synchronization.
- 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".