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

Commit 1b62f2af authored by Ram Indani's avatar Ram Indani Committed by Android (Google) Code Review
Browse files

Merge changes from topic "hwc-rri"

* changes:
  Adds Composition REFRESH_RATE_INDICATOR
  [SF] Adds Refresh Rate Indicator HWC callback handlers
parents bb1658df c1945cb7
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -585,6 +585,7 @@ void OutputLayer::writeOutputIndependentPerFrameStateToHWC(
        case Composition::CURSOR:
        case Composition::CURSOR:
        case Composition::DEVICE:
        case Composition::DEVICE:
        case Composition::DISPLAY_DECORATION:
        case Composition::DISPLAY_DECORATION:
        case Composition::REFRESH_RATE_INDICATOR:
            writeBufferStateToHWC(hwcLayer, outputIndependentState, skipLayer);
            writeBufferStateToHWC(hwcLayer, outputIndependentState, skipLayer);
            break;
            break;
        case Composition::INVALID:
        case Composition::INVALID:
@@ -780,6 +781,7 @@ void OutputLayer::detectDisallowedCompositionTypeChange(Composition from, Compos
        case Composition::CURSOR:
        case Composition::CURSOR:
        case Composition::SIDEBAND:
        case Composition::SIDEBAND:
        case Composition::DISPLAY_DECORATION:
        case Composition::DISPLAY_DECORATION:
        case Composition::REFRESH_RATE_INDICATOR:
            result = (to == Composition::CLIENT || to == Composition::DEVICE);
            result = (to == Composition::CLIENT || to == Composition::DEVICE);
            break;
            break;
    }
    }
+4 −0
Original line number Original line Diff line number Diff line
@@ -151,6 +151,10 @@ std::string to_string(const Plan& plan) {
                // A for "Alpha", since the decoration is an alpha layer.
                // A for "Alpha", since the decoration is an alpha layer.
                result.append("A");
                result.append("A");
                break;
                break;
            case aidl::android::hardware::graphics::composer3::Composition::REFRESH_RATE_INDICATOR:
                // R for "Refresh", since the layer is Refresh rate overlay.
                result.append("R");
                break;
        }
        }
    }
    }
    return result;
    return result;
+6 −0
Original line number Original line Diff line number Diff line
@@ -208,6 +208,12 @@ public:
        return ::ndk::ScopedAStatus::ok();
        return ::ndk::ScopedAStatus::ok();
    }
    }


    ::ndk::ScopedAStatus onRefreshRateChangedDebug(
            const RefreshRateChangedDebugData& refreshRateChangedDebugData) override {
        mCallback.onRefreshRateChangedDebug(refreshRateChangedDebugData);
        return ::ndk::ScopedAStatus::ok();
    }

private:
private:
    HWC2::ComposerCallback& mCallback;
    HWC2::ComposerCallback& mCallback;
};
};
+4 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@
#include <aidl/android/hardware/graphics/composer3/Composition.h>
#include <aidl/android/hardware/graphics/composer3/Composition.h>
#include <aidl/android/hardware/graphics/composer3/DisplayCapability.h>
#include <aidl/android/hardware/graphics/composer3/DisplayCapability.h>
#include <aidl/android/hardware/graphics/composer3/OverlayProperties.h>
#include <aidl/android/hardware/graphics/composer3/OverlayProperties.h>
#include <aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.h>


namespace android {
namespace android {


@@ -63,6 +64,8 @@ class Layer;


namespace hal = android::hardware::graphics::composer::hal;
namespace hal = android::hardware::graphics::composer::hal;


using aidl::android::hardware::graphics::composer3::RefreshRateChangedDebugData;

// Implement this interface to receive hardware composer events.
// Implement this interface to receive hardware composer events.
//
//
// These callback functions will generally be called on a hwbinder thread, but
// These callback functions will generally be called on a hwbinder thread, but
@@ -77,6 +80,7 @@ struct ComposerCallback {
                                                       const hal::VsyncPeriodChangeTimeline&) = 0;
                                                       const hal::VsyncPeriodChangeTimeline&) = 0;
    virtual void onComposerHalSeamlessPossible(hal::HWDisplayId) = 0;
    virtual void onComposerHalSeamlessPossible(hal::HWDisplayId) = 0;
    virtual void onComposerHalVsyncIdle(hal::HWDisplayId) = 0;
    virtual void onComposerHalVsyncIdle(hal::HWDisplayId) = 0;
    virtual void onRefreshRateChangedDebug(const RefreshRateChangedDebugData&) = 0;


protected:
protected:
    ~ComposerCallback() = default;
    ~ComposerCallback() = default;
+2 −0
Original line number Original line Diff line number Diff line
@@ -113,6 +113,8 @@ inline std::string to_string(
            return "Sideband";
            return "Sideband";
        case aidl::android::hardware::graphics::composer3::Composition::DISPLAY_DECORATION:
        case aidl::android::hardware::graphics::composer3::Composition::DISPLAY_DECORATION:
            return "DisplayDecoration";
            return "DisplayDecoration";
        case aidl::android::hardware::graphics::composer3::Composition::REFRESH_RATE_INDICATOR:
            return "RefreshRateIndicator";
        default:
        default:
            return "Unknown";
            return "Unknown";
    }
    }
Loading