Loading libs/binder/ProcessState.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -368,7 +368,7 @@ String8 ProcessState::makeBinderThreadName() { int32_t s = android_atomic_add(1, &mThreadPoolSeq); pid_t pid = getpid(); String8 name; name.appendFormat("Binder:%d_%X", pid, s); name.appendFormat("%d_%X:%s", pid, s, mDriverName.c_str()); return name; } Loading libs/gui/Android.bp +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ cc_library_headers { "android.hardware.graphics.bufferqueue@2.0", ], min_sdk_version: "29", // TODO(b/218719284) can media use be constrained to libgui_bufferqueue_static? apex_available: [ "//apex_available:platform", "com.android.media.swcodec", "test_com.android.media.swcodec", ], } cc_library_headers { Loading Loading @@ -339,6 +345,7 @@ cc_defaults { "android.hardware.graphics.bufferqueue@2.0", "android.hardware.graphics.common@1.1", "android.hardware.graphics.common@1.2", "android.hardware.graphics.common-V3-ndk", "android.hidl.token@1.0-utils", "libbase", "libcutils", Loading libs/gui/DisplayEventReceiver.cpp +11 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,13 @@ DisplayEventReceiver::DisplayEventReceiver( mEventConnection = sf->createDisplayEventConnection(vsyncSource, eventRegistration); if (mEventConnection != nullptr) { mDataChannel = std::make_unique<gui::BitTube>(); mEventConnection->stealReceiveChannel(mDataChannel.get()); const auto status = mEventConnection->stealReceiveChannel(mDataChannel.get()); if (!status.isOk()) { ALOGE("stealReceiveChannel failed: %s", status.toString8().c_str()); mInitError = std::make_optional<status_t>(status.transactionError()); mDataChannel.reset(); mEventConnection.clear(); } } } } Loading @@ -51,12 +57,11 @@ DisplayEventReceiver::~DisplayEventReceiver() { status_t DisplayEventReceiver::initCheck() const { if (mDataChannel != nullptr) return NO_ERROR; return NO_INIT; return mInitError.has_value() ? mInitError.value() : NO_INIT; } int DisplayEventReceiver::getFd() const { if (mDataChannel == nullptr) return NO_INIT; if (mDataChannel == nullptr) return mInitError.has_value() ? mInitError.value() : NO_INIT; return mDataChannel->getFd(); } Loading @@ -69,7 +74,7 @@ status_t DisplayEventReceiver::setVsyncRate(uint32_t count) { mEventConnection->setVsyncRate(count); return NO_ERROR; } return NO_INIT; return mInitError.has_value() ? mInitError.value() : NO_INIT; } status_t DisplayEventReceiver::requestNextVsync() { Loading @@ -77,7 +82,7 @@ status_t DisplayEventReceiver::requestNextVsync() { mEventConnection->requestNextVsync(); return NO_ERROR; } return NO_INIT; return mInitError.has_value() ? mInitError.value() : NO_INIT; } status_t DisplayEventReceiver::getLatestVsyncEventData(VsyncEventData* outVsyncEventData) const { Loading libs/gui/ISurfaceComposer.cpp +34 −8 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ // --------------------------------------------------------------------------- using namespace aidl::android::hardware::graphics; namespace android { using gui::IDisplayEventConnection; Loading Loading @@ -1201,8 +1203,9 @@ public: return NO_ERROR; } status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken, bool* outSupport) const override { status_t getDisplayDecorationSupport( const sp<IBinder>& displayToken, std::optional<common::DisplayDecorationSupport>* outSupport) const override { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { Loading @@ -1225,7 +1228,26 @@ public: ALOGE("getDisplayDecorationSupport: failed to read support: %d", error); return error; } *outSupport = support; if (support) { int32_t format, alphaInterpretation; error = reply.readInt32(&format); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read format: %d", error); return error; } error = reply.readInt32(&alphaInterpretation); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read alphaInterpretation: %d", error); return error; } outSupport->emplace(); outSupport->value().format = static_cast<common::PixelFormat>(format); outSupport->value().alphaInterpretation = static_cast<common::AlphaInterpretation>(alphaInterpretation); } else { outSupport->reset(); } return NO_ERROR; } Loading Loading @@ -2164,14 +2186,18 @@ status_t BnSurfaceComposer::onTransact( case GET_DISPLAY_DECORATION_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); SAFE_PARCEL(data.readNullableStrongBinder, &displayToken); std::optional<common::DisplayDecorationSupport> support; auto error = getDisplayDecorationSupport(displayToken, &support); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read display token: %d", error); ALOGE("getDisplayDecorationSupport failed with error %d", error); return error; } bool support = false; error = getDisplayDecorationSupport(displayToken, &support); reply->writeBool(support); reply->writeBool(support.has_value()); if (support) { reply->writeInt32(static_cast<int32_t>(support.value().format)); reply->writeInt32(static_cast<int32_t>(support.value().alphaInterpretation)); } return error; } case SET_FRAME_RATE: { Loading libs/gui/ITransactionCompletedListener.cpp +19 −2 Original line number Diff line number Diff line Loading @@ -111,7 +111,14 @@ status_t JankData::readFromParcel(const Parcel* input) { status_t SurfaceStats::writeToParcel(Parcel* output) const { SAFE_PARCEL(output->writeStrongBinder, surfaceControl); SAFE_PARCEL(output->writeInt64, acquireTime); if (const auto* acquireFence = std::get_if<sp<Fence>>(&acquireTimeOrFence)) { SAFE_PARCEL(output->writeBool, true); SAFE_PARCEL(output->write, **acquireFence); } else { SAFE_PARCEL(output->writeBool, false); SAFE_PARCEL(output->writeInt64, std::get<nsecs_t>(acquireTimeOrFence)); } if (previousReleaseFence) { SAFE_PARCEL(output->writeBool, true); SAFE_PARCEL(output->write, *previousReleaseFence); Loading @@ -131,8 +138,18 @@ status_t SurfaceStats::writeToParcel(Parcel* output) const { status_t SurfaceStats::readFromParcel(const Parcel* input) { SAFE_PARCEL(input->readStrongBinder, &surfaceControl); SAFE_PARCEL(input->readInt64, &acquireTime); bool hasFence = false; SAFE_PARCEL(input->readBool, &hasFence); if (hasFence) { acquireTimeOrFence = sp<Fence>::make(); SAFE_PARCEL(input->read, *std::get<sp<Fence>>(acquireTimeOrFence)); } else { nsecs_t acquireTime; SAFE_PARCEL(input->readInt64, &acquireTime); acquireTimeOrFence = acquireTime; } SAFE_PARCEL(input->readBool, &hasFence); if (hasFence) { previousReleaseFence = new Fence(); Loading Loading
libs/binder/ProcessState.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -368,7 +368,7 @@ String8 ProcessState::makeBinderThreadName() { int32_t s = android_atomic_add(1, &mThreadPoolSeq); pid_t pid = getpid(); String8 name; name.appendFormat("Binder:%d_%X", pid, s); name.appendFormat("%d_%X:%s", pid, s, mDriverName.c_str()); return name; } Loading
libs/gui/Android.bp +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ cc_library_headers { "android.hardware.graphics.bufferqueue@2.0", ], min_sdk_version: "29", // TODO(b/218719284) can media use be constrained to libgui_bufferqueue_static? apex_available: [ "//apex_available:platform", "com.android.media.swcodec", "test_com.android.media.swcodec", ], } cc_library_headers { Loading Loading @@ -339,6 +345,7 @@ cc_defaults { "android.hardware.graphics.bufferqueue@2.0", "android.hardware.graphics.common@1.1", "android.hardware.graphics.common@1.2", "android.hardware.graphics.common-V3-ndk", "android.hidl.token@1.0-utils", "libbase", "libcutils", Loading
libs/gui/DisplayEventReceiver.cpp +11 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,13 @@ DisplayEventReceiver::DisplayEventReceiver( mEventConnection = sf->createDisplayEventConnection(vsyncSource, eventRegistration); if (mEventConnection != nullptr) { mDataChannel = std::make_unique<gui::BitTube>(); mEventConnection->stealReceiveChannel(mDataChannel.get()); const auto status = mEventConnection->stealReceiveChannel(mDataChannel.get()); if (!status.isOk()) { ALOGE("stealReceiveChannel failed: %s", status.toString8().c_str()); mInitError = std::make_optional<status_t>(status.transactionError()); mDataChannel.reset(); mEventConnection.clear(); } } } } Loading @@ -51,12 +57,11 @@ DisplayEventReceiver::~DisplayEventReceiver() { status_t DisplayEventReceiver::initCheck() const { if (mDataChannel != nullptr) return NO_ERROR; return NO_INIT; return mInitError.has_value() ? mInitError.value() : NO_INIT; } int DisplayEventReceiver::getFd() const { if (mDataChannel == nullptr) return NO_INIT; if (mDataChannel == nullptr) return mInitError.has_value() ? mInitError.value() : NO_INIT; return mDataChannel->getFd(); } Loading @@ -69,7 +74,7 @@ status_t DisplayEventReceiver::setVsyncRate(uint32_t count) { mEventConnection->setVsyncRate(count); return NO_ERROR; } return NO_INIT; return mInitError.has_value() ? mInitError.value() : NO_INIT; } status_t DisplayEventReceiver::requestNextVsync() { Loading @@ -77,7 +82,7 @@ status_t DisplayEventReceiver::requestNextVsync() { mEventConnection->requestNextVsync(); return NO_ERROR; } return NO_INIT; return mInitError.has_value() ? mInitError.value() : NO_INIT; } status_t DisplayEventReceiver::getLatestVsyncEventData(VsyncEventData* outVsyncEventData) const { Loading
libs/gui/ISurfaceComposer.cpp +34 −8 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ // --------------------------------------------------------------------------- using namespace aidl::android::hardware::graphics; namespace android { using gui::IDisplayEventConnection; Loading Loading @@ -1201,8 +1203,9 @@ public: return NO_ERROR; } status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken, bool* outSupport) const override { status_t getDisplayDecorationSupport( const sp<IBinder>& displayToken, std::optional<common::DisplayDecorationSupport>* outSupport) const override { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { Loading @@ -1225,7 +1228,26 @@ public: ALOGE("getDisplayDecorationSupport: failed to read support: %d", error); return error; } *outSupport = support; if (support) { int32_t format, alphaInterpretation; error = reply.readInt32(&format); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read format: %d", error); return error; } error = reply.readInt32(&alphaInterpretation); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read alphaInterpretation: %d", error); return error; } outSupport->emplace(); outSupport->value().format = static_cast<common::PixelFormat>(format); outSupport->value().alphaInterpretation = static_cast<common::AlphaInterpretation>(alphaInterpretation); } else { outSupport->reset(); } return NO_ERROR; } Loading Loading @@ -2164,14 +2186,18 @@ status_t BnSurfaceComposer::onTransact( case GET_DISPLAY_DECORATION_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); SAFE_PARCEL(data.readNullableStrongBinder, &displayToken); std::optional<common::DisplayDecorationSupport> support; auto error = getDisplayDecorationSupport(displayToken, &support); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read display token: %d", error); ALOGE("getDisplayDecorationSupport failed with error %d", error); return error; } bool support = false; error = getDisplayDecorationSupport(displayToken, &support); reply->writeBool(support); reply->writeBool(support.has_value()); if (support) { reply->writeInt32(static_cast<int32_t>(support.value().format)); reply->writeInt32(static_cast<int32_t>(support.value().alphaInterpretation)); } return error; } case SET_FRAME_RATE: { Loading
libs/gui/ITransactionCompletedListener.cpp +19 −2 Original line number Diff line number Diff line Loading @@ -111,7 +111,14 @@ status_t JankData::readFromParcel(const Parcel* input) { status_t SurfaceStats::writeToParcel(Parcel* output) const { SAFE_PARCEL(output->writeStrongBinder, surfaceControl); SAFE_PARCEL(output->writeInt64, acquireTime); if (const auto* acquireFence = std::get_if<sp<Fence>>(&acquireTimeOrFence)) { SAFE_PARCEL(output->writeBool, true); SAFE_PARCEL(output->write, **acquireFence); } else { SAFE_PARCEL(output->writeBool, false); SAFE_PARCEL(output->writeInt64, std::get<nsecs_t>(acquireTimeOrFence)); } if (previousReleaseFence) { SAFE_PARCEL(output->writeBool, true); SAFE_PARCEL(output->write, *previousReleaseFence); Loading @@ -131,8 +138,18 @@ status_t SurfaceStats::writeToParcel(Parcel* output) const { status_t SurfaceStats::readFromParcel(const Parcel* input) { SAFE_PARCEL(input->readStrongBinder, &surfaceControl); SAFE_PARCEL(input->readInt64, &acquireTime); bool hasFence = false; SAFE_PARCEL(input->readBool, &hasFence); if (hasFence) { acquireTimeOrFence = sp<Fence>::make(); SAFE_PARCEL(input->read, *std::get<sp<Fence>>(acquireTimeOrFence)); } else { nsecs_t acquireTime; SAFE_PARCEL(input->readInt64, &acquireTime); acquireTimeOrFence = acquireTime; } SAFE_PARCEL(input->readBool, &hasFence); if (hasFence) { previousReleaseFence = new Fence(); Loading