aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-14 00:00:52 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-14 00:00:52 +0000
commit4dccbb0c5214fa88614c2e37bc170e1415954a46 (patch)
tree95d6fd3c289efe91619c254bcfdb6718c21441dc
parent60d509d4e05e18d1d2fc1cd48189cb9d050fd7ad (diff)
parent92df735b5e394a4ebb74fbbaf410c3a564a35e9d (diff)
downloadgoldfish-opengl-4dccbb0c5214fa88614c2e37bc170e1415954a46.tar.gz
Snap for 11445705 from 92df735b5e394a4ebb74fbbaf410c3a564a35e9d to sdk-release
Change-Id: I18f9b72208b2ece2af03514f8fc47b5f6248a526
-rw-r--r--system/gralloc/gralloc_old.cpp15
-rw-r--r--system/hwc3/HostFrameComposer.cpp15
-rw-r--r--system/hwc3/HostFrameComposer.h3
3 files changed, 8 insertions, 25 deletions
diff --git a/system/gralloc/gralloc_old.cpp b/system/gralloc/gralloc_old.cpp
index 080b34c9..13228e85 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;
@@ -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) {
@@ -559,8 +546,6 @@ static void updateHostColorBuffer(cb_handle_old_t* cb,
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__);
}
diff --git a/system/hwc3/HostFrameComposer.cpp b/system/hwc3/HostFrameComposer.cpp
index d440b880..8f232dcc 100644
--- a/system/hwc3/HostFrameComposer.cpp
+++ b/system/hwc3/HostFrameComposer.cpp
@@ -524,10 +524,7 @@ HWC3::Error HostFrameComposer::presentDisplay(
*outDisplayFence = std::move(flushCompleteFence);
} else {
- rcEnc->rcSetDisplayColorBuffer(
- rcEnc, displayInfo.hostDisplayId,
- hostCon->grallocHelper()->getHostHandle(displayClientTarget.getBuffer()));
- post(hostCon, rcEnc, displayClientTarget.getBuffer());
+ post(hostCon, rcEnc, displayInfo.hostDisplayId, displayClientTarget.getBuffer());
*outDisplayFence = std::move(fence);
}
}
@@ -696,10 +693,7 @@ HWC3::Error HostFrameComposer::presentDisplay(
displayId, compositionResult->getDrmBuffer(), displayClientTargetFence);
*outDisplayFence = std::move(flushFence);
} else {
- rcEnc->rcSetDisplayColorBuffer(
- rcEnc, displayInfo.hostDisplayId,
- hostCon->grallocHelper()->getHostHandle(displayClientTarget.getBuffer()));
- post(hostCon, rcEnc, displayClientTarget.getBuffer());
+ post(hostCon, rcEnc, displayInfo.hostDisplayId, displayClientTarget.getBuffer());
*outDisplayFence = std::move(displayClientTargetFence);
}
ALOGV("%s fallback to post, returns outRetireFence %d", __FUNCTION__,
@@ -712,10 +706,13 @@ HWC3::Error HostFrameComposer::presentDisplay(
}
void HostFrameComposer::post(HostConnection* hostCon, ExtendedRCEncoderContext* rcEnc,
- buffer_handle_t h) {
+ uint32_t hostDisplayId, buffer_handle_t h) {
assert(cb && "native_handle_t::from(h) failed");
hostCon->lock();
+ rcEnc->rcSetDisplayColorBuffer(
+ rcEnc, hostDisplayId,
+ hostCon->grallocHelper()->getHostHandle(h));
rcEnc->rcFBPost(rcEnc, hostCon->grallocHelper()->getHostHandle(h));
hostCon->flush();
hostCon->unlock();
diff --git a/system/hwc3/HostFrameComposer.h b/system/hwc3/HostFrameComposer.h
index e90f7cfd..2cd9854a 100644
--- a/system/hwc3/HostFrameComposer.h
+++ b/system/hwc3/HostFrameComposer.h
@@ -74,7 +74,8 @@ class HostFrameComposer : public FrameComposer {
private:
HWC3::Error createHostComposerDisplayInfo(Display* display, uint32_t hostDisplayId);
- void post(HostConnection* hostCon, ExtendedRCEncoderContext* rcEnc, buffer_handle_t h);
+ void post(HostConnection* hostCon, ExtendedRCEncoderContext* rcEnc, uint32_t hostDisplayId,
+ buffer_handle_t h);
bool mIsMinigbm = false;