Commit Graph

80 Commits

Author SHA1 Message Date
Saurabh Shah
f84c412a37 sdm/hwc/gralloc: Move fb_id lifecycle to DAL
--Move fb_id creation/deletion from gralloc to DAL and make it per
cycle
--Make Gralloc/HWC/SDM structures independent of libdrmutils
and fb_id / gemhandles
--Pass BufferAllocator pointer to Display* and HWDevice*
--Add new GetBufferLayout API to BufferAllocator that can be called
by DAL before creating fb_id

Change-Id: I102f432cccee912ad4bcce622764938fa3d36ed3
CRs-fixed: 1114808
2017-04-14 10:14:34 -07:00
Rohit Kulkarni
7943ec969d display-hal: Add support for P010 ubwc format
This patch adds support for handling P010 ubwc format in display-hal
libs.

Change-Id: I1c7489be859a608566240c3b6722c84bb9a468ca
CRs-fixed: 2018756
2017-03-27 14:37:21 -07:00
Prabhanjan Kandula
f48302a611 gralloc: Add support for 8-bit RAW MIPI stream
Define new HAL color format for RAW-8 stream and
add support for buffer allocation with RAW-8 format.

Change-Id: I1ee1dbd270d25c27e52c5dd023345c8283c658d2
2017-02-27 18:02:59 -08:00
Saurabh Shah
7d476edfb3 sdm: drm: Add support for default non-atomic mode
Add support for booting up with default non-atomic mode
Add libdrmutils that currently has:
DRMMaster:
    Creates a master DRM session
    Converts ION handles to DRM FB_ID
DRMResMgr:
    Enables a default display path by providing APIs for
    connector id, crtc id, mode etc

Change-Id: I1dc697d2cc5e3fa744c99e2c9ddd57bf06e78c4f
CRs-fixed: 1114808
2017-02-07 14:37:24 -08:00
Rahul Sharma
61173ea422 sdm: Add support for new pixel formats in HAL
Add support for BGR_888 and CBYCRY_422_I in display HAL. The
new formats will be used by QCarCam Application.

CRs-Fixed: 1116491
Change-Id: I5ccca57a3ca2d27c4e064b0c5abd68c77c7afadd
2017-01-27 09:00:06 -08:00
Arun Kumar K.R
c18263edc2 display: Add Support for Rec.2020
- Add Rec2020 CSC in qdMetadata for limited/full range
- Expose CSC as #defines in gralloc private header to
  help GFX decouple from the display headers

Change-Id: I90ee2708275bf1a37ece0fce2f0867dfad64e39a
Crs-fixed: 1074164
2016-10-17 10:25:18 -07:00
Linux Build Service Account
33d7631a96 Merge "gralloc: Use getpagesize() in place of PAGE_SIZE." 2016-10-07 07:44:24 -07:00
Linux Build Service Account
81c6c49dc4 Merge "libgralloc: Store unaligned buffer resolution in private handle." 2016-09-28 05:18:45 -07:00
Dileep Marchya
5b4eaed30b gralloc: Use getpagesize() in place of PAGE_SIZE.
- Use getpagesize() function from unistd.h to get page size
  in place of PAGE_SIZE macro.
- Make isDisableUBWCForEncoder declaration pure virtual.

Change-Id: I89405e999e4683874f4daa32188181e688a19812
CRs-Fixed: 1069351
2016-09-28 12:32:39 +05:30
Arun Kumar K.R
e06d05ab98 gralloc: Change Venus TP10 UBWC enum to align with video
Align Venus TP10 UBWC format enum value to the value defined in the
video header, in the same way as its done for Venus UBWC format

Change-Id: I4e929d8dd028dc3f854f1ec9ecc5f8dbbfae98be
CRs-fixed: 1061950
2016-09-20 10:59:41 -07:00
Ramkumar Radhakrishnan
ba55eac6ae libgralloc: Store unaligned buffer resolution in private handle.
Add unaligned_width and unaligned_height in private_handle_t to store
the buffer resolution without alignment that client asked to allocate.

Change-Id: I28d757af4178f581e6a83dc06198106c85fc7262
CRs-Fixed: 1040942
2016-09-08 15:15:49 -07:00
Ramkumar Radhakrishnan
db89d1f64e libgralloc: Add support for 10 bit RGB/YUV formats.
Add 10 bit RGB/YUV HAL Pixel formats in gralloc library.

CRs-Fixed: 882953
Change-Id: I5c99bbd61d899408d6ff182b11ffb537bbde13c6
2016-03-17 19:09:50 -07:00
Surajit Podder
074314d7e7 gralloc: Add support for PRIV_FLAGS_DISP_CONSUMER
On some targets, Venus h/w can support 4k decoding but mdss
can handle only upto 2k.
So, in usecases where the resolution of the video
is more than 2k, venus h/w would downscale the content to 2k
and allocate the output decoded buffers at 2k.

