Commit Graph

218 Commits

Author SHA1 Message Date
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
Naseer Ahmed
3324ff775b hwc: metadata API to set 3D format.
API to allow the video decoder to set the S3D format.
The supported format definitions have moved to qdMetadata.h
for uniformity.

Change-Id: I2b313bf72df97ae948e7efc7faf4a4441c0ef5ce
2015-02-12 22:15:28 -05:00
Sushil Chauhan
3233329902 gralloc: Add UBWC support for Camera
Camera sends IMPLEMENTATION_DEFINED format, so if UBWC gralloc usage
flag is set, it expects gralloc to set the pixel format as NV12_UBWC
instead of use-case specific pixel formats.

Change-Id: Id0a11893401d1338f4f123ca8df029ed96b18ab9
2015-02-04 19:03:16 -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
Arun Kumar K.R
6364fa6c26 gralloc: Add RGBA_5551 and RGBA_4444 formats
Define RGBA_5551 and RGBA_4444 which are OEM specific formats in
gralloc_priv.h

Change-Id: I6cdb723ea7e0783e7f58dbe1b45152dc427994c9
2015-01-14 14:47:11 -08:00
Arun Kumar K.R
0d5ab451f3 gralloc: Change color formats from enums to defines
This helps in checking the formats using the defines at
compile time.
Helps in removing dependency of other modules on display
HAL

Change-Id: I8bd9bf471b2bcf26ccdfeb0cf3cb4ef31faf5702
2015-01-14 14:47:11 -08:00
Arun Kumar K.R
563fbde27c gralloc: Add perform function to get map_secure_buffer info
Gfx modules can use the perform function to determine if it has
to map the secure_buffer.

Change-Id: I2a1f56f1d51a0aa9db96c8d67e18cd9523f87c1f
2015-01-14 14:47:10 -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
Linux Build Service Account
453e7745a5 Merge "gralloc: Allocate cached by default, don't use bitops on SW flags" 2014-12-23 05:58:13 -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
Arun Kumar K.R
1dfcdbb8a0 gralloc: Change perfom enums to defines
Change gralloc perform enums to #defines, so that gfx libraries
can use this to determine if the feature is supported on the
current version of display HAL.

Change-Id: I22f5502e5801b5ab586f9b054afc4275844318c6
2014-12-16 17:12:24 -08:00
Linux Build Service Account
b1c73a3d3c Merge "gralloc: In lock use writer info from allocation time" 2014-12-14 20:47:25 -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
Saurabh Shah
36b9256b38 gralloc: In lock use writer info from allocation time
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
2014-12-08 19:02:25 -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
Arun Kumar K.R
da2f69b96f gralloc/qdMetadata: Add mapSecureBuffer field to metadata struct
- The client sets this metadata to inform GPU to map the CP buffer
- GPU will check the PRIV_FLAG_SECURE and this metadata to map the CP buffer
- If this field is not set on the buffer handle, then GPU will not map
  the CP buffer
- Allow mapping of metadata for SECURE_BUFFERS also

Change-Id: I86300a1b4e3008f9d0884940420e9036c47a016f
2014-10-10 16:23:26 -07:00
Linux Build Service Account
08574507b5 Merge "gralloc: Optimize ION cache clean and invalidate calls" 2014-09-27 10:09:59 -07:00
Naseer Ahmed
9eb5e09577 display: Fix warnings
Treat warnings as errors again

Change-Id: Ibd7f484d31ad420b85e82fd5183d70bf7dce4bfa
2014-09-25 16:11:15 -04: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
Saurabh Shah
d4749de34b gralloc\memalloc: Add traces
Add traces to gralloc (mapper) and memalloc (ionalloc) functions

Change-Id: Ia980b8fce92659a8b72a37ef129f20eb01fe2b43
2014-09-10 18:07:35 -07:00
Linux Build Service Account
accf2da784 Merge "gralloc: Use ION fd in FB handle" 2014-08-25 08:22:43 -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
Arun Kumar K.R
f0f853f442 gralloc: Use ION fd in FB handle
- 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
2014-08-08 10:46:30 -07:00
Arun Kumar K.R
b3184cc122 libgralloc: Remove GRALLOC_MODULE_PERFORM_UPDATE_BUFFER_GEOMETRY
Update buffer geometry is supported through metadata, hence remove
GRALLOC_MODULE_PERFORM_UPDATE_BUFFER_GEOMETRY support

