Use new GFX API compute_aligned_width_and_height to get the stride
value for RGB surfaces.
Backward compatible with GFX old API when old GFX library is used.
Change-Id: I15b0954602b816bf4e88f48622494144fc77c14f
This reverts commit 0a1db6aef28c3b90d1f992f56abc562dbae10b55.
Video encoder uses the NV12 encodeable format again.
Change-Id: I1b5170a5c2b5c7de0791cc5bc44457257519f749
The custom stride can be set by video for smooth streaming.
Return this in perform so that graphics can use it.
Change-Id: I798fc0894b8d9662e93769a53a540cb61b527a44
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)
YUV 420 buffers have the chroma starting at consecutive bytes
but end at the same byte. This results in the second chroma size
being one byte shorter in size. This isn't a problem for
hardware, however, the gralloc lock_ycbcr API expects to read the
same number of bytes based on the cstride for both chroma
components. This could lead to it accessing memory beyond what is
allocated leading to a crash in the calling process especially
when the size aligns exactly to the page size. Add one byte
padding when allocating YUV buffers to make sure the users of
this gralloc API get enough bytes to read.
Bug: 10787131
Change-Id: Id18e0739f9fdc2c7a4fbe7724be668a989f1a4a1
(cherry picked from commit ca07ffae967e7137fb0d97fb9999a11c09b4a7b5)
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)
This changes removes the use of 5551 and 4444 pixel formats
as its not supported anymore
Change-Id: I817510c3c7c0c3d95924c2ffc79e5727a6d6c48f
(cherry picked from commit 1fbd4a9662b07d53a3f220c91b3e85ca571a4938)
MM HEAP will be used only for Widevine Level-1 secure playback.
Since Video component assures of using MM HEAP flags only for
WV Level-1 and Level-3 will not be marked with MM HEAP it is
possible to allow supporting both of these protection levels
co existing in a device.
Change-Id: I153eeebf20bdab0c2ce930a5a124369a2b3249a6
CRs-fixed: 562601
1.Framework notifies HAL with "HWC_FORMAT_RB_SWAP" layer flag to handle
a limitation where R and B components were swapped in Rendering phase.
2.Add "R/B swap" in hwc query to enable framework to query for support
in display HAL, at run-time.
Change-Id: I3b44d15b51b4f24939048fee9d1bac2b9009c97c
- 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
Adding support for interleaved HAL_PIXEL_FORMAT_YCbCr_422_I and
HAL_PIXEL_FORMAT_YCrCb_422_I format in display HAL.
Change-Id: Ib87d9bf481c20bf6a92293dd04746719b1d928c1
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
GRALLOC_USAGE_SW_WRITE_RARELY and GRALLOC_USAGE_SW_READ_RARELY
need to be compared directly since they share bits with
GRALLOC_USAGE_SW_WRITE_OFTEN and GRALLOC_USAGE_SW_READ_OFTEN.
Change-Id: I52692027033e1036e3ad960b9e03dd8ee60b4111
Targets having the venus core have the same allocation and stride
requirements for HAL_PIXEL_FORMAT_NV12_ENCODEABLE as the
HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS format.
Change-Id: Ie5ab8db6639dfa791c5be0161cde6140c3dae779
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
We do further operations in fb_device_open based on the result of
mapFrameBuffer. However, if mapFrameBuffer is never done, we
could end up with a random crash when using the info values in
fb_device_open. Defaulting to an error value avoids this.
Change-Id: I1e51f814611a3f2eb73f36d75e14d8725ca98474
Display headers used by other components should be at a common
location to avoid issues with future changes in paths.
Change-Id: Iaec21206b82dd7dae03e598b9ec46b3e6f1bbf71
The SurfaceFlinger opens the framebuffer module even when it
isn't necessary. It does this for some legacy hals.
Due to this we unnecessarily mmap the fb memory in gralloc.
Do not map this unless the property to use the framebuffer
memory is set.
Change-Id: Ib4ebfdf9a63af0dabb53170342181bac0360baeb
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
Check that the buffer is actually an ion buffer
before calling clean. This is needed for the case
where the physically contiguous framebuffer is mapped.
That framebuffer memory is used for bringup.
Change-Id: I2db84d4bfc3465d995f12e0860be3cafa0d4a81b
- Adds flag GRALLOC_USAGE_PRIVATE_CAMERA_HEAP to use the dedicated
CAMERA_HEAP
- Remove GRALLOC_USAGE_PRIVATE_CP_BUFFER which is not used anymore
Change-Id: Iefea88d9a67d2fa0ca74492f508e1d5508d08983
-- Though buffer usage is not marked with any Heap, if usage flags
set with GRALLOC_USAGE_PROTECTED allocate from IOMMU heap.
-- Allow using GRALLOC_USAGE_PROTECTED for non tz level protection.
Change-Id: Ie3c8bd8821f4ab344a2b798a723ab65d4ef5b44e
CRs-fixed: 484838
CRs-fixed: 480493
The gralloc header was updated with a new extension for locking
ycbcr - initializing the reserved field breaks the build.
Change-Id: I88d26bbd2005041e9396c8f5a0d2fe18f9c4055e
If there are any EXTERNAL_ONLY layers present in the list, mark
them as HWC_OVERLAY such that SF does not compose and in hwc_set
post that layer to Ext display, ignore other layers
Change-Id: Ic5db3bfa88295167d23d1fb2be7640c9fc772054
These format qualifiers will help graphics decide which
standard to use when working with a YUV texture.
Change-Id: I6ad464e6b070d3b375c5e07f03228308d15407cd
Don't add adreno specific padding computed by libadreno_utils if
debug.gralloc.map_fb_memory is set.
Since this is a debug property, we can disable surface padding
when the property is enabled.
Change-Id: I5ff310483930f8da04f6955889eea3973fd3d342
CRs-fixed: 480925
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
The allocation is done as specified in system/graphics.h
Raw formats are 16 bit and aligned to 32 bytes, blob formats have
a height of 1 and the size of the buffer is equal to the width.
Change-Id: If762a34dde3b78f138689ced1077c9529020ebf0
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
Set the raster mode as "unknown" when calling libadreno_utils to
compute the surface stride. This allows libadreno_utils to decide
the best stride to pick up based on the specific GPU.
Change-Id: Id88f5887168564398492ab03d160ddd0ce5e083a