Set crtc again if dpms off executed 44/255744/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Tue, 23 Mar 2021 08:32:10 +0000 (17:32 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Tue, 23 Mar 2021 08:32:13 +0000 (17:32 +0900)
When dpms off execute, sometimes setted surface can be free by offscreen commit. (prepare commit)
In this case it's need to crtc set again before atomic commit after dpms on.

Change-Id: I384170009f3151f0b7a2b233a70ffbe129e94244
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/tdm_nexell_display.c
src/tdm_nexell_types.h

index 139a61a292ddc53e07d9f4512b0146c805dc9fcc..80e8c3cb8295a851f7f797dc240ae6d97c02b7ec 100644 (file)
@@ -1524,7 +1524,7 @@ _nexell_output_atomic_commit(tdm_output *output, int sync, void *user_data)
 
        RETURN_VAL_IF_FAIL(output_data, TDM_ERROR_INVALID_PARAMETER);
 
-       if (!output_data->crtc_enabled || output_data->mode_changed) {
+       if (!output_data->crtc_enabled || output_data->mode_changed || output_data->crtc_reset) {
                drmModeModeInfoPtr mode;
 
                layer_data = output_data->primary_layer;
@@ -1550,6 +1550,7 @@ _nexell_output_atomic_commit(tdm_output *output, int sync, void *user_data)
 
                output_data->crtc_enabled = 1;
                output_data->mode_changed = 0;
+               output_data->crtc_reset = 0;
        }
 
        request = drmModeAtomicAlloc();
@@ -1719,6 +1720,9 @@ nexell_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value)
                return TDM_ERROR_OPERATION_FAILED;
        }
 
+       if (dpms_value == TDM_OUTPUT_DPMS_OFF)
+               output_data->crtc_reset = 1;
+
        return TDM_ERROR_NONE;
 }
 
index be16585100c9ea123f8f8abc89bc899fde773885..47cca8c38abb31ac00c3ce7e4a0548bbca3ed46d 100644 (file)
@@ -206,6 +206,8 @@ struct _tdm_nexell_output_data {
        /* hwc */
        int hwc_enable;
        tdm_nexell_hwc_data *hwc_data;
+
+       int crtc_reset;
 };
 
 struct _tdm_nexell_layer_data {