1. Add support for UBWC allocation in the Gralloc APIs for aligned
width, aligned height and buffer size. A client can request for UBWC
allocation by sending UBWC specific HAL pixel format or by setting
GRALLOC_USAGE_PRIVATE_ALLOC_UBWC flag in the usage flags.
2. Gralloc allocates UBWC aligned buffer, only if format is supported
by GPU and MDP and no CPU usage flags are set. Otherwise it allocates
linear buffer.
3. If UBWC conditions are met, gralloc sets PRIV_FLAGS_UBWC_ALIGNED
in private handle flags to tell client that allocated buffer has UBWC
alignment. This flag remains unset by default.
4. Add helper functions in gralloc to calculate UBWC meta buffer size
for RGB* formats.
5. Add UBWC HAL pixel format HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC
which has been defined by Video module.
6. Add AdrenoMemInfo api to query, if GPU supports UBWC for a format.
7.MDP driver expects UBWC specific pixel format defined by MDP header.
Change-Id: I5b4344bc90aa498dbdb7bb8100e70ed7728e6ea5
Allocate gralloc buffers cached by default unless clients specify
uncached using PRIVATE_UNCACHED or READ_RARELY or WRITE_RARELY at
allocation time. Some clients could use gralloc for allocation but
later won't use lock()/unlock() for CPU operations and likely use
their own caching methods. Cached by default helps such clients.
SW usage flags are not defined as bit values, so do not use bitops
on those flags.
Change-Id: Id371de2ec6efbfa0ed84172b3540f3ebc8f5d459
lock() can be called from a CpuConsumer with only the READ_OFTEN flag
so relying only on that makes gralloc assume there are no non cpu
writers.
Store the writer information during allocation in private flags of
handle and refer to those during lock()
Change-Id: Ifbf25ebc74dbf4e422a2fdec52ec000cd75e549b
- After mmap, use the meta data ioctl to get the ION fd
for the framebuffer memory as GPU expects buffers to
from ION
- Set appropriate flags for the framebuffer private handle
- Remove unused members
Change-Id: I45c4917d9811cd3b3800adf222b92f41f97430c0
1. Use MDP rotator to rotate RGB layers which are rendered by software
2. Restrict total number of rotator sessions to 4 for all displays
3. Disable RGB layer rotation for all MDP versions < MDP5
Change-Id: Ie93111082dff9a16b614e9768df5d8ce83ff9e25
Set Data alignment to 1M only for secureed buffers which
are allocated via MM heap. IOMMU heap allocated buffers
should have buffer alignment of 4k.
Change-Id: I501b35ab103b687f1081338e0c100c29e0b9c4bf
Remove opaque types like size_t, uintptr_t, intptr_t to support
32bit and 64bit processes together.
When a 64bit process creates a handle and a 32bit process validates
the incoming ints against expected ints, opaque types lead to
different and mismatching values.
Always use unit64_t for base address for 32bit and 64bit SF.
Use unsigned int for offset and size, since ION uses that.
Change-Id: I7db5544556a8924f98010b965f837592e9f0b4ca
RGB888 layers were marked as VIDEO and treated as YUV along the path.
If RGB888 is ever required to be a video format we need to make sure
to have other differentiation mechanisms between a UI RGB888 and a
Video RGB888 if any special handling is necessary.
Change-Id: I94c74ac10d589e20dd600db0d1e32645613b1b21
Fill the android_ycbcr struct for HAL_PIXEL_FORMAT_YCbCr_*_888
formats.
This is a flexible YUV format that allows gralloc to set a
hardware specific YUV format based on the usage flags passed in.
Here we set the format similar to how we set the implementation
defined format and set the android_ycbcr structure to point to
the appropriate plane offsets.
Reference: HAL_PIXEL_FORMAT_YCbCr_420_888 definition in
system/core/include/system/graphics.h
Change-Id: If0c7abf5e206bf982ad333da2dae57cbac302733
Since camera now uses the metadata to store the color space,
store the default color space values here as well instead of
storing in the flags.
Change-Id: I11ee84f391a8ee9d06267aa05645fa9467dc23a6
1. Screenrecord and WFD use virtual display and encoder.
Since HAL supports only one virtual display, we need a
definite way to distinguish both use-cases.
Failure to differentiate will break Screen record + WFD
concurrent usecase.
WFD stack will set this usage flag and SF will query the usage
flags to differentiate WFD and screenrecord usecase.
2. Deprecate GRALLOC_USAGE_PRIVATE_EXTERNAL_CC and
GRALLOC_USAGE_PRIVATE_EXTERNAL_BLOCK flags as these are no
longer used.
Change-Id: Ifa260c5af2371eea830744ce62a5a83b8cfd0de7
Macro tile is enabled only if all the conditions are met:
1. GPU hardware should support Macro Tiling.
2. MDSS hardware should support Macro Tiling.
3. USAGE flags shouldnt contain GRALLOC_USAGE_SW_READ_OFTEN and
GRALLOC_USAGE_SW_WRITE_OFTEN.
4. RGB 16bit and 32bit formats.
5. persist.hwc.macro_tile_enable flag should be enabled.
PRIV_FLAGS_TILE_RENDERED flag is added to indicate whether the layer
is rendered/composited in Macro Tiling or Linear format.
Change-Id: Ie3139839c84d76c5d1a2300f33910a09eb7336f4
For mpq8092, RGB888 is the output video format, so need to make
it a video buffer type, so that VIG pipe gets allocated for
it. Another reason is that GPU cannot process RGB888, so marking
it as a VIDEO layer will ensure that it will get picked by MDP.
Change-Id: I5d1812a70f5e4d1fb7448d0a145a15c07c6fc188
For implementation defined formats which go via HWC, set the
default value to RGBA8888.
Change-Id: I741504d54694ac061ecd6c870cb8f815cc61ab24
CRs-Fixed: 588596
This reverts commit 0a1db6aef28c3b90d1f992f56abc562dbae10b55.
Video encoder uses the NV12 encodeable format again.
Change-Id: I1b5170a5c2b5c7de0791cc5bc44457257519f749
As sRGB_888 is not defined, replace it with sRGB_X_8888
Change-Id: Ie7e27ffea1ca6ec99de8e746c0f784e5fc9a4e53
(cherry picked from commit b81796dc9a0c4178004ae947e9d756c5cae6967a)
Refer to graphics.h for the definition of these new formats.
The HWC doesn't yet support output to these formats.
Change-Id: I14dade3412d262d853d3783ba77d559c76d331bf
(cherry picked from commit 3a63837a3d006aee3d176d379409bf3134f6189b)
Add Support to HAL_PIXEL_FORMAT_NV21_ZSL format in gralloc for
camera capture usecase.
This support is required because, CPP module requires 64 byte
aligned width and height to resolve corruption in bottom/left edge
of the landscape/portrait buffer.
Change-Id: Id3e0e5f3d695d5111f3469f78a1d52aad9bea4f4
(cherry picked from commit 512ee1dcef6fa47dfdcf3990fea29bd85f967f02)
- Identify secure display layer in the hwc_list
- Need to set both SECURE_OVERLAY and SECURE_DISPLAY flags for the secure
display layer
- Disable idle timeout for secure display usecase, as GPU should not be
accessing secure display layer
Change-Id: I555910db77c466b5e103b24b4f0ec7f47bb210a5
For buffers with usage set as GRALLOC_USAGE_EXTERNAL_DISP or
GRALLOC_USAGE_PROTECTED, dont mark them as BUFFER_TYPE_VIDEO,
as they can be either RGB/YUV
Change-Id: If4ee80ae85427b2bd850a9f6aeb2c914d4c7c198
CRs-fixed: 537052
Make sure ITU formats are applied exclusively for camera buffers.
Camera HW_TEXTURE buffers go to GPU and should be marked as 601 FR.
Earlier, this was OR'd with video encoder due to which it
incorrectly got marked as 709.
Change-Id: Icaf3692b581b7861229e613dd632123d21dda2cf
The gralloc allocation can happen from processes other than
surfaceflinger in which case we cannot open the framebuffer
device to get the mdp version. Use the MDSS_TARGET flag to
differentiate.
Change-Id: I69bc9ff6004b382a2836274a32fbbd3b2e67dea2
These format qualifiers will help graphics decide which
standard to use when working with a YUV texture.
Change-Id: I6ad464e6b070d3b375c5e07f03228308d15407cd
For IMPLEMENTATION_DEFINED pixel format, if the usage flag is
HW_VIDEO_ENCODER, the private gralloc format should be
HAL_PIXEL_FORMAT_NV12_ENCODEABLE.
Change-Id: I61e8aabe124179e8bebda5d50ad1d8681060b99a
Consumer of gralloc buffers need to distinguish between buffers
with different usage flags, such as HW_TEXTURE vs VIDEO_ENCODER.
Change-Id: Idc330390c184ea942c096b84d29afe7705c06e4d
Enable mapping from framebuffer if debug.gralloc.map_fb_memory
is set to 1. This is useful for bringup.
Change-Id: I3c860148729c5f5c98d84bf17e6633285b4b0af1
Some clients need to distinguish between buffers going to HWC
for composition and other regular buffers.
Change-Id: Ia05a765afe2f8bd223f3e47edd0fb746d6ade531
bufferSize set using native window set buffer size will override gralloc
calculated size only if bufferSize is greater.
Fix for 720P, 1080P HD content playback is not working on 7x27A due to
buffer size mismatch between requested size by frameworks and allocated
size by gralloc for HAL_PIXEL_FORMAT_YCrCb_420_SP and
HAL_PIXEL_FORMAT_YCrCb_420_SP format
Change-Id: I16d04e406ab8f1f35e0e0a70e19d99a019adc5ef
CRs-Fixed: 451783
This patch removes the usage of the framebuffer HAL which is
deprecated in JB MR1 onwards. The code is left for compatibility
such as conformance tests but it is unused for normal display
usage.
Change-Id: If98133bdaa759cdc41d4503ff695b225ee43cb6f
Conflicts:
libhwcomposer/hwc_utils.cpp
genlock is no-op from Android 4.2 onwards since the sync framework
is used for explicit synchronization.
Change-Id: Idd1df589516534a683e0fa1ef0cfbb7f0e411f67
Make the display HALs compile with/without the Qualcomm BSP
specific features so they can work with pure AOSP.
Change-Id: I1ad7282c4fe1fe7e3309afb530a07735f165ffbe
For secure content, use GRALLOC_USAGE_PROTECTED flag instead of
the obsolete flag GRALLOC_USAGE_PRIVATE_CP_BUFFER.
Change-Id: I69bf8cfd3a978fd472608beb44056e1bf55c1414
Align secure buffers to 1M alignment as TZ expects this for
protecting the buffers, MDP5 onwards.
Update the buffer-size to the same alignment used.
Change-Id: I369932a4a72b28c05a3ea216a8bba681de1f9dad
Allocate extra space for metadata in buffer handles
Provide api to map this space in client process and set the metadata
Change-Id: I8bca8448670d4aa88d439320faf402dae30458f8
Don't allocate primary framebuffer from carveout.
Allocate them from IOMMU heap just like the external framebuffer.
Bug: 7626586
Change-Id: I52a8db1a34d19856302b38d2c30c1290d1f2f060
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Gralloc uses the GRALLOC_USAGE_HW_FB flag to allocate memory from carveout.
This is fine for primary framebuffer, but for external framebuffer we need IOMMU
heap buffers, since the ioctls for external work with those.
Ideally, the primary buffers also need to come from IOMMU heap, which is ongoing
work. This patch allocates the first 2 FB buffer requests (assuming they are for
primary) from carveout and allocates all subsequent buffers from IOMMU heap.
Bug: 7124159
Change-Id: Ie53b2e1e7fcac136acd2d251f39cefe367fc7125
Signed-off-by: Iliyan Malchev <malchev@google.com>