Commit graph

51 commits

Author SHA1 Message Date
Valerie Hau
5543b1eb04 Add validateBufferSize and getTransportSize to gralloc.h
This reverts commit ae6d8a3e33.

Bug: 130669566
Test: build, boot
Change-Id: Icdb3b1e0534233995d5c0594feede6261033ec45
2019-04-24 22:44:42 +00:00
Valerie Hau
ae6d8a3e33 Revert "Add validateBufferSize and getTransportSize to gralloc.h"
This reverts commit 491378a3d4.

Reason for revert: Break Elfin
Bug: 130669566
Change-Id: I07c6883872ed9033ec5edbf27b0bd423ead39962
2019-04-23 22:55:18 +00:00
Valerie Hau
491378a3d4 Add validateBufferSize and getTransportSize to gralloc.h
Bug: 130669566
Test: build, boot

Change-Id: Ic141e1c6f16d0e3c1e81c2bc6c5170e30bc60f3f
2019-04-23 11:38:03 -07:00
Shuzhen Wang
f43b544c0e Camera: Add HEIC encoding support
- Add new BlobId to specify JPEG APP segments.
- Add new gralloc usage flag for HEIC encoder.

Test: testHeic CTS test
Bug: 79465976
Change-Id: Ie70654504eecb280e3a51b60c104124035c5fbe5
2019-02-04 18:18:09 -08:00
Mathias Agopian
d8108ab504 fix circular dependency libnativewindow <-> libui
Bug: 37647680, 37648355
Test: compile, manual
Change-Id: I5aaf07dd76d0d8f5294fb4133c7a0b5e6df3bebc
2017-05-05 14:08:40 -07:00
Colin Cross
69735185b6 Merge "Make gralloc enums unsigned" am: e1582496f9 am: e4f267c1a1
am: 5f1f8915f9

Change-Id: I55e70cb51adb4613d9ce61d6c32365b6cddfb6e0
2016-10-08 22:50:38 +00:00
Colin Cross
92bba13dd1 Make gralloc enums unsigned
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
2016-10-08 11:40:17 -07:00
Colin Cross
2b932a434e Avoid C-style cast warnings am: cc8d9f9fcb am: ac416b9ed3
am: 9a786a3044

Change-Id: I35021c183bb6772c47a0e6ba9d94215dd0728d33
2016-10-08 00:49:03 +00:00
Colin Cross
cc8d9f9fcb Avoid C-style cast warnings
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
2016-10-07 13:10:20 -07:00
Ruchi Kandoi
4cb6c4ff1f gralloc: Adds a new inline method map_usage_to_memtrack.
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>
2016-05-10 16:57:53 +00:00
Dan Stoza
fd2d859445 gralloc: Sort usage flags
Sorts the usage flags in increasing order so it's easier to see where
the gaps are.

Bug: 21609491
Change-Id: I98af3c67be84c6c5137767f3cd7a8bd63dfb5c03
2015-06-03 10:42:38 -07:00
Chong Zhang
2e3ed7e2e7 libhardware: fix gralloc usage bit redefine
bug: 21584171
Change-Id: I66c287681d3e53a263f85fbddfccbb199eaa4b33
2015-06-02 19:00:11 -07:00
Dan Stoza
201c7d91b7 gralloc: Add foreign buffer usage flag
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
2015-05-29 19:52:34 +00:00
Lajos Molnar
811677e68d gralloc: clarify lock_ycbcr in light of multimedia codec usage
Bug: 19179927
Change-Id: I53886f8d1a3a998b958f031b04ddd4cbf19aad2c
2015-01-30 11:02:58 -08:00
Greg Hackmann
8931ce18e5 gralloc: add GRALLOC_USAGE_CURSOR flag
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>
2014-07-23 20:59:44 +00:00
Francis Hart
2e49f9acbb gralloc: Add asynchronous lock/unlock API
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
2014-05-12 09:13:35 -07:00
Greg Hackmann
fd9dc63027 Revert "gralloc: Add asynchronous lock/unlock API"
This reverts commit 2861789f4f.

Change-Id: I334b8ca9b9fdef510df514c18aabb6a593dfaa75
2014-05-09 21:36:14 +00:00
Francis Hart
2861789f4f gralloc: Add asynchronous lock/unlock API
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
2014-05-02 19:46:58 +00:00
Jason Sams
2242385281 Add usage bit for RenderScript.
Change-Id: I3ac3dc8e20e94ee885228febdc8eeb66278054cb
2013-07-16 12:51:13 -07:00
Eino-Ville Talvala
6efab252d5 gralloc: Clarify alloc stride for HAL_PIXEL_FORMAT_YCbCr_420_888
Bug: 8734880
Change-Id: I0cca7fd1965e1547991be06b6b18d6302dbe8670
2013-05-06 14:05:05 -07:00
Alex Ray
06e3bf2566 gralloc: add lock_ycbcr method
This method is meant for locking the flexible YCbCr format documented in
the system graphics header.

Bug: 8734880
Change-Id: I45ae8937dcc16d0ae8a204a136121f78b4cc51e0
2013-04-26 13:51:10 -07:00
Alex Ray
a7c6642913 Revert "gralloc: add lock_ycbcr method"
This reverts commit baa47f353a.
2013-04-18 15:02:57 -07:00
Alex Ray
baa47f353a gralloc: add lock_ycbcr method
This method is meant for locking the flexible YCbCr format documented in
the system graphics header.

Change-Id: I98b196bab06f1d05fce725da44760180ce487034
2013-04-09 15:11:45 -07:00
Greg Hackmann
d6f7aad8de Fix GRALLOC_USAGE_SW_WRITE flag documentation
Change-Id: Ie553c521290358bf37c6954f65f790162aa43730
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2012-12-07 10:39:11 -08:00
Eino-Ville Talvala
7f8dd0ad2d Revert "Revert "Add reprocess method, redefine gralloc ZSL usage flag""
Missing project ready to go.

