diff options
author | Lingfeng Yang <lfy@google.com> | 2021-08-05 19:42:03 -0700 |
---|---|---|
committer | Lingfeng Yang <lfy@google.com> | 2021-08-06 11:25:20 -0700 |
commit | 4494e762319a6156cf427a20c8b38f66d5be886a (patch) | |
tree | e4bede5f33e110d33192b2842182c61fb1768e8b | |
parent | 8be7045ae05577da0a0711138210d40b6619036e (diff) | |
download | goldfish-opengl-4494e762319a6156cf427a20c8b38f66d5be886a.tar.gz |
In mapper, use rcReadColorBufferDMA if availableandroid12-dev
Bug: 189960317
Test: ./cts-tradefed run cts -m CtsViewTestCases -t
android.view.cts.ASurfaceControlBackPressureTest#testSurfaceTransaction_setEnableBackPressure
fails fewer frames
Test: ./cts-tradefed run cts -m CtsNativeHardwareTestCases 100%
Change-Id: I0be2dabb0b78818e53911864f0848d5e4954e8c9
Merged-In: I0be2dabb0b78818e53911864f0848d5e4954e8c9
-rw-r--r-- | system/hals/mapper3.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/system/hals/mapper3.cpp b/system/hals/mapper3.cpp index 0788a0a6..570ae5ea 100644 --- a/system/hals/mapper3.cpp +++ b/system/hals/mapper3.cpp @@ -449,11 +449,24 @@ private: // **** impl **** } } } else { - rcEnc->rcReadColorBuffer(rcEnc, - cb.hostHandle, - 0, 0, cb.width, cb.height, - cb.glFormat, cb.glType, - bufferBits); + if (rcEnc->featureInfo()->hasReadColorBufferDma) { + { + AEMU_SCOPED_TRACE("bindDmaDirectly"); + rcEnc->bindDmaDirectly(bufferBits, + getMmapedPhysAddr(cb.getMmapedOffset())); + } + rcEnc->rcReadColorBufferDMA(rcEnc, + cb.hostHandle, + 0, 0, cb.width, cb.height, + cb.glFormat, cb.glType, + bufferBits, cb.width * cb.height * cb.bytesPerPixel); + } else { + rcEnc->rcReadColorBuffer(rcEnc, + cb.hostHandle, + 0, 0, cb.width, cb.height, + cb.glFormat, cb.glType, + bufferBits); + } } } |