Commit Graph

74 Commits

Author SHA1 Message Date
Sushil Chauhan
6686c80f64 sde: Add support for RGBX_8888 UBWC format
1. Add support for RGBX_8888 UBWC in display engine and gralloc APIs.
2. Set the appropriate rotator output format for RGB* UBWC formats.
3. Move the UBWC aligned format enums in their appropriate range.

Change-Id: I0107f10894f9edbe657fce29b99f6e909c675150
2015-04-15 18:22:24 -07:00
Linux Build Service Account
6fc33505bd Merge "gralloc: App support for new secure system heap and flags" 2015-04-14 03:25:44 -07:00
Shalaj Jain
1f9725a296 gralloc: App support for new secure system heap and flags
Add support for new secure system heap and corresponding flags
for all pixel buffers. Keep the old mm heap for secure display
buffers.

Change-Id: Ic0ee7783a2d1ff420c34396f7cc4bd5ac3058c44
2015-03-30 14:41:36 -07:00
Mansoor Aftab
e9912a6857 gralloc: Add Raw10 support in allocator
CRs-Fixed: 810651
Change-Id: I231979626e073887ae42d5bec2d25138c3dd763f
2015-03-23 11:26:20 -07:00
Naseer Ahmed
8d0d72ad40 gralloc: Deprecate old stuff.
1. Reclaim some old gralloc flags.
2. System heap allocation happens by default.
3. Remove some unused private flags.
4. Add heapid member to alloc_data to better line up with ion
   header
5. Remove check for MDSS_TARGET

Change-Id: I37be0a2fcd5fd4a14bb9ca235fcae41f6f3ec19e
2015-03-19 13:39:21 -04:00
Sushil Chauhan
4686c97328 gralloc: Add support for NV12_UBWC in getYUVPlaneInfo api
Add support for NV12_UBWC HAL pixel format in getYUVPlaneInfo api to
enable GRALLOC_MODULE_PERFORM_GET_YUV_PLANE_INFO for this format.

Change-Id: I94389ddc45cba94124b36fb3ecb0b947250c0681
2015-03-11 18:15:28 -07:00
Sushil Chauhan
a9d47001c9 gralloc: Change private usage flags from enums to defines
1. It helps in checking gralloc private usage flags at compile time.
2. Define GRALLOC_MODULE_PERFORM_GET_UBWC_FLAG to enable client to
   query the value of "PRIV_FLAGS_UBWC_ALIGNED" flag at run time.
3. Add ADRENO_PIXELFORMAT_NV12_EXT in defined Adreno Pixel formats
   to fix NV12_UBWC HAL pixel format conversion to Adreno format.

Change-Id: I78ccac98f1bd1bfbd2aa596ceb7a293f3d2e5f6e
2015-02-23 13:12:22 -08:00
Linux Build Service Account
09ca40a8d3 Merge "gralloc: Allow UBWC for explicitly defined UBWC HAL pixel format" 2015-02-01 14:29:37 -08:00
Sushil Chauhan
81594f6d66 gralloc: Allow UBWC for explicitly defined UBWC HAL pixel format
1. Allow UBWC allocation, if client is using an explicitly defined
UBWC HAL pixel format OR if client sets UBWC gralloc usage flag and
GPU supports the format.

2. EGL wants gralloc to set PRIV_FLAGS_UBWC_ALIGNED bit in private
handle flags, only if GPU supports UBWC for that format.

Change-Id: I4194a046217cbc4c0a8ac2b2fb4b73ebd5076fc2
2015-01-30 10:21:19 -08:00
Kaushik Kanetkar
071aca66e2 gralloc: Modify getYUVPlaneInfo
Modify getYUVPlaneInfo to return data from metadata
as well, if the geometry has changed, and align it
according to the format.

Change-Id: I119a1719c214c87e542b471c9cd9a20b01e2bf5e
2015-01-27 12:58:16 -07:00
Sushil Chauhan
082acd66c4 gralloc: Add adreno_utils header
Add adreno_utils header to define Adreno pixel formats, which are
needed by gralloc to map HAL format to corresponding Adreno format.

