sdm/gralloc: Add TP10_UBWC and P010 format support with DRM
sdm:add supported formats based on modifier combination, add definition of modifiers gralloc: assign format modifiers for TP10_UBWC and P010 Change-Id: I66b0fac446cc112dc758653f85b427956b7d2ca6 CRs-fixed: 1114808
This commit is contained in:
@@ -80,6 +80,12 @@
|
|||||||
#ifndef DRM_FORMAT_MOD_QCOM_COMPRESSED
|
#ifndef DRM_FORMAT_MOD_QCOM_COMPRESSED
|
||||||
#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
|
#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef DRM_FORMAT_MOD_QCOM_DX
|
||||||
|
#define DRM_FORMAT_MOD_QCOM_DX fourcc_mod_code(QCOM, 0x2)
|
||||||
|
#endif
|
||||||
|
#ifndef DRM_FORMAT_MOD_QCOM_TIGHT
|
||||||
|
#define DRM_FORMAT_MOD_QCOM_TIGHT fourcc_mod_code(QCOM, 0x4)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace gralloc;
|
using namespace gralloc;
|
||||||
@@ -1282,12 +1288,13 @@ void getDRMFormat(int hal_format, int flags, uint32_t *drm_format,
|
|||||||
*drm_format = DRM_FORMAT_NV21;
|
*drm_format = DRM_FORMAT_NV21;
|
||||||
break;
|
break;
|
||||||
case HAL_PIXEL_FORMAT_YCbCr_420_P010:
|
case HAL_PIXEL_FORMAT_YCbCr_420_P010:
|
||||||
// TODO *drm_format = DRM_FORMAT_P010;
|
*drm_format = DRM_FORMAT_NV12;
|
||||||
|
*drm_format_modifier = DRM_FORMAT_MOD_QCOM_DX;
|
||||||
break;
|
break;
|
||||||
case HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC:
|
case HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC:
|
||||||
// TODO *drm_format = DRM_FORMAT_P010;
|
*drm_format = DRM_FORMAT_NV12;
|
||||||
// *drm_format_modifier = DRM_FORMAT_MOD_QCOM_COMPRESSED |
|
*drm_format_modifier = DRM_FORMAT_MOD_QCOM_COMPRESSED |
|
||||||
// DRM_FORMAT_MOD_QCOM_TIGHT;
|
DRM_FORMAT_MOD_QCOM_DX | DRM_FORMAT_MOD_QCOM_TIGHT;
|
||||||
break;
|
break;
|
||||||
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
|
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
|
||||||
*drm_format = DRM_FORMAT_NV16;
|
*drm_format = DRM_FORMAT_NV16;
|
||||||
|
|||||||
@@ -54,6 +54,18 @@
|
|||||||
|
|
||||||
#include "hw_info_drm.h"
|
#include "hw_info_drm.h"
|
||||||
|
|
||||||
|
#ifdef COMPILE_DRM
|
||||||
|
#ifndef DRM_FORMAT_MOD_QCOM_COMPRESSED
|
||||||
|
#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
|
||||||
|
#endif
|
||||||
|
#ifndef DRM_FORMAT_MOD_QCOM_DX
|
||||||
|
#define DRM_FORMAT_MOD_QCOM_DX fourcc_mod_code(QCOM, 0x2)
|
||||||
|
#endif
|
||||||
|
#ifndef DRM_FORMAT_MOD_QCOM_TIGHT
|
||||||
|
#define DRM_FORMAT_MOD_QCOM_TIGHT fourcc_mod_code(QCOM, 0x4)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define __CLASS__ "HWInfoDRM"
|
#define __CLASS__ "HWInfoDRM"
|
||||||
|
|
||||||
using drm_utils::DRMMaster;
|
using drm_utils::DRMMaster;
|
||||||
@@ -542,20 +554,24 @@ void HWInfoDRM::GetSDMFormat(uint32_t drm_format, uint64_t drm_format_modifier,
|
|||||||
case DRM_FORMAT_XBGR2101010:
|
case DRM_FORMAT_XBGR2101010:
|
||||||
fmts.push_back(kFormatXBGR2101010);
|
fmts.push_back(kFormatXBGR2101010);
|
||||||
break;
|
break;
|
||||||
/* case DRM_FORMAT_P010:
|
|
||||||
fmts.push_back(drm_format_modifier == (DRM_FORMAT_MOD_QCOM_COMPRESSED |
|
|
||||||
DRM_FORMAT_MOD_QCOM_TIGHT) ?
|
|
||||||
kFormatYCbCr420TP10Ubwc : kFormatYCbCr420P010; */
|
|
||||||
case DRM_FORMAT_YVU420:
|
case DRM_FORMAT_YVU420:
|
||||||
fmts.push_back(kFormatYCrCb420PlanarStride16);
|
fmts.push_back(kFormatYCrCb420PlanarStride16);
|
||||||
break;
|
break;
|
||||||
case DRM_FORMAT_NV12:
|
case DRM_FORMAT_NV12:
|
||||||
if (drm_format_modifier) {
|
if (drm_format_modifier == (DRM_FORMAT_MOD_QCOM_COMPRESSED |
|
||||||
fmts.push_back(kFormatYCbCr420SPVenusUbwc);
|
DRM_FORMAT_MOD_QCOM_DX | DRM_FORMAT_MOD_QCOM_TIGHT)) {
|
||||||
|
fmts.push_back(kFormatYCbCr420TP10Ubwc);
|
||||||
|
} else if (drm_format_modifier == DRM_FORMAT_MOD_QCOM_COMPRESSED) {
|
||||||
|
fmts.push_back(kFormatYCbCr420SPVenusUbwc);
|
||||||
|
} else if (drm_format_modifier == DRM_FORMAT_MOD_QCOM_DX) {
|
||||||
|
fmts.push_back(kFormatYCbCr420P010);
|
||||||
} else {
|
} else {
|
||||||
fmts.push_back(kFormatYCbCr420SemiPlanarVenus);
|
fmts.push_back(kFormatYCbCr420SemiPlanarVenus);
|
||||||
fmts.push_back(kFormatYCbCr420SemiPlanar);
|
fmts.push_back(kFormatYCbCr420SemiPlanar);
|
||||||
}
|
}
|
||||||
|
// TODO(user):
|
||||||
|
// else if (drm_format_modifier == (DRM_FORMAT_MOD_QCOM_COMPRESSED | DRM_FORMAT_MOD_QCOM_DX))
|
||||||
|
// fmts.push_back(kFormatYCbCr420P010Ubwc);
|
||||||
break;
|
break;
|
||||||
case DRM_FORMAT_NV21:
|
case DRM_FORMAT_NV21:
|
||||||
fmts.push_back(kFormatYCrCb420SemiPlanarVenus);
|
fmts.push_back(kFormatYCrCb420SemiPlanarVenus);
|
||||||
|
|||||||
Reference in New Issue
Block a user