summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoegeun Kwon <hoegeun.kwon@samsung.com>2017-07-20 15:05:47 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2019-04-25 17:58:35 +0900
commit8a0fcc247fa36c164700ac68e66cdc27310316d8 (patch)
tree177b68f816912c63b993a00f612a0fa44c2ae202
parentb084c956bcd8b6318c6ec73b913bf7228567fa49 (diff)
downloadlibdrm-8a0fcc247fa36c164700ac68e66cdc27310316d8.tar.gz
libdrm-8a0fcc247fa36c164700ac68e66cdc27310316d8.tar.bz2
libdrm-8a0fcc247fa36c164700ac68e66cdc27310316d8.zip
ipptest: Add support for the source resolution use to various
There is a problem that can't test various source resolutions. So support for the source resolution use to various. The default source resolution is 720x1280. The source resolution can be used various as below. - For example: : ipptest -s 26#320x320:1440x2560 -d 1 (The source resolution used is 320x320.) Change-Id: If452fb4524ecffe65cec5ccbe8f3956944bd7ecb Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
-rw-r--r--tests/ipptest/fimc.c86
-rw-r--r--tests/ipptest/fimctest.c17
-rw-r--r--tests/ipptest/fimctest.h1
3 files changed, 84 insertions, 20 deletions
diff --git a/tests/ipptest/fimc.c b/tests/ipptest/fimc.c
index 7a422c90..04a0c54d 100644
--- a/tests/ipptest/fimc.c
+++ b/tests/ipptest/fimc.c
@@ -399,16 +399,52 @@ static int pipe_find_crtc_and_mode(struct device *dev, struct pipe_arg *pipe,
return 0;
}
+static void exynos_drm_ipp_get_property(int fd)
+{
+ struct drm_exynos_ipp_prop_list prop_list = { 0, };
+ int prop_list_num;
+ int ret;
+ int i;
+
+ ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY, &prop_list);
+ if (ret)
+ goto err_get_property;
+
+ prop_list_num = prop_list.count;
+ for (i = 1; i <= prop_list_num; i++) {
+ prop_list.ipp_id = i;
+
+ ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY, &prop_list);
+ if (ret)
+ goto err_get_property;
+
+ printf("DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY: ipp_id[%u]\n",
+ prop_list.ipp_id);
+ printf("DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY: crop_min[%u:%u]\n",
+ prop_list.crop_min.hsize, prop_list.crop_min.vsize);
+ printf("DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY: crop_max[%u:%u]\n",
+ prop_list.crop_max.hsize, prop_list.crop_max.vsize);
+ printf("DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY: rot_max[%u:%u]\n",
+ prop_list.rot_max.hsize, prop_list.rot_max.vsize);
+ }
+
+ return;
+
+err_get_property:
+ fprintf(stderr,
+ "failed to DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY : %d\n", errno);
+}
+
static int exynos_drm_ipp_set_property(int fd,
struct drm_exynos_ipp_property *property,
+ struct drm_exynos_sz *src_sz,
struct drm_exynos_sz *def_sz,
enum drm_exynos_ipp_cmd cmd,
enum drm_exynos_ipp_cmd_m2m cmd_m2m,
enum drm_exynos_degree degree)
{
- struct drm_exynos_pos crop_pos = {0, 0, 720, 1280};
+ struct drm_exynos_pos crop_pos = {0, 0, src_sz->hsize, src_sz->vsize};
struct drm_exynos_pos scale_pos = {0, 0, def_sz->hsize, def_sz->vsize};
- struct drm_exynos_sz src_sz = { 720, 1280 };
struct drm_exynos_sz dst_sz = {def_sz->hsize, def_sz->vsize};
int ret = 0;
@@ -427,7 +463,7 @@ static int exynos_drm_ipp_set_property(int fd,
property->config[EXYNOS_DRM_OPS_SRC].fmt =
DRM_FORMAT_YUV422;
property->config[EXYNOS_DRM_OPS_SRC].pos = crop_pos;
- property->config[EXYNOS_DRM_OPS_SRC].sz = src_sz;
+ property->config[EXYNOS_DRM_OPS_SRC].sz = *src_sz;
property->config[EXYNOS_DRM_OPS_DST].ops_id = EXYNOS_DRM_OPS_DST;
property->config[EXYNOS_DRM_OPS_DST].flip = EXYNOS_DRM_FLIP_NONE;
@@ -463,14 +499,14 @@ static int exynos_drm_ipp_set_property(int fd,
EXYNOS_DRM_DEGREE_90 ||
property->config[EXYNOS_DRM_OPS_SRC].degree ==
EXYNOS_DRM_DEGREE_270) {
- src_sz.hsize = def_sz->vsize;
- src_sz.vsize = def_sz->hsize;
+ src_sz->hsize = def_sz->vsize;
+ src_sz->vsize = def_sz->hsize;
crop_pos.w = def_sz->vsize;
crop_pos.h = def_sz->hsize;
}
property->config[EXYNOS_DRM_OPS_SRC].pos = crop_pos;
- property->config[EXYNOS_DRM_OPS_SRC].sz = src_sz;
+ property->config[EXYNOS_DRM_OPS_SRC].sz = *src_sz;
property->config[EXYNOS_DRM_OPS_DST].ops_id = EXYNOS_DRM_OPS_DST;
property->config[EXYNOS_DRM_OPS_DST].flip = EXYNOS_DRM_FLIP_NONE;
@@ -497,11 +533,15 @@ static int exynos_drm_ipp_set_property(int fd,
}
ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY, property);
- if (ret)
+ if (ret) {
fprintf(stderr,
"failed to DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY : %d\n",
errno);
-
+
+ exynos_drm_ipp_get_property(fd);
+ return ret;
+ }
+
printf("DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY : prop_id[%d]\n",
property->prop_id);
@@ -656,7 +696,7 @@ void fimc_m2m_set_mode(struct device *dev, struct connector *c, int count,
struct drm_exynos_ipp_property property;
struct drm_exynos_ipp_cmd_ctrl cmd_ctrl;
struct drm_exynos_sz def_sz;
- struct drm_exynos_sz src_sz = { 720, 1280 };
+ struct drm_exynos_sz src_sz;
struct drm_exynos_ipp_queue_buf qbuf1[MAX_BUF], qbuf2[MAX_BUF];
struct drm_exynos_gem_create gem1[MAX_BUF], gem2[MAX_BUF];
void *usr_addr1[MAX_BUF], *usr_addr2[MAX_BUF];
@@ -669,6 +709,9 @@ void fimc_m2m_set_mode(struct device *dev, struct connector *c, int count,
struct timeval begin, end;
char filename[80];
+ src_sz = c[0].src_sz;
+ printf("source image resolution [%ux%u]\n", src_sz.hsize, src_sz.vsize);
+
dev->mode.width = 0;
dev->mode.height = 0;
@@ -724,11 +767,13 @@ void fimc_m2m_set_mode(struct device *dev, struct connector *c, int count,
/* For property */
if (display == IPP_CMD_M2M_DISPLAY)
ret = exynos_drm_ipp_set_property(dev->fd, &property,
- &def_sz, IPP_CMD_M2M, IPP_CMD_M2M_DISPLAY,
+ &src_sz, &def_sz,
+ IPP_CMD_M2M, IPP_CMD_M2M_DISPLAY,
EXYNOS_DRM_DEGREE_0);
else
ret = exynos_drm_ipp_set_property(dev->fd, &property,
- &def_sz, IPP_CMD_M2M, IPP_CMD_M2M_FILE, degree);
+ &src_sz, &def_sz,
+ IPP_CMD_M2M, IPP_CMD_M2M_FILE, degree);
if (ret) {
fprintf(stderr, "failed to ipp property\n");
goto err_ipp_dst_buff_close;
@@ -874,13 +919,16 @@ void fimc_m2m_set_mode(struct device *dev, struct connector *c, int count,
/* For property */
if (j == 0) {
- ret = exynos_drm_ipp_set_property(dev->fd, &property,
- &def_sz, IPP_CMD_M2M, IPP_CMD_M2M_DISPLAY,
- degree);
+ ret = exynos_drm_ipp_set_property(dev->fd,
+ &property, &src_sz, &def_sz,
+ IPP_CMD_M2M,
+ IPP_CMD_M2M_DISPLAY, degree);
} else {
- ret = exynos_drm_ipp_set_property(dev->fd, &property,
- &def_sz, IPP_CMD_M2M, IPP_CMD_M2M_DISPLAY,
- EXYNOS_DRM_DEGREE_0);
+ ret = exynos_drm_ipp_set_property(dev->fd,
+ &property, &src_sz, &def_sz,
+ IPP_CMD_M2M,
+ IPP_CMD_M2M_DISPLAY,
+ EXYNOS_DRM_DEGREE_0);
}
if (ret) {
fprintf(stderr, "failed to ipp property\n");
@@ -978,7 +1026,7 @@ void fimc_wb_set_mode(struct connector *c, int count, int page_flip,
def_sz.vsize = height;
/* For property */
- ret = exynos_drm_ipp_set_property(fd, &property, &def_sz,
+ ret = exynos_drm_ipp_set_property(fd, &property, &def_sz, &def_sz,
IPP_CMD_WB, IPP_CMD_M2M_NONE, EXYNOS_DRM_DEGREE_0);
printf("property: %d\n", ret);
if (ret) {
@@ -1059,7 +1107,7 @@ void fimc_wb_set_mode(struct connector *c, int count, int page_flip,
}
/* For property */
- ret = exynos_drm_ipp_set_property(fd, &property,
+ ret = exynos_drm_ipp_set_property(fd, &property, &def_sz,
&def_sz, IPP_CMD_WB, IPP_CMD_M2M_NONE, EXYNOS_DRM_DEGREE_90);
if (ret) {
fprintf(stderr, "failed to ipp property\n");
diff --git a/tests/ipptest/fimctest.c b/tests/ipptest/fimctest.c
index 1866f1ea..5faa6853 100644
--- a/tests/ipptest/fimctest.c
+++ b/tests/ipptest/fimctest.c
@@ -370,7 +370,9 @@ static void usage(char *name)
fprintf(stderr, "\t-D\ttest M2M Display Mode\n");
fprintf(stderr, "\t-d\tlist of degree operation : 0: 0, 1: 90, 2, 180, 3, 270\n");
fprintf(stderr, "\t-s <connector_id>:<mode>\tset a mode\n");
+ fprintf(stderr, "\t-s <connector_id>#<src_resolution>:<mode>\tset a mode\n");
fprintf(stderr, "\t-s <connector_id>@<crtc_id>:<mode>\tset a mode\n");
+ fprintf(stderr, "\t-s <connector_id>@<crtc_id>#<src_resolution>:<mode>\tset a mode\n");
fprintf(stderr, "\n\tDefault is to dump all info.\n");
exit(0);
}
@@ -418,13 +420,26 @@ int main(int argc, char **argv)
break;
case 's':
con_args[count].crtc = -1;
+ con_args[count].src_sz.hsize = 720;
+ con_args[count].src_sz.vsize = 1280;
if (sscanf(optarg, "%d:%64s",
&con_args[count].id,
con_args[count].mode_str) != 2 &&
+ sscanf(optarg, "%d#%ux%u:%64s",
+ &con_args[count].id,
+ &con_args[count].src_sz.hsize,
+ &con_args[count].src_sz.vsize,
+ con_args[count].mode_str) != 4 &&
sscanf(optarg, "%d@%d:%64s",
&con_args[count].id,
&con_args[count].crtc,
- con_args[count].mode_str) != 3)
+ con_args[count].mode_str) != 3 &&
+ sscanf(optarg, "%d@%d#%ux%u:%64s",
+ &con_args[count].id,
+ &con_args[count].crtc,
+ &con_args[count].src_sz.hsize,
+ &con_args[count].src_sz.vsize,
+ con_args[count].mode_str) != 5)
usage(argv[0]);
count++;
break;
diff --git a/tests/ipptest/fimctest.h b/tests/ipptest/fimctest.h
index e9b60db3..6d2b662c 100644
--- a/tests/ipptest/fimctest.h
+++ b/tests/ipptest/fimctest.h
@@ -19,6 +19,7 @@ struct connector {
int crtc;
unsigned int fb_id[2], current_fb_id;
struct timeval start;
+ struct drm_exynos_sz src_sz;
int swap_count;
};