Change-Id: I6d38f34583955e3990393801f1dca0dd9aa2013b
2015-01-16 16:10:14 -08:00
Sushil Chauhan
65e26307e6 display: Add support for UBWC in display hal
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
2015-01-16 11:00:01 -08:00
Sushil Chauhan
c8da337f63 gralloc: Deprecate GRALLOC_USAGE_PRIVATE_UI_CONTIG_HEAP flag
Remove the unused gralloc flag: GRALLOC_USAGE_PRIVATE_UI_CONTIG_HEAP.
It was only used when we had ION carveout allocations for UI. It is
not needed anymore and no module is using it.

Change-Id: I46ec5758ec3c753ee20426c258aa2a0a46f6a4ac
2014-12-30 10:30:38 -08:00
Saurabh Shah
1adcafe634 gralloc: Allocate cached by default, don't use bitops on SW flags
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
2014-12-19 18:30:00 -08:00
Shalaj Jain
13cdf813ab gralloc: Allow non-contiguous allocations for secure buffers
Pass a flag to ion to allow non-contiguous allocations with a sg
(scatter gather) list of 1MB chunks for all secure buffers except
secure display.

Change-Id: Ife2709e94571ab7603b29da17805a857ba73fd72
2014-12-11 10:54:35 -08:00
Linux Build Service Account
e98a3d6b04 Merge "libhwcomposer: libgralloc Set MDP_SMP_FORCE_ALLOC flag" 2014-11-09 23:41:33 -08:00
Ramkumar Radhakrishnan
964395241b Revert "get rid of HAL pixelformats 5551 and 4444"
This reverts commit e4001e736d.

Change-Id: Ic09ba8bc5b0784bce07e8800f6276b3290bc0e7a
2014-10-29 17:23:41 -07:00
Justin Philip
d616660fe6 libhwcomposer: libgralloc Set MDP_SMP_FORCE_ALLOC flag
For PROTECTED but NON SECURE layers set MDP_SMP_FORCE_ALLOC flag
to allow SMP allocation and prevent GPU fallback
In Such cases if video resolution changes dynamically
it fails to display layer due to GPU fallback.
Use this flag for FB layer composition and depricate
MDP_BACKEND_COMPOSITION flag.

Change-Id: I9ab7cbdd2e12b56dfa67d5b4b3ff6b2dcd0096be
2014-10-21 21:34:30 -07:00
Saurabh Shah
9ff53a9d9f gralloc: Optimize ION cache clean and invalidate calls
-Clients not having WRITE_OFTEN or READ_OFTEN are uncached.
-Invalidate cache on lock only if CPU needs to read and there
are non-CPU writers in system (camera,gpu etc)
-Flush cache on unlock only if CPU writes. Since all buffers will be
read in HWC(MDP) there is no need to check if readers exist.

Change-Id: Icd114e60b7456bd71592b81016892e806c37cb22
2014-09-24 16:02:21 -07:00
Arun Kumar K.R
6e3324827f gralloc: fix getYUVPlaneInfo for YV12 format
- Use proper alignment for cstride while calculating the
  ycbcr info for YV12 format
- This fixes the corruption issue when the video is composed
  using GPU

CRs-fixed: 711696
Change-Id: I776cc6c5ce781ea3de25b5d8427345b512a8305a
2014-08-21 13:23:57 -07:00
Linux Build Service Account
8f4e1a68ba Merge "gralloc: Align NV21 to 32 pixels" 2014-06-06 06:07:17 -07:00
Naseer Ahmed
0415b73fdf gralloc: Align NV21 to 32 pixels
Graphics requires 32 pixel alignment and camera driver is being
updated to this.

