diff options
author | Yichi Chen <yichichen@google.com> | 2020-11-27 16:59:17 +0800 |
---|---|---|
committer | Yichi Chen <yichichen@google.com> | 2020-12-14 15:48:31 +0800 |
commit | 24d72cb5d38b4d4cad1ebd986d6a5cd78d334e8c (patch) | |
tree | 2a334a969b3c5d27fbabeddb6bd8bc2271b874f0 /libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp | |
parent | 6132ece5176b49e1da92c6ecceb23bc0e8b8a3ae (diff) |
libhwc2.1: Add basic support function for AFBC color format
It is necessary to consider color format with AFBC compression type
since AFBC may provide different configuration especially for YUV
formats. The patch extends the basic functions in ExynosHWCHelper.cpp to
include AFBC compression type while checking the HAL format.
Bug: 139446002
Test: AFBC video playback with DPU composition
Change-Id: I23918f526ffbe655064c08ff4ef9cc7843df9188
Diffstat (limited to 'libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp')
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp index 002482e..bea0424 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp @@ -645,21 +645,25 @@ int32_t ExynosDisplayDrmInterface::addFBFromDisplayConfig( else if (isFormatSBWC(config.format)) compressType = COMP_ANY; - drmFormat = halFormatToDrmFormat(config.format, compressType); + auto exynosFormat = halFormatToExynosFormat(config.format, compressType); + if (exynosFormat == nullptr) { + HWC_LOGE(mExynosDisplay, "%s:: unknown HAL format (%d)", __func__, config.format); + return -EINVAL; + } + + drmFormat = exynosFormat->drmFormat; if (drmFormat == DRM_FORMAT_UNDEFINED) { - HWC_LOGE(mExynosDisplay, "%s:: known drm format (%d)", - __func__, config.format); + HWC_LOGE(mExynosDisplay, "%s:: unknown drm format (%d)", __func__, config.format); return -EINVAL; } bpp = getBytePerPixelOfPrimaryPlane(config.format); - if ((bufferNum = getBufferNumOfFormat(config.format)) == 0) { + if ((bufferNum = exynosFormat->bufferNum) == 0) { HWC_LOGE(mExynosDisplay, "%s:: getBufferNumOfFormat(%d) error", __func__, config.format); return -EINVAL; } - if (((planeNum = getPlaneNumOfFormat(config.format)) == 0) || - (planeNum > MAX_PLANE_NUM)) { + if (((planeNum = exynosFormat->planeNum) == 0) || (planeNum > MAX_PLANE_NUM)) { HWC_LOGE(mExynosDisplay, "%s:: getPlaneNumOfFormat(%d) error, planeNum(%d)", __func__, config.format, planeNum); return -EINVAL; @@ -1267,7 +1271,7 @@ int ExynosDisplayDrmInterface::DrmModeAtomicReq::commit(uint32_t flags, bool log if (loggingForDebug) dumpAtomicCommitInfo(result, true); if (ret < 0) { - HWC_LOGE(mDrmDisplayInterface->mExynosDisplay, "commit error"); + HWC_LOGE(mDrmDisplayInterface->mExynosDisplay, "commit error: %d", ret); setError(ret); } |