Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c02242c4 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5289249 from 80c7d5a3 to qt-release

Change-Id: Ied282d6939169b15c99bdaf1630080caf22ea5ec
parents 2c8f9086 80c7d5a3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
    }

+25 −10
Original line number Diff line number Diff line
@@ -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();
    }

@@ -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;
        }
@@ -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
+10 −4
Original line number Diff line number Diff line
@@ -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;
@@ -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);
+14 −2
Original line number Diff line number Diff line
@@ -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() {
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public:

        struct Header {
            uint32_t type;
            uint32_t id;
            PhysicalDisplayId displayId;
            nsecs_t timestamp __attribute__((aligned(8)));
        };

Loading