Change-Id: I00fe659f7a16abeb8f65d9bbf41a24a7c8113bfb
CRs-fixed: 476475
2014-05-29 16:59:02 -04:00
Naseer Ahmed
a28d31c01c gralloc: Fix NV12 and NV21 stride
NV12 spec says that the chroma stride is the same as the luma
stride. The camera hardware produces YUV data per this spec.
NV21 has the same behaviour with the chroma samples reversed.
Venus also conforms to this.

Change-Id: I6e107b2a3ba6f51e135348bd147a9c26be003bb2
2014-05-29 15:46:29 -04:00
Saurabh Shah
8f0ea6ff81 gralloc: Remove opaque types
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
2014-05-22 12:14:30 -07:00
Praveena Pachipulusu
2005e8f612 hwc: Fix klockwork errors
Resolving klockwork errors to avoid memory leaks,
improper assignments in liboverlay.

Change-Id: I82ac6ae782c7b783e89999b832bbd1d361376b9f
2014-05-16 08:45:03 +05:30
Naseer Ahmed
b29fdfdd84 gralloc: Report YUV plane info
The android_ycbcr structure in graphics.h is populated to give
the luma and chroma addresses. Use the same structure to give
this information to graphics via a gralloc perform call.

Change-Id: Ib42866a9ea90873886dcb60a1aac6cb375292642
2014-04-25 09:56:38 -07:00
Arun Kumar K.R
6c85f050b2 libgralloc: use proper types and type casts
- Use proper types for pointers
- Resolve compiler errors
- handle proper type casts
- remove unused variables

Change-Id: I628ebe174485d30abadea4ca40b67f9aab1a0652
2014-03-28 15:14:58 -07:00
Jeykumar Sankaran
2ba20513e4 libgralloc: Invoke adreno for ASTC format padding.
Invoke adreno util API to calculate padding bytes for ASTC
formats.

Change-Id: I96af0199a0029786fd2975a7c002d5414c797521
2014-03-07 10:02:13 -08:00
Manoj Kumar AVM
5a5529b817 hqd: Add support for 565 macro tile format
Extend macro tile feature support to rgb565 format.

Change-Id: I3d696d1ec66bfd95fcf3d243a1d669cb074da77f
2014-02-25 10:56:04 -08:00
Ramkumar Radhakrishnan
36bd527bc8 display: Remove klockwork warnings and errors.
Remove all klockwork warnings and errors for libgralloc,
libhwcomposer, liboverlay, libqdutils, libqservice, libvirtual,
libexternal libraries to avoid buffer overflow and memory leaks.

Change-Id: I078143bcbcf5e4b342156bd8305a644566f7cc4b
2014-02-18 12:39:21 -08:00
Linux Build Service Account
a6976555a1 Merge "h/q/d: Add missing ASTC format" 2014-02-09 19:08:39 -08:00
Jeykumar Sankaran
8f4585fc6f h/q/d: Add missing ASTC format
Adds support for Khronos format COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR

Change-Id: I2ca2c548cbcca0c56f28d2158cb5a0d01a326f0f
2014-02-05 15:23:40 -08:00
Saurabh Shah
d0b0d8f055 gralloc: Fix getSize and getAlignedWidthAndHeight
getSize was incorrectly modifying aligned height and allocating
a buffer of lesser than expected size.

All alignments should be done in getAlignedWidthAndHeight so as not
to break the GRALLOC_PERFORM functions.

getSize()'s return type is unsigned, but a signed value is returned.
Instead on error, a size of 0 should be reported.

Change-Id: Ifae5e758de8e689701cd43892324ccc0140675cd
2014-02-04 13:22:38 -08:00
Naseer Ahmed
63326f4b22 gralloc: Add support for ASTC formats
This change adds support for Khronos standard ASTC formats.

Change-Id: I6963f2ed82b5f179ed8627022746deec02ff826a
2014-01-30 12:56:37 -08:00
Manoj Kumar AVM
8a22081e49 hwc: Add support for Macro Tile feature
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
2014-01-14 13:32:31 -08:00
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
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
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
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
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
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