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

Commit b00dc402 authored by Huihong Luo's avatar Huihong Luo Committed by Android (Google) Code Review
Browse files

Merge "Variable refresh rate for virtual display"

parents bd6c28dd 1768cb03
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1182,12 +1182,14 @@ void SurfaceComposerClient::Transaction::setDefaultApplyToken(sp<IBinder> applyT
}
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------


sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName, bool secure) {
sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName, bool secure,
                                                 float requestedRefereshRate) {
    sp<IBinder> display = nullptr;
    sp<IBinder> display = nullptr;
    binder::Status status =
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->createDisplay(std::string(
            ComposerServiceAIDL::getComposerService()->createDisplay(std::string(
                                                                             displayName.string()),
                                                                             displayName.string()),
                                                                     secure, &display);
                                                                     secure, requestedRefereshRate,
                                                                     &display);
    return status.isOk() ? display : nullptr;
    return status.isOk() ? display : nullptr;
}
}


+13 −1
Original line number Original line Diff line number Diff line
@@ -79,9 +79,21 @@ interface ISurfaceComposer {


    /**
    /**
     * Create a virtual display
     * Create a virtual display
     *
     * displayName
     *     The name of the virtual display
     * secure
     *     Whether this virtual display is secure
     * requestedRefreshRate
     *     The refresh rate, frames per second, to request on the virtual display.
     *     This is just a request, the actual rate may be adjusted to align well
     *     with physical displays running concurrently. If 0 is specified, the
     *     virtual display is refreshed at the physical display refresh rate.
     *
     * requires ACCESS_SURFACE_FLINGER permission.
     * requires ACCESS_SURFACE_FLINGER permission.
     */
     */
    @nullable IBinder createDisplay(@utf8InCpp String displayName, boolean secure);
    @nullable IBinder createDisplay(@utf8InCpp String displayName, boolean secure,
            float requestedRefreshRate);


    /**
    /**
     * Destroy a virtual display
     * Destroy a virtual display
+1 −1
Original line number Original line Diff line number Diff line
@@ -67,7 +67,7 @@ public:
                 sp<gui::IDisplayEventConnection>*),
                 sp<gui::IDisplayEventConnection>*),
                (override));
                (override));
    MOCK_METHOD(binder::Status, createConnection, (sp<gui::ISurfaceComposerClient>*), (override));
    MOCK_METHOD(binder::Status, createConnection, (sp<gui::ISurfaceComposerClient>*), (override));
    MOCK_METHOD(binder::Status, createDisplay, (const std::string&, bool, sp<IBinder>*),
    MOCK_METHOD(binder::Status, createDisplay, (const std::string&, bool, float, sp<IBinder>*),
                (override));
                (override));
    MOCK_METHOD(binder::Status, destroyDisplay, (const sp<IBinder>&), (override));
    MOCK_METHOD(binder::Status, destroyDisplay, (const sp<IBinder>&), (override));
    MOCK_METHOD(binder::Status, getPhysicalDisplayIds, (std::vector<int64_t>*), (override));
    MOCK_METHOD(binder::Status, getPhysicalDisplayIds, (std::vector<int64_t>*), (override));
+2 −1
Original line number Original line Diff line number Diff line
@@ -355,7 +355,8 @@ public:
    sp<SurfaceControl> mirrorDisplay(DisplayId displayId);
    sp<SurfaceControl> mirrorDisplay(DisplayId displayId);


    //! Create a virtual display
    //! Create a virtual display
    static sp<IBinder> createDisplay(const String8& displayName, bool secure);
    static sp<IBinder> createDisplay(const String8& displayName, bool secure,
                                     float requestedRefereshRate = 0);


    //! Destroy a virtual display
    //! Destroy a virtual display
    static void destroyDisplay(const sp<IBinder>& display);
    static void destroyDisplay(const sp<IBinder>& display);
+1 −0
Original line number Original line Diff line number Diff line
@@ -736,6 +736,7 @@ public:
    }
    }


    binder::Status createDisplay(const std::string& /*displayName*/, bool /*secure*/,
    binder::Status createDisplay(const std::string& /*displayName*/, bool /*secure*/,
                                 float /*requestedRefreshRate*/,
                                 sp<IBinder>* /*outDisplay*/) override {
                                 sp<IBinder>* /*outDisplay*/) override {
        return binder::Status::ok();
        return binder::Status::ok();
    }
    }
Loading