use video plane. add YUV420 format to layer capability 80/166880/5
authorJunkyeong Kim <jk0430.kim@samsung.com>
Fri, 12 Jan 2018 08:02:55 +0000 (17:02 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Tue, 16 Jan 2018 11:06:54 +0000 (11:06 +0000)
0: overlay, video(YU12 only)
1: primary, rgb
2: overlay, rgb

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

index 2871e3655938851c7d95864954ebeb2c81cd922b..76139024008d391f938446e23445ccdd351d2b5b 100644 (file)
@@ -583,14 +583,14 @@ _tdm_nexell_display_create_layer_list_type(tdm_nexell_data *nexell_data)
                goto failed;
        }
 
-       opos_next = 1;
+       opos_next = 0;
        cpos_next = ovl_cnt;
-       if (plane_cnt < 2) {
-               TDM_ERR("plane count(%d) should be over 2", plane_cnt);
+       if (plane_cnt < 1) {
+               TDM_ERR("plane count(%d) should be over 1", plane_cnt);
                goto failed;
        }
 
-       for (i = plane_cnt - 2; i >= 0; i--) {
+       for (i = plane_cnt - 1; i >= 0; i--) {
                tdm_nexell_layer_data *layer_data;
 
                layer_data = calloc(1, sizeof(tdm_nexell_layer_data));
@@ -612,12 +612,17 @@ _tdm_nexell_display_create_layer_list_type(tdm_nexell_data *nexell_data)
                        layer_data->capabilities = TDM_LAYER_CAPABILITY_OVERLAY |
                                                                           TDM_LAYER_CAPABILITY_GRAPHIC |
                                                                           TDM_LAYER_CAPABILITY_SCANOUT;
-                       layer_data->zpos = opos_next++;
+                       if (opos_next == 1) {
+                               layer_data->zpos = 2;
+                               opos_next = 2;
+                       } else {
+                               layer_data->zpos = opos_next++;
+                       }
                } else if (types[i] == DRM_PLANE_TYPE_PRIMARY) {
                        layer_data->capabilities = TDM_LAYER_CAPABILITY_PRIMARY |
                                                                           TDM_LAYER_CAPABILITY_GRAPHIC |
                                                                           TDM_LAYER_CAPABILITY_SCANOUT;
-                       layer_data->zpos = 0;
+                       layer_data->zpos = 1;
                        output_data->primary_layer = layer_data;
                } else {
                        free(layer_data);
@@ -1550,7 +1555,8 @@ nexell_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps)
        for (i = 0; i < caps->format_count; i++) {
                /* TODO: kernel reports wrong formats */
                if (plane->formats[i] != DRM_FORMAT_XRGB8888 &&
-                   plane->formats[i] != DRM_FORMAT_ARGB8888) {
+                   plane->formats[i] != DRM_FORMAT_ARGB8888 &&
+                   plane->formats[i] != DRM_FORMAT_YUV420) {
                        TDM_WRN("plane(%d) zpos(%d) %c%c%c%c skipped",
                                        layer_data->plane_id, layer_data->zpos, FOURCC_STR(plane->formats[i]));
                        continue;