Commit Graph

132 Commits

Author SHA1 Message Date
Ramkumar Radhakrishnan
473f4085e3 libgralloc: Use new GFX API to calculate stride
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
2013-11-20 17:55:09 -08:00
Naseer Ahmed
f2feca9bcf Revert "display: Video Encoding not working"
This reverts commit 0a1db6aef28c3b90d1f992f56abc562dbae10b55.
Video encoder uses the NV12 encodeable format again.

Change-Id: I1b5170a5c2b5c7de0791cc5bc44457257519f749
2013-11-08 15:32:52 -08:00
Naseer Ahmed
a978f955cc gralloc: Perform function to return custom stride
The custom stride can be set by video for smooth streaming.
Return this in perform so that graphics can use it.

Change-Id: I798fc0894b8d9662e93769a53a540cb61b527a44
2013-11-08 15:23:34 -08:00
Jesse Hall
fbe96d2b78 Replace sRGB_888 with sRGB_X_8888
As sRGB_888 is not defined, replace it with sRGB_X_8888

Change-Id: Ie7e27ffea1ca6ec99de8e746c0f784e5fc9a4e53
(cherry picked from commit b81796dc9a0c4178004ae947e9d756c5cae6967a)
2013-11-08 15:23:10 -08:00
Naseer Ahmed
82fc4b733f gralloc: Add allocation support for sRGB formats
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)
2013-11-08 15:22:57 -08:00
Naseer Ahmed
2c215298e1 gralloc: Add padding byte for YUV 420
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)
2013-11-08 15:22:38 -08:00
Ramkumar Radhakrishnan
ff511027c4 display: Add support to HAL_PIXEL_FORMAT_NV21_ZSL format
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)
2013-11-08 15:22:07 -08:00
Mathias Agopian
e4001e736d get rid of HAL pixelformats 5551 and 4444
This changes removes the use of 5551 and 4444 pixel formats
as its not supported anymore

Change-Id: I817510c3c7c0c3d95924c2ffc79e5727a6d6c48f
(cherry picked from commit 1fbd4a9662b07d53a3f220c91b3e85ca571a4938)
2013-11-08 15:17:17 -08:00
Prabhanjan Kandula
e8f4becdf3 gralloc : Allow support for both Widevine level-1 and level-3
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
2013-10-24 18:28:50 +05:30
Sushil Chauhan
1f6d68fce6 hwc/copybit: Handle "R/B swap" for RGBA and RGBX color formats.
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
2013-10-18 13:58:16 -07:00
Ramkumar Radhakrishnan
ba713389c2 hwc: Add support for Secure display
- 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
2013-10-08 16:03:24 -07:00
Ramkumar Radhakrishnan
b52399cfa0 display: Add support for interleaved YUY2 and YUYV format.
Adding support for interleaved HAL_PIXEL_FORMAT_YCbCr_422_I and
HAL_PIXEL_FORMAT_YCrCb_422_I format in display HAL.

Change-Id: Ib87d9bf481c20bf6a92293dd04746719b1d928c1
2013-09-19 11:10:45 -07:00
Arun Kumar K.R
1062ea1607 libgralloc: Don't set buffer type to be BUFFER_TYPE_VIDEO
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
2013-09-06 17:29:43 -07:00
Naseer Ahmed
69662ac981 gralloc: Move getAllocator in unlock
Call it where it is actually needed, as it may lead to
unnecessary logs in software composition

Change-Id: Ie0e266ee0710229f3cf15f8314e2ae4b4dc1ac94
2013-08-28 13:21:37 -04:00
Linux Build Service Account
d6bf387820 Merge "gralloc: Fix caching for rarely read/write flags" 2013-08-22 19:47:40 -07:00
Naseer Ahmed
2686788a4b gralloc: Fix caching for rarely read/write flags
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
2013-08-21 19:31:34 -04:00
Linux Build Service Account
c2f58ae4b3 Merge "gralloc: Fix NV12_ENCODEABLE allocation" 2013-08-21 12:27:53 -07:00
Naseer Ahmed
ce0c9500a4 gralloc: Fix NV12_ENCODEABLE allocation
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
2013-08-15 14:00:56 -04:00
Naseer Ahmed
22fa2d3545 gralloc: Fix ITU formats for camera
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
2013-08-14 13:28:54 -04:00
Naseer Ahmed
473986c5c8 gralloc: Default to an error value for mapFrameBuffer
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
2013-07-16 12:47:21 -04:00
Linux Build Service Account
21028318fd Merge "display: Export headers" 2013-07-15 17:36:44 -07:00
Linux Build Service Account
5c851b5e42 Merge "liboverlay: Allocate cached rotator buffers" 2013-07-12 17:20:18 -07:00
Naseer Ahmed
c55d60a3d7 display: Export headers
Display headers used by other components should be at a common
location to avoid issues with future changes in paths.

Change-Id: Iaec21206b82dd7dae03e598b9ec46b3e6f1bbf71
2013-07-12 11:58:51 -04:00
Naseer Ahmed
499ab3dfdf gralloc: Do not map framebuffer memory unless needed
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
2013-07-04 17:09:54 -04:00
Naseer Ahmed
74e4567e35 gralloc: Remove memset.
The ion driver now guarantees that it will give us a zero'd out
buffer at allocation.

