diff options
author | TreeHugger Robot <android-build-prod@system.gserviceaccount.com> | 2020-05-18 20:54:24 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-05-18 20:54:24 +0000 |
commit | 2132d7d35b05015c82aa66b6043d38a4a67a902c (patch) | |
tree | 16f20689abcdb6140266e045fa4fe078e9f496fe /libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp | |
parent | cb2530ece09e4da301afdabc3ea7608c866f2ce1 (diff) | |
parent | 0dd3825274713a02c6dcaa4179006b2075b7809b (diff) |
Merge "libhwc2.1: propagate modifiers to all planes" into qt-hammersmith-dev
Diffstat (limited to 'libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp')
-rw-r--r-- | libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp index 2ca9add..95ad7da 100644 --- a/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayDrmInterface.cpp @@ -620,21 +620,6 @@ int32_t ExynosDisplayDrmInterface::addFBFromDisplayConfig( __func__, config.format, planeNum); return -EINVAL; } - for (uint32_t bufferIndex = 0; bufferIndex < bufferNum; bufferIndex++) { - pitches[bufferIndex] = config.src.f_w * bpp; - - buf_handles[bufferIndex] = drmReq.getBufHandleFromFd(config.fd_idma[bufferIndex]); - } - if ((bufferNum == 1) && (planeNum > bufferNum)) { - /* offset for cbcr */ - offsets[CBCR_INDEX] = - getExynosBufferYLength(config.src.f_w, config.src.f_h, config.format); - for (uint32_t planeIndex = 1; planeIndex < planeNum; planeIndex++) - { - buf_handles[planeIndex] = buf_handles[0]; - pitches[planeIndex] = pitches[0]; - } - } if (config.compression) { uint64_t compressed_modifier = AFBC_FORMAT_MOD_BLOCK_SIZE_16x16; @@ -651,6 +636,25 @@ int32_t ExynosDisplayDrmInterface::addFBFromDisplayConfig( modifiers[0] |= DRM_FORMAT_MOD_ARM_AFBC(compressed_modifier); } + for (uint32_t bufferIndex = 0; bufferIndex < bufferNum; bufferIndex++) { + pitches[bufferIndex] = config.src.f_w * bpp; + + buf_handles[bufferIndex] = drmReq.getBufHandleFromFd(config.fd_idma[bufferIndex]); + modifiers[bufferIndex] = modifiers[0]; + } + + if ((bufferNum == 1) && (planeNum > bufferNum)) { + /* offset for cbcr */ + offsets[CBCR_INDEX] = + getExynosBufferYLength(config.src.f_w, config.src.f_h, config.format); + for (uint32_t planeIndex = 1; planeIndex < planeNum; planeIndex++) + { + buf_handles[planeIndex] = buf_handles[0]; + pitches[planeIndex] = pitches[0]; + modifiers[planeIndex] = modifiers[0]; + } + } + ret = drmReq.addFB2WithModifiers(config.src.f_w, config.src.f_h, drmFormat, buf_handles, pitches, offsets, modifiers, &fbId, modifiers[0] ? DRM_MODE_FB_MODIFIERS : 0); |