diff options
author | Junkyeong Kim <jk0430.kim@samsung.com> | 2016-11-30 13:38:55 +0900 |
---|---|---|
committer | Junkyeong Kim <jk0430.kim@samsung.com> | 2016-11-30 13:39:05 +0900 |
commit | 69f5cfc637a7163f154f808d5dc374f8bf6be490 (patch) | |
tree | f9019d555052f717a65441cab947724f31af11d5 | |
parent | 7ab778caeb2340af31ef8e6cf1c177c528416582 (diff) | |
download | libtdm-drm-69f5cfc637a7163f154f808d5dc374f8bf6be490.tar.gz libtdm-drm-69f5cfc637a7163f154f808d5dc374f8bf6be490.tar.bz2 libtdm-drm-69f5cfc637a7163f154f808d5dc374f8bf6be490.zip |
add ouput_list empty checking
Change-Id: I84472e40bd79edff7c3c80d811bde08f283f9321
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
-rw-r--r-- | src/tdm_drm_display.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tdm_drm_display.c b/src/tdm_drm_display.c index 9ff29ee..ad0e6d6 100644 --- a/src/tdm_drm_display.c +++ b/src/tdm_drm_display.c @@ -382,16 +382,16 @@ _tdm_drm_display_create_layer_list(tdm_drm_data *drm_data) tdm_drm_output_data *output_data = NULL; int i; + if (LIST_IS_EMPTY(&drm_data->output_list)) { + TDM_ERR("no output"); + return TDM_ERROR_OPERATION_FAILED; + } + /* The TDM drm backend only support one output. */ LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link) { break; } - if (!output_data) { - TDM_ERR("no output"); - return TDM_ERROR_OPERATION_FAILED; - } - if (drm_data->plane_res->count_planes == 0) { TDM_ERR("no layer error"); return TDM_ERROR_OPERATION_FAILED; @@ -493,16 +493,16 @@ _tdm_drm_display_create_layer_list_type(tdm_drm_data *drm_data) tdm_error ret; int i; + if (LIST_IS_EMPTY(&drm_data->output_list)) { + TDM_ERR("no output"); + return TDM_ERROR_OPERATION_FAILED; + } + /* The TDM drm backend only support one output. */ LIST_FOR_EACH_ENTRY(output_data, &drm_data->output_list, link) { break; } - if (!output_data) { - TDM_ERR("no output"); - return TDM_ERROR_OPERATION_FAILED; - } - ret = _tdm_drm_display_get_property(drm_data, drm_data->plane_res->planes[0], DRM_MODE_OBJECT_PLANE, "type", &type, |