diff options
| author | Paul Keith <javelinanddart@gmail.com> | 2019-02-06 20:01:29 -0600 |
|---|---|---|
| committer | Paul Keith <javelinanddart@gmail.com> | 2019-02-07 08:36:33 -0600 |
| commit | 62d6ecd2d47aadf92cc4885eaa31ce0f07d4e07d (patch) | |
| tree | 25c99bc422eb5d6b992591361d51b0d97fd71e19 | |
| parent | 36ab5756214efd7519fc0af04a5fdca8dfdd312f (diff) | |
| download | android_hardware_lineage_livedisplay-62d6ecd2d47aadf92cc4885eaa31ce0f07d4e07d.tar.gz android_hardware_lineage_livedisplay-62d6ecd2d47aadf92cc4885eaa31ce0f07d4e07d.tar.bz2 android_hardware_lineage_livedisplay-62d6ecd2d47aadf92cc4885eaa31ce0f07d4e07d.zip | |
livedisplay: sdm: Fix restoring default mode
* It turns out that some sdm devices need this to be manually set
to the default mode in order for the correct mode to be set
* This partially reverts 950336a which was merged too early,
but also fixes a bug in the if check for the modeId, since
the modeId can be greater than *or equal to* 0
Change-Id: Ie2c0e9d496ad850104886cd59d82f78be2510db6
| -rw-r--r-- | sdm/DisplayModes.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sdm/DisplayModes.cpp b/sdm/DisplayModes.cpp index 0cc900d..4ddd0eb 100644 --- a/sdm/DisplayModes.cpp +++ b/sdm/DisplayModes.cpp @@ -51,6 +51,13 @@ DisplayModes::DisplayModes(void* libHandle, uint64_t cookie) { disp_api_set_default_display_mode = reinterpret_cast<int32_t (*)(uint64_t, uint32_t, int32_t, uint32_t)>( dlsym(mLibHandle, "disp_api_set_default_display_mode")); + + if (isSupported()) { + DisplayMode mode = getDefaultDisplayModeInternal(); + if (mode.id >= 0) { + setDisplayMode(mode.id, false); + } + } } bool DisplayModes::isSupported() { |