This reverts commit 536148699beffcc4e6a2ced7c41fbbc3bcfa9886

Change-Id: I101343b443be6febe160685de6d72ddbf7e6aea5
2012-09-04 14:21:07 -07:00
Eino-Ville Talvala
3b98ffb168 Revert "Add reprocess method, redefine gralloc ZSL usage flag"
More dependent projects than I realized

This reverts commit 7fa4a7e706cd8da0a4fd6722ff3b00b8088a01ae

Change-Id: I813ffde0f8d602fd6d75186bf82e93c7ffed9a9a
2012-09-04 12:27:14 -07:00
Eino-Ville Talvala
70d87bf07e Add reprocess method, redefine gralloc ZSL usage flag
- Camera2: Add allocate_reprocess_stream_from_stream for ZSL usecases
- Gralloc: Make GRALLOC_USAGE_HW_CAMERA_ZSL be simply
  GRALLOC_USAGE_HW_CAMERA_READ | GRALLOC_USAGE_HW_CAMERA_WRITE
- Gralloc: Add GRALLOC_USAGE_HW_CAMERA_MASK

Change-Id: Icd8ac1f786e3adb6a422f27f03a5a4cb04a815cc
2012-09-01 18:28:38 -07:00
Eino-Ville Talvala
2388a2dc91 Camera2: Use HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED
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
2012-08-28 14:22:53 -07:00
Eino-Ville Talvala
7797d75b12 Add camera gralloc usage flags.
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
2012-07-16 14:50:50 -07:00
Glenn Kasten
bb56a1007d Fix typo in gralloc.h
Change-Id: I8d989b21e10e19ae4124188f02ef84eeabdb4654
2011-12-19 09:14:19 -08:00
Jamie Gennis
29ead941b3 Gralloc: add a usage bit for video encoding
This change adds a new Gralloc usage bit to indicate that a buffer will
be passed to the HW video encoder.

Change-Id: I75c3fc514906e5b18fb60345a2d9c5a606403633
2011-11-21 17:45:29 -08:00
Jamie Gennis
4b560d5563 Gralloc: add a HWComposer usage bit
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
2011-08-10 11:41:52 -07:00
Mathias Agopian
5337b10289 split fb.h out of gralloc.h
fb and gralloc are part of the same HAL for now,
but for clarity we split them into these two headers.

Change-Id: I8e9e3068e47f0d94dd7c145d72fdc2e9fff24af5
2011-05-12 16:21:49 -07:00
Iliyan Malchev
33c0fe022e libhardware: move buffer_handle_t to system/core
Change-Id: I2ed9ff7360086bc3458b2211437c102fee615481
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:54 -07:00
Iliyan Malchev
ef1ab51f16 libhardware: minor cleanup in gralloc.h
Change-Id: I2180725805e47d313e29ed80b4c9c05e06b77831
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:54 -07:00
Mathias Agopian
53b8af5e9c get rid of GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER
Change-Id: I916812dcfa2e1188e7e249303b80b7b221de71fd
2011-04-28 19:05:05 -07:00
Mathias Agopian
97c7c40b73 add a method to blank/unblank the screen
Change-Id: I3874654248826c29e57bb62bb5217184bdfb4263
2011-04-18 19:05:29 -07:00
Glenn Kasten
7cb277a5c2 Protected surface API
Change-Id: I63a16e77228b4a440ad08b9f21d8fbbacef3698e
2011-01-27 17:54:12 -08:00
Erik Gilling
158549c894 gralloc: add dump hooks to gralloc/hwcomposer
Change-Id: I27bf46103b4d1d547c42a6de4f3270a6dfd7b7ec
2010-12-08 15:31:40 -08:00
Erik Gilling
e99520400f gralloc: add padding to alloc_device_t and hwc_composer_device_t
also adds version #defines

Change-Id: I89f19fc7811ea9c9efb579a9f6abb4c3d9011bbf
2010-12-08 15:16:52 -08:00
Jamie Gennis
7edeaf91a8 Add a gralloc usage flag for external displays.
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
2010-11-17 18:51:17 -08:00
Jamie Gennis
95d78bef32 Add 4 private gralloc usage bits.
The private gralloc usage bits can be used to specify device-specific
allocation requirements.

Change-Id: Idc4fbdd3dd7b71767143cf3df5886dfaf43e50a4
2010-07-01 16:49:52 -07:00
Jamie Gennis
aabb702923 Fix a typo in the GRALLOC_USAGE_HW_2D constant.
Change-Id: I3de500455715298765b2e27bc8c59e2ec6c7a34f
2010-07-01 16:49:07 -07:00
Mathias Agopian
cd2433f380 fix[2222341] Soft reset while going back from camcorder settings
add a way to convert a mapped "pushbuffer" buffer to a gralloc handle
which then can be safely used by surfaceflinger
2009-10-30 14:38:22 -07:00
Mathias Agopian
8255d9d3b6 Android side of the fix for [2121211] Sholes has stutter during animations
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.
2009-09-17 16:15:36 -07:00
Mathias Agopian
9d82c1a447 add typedefs to gralloc and hardware.h so it's more C friendly 2009-08-19 11:20:55 -07:00
Mathias Agopian
f5cf8f842a better documentation for (*setUpdateRect)() 2009-05-07 17:39:31 -07:00
Mathias Agopian
485e69809a better documentation and implementation for lock/unlock 2009-05-05 20:49:49 -07:00
Mathias Agopian
295190f426 get rid of unused/needed flags 2009-05-05 18:30:52 -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