Change-Id: I349a966c383e16600126634723da15f4137a30d8
2014-07-23 15:51:59 -07:00
Arun Kumar K.R
d7d5f8d2ae Revert "libgralloc: Add support for custom buffer size."
This reverts commit 3d4c0ac4f2.

Conflicts:
	libgralloc/gpu.cpp

Change-Id: I6a9df303a4af33610e866e6651e1e2253b94d9cf
2014-07-23 14:50:35 -07:00
Linux Build Service Account
995d0a8ac9 Merge "display: remove compiler warnings" 2014-06-20 18:39:25 -07:00
Shalaj Jain
a70b435d10 display: remove compiler warnings
Use correct typecasts and format specifiers and resolve
compiler warnings

Change-Id: I51b12ecb78a9a496cf1f76c3d32892a203f70c43
2014-06-19 15:44:51 -07:00
Ramkumar Radhakrishnan
9d20b39e4a hwc: Rotate RGB layer using MDP Rotator
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
2014-06-16 12:10:40 -07:00
Linux Build Service Account
8f4e1a68ba Merge "gralloc: Align NV21 to 32 pixels" 2014-06-06 06:07:17 -07:00
Linux Build Service Account
a38d62051b Merge "libgralloc: Set Alignment to 1M only for Secured buffers." 2014-06-05 16:38:14 -07:00
Praveena Pachipulusu
95e16d4911 libgralloc: Set Alignment to 1M only for Secured buffers.
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
2014-06-03 19:44:25 +05:30
Linux Build Service Account
85c7caac2f Merge "gralloc: Fix NV12 and NV21 stride" 2014-06-01 20:49:28 -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
Linux Build Service Account
d187510c4c Merge "display: Change LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH" 2014-05-29 04:35:22 -07:00
Mitchel Humpherys
8a06dbc53a rename heap_mask -> heap_id_mask
The Ion API is changing yet again. heap_mask has been renamed in Ion to
heap_id_mask. Rename ours.

Change-Id: I70154b7166ce66b27ae37e31345f32480d2b9b2d
2014-05-27 15:38:19 -07: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
Ajay Dudani
96719e7d57 display: Change LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH
To comply with multi-arch build system changes for 64-bit support,
LOCAL_MODULE_RELATIVE_PATH needs to be used.

Drop explicit use of LOCAL_MODULE_PATH as its not needed, and
causes build system to overwrite one of multi-arch library
variants with the other arch variant.

Change-Id: I882de72ad2003f1e2bcc93fb63bad7377a84d31d
2014-05-14 16:30:45 -07:00
Naseer Ahmed
9136b8000b display: Remove ashmem header includes
Ashmem use in gralloc has been deprecated for some time. Remove
the stale headers.

Change-Id: Ie048c377b649c0639ffeefe9af41f7a5caaf0382
2014-05-13 11:22:39 -04:00
Naseer Ahmed
f5ff33a0de gralloc: Fix incorrect handle validation check
The YUV plane info reported to driver has an incorrect handle
check. Use the check correctly.

Change-Id: Ice6388a3d8b91bfa5373e850e3102c6ccf92eb75
2014-04-30 15:30:39 -04:00
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
Linux Build Service Account
38ef977bad Merge "Display and wfd synchronization during teardown" 2014-04-17 03:52:54 -07:00
Raj kamal
59fea567e1 Display and wfd synchronization during teardown
* Provide a binder interface call for wfd module
to inform display about the start/stop/pause/resume
of wfd session.

* This is needed for wfd-hdmi synchronization in
case of v4l2 wfd solution. If hdmi is plugged
in during v4l2 wfd session, display-hal waits in
uevent thread for wfd teardown notification from
wfd module, before going ahead with configuring
external display.

* For VDS WFD solution, display-hal waits in uevent
thread for wfd-teardown to be signalled from
the composition thread.

Change-Id: I9514cb5bc7ff81de0b5dd4cdf66d8286a64ba094
2014-04-15 14:15:59 +05:30