[PATCH] drm/exynos/gsc: fix the hardware limitations

Hoegeun Kwon hoegeun.kwon at samsung.com
Thu Nov 24 07:51:36 UTC 2016


The maximum size of input or output rotation is 2047 x 2047.
Fixed an error on limitations.

Signed-off-by: Hoegeun Kwon <hoegeun.kwon at samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 11 +++++++++--
 include/uapi/drm/exynos_drm.h           |  2 ++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
index bef5798..36e05ae 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
@@ -71,6 +71,7 @@
 #define GSC_CROP_MIN	32
 #define GSC_SCALE_MAX	4224
 #define GSC_SCALE_MIN	32
+#define GSC_ROT_MAX	2047
 #define GSC_COEF_RATIO	7
 #define GSC_COEF_PHASE	9
 #define GSC_COEF_ATTR	16
@@ -1371,6 +1372,8 @@ static int gsc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
 	prop_list->scale_max.vsize = GSC_SCALE_MAX;
 	prop_list->scale_min.hsize = GSC_SCALE_MIN;
 	prop_list->scale_min.vsize = GSC_SCALE_MIN;
+	prop_list->rot_max.hsize = GSC_ROT_MAX;
+	prop_list->rot_max.vsize = GSC_ROT_MAX;
 
 	return 0;
 }
@@ -1444,7 +1447,9 @@ static int gsc_ippdrv_check_property(struct device *dev,
 				if ((pos->h < pp->crop_min.hsize) ||
 					(sz->vsize > pp->crop_max.hsize) ||
 					(pos->w < pp->crop_min.vsize) ||
-					(sz->hsize > pp->crop_max.vsize)) {
+					(sz->hsize > pp->crop_max.vsize) ||
+					(pos->h > pp->rot_max.hsize) ||
+					(pos->w > pp->rot_max.vsize)) {
 					DRM_ERROR("out of crop size.\n");
 					goto err_property;
 				}
@@ -1465,7 +1470,9 @@ static int gsc_ippdrv_check_property(struct device *dev,
 				if ((pos->h < pp->scale_min.hsize) ||
 					(sz->vsize > pp->scale_max.hsize) ||
 					(pos->w < pp->scale_min.vsize) ||
-					(sz->hsize > pp->scale_max.vsize)) {
+					(sz->hsize > pp->scale_max.vsize) ||
+					(pos->h > pp->rot_max.hsize) ||
+					(pos->w > pp->rot_max.vsize)) {
 					DRM_ERROR("out of scale size.\n");
 					goto err_property;
 				}
diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index cb3e9f9..d5d5518 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -192,6 +192,7 @@ enum drm_exynos_planer {
  * @crop_max: crop max resolution.
  * @scale_min: scale min resolution.
  * @scale_max: scale max resolution.
+ * @rot_max: rotation max resolution.
  */
 struct drm_exynos_ipp_prop_list {
 	__u32	version;
@@ -210,6 +211,7 @@ struct drm_exynos_ipp_prop_list {
 	struct drm_exynos_sz	crop_max;
 	struct drm_exynos_sz	scale_min;
 	struct drm_exynos_sz	scale_max;
+	struct drm_exynos_sz	rot_max;
 };
 
 /**
-- 
1.9.1



More information about the dri-devel mailing list