In cases where display(SF) is not the consumer of the
decoded buffers(for ex:transcoding, etc), downscaling
need not happen.

So, video f/w needs a mechanism to identify the consumer
of the decoded buffers and allocate them accordingly.

The buffers would be allocated at the incoming video
resolution by default. During allocation, the gralloc private
flag PRIV_FLAGS_DISP_CONSUMER would be set to indicate to the
video f/w if display is the consumer of the content.

If display happens to be the consumer and the resolution
of the incoming video is more than 2k, video f/w would
cancel the earlier allocated buffers and would allocate
the new buffers at 2k.

Change-Id: Ic6e562d357eadb8d49b166b454746f91ccc85ed8
2015-11-25 13:27:34 -08: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
Saurabh Shah
bddb9529c8 gralloc: Use only metadata for color space
Currently both handle metadata and handle flags are used to indicate
the color space. This change deprecates support for flags.

Also gralloc doesn't set a color space based on use case anymore,
since front-end requirements keep changing. The default is set to 601
and the onus of correctly specifying the color space now rests on
clients.

CRs-fixed: 919117

Change-Id: I4988830e22804517b393c60dbe641d3bd1d790ec
2015-10-20 10:08:05 -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
Linux Build Service Account
c9cc41dd27 Merge "gralloc: Add a private flag for INTERNAL only" 2015-09-12 22:47:10 -07:00
Kaushik Kanetkar
4cb337cbfd gralloc: Add HAL_PIXEL_FORMAT_BGR_565 format
- Define new format in gralloc_priv.h header
- Add support for HAL_PIXEL_FORMAT_BGR_565 while allocating buffers

CRs-fixed: 904907

Change-Id: I2cf3cdcfc5c89b11abc4ceb4daba77a5123ecf67
2015-09-10 12:07:12 -06:00
Arun Kumar K.R
48a5755087 gralloc: Add a private flag for INTERNAL only
Add PRIV_FLAGS_INTERNAL_ONLY which will be used by clients
to know if that is an INTERNAL only layer.

Change-Id: I2cc69bcbc86c18d97ce0c841670b760e48721ffa
2015-09-03 11:43:24 -07:00
Linux Build Service Account
7648232a7e Merge "hwc: Add support for YCrCb_420_SP_VENUS(NV21_VENUS)" 2015-05-06 11:38:07 -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
Raj Kamal
8bb3b8f79a hwc: Add support for YCrCb_420_SP_VENUS(NV21_VENUS)
* Earlier, camera preview buffers were of NV21(YCrCb_420_SP)
  and the video buffers were of NV12_VENUS(YCbCr_420_SP_VENUS)
  format. Now that the video encoder has support for NV21,
  both the camera and video buffers can be of
  NV21_VENUS(YCrCb_420_SP_VENUS) format.

* If the preview and video buffer sizes are the same,
  CPP double pass to generate video and preview buffers can be
  avoided and the buffers can now be generated within a single pass
  with CPP duplication thereby saving power.

* Add support in gralloc for NV12_VENUS format to achieve
  the same.

Change-Id: I7001f975f2cafa21c893e7384ddbddd5f2788b1d
2015-04-16 18:28:45 +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
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
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
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
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
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
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
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
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
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
Linux Build Service Account
ca1f9ef3ba Merge "gralloc: Add GRALLOC_PRIVATE_USAGE_WFD flag" 2014-03-01 16:19:54 -08: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
1f6a82159c gralloc: Add GRALLOC_PRIVATE_USAGE_WFD flag
1. Screenrecord and WFD use virtual display and encoder.
   Since HAL supports only one virtual display, we need a
   definite way to distinguish both use-cases.

   Failure to differentiate will break Screen record + WFD
   concurrent usecase.

   WFD stack will set this usage flag and SF will query the usage
   flags to differentiate WFD and screenrecord usecase.

2. Deprecate GRALLOC_USAGE_PRIVATE_EXTERNAL_CC and
   GRALLOC_USAGE_PRIVATE_EXTERNAL_BLOCK flags as these are no
   longer used.

Change-Id: Ifa260c5af2371eea830744ce62a5a83b8cfd0de7
2014-02-20 11:22:33 -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
Linux Build Service Account
b6b9bde81e Merge "hwc: Add support for Macro Tile feature" 2014-01-16 13:27:11 -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
Ranjith Kagathi Ananda
251f6d9927 gralloc_priv.h: Adds 10bit compressed HAL pixel format in enum list
VPU and MDSS on MPQ8092 supports the 10 bit compressed pixel format
to reduce the memory access bandwidth

Change-Id: I903c52640120c4bf4252405831b98d1ef92c1572
2014-01-02 16:50:10 -08:00