Loading cmds/flatland/GLHelper.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -222,9 +222,9 @@ bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h, } bool GLHelper::computeWindowScale(uint32_t w, uint32_t h, float* scale) { sp<IBinder> dpy = mSurfaceComposerClient->getBuiltInDisplay(0); const sp<IBinder> dpy = mSurfaceComposerClient->getInternalDisplayToken(); if (dpy == nullptr) { fprintf(stderr, "SurfaceComposer::getBuiltInDisplay failed.\n"); fprintf(stderr, "SurfaceComposer::getInternalDisplayToken failed.\n"); return false; } Loading libs/gui/ISurfaceComposer.cpp +25 −10 Original line number Diff line number Diff line Loading @@ -275,12 +275,25 @@ public: remote()->transact(BnSurfaceComposer::DESTROY_DISPLAY, data, &reply); } virtual sp<IBinder> getBuiltInDisplay(int32_t id) { virtual std::vector<PhysicalDisplayId> getPhysicalDisplayIds() const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (remote()->transact(BnSurfaceComposer::GET_PHYSICAL_DISPLAY_IDS, data, &reply) == NO_ERROR) { std::vector<PhysicalDisplayId> displayIds; if (reply.readUint64Vector(&displayIds) == NO_ERROR) { return displayIds; } } return {}; } virtual sp<IBinder> getPhysicalDisplayToken(PhysicalDisplayId displayId) const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); data.writeInt32(id); remote()->transact(BnSurfaceComposer::GET_BUILT_IN_DISPLAY, data, &reply); data.writeUint64(displayId); remote()->transact(BnSurfaceComposer::GET_PHYSICAL_DISPLAY_TOKEN, data, &reply); return reply.readStrongBinder(); } Loading Loading @@ -896,10 +909,10 @@ status_t BnSurfaceComposer::onTransact( destroyDisplay(display); return NO_ERROR; } case GET_BUILT_IN_DISPLAY: { case GET_PHYSICAL_DISPLAY_TOKEN: { CHECK_INTERFACE(ISurfaceComposer, data, reply); int32_t id = data.readInt32(); sp<IBinder> display(getBuiltInDisplay(id)); PhysicalDisplayId displayId = data.readUint64(); sp<IBinder> display = getPhysicalDisplayToken(displayId); reply->writeStrongBinder(display); return NO_ERROR; } Loading Loading @@ -1216,12 +1229,14 @@ status_t BnSurfaceComposer::onTransact( } return error; } case GET_PHYSICAL_DISPLAY_IDS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); return reply->writeUint64Vector(getPhysicalDisplayIds()); } default: { return BBinder::onTransact(code, data, reply, flags); } } } // ---------------------------------------------------------------------------- }; } // namespace android libs/gui/Surface.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -321,8 +321,11 @@ status_t Surface::getFrameTimestamps(uint64_t frameNumber, status_t Surface::getWideColorSupport(bool* supported) { ATRACE_CALL(); sp<IBinder> display( composerService()->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain)); const sp<IBinder> display = composerService()->getInternalDisplayToken(); if (display == nullptr) { return NAME_NOT_FOUND; } *supported = false; status_t error = composerService()->isWideColorDisplay(display, supported); return error; Loading @@ -331,8 +334,11 @@ status_t Surface::getWideColorSupport(bool* supported) { status_t Surface::getHdrSupport(bool* supported) { ATRACE_CALL(); sp<IBinder> display( composerService()->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain)); const sp<IBinder> display = composerService()->getInternalDisplayToken(); if (display == nullptr) { return NAME_NOT_FOUND; } HdrCapabilities hdrCapabilities; status_t err = composerService()->getHdrCapabilities(display, &hdrCapabilities); Loading libs/gui/SurfaceComposerClient.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -484,8 +484,20 @@ void SurfaceComposerClient::destroyDisplay(const sp<IBinder>& display) { return ComposerService::getComposerService()->destroyDisplay(display); } sp<IBinder> SurfaceComposerClient::getBuiltInDisplay(int32_t id) { return ComposerService::getComposerService()->getBuiltInDisplay(id); std::vector<PhysicalDisplayId> SurfaceComposerClient::getPhysicalDisplayIds() { return ComposerService::getComposerService()->getPhysicalDisplayIds(); } std::optional<PhysicalDisplayId> SurfaceComposerClient::getInternalDisplayId() { return ComposerService::getComposerService()->getInternalDisplayId(); } sp<IBinder> SurfaceComposerClient::getPhysicalDisplayToken(PhysicalDisplayId displayId) { return ComposerService::getComposerService()->getPhysicalDisplayToken(displayId); } sp<IBinder> SurfaceComposerClient::getInternalDisplayToken() { return ComposerService::getComposerService()->getInternalDisplayToken(); } void SurfaceComposerClient::Transaction::setAnimationTransaction() { Loading libs/gui/include/gui/DisplayEventReceiver.h +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public: struct Header { uint32_t type; uint32_t id; PhysicalDisplayId displayId; nsecs_t timestamp __attribute__((aligned(8))); }; Loading Loading
cmds/flatland/GLHelper.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -222,9 +222,9 @@ bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h, } bool GLHelper::computeWindowScale(uint32_t w, uint32_t h, float* scale) { sp<IBinder> dpy = mSurfaceComposerClient->getBuiltInDisplay(0); const sp<IBinder> dpy = mSurfaceComposerClient->getInternalDisplayToken(); if (dpy == nullptr) { fprintf(stderr, "SurfaceComposer::getBuiltInDisplay failed.\n"); fprintf(stderr, "SurfaceComposer::getInternalDisplayToken failed.\n"); return false; } Loading
libs/gui/ISurfaceComposer.cpp +25 −10 Original line number Diff line number Diff line Loading @@ -275,12 +275,25 @@ public: remote()->transact(BnSurfaceComposer::DESTROY_DISPLAY, data, &reply); } virtual sp<IBinder> getBuiltInDisplay(int32_t id) { virtual std::vector<PhysicalDisplayId> getPhysicalDisplayIds() const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (remote()->transact(BnSurfaceComposer::GET_PHYSICAL_DISPLAY_IDS, data, &reply) == NO_ERROR) { std::vector<PhysicalDisplayId> displayIds; if (reply.readUint64Vector(&displayIds) == NO_ERROR) { return displayIds; } } return {}; } virtual sp<IBinder> getPhysicalDisplayToken(PhysicalDisplayId displayId) const { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); data.writeInt32(id); remote()->transact(BnSurfaceComposer::GET_BUILT_IN_DISPLAY, data, &reply); data.writeUint64(displayId); remote()->transact(BnSurfaceComposer::GET_PHYSICAL_DISPLAY_TOKEN, data, &reply); return reply.readStrongBinder(); } Loading Loading @@ -896,10 +909,10 @@ status_t BnSurfaceComposer::onTransact( destroyDisplay(display); return NO_ERROR; } case GET_BUILT_IN_DISPLAY: { case GET_PHYSICAL_DISPLAY_TOKEN: { CHECK_INTERFACE(ISurfaceComposer, data, reply); int32_t id = data.readInt32(); sp<IBinder> display(getBuiltInDisplay(id)); PhysicalDisplayId displayId = data.readUint64(); sp<IBinder> display = getPhysicalDisplayToken(displayId); reply->writeStrongBinder(display); return NO_ERROR; } Loading Loading @@ -1216,12 +1229,14 @@ status_t BnSurfaceComposer::onTransact( } return error; } case GET_PHYSICAL_DISPLAY_IDS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); return reply->writeUint64Vector(getPhysicalDisplayIds()); } default: { return BBinder::onTransact(code, data, reply, flags); } } } // ---------------------------------------------------------------------------- }; } // namespace android
libs/gui/Surface.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -321,8 +321,11 @@ status_t Surface::getFrameTimestamps(uint64_t frameNumber, status_t Surface::getWideColorSupport(bool* supported) { ATRACE_CALL(); sp<IBinder> display( composerService()->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain)); const sp<IBinder> display = composerService()->getInternalDisplayToken(); if (display == nullptr) { return NAME_NOT_FOUND; } *supported = false; status_t error = composerService()->isWideColorDisplay(display, supported); return error; Loading @@ -331,8 +334,11 @@ status_t Surface::getWideColorSupport(bool* supported) { status_t Surface::getHdrSupport(bool* supported) { ATRACE_CALL(); sp<IBinder> display( composerService()->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain)); const sp<IBinder> display = composerService()->getInternalDisplayToken(); if (display == nullptr) { return NAME_NOT_FOUND; } HdrCapabilities hdrCapabilities; status_t err = composerService()->getHdrCapabilities(display, &hdrCapabilities); Loading
libs/gui/SurfaceComposerClient.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -484,8 +484,20 @@ void SurfaceComposerClient::destroyDisplay(const sp<IBinder>& display) { return ComposerService::getComposerService()->destroyDisplay(display); } sp<IBinder> SurfaceComposerClient::getBuiltInDisplay(int32_t id) { return ComposerService::getComposerService()->getBuiltInDisplay(id); std::vector<PhysicalDisplayId> SurfaceComposerClient::getPhysicalDisplayIds() { return ComposerService::getComposerService()->getPhysicalDisplayIds(); } std::optional<PhysicalDisplayId> SurfaceComposerClient::getInternalDisplayId() { return ComposerService::getComposerService()->getInternalDisplayId(); } sp<IBinder> SurfaceComposerClient::getPhysicalDisplayToken(PhysicalDisplayId displayId) { return ComposerService::getComposerService()->getPhysicalDisplayToken(displayId); } sp<IBinder> SurfaceComposerClient::getInternalDisplayToken() { return ComposerService::getComposerService()->getInternalDisplayToken(); } void SurfaceComposerClient::Transaction::setAnimationTransaction() { Loading
libs/gui/include/gui/DisplayEventReceiver.h +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public: struct Header { uint32_t type; uint32_t id; PhysicalDisplayId displayId; nsecs_t timestamp __attribute__((aligned(8))); }; Loading