dpms: save current dpms value 77/216077/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 21 Oct 2019 02:50:58 +0000 (11:50 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 21 Oct 2019 02:51:01 +0000 (11:51 +0900)
do not set buffer and commit when dpms is not on.

Change-Id: I855c87a3380a9dab6611a66e8f4b94f02ae302ff
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/tdm_drm_display.c
src/tdm_drm_hwc.c
src/tdm_drm_types.h

index bac6dbe..debc71a 100644 (file)
@@ -1313,6 +1313,8 @@ drm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value)
                return TDM_ERROR_OPERATION_FAILED;
        }
 
+       output_data->current_dpms = dpms_value;
+
        return TDM_ERROR_NONE;
 }
 
index c775ff3..de657e2 100644 (file)
@@ -648,6 +648,11 @@ drm_hwc_accept_validation(tdm_hwc *hwc)
 
        TDM_INFO(" ==============Accept Changes Done=================================");
 
+       if (hwc_data->output_data->current_dpms != TDM_OUTPUT_DPMS_ON) {
+               TDM_ERR("dpms is not on. do not set buffer");
+               return TDM_ERROR_BAD_REQUEST;
+       }
+
        ret = _drm_hwc_prepare_commit(hwc_data);
        RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
 
@@ -668,6 +673,11 @@ drm_hwc_commit(tdm_hwc *hwc, int sync, void *user_data)
 
        TDM_INFO(" ==============COMMIT=================================");
 
+       if (hwc_data->output_data->current_dpms != TDM_OUTPUT_DPMS_ON) {
+               TDM_ERR("dpms is not on. do not commit");
+               return TDM_ERROR_BAD_REQUEST;
+       }
+
        ret = drm_output_commit(output_data, sync, user_data);
        RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
 
index 74a51bc..34ca532 100644 (file)
@@ -173,6 +173,9 @@ struct _tdm_drm_output_data {
        /* hwc */
        int hwc_enable;
        tdm_drm_hwc_data *hwc_data;
+
+       /* dpms */
+       tdm_output_dpms current_dpms;
 };
 
 struct _tdm_drm_layer_data {