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

Commit ed78f7dc authored by petsjonkin's avatar petsjonkin
Browse files

Moving vrrSupported flag to DisplayDeviceConfig.

Adding support for devices with vrr + non vrr screens.
Now instead of global flag, it is per display.

Bug: b/330810426
Test: atest DisplayModeDirectorTest atest BrightnessObserverTest atest SettingsObserverTest
Change-Id: I4f30fb425b549ff67591fc9f1656f0ccccd620e2
parent 2d86d415
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -363,6 +363,14 @@ public abstract class DisplayManagerInternal {
     */
    public abstract List<RefreshRateLimitation> getRefreshRateLimitations(int displayId);

    /**
     * Returns if vrr support is enabled for specified display
     *
     * @param displayId The id of the display.
     * @return true if associated display supports dvrr
     */
    public abstract boolean isVrrSupportEnabled(int displayId);

    /**
     * For the given displayId, updates if WindowManager is responsible for mirroring on that
     * display. If {@code false}, then SurfaceFlinger performs no layer mirroring to the
+0 −3
Original line number Diff line number Diff line
@@ -4334,9 +4334,6 @@
    -->
    <bool name="config_wallpaperTopApp">false</bool>

    <!-- True if the device supports dVRR  -->
    <bool name="config_supportsDvrr">false</bool>

    <!-- True if the device supports at least one form of multi-window.
         E.g. freeform, split-screen, picture-in-picture. -->
    <bool name="config_supportsMultiWindow">true</bool>
+0 −1
Original line number Diff line number Diff line
@@ -404,7 +404,6 @@
  <java-symbol type="bool" name="config_supportAudioSourceUnprocessed" />
  <java-symbol type="bool" name="config_freeformWindowManagement" />
  <java-symbol type="bool" name="config_supportsBubble" />
  <java-symbol type="bool" name="config_supportsDvrr" />
  <java-symbol type="bool" name="config_supportsMultiWindow" />
  <java-symbol type="bool" name="config_supportsSplitScreenMultiWindow" />
  <java-symbol type="bool" name="config_supportsMultiDisplay" />
+13 −1
Original line number Diff line number Diff line
@@ -587,7 +587,7 @@ import javax.xml.datatype.DatatypeConfigurationException;
 *              </point>
 *          </luxThresholds>
 *     </idleScreenRefreshRateTimeout>
 *
 *     <supportsVrr>true</supportsVrr>
 *
 *    </displayConfiguration>
 *  }
@@ -903,6 +903,8 @@ public class DisplayDeviceConfig {
     */
    private float mBrightnessCapForWearBedtimeMode;

    private boolean mVrrSupportEnabled;

    private final DisplayManagerFlags mFlags;

    @VisibleForTesting
@@ -1941,6 +1943,13 @@ public class DisplayDeviceConfig {
        return mBrightnessCapForWearBedtimeMode;
    }

    /**
     * @return true if display supports dvrr
     */
    public boolean isVrrSupportEnabled() {
        return mVrrSupportEnabled;
    }

    @Override
    public String toString() {
        return "DisplayDeviceConfig{"
@@ -2076,6 +2085,8 @@ public class DisplayDeviceConfig {
                + "\n"
                + "mEvenDimmerBrightnessData:" + (mEvenDimmerBrightnessData != null
                ? mEvenDimmerBrightnessData.toString() : "null")
                + "\n"
                + "mVrrSupported= " + mVrrSupportEnabled + "\n"
                + "}";
    }

@@ -2150,6 +2161,7 @@ public class DisplayDeviceConfig {
                mHdrBrightnessData = HdrBrightnessData.loadConfig(config);
                loadBrightnessCapForWearBedtimeMode(config);
                loadIdleScreenRefreshRateTimeoutConfigs(config);
                mVrrSupportEnabled = config.getSupportsVrr();
            } else {
                Slog.w(TAG, "DisplayDeviceConfig file is null");
            }
+13 −0
Original line number Diff line number Diff line
@@ -2763,6 +2763,7 @@ public final class DisplayManagerService extends SystemService {
                            + requestedRefreshRate + " on Display: " + displayId);
                }
            }

            mDisplayModeDirector.getAppRequestObserver().setAppRequest(
                    displayId, requestedModeId, requestedMinRefreshRate, requestedMaxRefreshRate);

@@ -4937,6 +4938,18 @@ public final class DisplayManagerService extends SystemService {
            return config.getRefreshRateLimitations();
        }

        @Override
        public boolean isVrrSupportEnabled(int displayId) {
            DisplayDevice device;
            synchronized (mSyncRoot) {
                device = getDeviceForDisplayLocked(displayId);
            }
            if (device == null) {
                return false;
            }
            return device.getDisplayDeviceConfig().isVrrSupportEnabled();
        }

        @Override
        public void setWindowManagerMirroring(int displayId, boolean isMirroring) {
            synchronized (mSyncRoot) {
Loading