Commit Graph

54 Commits

Author SHA1 Message Date
Naseer Ahmed
b8ecfbf5a7 display: Enable clang for all display modules
Change-Id: I71e3fa3f7d44253b8e01d1eafe086b1898d65a8e
2015-11-03 08:02:01 -05:00
Saurabh Shah
95f8368b4b gralloc/metadata: Add support for single buffer mode
Add support for setting single buffer mode on a buffer via gralloc
perform from gfx

Change-Id: I7640b3b984ebc1c4c8fcaedfb3e222ec989a84cb
2015-10-29 11:12:23 -07:00
Dileep Marchya
1a7e1f193e sdm: Add support for IGC.
- Add support for sRGB IGC.
- Program IGC PP parameters for sRGB contents.

Change-Id: I41b4b0bd8ef60fc7f869c742d084f4c3a3db6635
2015-10-16 16:11:23 -07:00
Manoj Kumar AVM
8e1aa18e18 gralloc: Return aligned w,h for UPDATE_BUFFER_GEOMETRY
Return aligned width and height in case meta operation is
UPDATE_BUFFER_GEOMETRY.

CRs-Fixed: 880373
Change-Id: I3b263518d509f4de68c93692eace3cb0b2c69808
2015-08-12 16:00:26 -07:00
Sushil Chauhan
e7acc3c916 sdm: Add support for LINEAR_FORMAT metadata operation
1. Define LINEAR_FORMAT operation in MetaData.
2. VENUS ouput buffer is linear for NV12_UBWC Interlaced video playback.
   So Video module performs LINEAR_FORMAT operation to set "linearFormat"
   metadata member to NV12 linear format in case of Interlaced video.
3. Handle LINEAR_FORMAT metadata operation in HWC wrapper and gralloc.

CRs-Fixed: 855474

Change-Id: I77dd72bec26f225de75adb6c214ccd90db239e3e
2015-06-29 15:21:58 -07:00
Linux Build Service Account
4613ff9183 Merge "gralloc: UBWC aligned buffers are Macro Tiled" 2015-05-06 15:47:23 -07:00
Sushil Chauhan
e61fac5be4 gralloc: UBWC aligned buffers are Macro Tiled
All UBWC aligned buffers are Macro tiled.

Change-Id: I71bb0269d337d1ca2017ce9665010f738674f1a8
2015-05-01 10:17:29 -07:00
Sushil Chauhan
c85b65b46e gralloc: Fix UBWC related issues
1. Fix the missed ALIGN in getUBwcMetaBufferSize api.
2. Fix de-reference of data address pointer in getRgbDataAddress api.

Change-Id: I5dae2b6f449bb9a5b0dcc23110a2efce36060a42
2015-04-30 11:05:36 -07:00
Linux Build Service Account
bf75d5fcab Merge "gralloc: Fix a missed unmap." 2015-04-29 08:20:40 -07:00
Saurabh Shah
dbe41c5b5d gralloc: Fix a missed unmap.
Change I86300a1b4e3008f9d0884940420e9036c47a016f introduces a
regression by mapping metadata part of secure buffers, but not
unmapping that. This change fixes the map/unmap asymmetry.

Change-Id: I078eef1139642bd6d8a01145ab1c81060621fb8d
2015-04-23 16:04:08 -07:00
Sushil Chauhan
7dd3a4368f gralloc: Add gralloc perform api to query RGB data address
A client can call GRALLOC_MODULE_PERFORM_GET_RGB_DATA_ADDRESS api
to get RGB data address for any linear or UBWC aligned RGB buffer.

Change-Id: I3a7d25f504b7ba1dec79cc872cafbb38ddbb6bd2
2015-04-16 10:41:14 -07:00
Ramakant Singh
04b6b241cf hwc: Add NULL check for gralloc private_hnd_t
Add NULL check for private_hnd_t before assigning
to a buffer.

Change-Id: I302be85a68cf024740223faf718081c390f73b61
2015-03-23 15:01:12 +05:30
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
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
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
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
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
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
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
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
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
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
Naseer Ahmed
69669978f7 gralloc: Remove pmem includes
Remove android_pmem as it is no longer used

