summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoram Park <boram1288.park@samsung.com>2016-06-14 11:34:00 +0900
committerBoram Park <boram1288.park@samsung.com>2016-06-14 11:34:00 +0900
commitbc134448f90a23e66ed246ada0bc497bb8cd8575 (patch)
tree0b5402f4a29d462115a1ec62d86338a9540db98d
parent43e1062983361c140d140d9d61b819c093d2136c (diff)
downloadlibtdm-drm-bc134448f90a23e66ed246ada0bc497bb8cd8575.tar.gz
libtdm-drm-bc134448f90a23e66ed246ada0bc497bb8cd8575.tar.bz2
libtdm-drm-bc134448f90a23e66ed246ada0bc497bb8cd8575.zip
Change-Id: I2b3cbdf67de075bd6d33a2d43e49ef5b826ae361
-rw-r--r--src/tdm_drm.c2
-rw-r--r--src/tdm_drm_display.c8
-rw-r--r--src/tdm_drm_pp.c23
3 files changed, 24 insertions, 9 deletions
diff --git a/src/tdm_drm.c b/src/tdm_drm.c
index 8ac23d4..ac8d1bc 100644
--- a/src/tdm_drm.c
+++ b/src/tdm_drm.c
@@ -9,7 +9,7 @@
#include "tdm_drm.h"
#include <tdm_helper.h>
-//#define ENABLE_PP
+#define ENABLE_PP
#define TDM_DRM_NAME "vigs"
diff --git a/src/tdm_drm_display.c b/src/tdm_drm_display.c
index 6f8be78..868c25d 100644
--- a/src/tdm_drm_display.c
+++ b/src/tdm_drm_display.c
@@ -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;
}
diff --git a/src/tdm_drm_pp.c b/src/tdm_drm_pp.c
index 1da577f..3e9d999 100644
--- a/src/tdm_drm_pp.c
+++ b/src/tdm_drm_pp.c
@@ -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