diff options
author | Gurchetan Singh <gurchetansingh@google.com> | 2024-01-23 15:56:05 -0800 |
---|---|---|
committer | Gurchetan Singh <gurchetansingh@google.com> | 2024-02-01 11:02:26 -0800 |
commit | 1f23f4cc861f7e56546431d0a86977a54121186f (patch) | |
tree | 22b9f7e2bf35797e90c10309a4f61f517d5357d9 | |
parent | 7d3a6601425d415c988ad3ee6232e001f0dd84e6 (diff) | |
download | goldfish-opengl-1f23f4cc861f7e56546431d0a86977a54121186f.tar.gz |
goldfish-opengl: nuke instances of goldfish_dma
There seems to fallback paths available when goldfish
and goldfish_asg aren't available. Use them.
BUG=311486792
TEST=compile
Change-Id: I13d8936461985600c9c0ba9da279180f88304c47
-rw-r--r-- | system/gralloc/gralloc_old.cpp | 24 | ||||
-rw-r--r-- | system/hals/mapper3.cpp | 10 |
2 files changed, 1 insertions, 33 deletions
diff --git a/system/gralloc/gralloc_old.cpp b/system/gralloc/gralloc_old.cpp index 080b34c9..53d4a94a 100644 --- a/system/gralloc/gralloc_old.cpp +++ b/system/gralloc/gralloc_old.cpp @@ -32,7 +32,6 @@ #include "aemu/base/threads/AndroidThread.h" #include "glUtils.h" #include "goldfish_address_space.h" -#include "goldfish_dma.h" #include "gralloc_common.h" #if PLATFORM_SDK_VERSION < 26 @@ -229,17 +228,13 @@ struct gralloc_dmaregion_t { sz(INITIAL_DMA_REGION_SIZE), refcount(0), bigbufCount(0) { - memset(&goldfish_dma, 0, sizeof(goldfish_dma)); pthread_mutex_init(&lock, NULL); if (rcEnc->hasDirectMem()) { host_memory_allocator.hostMalloc(&address_space_block, sz); - } else if (rcEnc->getDmaVersion() > 0) { - goldfish_dma_create_region(sz, &goldfish_dma); } } - goldfish_dma_context goldfish_dma; GoldfishAddressSpaceHostMemoryAllocator host_memory_allocator; GoldfishAddressSpaceBlock address_space_block; uint32_t sz; @@ -260,7 +255,7 @@ static gralloc_memregions_t* init_gralloc_memregions() { } static bool has_DMA_support(const ExtendedRCEncoderContext *rcEnc) { - return rcEnc->getDmaVersion() > 0 || rcEnc->hasDirectMem(); + return false; } static gralloc_dmaregion_t* init_gralloc_dmaregion(ExtendedRCEncoderContext *rcEnc) { @@ -281,11 +276,6 @@ static void get_gralloc_region(ExtendedRCEncoderContext *rcEnc) { } static void resize_gralloc_dmaregion_locked(gralloc_dmaregion_t* grdma, uint32_t new_sz) { - if (grdma->goldfish_dma.mapped_addr) { - goldfish_dma_unmap(&grdma->goldfish_dma); - } - close(grdma->goldfish_dma.fd); - goldfish_dma_create_region(new_sz, &grdma->goldfish_dma); grdma->sz = new_sz; } @@ -355,9 +345,6 @@ static void gralloc_dmaregion_register_ashmem_dma_locked(gralloc_dmaregion_t* gr resize_gralloc_dmaregion_locked(grdma, new_sz); } } - if (!grdma->goldfish_dma.mapped_addr) { - goldfish_dma_map(&grdma->goldfish_dma); - } } static void gralloc_dmaregion_register_ashmem(ExtendedRCEncoderContext *rcEnc, uint32_t sz) { @@ -556,15 +543,6 @@ static void updateHostColorBuffer(cb_handle_old_t* cb, break; } - if (grdma->address_space_block.guestPtr()) { - rcEnc->bindDmaDirectly(grdma->address_space_block.guestPtr(), - grdma->address_space_block.physAddr()); - } else if (grdma->goldfish_dma.mapped_addr) { - rcEnc->bindDmaContext(&grdma->goldfish_dma); - } else { - ALOGE("%s: Unexpected DMA", __func__); - } - D("%s: call. dma update with sz=%u", __func__, send_buffer_size); pthread_mutex_lock(&grdma->lock); rcEnc->rcUpdateColorBufferDMA(rcEnc, cb->hostHandle, diff --git a/system/hals/mapper3.cpp b/system/hals/mapper3.cpp index 8be0b492..006292fc 100644 --- a/system/hals/mapper3.cpp +++ b/system/hals/mapper3.cpp @@ -480,11 +480,6 @@ private: // **** impl **** } } else { 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, @@ -566,11 +561,6 @@ private: // **** impl **** const HostConnectionSession conn = getHostConnectionSession(); ExtendedRCEncoderContext *const rcEnc = conn.getRcEncoder(); { - AEMU_SCOPED_TRACE("bindDmaDirectly"); - rcEnc->bindDmaDirectly(bufferBits, - getMmapedPhysAddr(cb.getMmapedOffset())); - } - { AEMU_SCOPED_TRACE("updateColorBuffer"); rcEnc->rcUpdateColorBufferDMA(rcEnc, cb.hostHandle, 0, 0, cb.width, cb.height, |