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

Commit 430f8eae authored by Ian Elliott's avatar Ian Elliott Committed by Android (Google) Code Review
Browse files

Merge "Only enumerate display_timing when present timestamp supported" into oc-dev

parents 5bf90e1d 5c34de2c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -578,6 +578,14 @@ void SurfaceFlinger::init() {

    Mutex::Autolock _l(mStateLock);

    // Inform native graphics APIs whether the present timestamp is supported:
    if (getHwComposer().hasCapability(
            HWC2::Capability::PresentFenceIsNotReliable)) {
        property_set(kTimestampProperty, "0");
    } else {
        property_set(kTimestampProperty, "1");
    }

    if (useVrFlinger) {
        auto vrFlingerRequestDisplayCallback = [this] (bool requestDisplay) {
            mVrFlingerRequestsDisplay = requestDisplay;
+1 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ private:
    enum { LOG_FRAME_STATS_PERIOD =  30*60*60 };

    static const size_t MAX_LAYERS = 4096;
    static constexpr const char* kTimestampProperty = "service.sf.present_timestamp";

    // We're reference counted, never destroy SurfaceFlinger directly
    virtual ~SurfaceFlinger();
+3 −0
Original line number Diff line number Diff line
@@ -549,6 +549,9 @@ void SurfaceFlinger::init() {
    LOG_ALWAYS_FATAL_IF(mEGLContext == EGL_NO_CONTEXT,
            "couldn't create EGLContext");

    // Inform native graphics APIs that the present timestamp is NOT supported:
    property_set(kTimestampProperty, "0");

    // initialize our non-virtual displays
    for (size_t i=0 ; i<DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES ; i++) {
        DisplayDevice::DisplayType type((DisplayDevice::DisplayType)i);
+10 −3
Original line number Diff line number Diff line
@@ -817,9 +817,6 @@ VkResult EnumerateDeviceExtensionProperties(
    loader_extensions.push_back({
        VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME,
        VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION});
    loader_extensions.push_back({
        VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME,
        VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION});

    if (kEnableUnratifiedExtensions) {
        // conditionally add shared_presentable_image if supportable
@@ -832,6 +829,16 @@ VkResult EnumerateDeviceExtensionProperties(
        }
    }

    // conditionally add VK_GOOGLE_display_timing if present timestamps are
    // supported by the driver:
    char timestamp_property[PROPERTY_VALUE_MAX];
    property_get("service.sf.present_timestamp", timestamp_property, "1");
    if (strcmp(timestamp_property, "1") == 0) {
        loader_extensions.push_back({
                VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME,
                VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION});
    }

    // enumerate our extensions first
    if (!pLayerName && pProperties) {
        uint32_t count = std::min(