enable PP 03/74703/1 accepted/tizen/common/20160615.193929 accepted/tizen/ivi/20160616.003501 accepted/tizen/mobile/20160616.003611 accepted/tizen/tv/20160616.003432 accepted/tizen/wearable/20160616.003603 submit/tizen/20160615.123805
authorBoram Park <boram1288.park@samsung.com>
Tue, 14 Jun 2016 02:34:00 +0000 (11:34 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 14 Jun 2016 02:34:00 +0000 (11:34 +0900)
Change-Id: I2b3cbdf67de075bd6d33a2d43e49ef5b826ae361

src/tdm_drm.c
src/tdm_drm_display.c
src/tdm_drm_pp.c

index 8ac23d4..ac8d1bc 100644 (file)
@@ -9,7 +9,7 @@
 #include "tdm_drm.h"
 #include <tdm_helper.h>
 
-//#define ENABLE_PP
+#define ENABLE_PP
 
 #define TDM_DRM_NAME "vigs"
 
index 6f8be78..868c25d 100644 (file)
@@ -339,6 +339,14 @@ _tdm_drm_display_commit_layer(tdm_drm_layer_data *layer_data)
                return TDM_ERROR_OPERATION_FAILED;
        }
 
+       TDM_DBG("plane(%d) crtc(%d) pos(%d) on: fb(%d,[%d,%d %dx%d]=>[%d,%d %dx%d])\n",
+                       layer_data->plane_id, output_data->crtc_id, layer_data->zpos,
+                       layer_data->display_buffer->fb_id,
+                       layer_data->info.src_config.pos.x, layer_data->info.src_config.pos.y,
+                       layer_data->info.src_config.pos.w, layer_data->info.src_config.pos.h,
+                       layer_data->info.dst_pos.x, layer_data->info.dst_pos.y,
+                       layer_data->info.dst_pos.w, layer_data->info.dst_pos.h);
+
        return TDM_ERROR_NONE;
 }
 
index 1da577f..3e9d999 100644 (file)
@@ -5,6 +5,7 @@
 #include <pixman.h>
 
 #include "tdm_drm.h"
+#include "tdm_helper.h"
 
 typedef struct _tdm_drm_pp_buffer {
        tbm_surface_h src;
@@ -174,17 +175,17 @@ _tdm_drm_pp_convert(tdm_drm_pp_buffer *buffer, tdm_info_pp *info)
        /* not handle buffers which have 2 more gem handles */
 
        memset(&src_info, 0, sizeof(tbm_surface_info_s));
-       tbm_surface_get_info(buffer->src, &src_info);
-       RETURN_VAL_IF_FAIL(src_info.planes[0].ptr != NULL, TDM_ERROR_INVALID_PARAMETER);
+       tbm_surface_map(buffer->src, TBM_OPTION_READ, &src_info);
+       GOTO_IF_FAIL(src_info.planes[0].ptr != NULL, fail_convert);
 
        memset(&dst_info, 0, sizeof(tbm_surface_info_s));
-       tbm_surface_get_info(buffer->dst, &dst_info);
-       RETURN_VAL_IF_FAIL(dst_info.planes[0].ptr != NULL, TDM_ERROR_INVALID_PARAMETER);
+       tbm_surface_map(buffer->dst, TBM_OPTION_WRITE, &dst_info);
+       GOTO_IF_FAIL(dst_info.planes[0].ptr != NULL, fail_convert);
 
        src_format = _tdm_drm_pp_pixman_get_format(src_info.format);
-       RETURN_VAL_IF_FAIL(src_format > 0, TDM_ERROR_INVALID_PARAMETER);
+       GOTO_IF_FAIL(src_format > 0, fail_convert);
        dst_format = _tdm_drm_pp_pixman_get_format(dst_info.format);
-       RETURN_VAL_IF_FAIL(dst_format > 0, TDM_ERROR_INVALID_PARAMETER);
+       GOTO_IF_FAIL(dst_format > 0, fail_convert);
 
        if (src_info.format == TBM_FORMAT_YUV420) {
                if (dst_info.format == TBM_FORMAT_XRGB8888)
@@ -194,7 +195,7 @@ _tdm_drm_pp_convert(tdm_drm_pp_buffer *buffer, tdm_info_pp *info)
                else if (dst_info.format == TBM_FORMAT_YVU420) {
                        TDM_ERR("can't convert %c%c%c%c to %c%c%c%c",
                                FOURCC_STR(src_info.format), FOURCC_STR(dst_info.format));
-                       return TDM_ERROR_OPERATION_FAILED;
+                       goto fail_convert;
                }
        }
        /* need checking for other formats also? */
@@ -204,7 +205,7 @@ _tdm_drm_pp_convert(tdm_drm_pp_buffer *buffer, tdm_info_pp *info)
        else
                sbw = src_info.planes[0].stride;
 
-       if (IS_RGB(src_info.format))
+       if (IS_RGB(dst_info.format))
                dbw = dst_info.planes[0].stride >> 2;
        else
                dbw = dst_info.planes[0].stride;
@@ -223,8 +224,14 @@ _tdm_drm_pp_convert(tdm_drm_pp_buffer *buffer, tdm_info_pp *info)
                                   info->dst_config.pos.x, info->dst_config.pos.y,
                                   info->dst_config.pos.w, info->dst_config.pos.h,
                                   rotate, hflip, 0);
+       tbm_surface_unmap(buffer->src);
+       tbm_surface_unmap(buffer->dst);
 
        return TDM_ERROR_NONE;
+fail_convert:
+       tbm_surface_unmap(buffer->src);
+       tbm_surface_unmap(buffer->dst);
+       return TDM_ERROR_OPERATION_FAILED;
 }
 
 tdm_error