[SurfaceFlinger] Replace android_dataspace with Dataspace.
This patch replaces all android_dataspace in SurfaceFlinger with Dataspace
V1.1. 3 commands in sequence are used to do the conversion:
find ./ -type f -exec sed -i -e 's/android_dataspace_t/Dataspace/g' {} \;
find ./ -type f -exec sed -i -e 's/android_dataspace/Dataspace/g' {} \;
find ./ -type f -exec sed -i -e 's/HAL_DATASPACE_/Dataspace::/g' {} \;
With some minor tweak because most of the APIs in frameworks/native are still
accepting android_dataspace/android_dataspace_t.
Next step is to convert the rest of android_dataspace usage to Dataspace in
frameworks/native as well as frameworks/base.
BUG: 77156734
Test: Build and flash
Change-Id: I2304c7014cb49a1c9f67c4563603fb55e8dbd679
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
index 9398bde..e6d7834 100644
--- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
+++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
@@ -44,6 +44,8 @@
namespace android {
// ----------------------------------------------------------------------------
+using ui::Dataspace;
+
/*
* This implements the (main) framebuffer management. This class is used
* mostly by SurfaceFlinger, but also by command line GL application.
@@ -92,7 +94,7 @@
uint32_t slot = 0;
sp<GraphicBuffer> buf;
sp<Fence> acquireFence(Fence::NO_FENCE);
- android_dataspace_t dataspace = HAL_DATASPACE_UNKNOWN;
+ Dataspace dataspace = Dataspace::UNKNOWN;
status_t result = nextBuffer(slot, buf, acquireFence, dataspace);
mDataSpace = dataspace;
if (result != NO_ERROR) {
@@ -104,7 +106,7 @@
status_t FramebufferSurface::nextBuffer(uint32_t& outSlot,
sp<GraphicBuffer>& outBuffer, sp<Fence>& outFence,
- android_dataspace_t& outDataspace) {
+ Dataspace& outDataspace) {
Mutex::Autolock lock(mMutex);
BufferItem item;
@@ -139,7 +141,7 @@
outFence = item.mFence;
mHwcBufferCache.getHwcBuffer(mCurrentBufferSlot, mCurrentBuffer,
&outSlot, &outBuffer);
- outDataspace = item.mDataSpace;
+ outDataspace = static_cast<Dataspace>(item.mDataSpace);
status_t result =
mHwc.setClientTarget(mDisplayType, outSlot, outFence, outBuffer, outDataspace);
if (result != NO_ERROR) {
@@ -178,7 +180,8 @@
void FramebufferSurface::dumpAsString(String8& result) const {
Mutex::Autolock lock(mMutex);
result.appendFormat(" FramebufferSurface: dataspace: %s(%d)\n",
- dataspaceDetails(mDataSpace).c_str(), mDataSpace);
+ dataspaceDetails(static_cast<android_dataspace>(mDataSpace)).c_str(),
+ mDataSpace);
ConsumerBase::dumpLocked(result, " ");
}