Change-Id: I7ec2b7d6dd94cdc394de12b69249ac9e1baa6708
2013-07-02 11:48:43 -07:00
Linux Build Service Account
0755535324 Merge "gralloc: Use compile time flag for mdss." 2013-06-18 19:41:51 -07:00
Linux Build Service Account
4c109136a1 Merge "gralloc: Fixes for software composition" 2013-06-18 19:41:48 -07:00
Naseer Ahmed
8478672bdb gralloc: Use compile time flag for mdss.
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
2013-06-14 17:39:22 -04:00
Naseer Ahmed
ec1479886d gralloc: Fixes for software composition
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
2013-06-14 17:06:46 -04:00
Arun Kumar K.R
5a9bc432df libgralloc: Allow USAGE_RARELY flags to be uncached
Allow GRALLOC_USAGE_SW_READ_RARELY and GRALLOC_USAGE_SW_WRITE_RARELY
flags to be uncached.

Change-Id: I014d659e5d5465c6a27aa3979d52cbf3f7c14024
2013-06-12 17:00:17 -07:00
Naseer Ahmed
a6ad22dbd5 gralloc: Allow system heap to be uncached.
Remove an old check that prevented this from happening.

Change-Id: I938b11b27e58fc38a679dc55e31e7b51eb86bd3a
2013-06-10 19:54:40 -07:00
Linux Build Service Account
9ed6331ea3 Merge "libgralloc: Add support to use CAMERA_HEAP" 2013-05-31 20:47:31 -07:00
Arun Kumar K.R
ff78b8909f libgralloc: Add support to use CAMERA_HEAP
- 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
2013-05-24 12:40:45 -07:00
Prabhanjan Kandula
92896b8622 libgralloc: Fix secure buffer issues.
-- 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
2013-05-22 22:21:33 -07:00
Naseer Ahmed
89bf85d130 gralloc: Do not initialize reserved field
The gralloc header was updated with a new extension for locking
ycbcr - initializing the reserved field breaks the build.

Change-Id: I88d26bbd2005041e9396c8f5a0d2fe18f9c4055e
2013-05-21 07:56:02 -07:00
Arun Kumar K.R
a2978452bd hwc: Add support for EXT_ONLY Layers
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
2013-05-11 18:05:40 -07:00
Linux Build Service Account
330067c2ef Merge "libgralloc: Don't pad if debug.gralloc.map_fb_memory is set" 2013-05-10 00:50:13 -07:00
Naseer Ahmed
fc940ef958 gralloc: Add ITU-R standard info for YUV formats
These format qualifiers will help graphics decide which
standard to use when working with a YUV texture.

Change-Id: I6ad464e6b070d3b375c5e07f03228308d15407cd
2013-05-08 12:21:02 -07:00
Naomi Luis
1b379695ef libgralloc: Don't pad if debug.gralloc.map_fb_memory is set
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
2013-05-06 14:14:46 -07:00
Linux Build Service Account
57b161e4ad Merge "gralloc: Add support for "RAW" and "BLOB" formats" 2013-04-23 20:01:57 -07:00
Linux Build Service Account
08746980da Merge "gralloc: Set correct private gralloc format for video buffers" 2013-04-23 20:01:49 -07:00
Linux Build Service Account
46cf12acc4 Merge "gralloc: Mark buffers used by HW Texture" 2013-04-23 20:01:45 -07:00
Shuzhen Wang
a11b6ba75c gralloc: Set correct private gralloc format for video buffers
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
2013-04-21 14:29:05 -07:00
Naseer Ahmed
7669daee42 gralloc: Add support for "RAW" and "BLOB" formats
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
2013-04-19 18:27:06 -04:00
Shuzhen Wang
46ca226768 gralloc: Mark buffers used by HW Texture
Consumer of gralloc buffers need to distinguish between buffers
with different usage flags, such as HW_TEXTURE vs VIDEO_ENCODER.

Change-Id: Idc330390c184ea942c096b84d29afe7705c06e4d
2013-04-18 09:53:50 -07:00
Naseer Ahmed
b5b904c9b0 gralloc: Cleanup usage of old API
All builds have now moved to the new ION API.

Change-Id: Ic5ed7aa40231be64c715d6bb0d00a022db3fb863
2013-04-16 13:00:17 -04:00
Naseer Ahmed
47aa15ed78 gralloc: Enable framebuffer memory mapping.
Enable mapping from framebuffer if debug.gralloc.map_fb_memory
is set to 1. This is useful for bringup.

Change-Id: I3c860148729c5f5c98d84bf17e6633285b4b0af1
2013-04-11 13:16:06 -04:00
Naseer Ahmed
e41ad9c8c1 gralloc: Mark buffers used by HWC
Some clients need to distinguish between buffers going to HWC
for composition and other regular buffers.

Change-Id: Ia05a765afe2f8bd223f3e47edd0fb746d6ade531
2013-04-08 08:32:13 -07:00
Naomi Luis
b65b23453f libgralloc: Set the Adreno raster mode as "unknown"
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
2013-03-28 14:12:47 -07:00
Linux Build Service Account
86acaa7718 Merge "display: Use cache invalidate and clean correctly" 2013-03-27 14:34:49 -07:00