Change-Id: Ib4328c57306da1ef87f9b822e70ff91da302c99a
2014-04-11 20:41:06 -04:00
Linux Build Service Account
43da51a308 Merge "gralloc: Perform func to return stride and height" 2014-04-03 08:13:42 -07:00
Raj Kamal
3d01d8d75e gralloc: Perform func to return stride and height
The custom stride and height can be set by video
decoder for smooth streaming. Return this in
perform so that graphics can use it

Change-Id: I44c814b2bae1f61d3ec5c36a22d1c6119542b10a
2014-04-02 08:38:41 +05:30
Naseer Ahmed
34d33bc907 gralloc: Add support for lock_ycbcr
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
2014-04-01 18:17:38 -04: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
Shuzhen Wang
c502c873e8 gralloc: add GRALLOC_MODULE_PERFORM_GET_COLOR_SPACE_FROM_HANDLE
Provide query for graphics to determine the color space.

Change-Id: Ib710f44845f7449db6c62906b424d4a1b54400cb
2014-02-27 08:58:38 -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
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
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
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
Naseer Ahmed
aeab91f977 display: Use cache invalidate and clean correctly
Make sure cache is invalidated before reading in software and
cleaned after writing in software.

Change-Id: I91c471c47a5f1ff11f9960f08091a17ffe575534
2013-03-25 20:58:54 -04:00
Naseer Ahmed
c0593ea5ec gralloc: Stride information fix
The perform enum for the stride is defined in gralloc_priv so it
is OK to keep the case outside.

Change-Id: Id31556f76c2a2ae93a15a2e2dc4169b07360e4e6
2013-03-18 11:46:24 -04:00
Naseer Ahmed
a163b73bea display: Remove genlock usage
genlock is no-op from Android 4.2 onwards since the sync framework
is used for explicit synchronization.

Change-Id: Idd1df589516534a683e0fa1ef0cfbb7f0e411f67
2013-03-15 11:48:59 -07:00
Naomi Luis
a44100cafc libgralloc: Add Perform function to get the stride.
- Introduce a new class to Get the Adreno computed stride information.
This class has been added to allow adreno library computed strides to
be propagated to the allocation function as well as those clients
requesting it.
- Add a new Perform function to get the stride. The width and the format
can be passed from the calling functions (like EGL) to get the stride of
the buffer.

Change-Id: I4c2b4a02deff327f0ea5558c478997527fe9d3cf
2013-02-14 09:19:35 -08:00
Linux Build Service Account
961407fe41 Merge "display: Reconcile display HALs" 2013-02-13 10:16:51 -08:00
Duy Truong
73d36df685 Update copyright to The Linux Foundation
Change-Id: I145b66896159ff9886ed73507f17b3165ba0266d
2013-02-09 20:33:23 -08:00
Naseer Ahmed
7421472e5c display: Reconcile display HALs
Make the display HALs compile with/without the Qualcomm BSP
specific features so they can work with pure AOSP.
Change-Id: I1ad7282c4fe1fe7e3309afb530a07735f165ffbe
2013-02-09 08:29:49 -05:00
Ramkumar Radhakrishnan
7bf31c32c8 display: Reset metadata pointer to NULL during unmap.
Initialize metadata pointer in the buffer handle to NULL after
unmapping the buffer pointer

Change-Id: I930a2d21a6f259426949d7aa58bd07f1f58839c0
CRs-Fixed: 434388
2013-01-29 12:03:25 -08:00
Linux Build Service Account
55f775b442 Merge "Update buffer dimensions with new dimension" 2013-01-13 11:34:41 -08:00
Ramkumar Radhakrishnan
47573e20d5 display: Add display metadata in buffer handle
Allocate extra space for metadata in buffer handles
Provide api to map this space in client process and set the metadata

Change-Id: I8bca8448670d4aa88d439320faf402dae30458f8
2012-12-26 15:45:17 -08:00
Ramkumar Radhakrishnan
935cb684ca Update buffer dimensions with new dimension
Add case GRALLOC_MODULE_PERFORM_UPDATE_BUFFER_GEOMETRY in
gralloc_perform function to update the new buffer dimensions.

Change-Id: I7a855dc017dd042dda2abdc28c51ce5ec919fceb
2012-12-04 16:42:04 -08:00