goldfish-opengl: nuke instances of goldfish_dma am: 1f23f4cc86

Original change: https://android-review.googlesource.com/c/device/generic/goldfish-opengl/+/2924521

Change-Id: I0ca26c64007b009ee55b66daadd67ee59d4b4a79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/system/gralloc/gralloc_old.cpp b/system/gralloc/gralloc_old.cpp
index 4332dc2..d401240 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 @@
         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 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 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 @@
             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 @@
             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 8be0b49..006292f 100644
--- a/system/hals/mapper3.cpp
+++ b/system/hals/mapper3.cpp
@@ -480,11 +480,6 @@
                 }
             } 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 @@
                 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,