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

Commit c65ae65a authored by Tony Huang's avatar Tony Huang Committed by Android (Google) Code Review
Browse files

Merge "VRR: Use appId to replace uid mapping" into main

parents 58ebf65d f3621106
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2788,16 +2788,16 @@ status_t SurfaceComposerClient::setOverrideFrameRate(uid_t uid, float frameRate)
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::updateSmallAreaDetection(std::vector<int32_t>& uids,
status_t SurfaceComposerClient::updateSmallAreaDetection(std::vector<int32_t>& appIds,
                                                         std::vector<float>& thresholds) {
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->updateSmallAreaDetection(uids, thresholds);
            ComposerServiceAIDL::getComposerService()->updateSmallAreaDetection(appIds, thresholds);
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::setSmallAreaDetectionThreshold(uid_t uid, float threshold) {
status_t SurfaceComposerClient::setSmallAreaDetectionThreshold(int32_t appId, float threshold) {
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->setSmallAreaDetectionThreshold(uid,
            ComposerServiceAIDL::getComposerService()->setSmallAreaDetectionThreshold(appId,
                                                                                      threshold);
    return statusTFromBinderStatus(status);
}
+4 −4
Original line number Diff line number Diff line
@@ -480,14 +480,14 @@ interface ISurfaceComposer {
     */
    void setOverrideFrameRate(int uid, float frameRate);

    oneway void updateSmallAreaDetection(in int[] uids, in float[] thresholds);
    oneway void updateSmallAreaDetection(in int[] appIds, in float[] thresholds);

    /**
     * Set the small area detection threshold for a specified uid by SmallAreaDetectionController.
     * Passing the threshold and uid to SurfaceFlinger to update the uid-threshold mapping
     * Set the small area detection threshold for a specified appId by SmallAreaDetectionController.
     * Passing the threshold and appId to SurfaceFlinger to update the appId-threshold mapping
     * in the scheduler.
     */
    oneway void setSmallAreaDetectionThreshold(int uid, float threshold);
    oneway void setSmallAreaDetectionThreshold(int appId, float threshold);

    /**
     * Enables or disables the frame rate overlay in the top left corner.
+5 −5
Original line number Diff line number Diff line
@@ -203,15 +203,15 @@ public:
    // by GameManager.
    static status_t setOverrideFrameRate(uid_t uid, float frameRate);

    // Update the small area detection whole uid-threshold mappings by same size uid and threshold
    // vector.
    // Update the small area detection whole appId-threshold mappings by same size appId and
    // threshold vector.
    // Ref:setSmallAreaDetectionThreshold.
    static status_t updateSmallAreaDetection(std::vector<int32_t>& uids,
    static status_t updateSmallAreaDetection(std::vector<int32_t>& appIds,
                                             std::vector<float>& thresholds);

    // Sets the small area detection threshold to particular apps (uid). Passing value 0 means
    // Sets the small area detection threshold to particular apps (appId). Passing value 0 means
    // to disable small area detection to the app.
    static status_t setSmallAreaDetectionThreshold(uid_t uid, float threshold);
    static status_t setSmallAreaDetectionThreshold(int32_t appId, float threshold);

    // Switches on/off Auto Low Latency Mode on the connected display. This should only be
    // called if the connected display supports Auto Low Latency Mode as reported by
+2 −2
Original line number Diff line number Diff line
@@ -999,12 +999,12 @@ public:

    binder::Status scheduleCommit() override { return binder::Status::ok(); }

    binder::Status updateSmallAreaDetection(const std::vector<int32_t>& /*uids*/,
    binder::Status updateSmallAreaDetection(const std::vector<int32_t>& /*appIds*/,
                                            const std::vector<float>& /*thresholds*/) {
        return binder::Status::ok();
    }

    binder::Status setSmallAreaDetectionThreshold(int32_t /*uid*/, float /*threshold*/) {
    binder::Status setSmallAreaDetectionThreshold(int32_t /*appId*/, float /*threshold*/) {
        return binder::Status::ok();
    }

+2 −1
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ Layer::Layer(const surfaceflinger::LayerCreationArgs& args)

    mOwnerUid = args.ownerUid;
    mOwnerPid = args.ownerPid;
    mOwnerAppId = mOwnerUid % PER_USER_RANGE;

    mPremultipliedAlpha = !(args.flags & ISurfaceComposerClient::eNonPremultiplied);
    mPotentialCursor = args.flags & ISurfaceComposerClient::eCursorWindow;
@@ -4431,7 +4432,7 @@ void Layer::setIsSmallDirty() {

    // If the damage region is a small dirty, this could give the hint for the layer history that
    // it could suppress the heuristic rate when calculating.
    mSmallDirty = mFlinger->mScheduler->isSmallDirtyArea(mOwnerUid,
    mSmallDirty = mFlinger->mScheduler->isSmallDirtyArea(mOwnerAppId,
                                                         bounds.getWidth() * bounds.getHeight());
}

Loading