diff options
author | Sushil Chauhan <sushilchauhan@codeaurora.org> | 2015-01-14 10:48:57 -0800 |
---|---|---|
committer | Sushil Chauhan <sushilchauhan@codeaurora.org> | 2015-01-16 11:00:01 -0800 |
commit | 65e26307e63ea672332aa5cea963ad630aaf95bf (patch) | |
tree | af5f53d7e8b03aa175a37c0fc4edf1b2176c27b7 /libgralloc/gr.h | |
parent | 2dbd0fa2625f44212b46ddff1efd95a431b65d76 (diff) | |
download | hardware_qcom_display-65e26307e63ea672332aa5cea963ad630aaf95bf.tar.gz hardware_qcom_display-65e26307e63ea672332aa5cea963ad630aaf95bf.tar.bz2 hardware_qcom_display-65e26307e63ea672332aa5cea963ad630aaf95bf.zip |
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
Diffstat (limited to 'libgralloc/gr.h')
-rw-r--r-- | libgralloc/gr.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libgralloc/gr.h b/libgralloc/gr.h index 797d57ee2..492f4952f 100644 --- a/libgralloc/gr.h +++ b/libgralloc/gr.h @@ -71,6 +71,9 @@ int alloc_buffer(private_handle_t **pHnd, int w, int h, int format, int usage); void free_buffer(private_handle_t *hnd); int getYUVPlaneInfo(private_handle_t* pHnd, struct android_ycbcr* ycbcr); +// To query if UBWC is enabled, based on format and usage flags +bool isUBwcEnabled(int format, int usage); + /*****************************************************************************/ class Locker { @@ -106,12 +109,21 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo> ~AdrenoMemInfo(); /* + * Function to compute aligned width and aligned height based on + * width, height, format and usage flags. + * + * @return aligned width, aligned height + */ + void getAlignedWidthAndHeight(int width, int height, int format, + int usage, int& aligned_w, int& aligned_h); + + /* * Function to compute the adreno aligned width and aligned height * based on the width and format. * * @return aligned width, aligned height */ - void getAlignedWidthAndHeight(int width, int height, int format, + void getGpuAlignedWidthHeight(int width, int height, int format, int tileEnabled, int& alignedw, int &alignedh); /* @@ -122,6 +134,13 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo> */ int isMacroTilingSupportedByGPU(); + /* + * Function to query whether GPU supports UBWC for given HAL format + * @return > 0 : supported + * 0 : not supported + */ + int isUBWCSupportedByGPU(int format); + private: // Pointer to the padding library. void *libadreno_utils; |