drm/exynos/gsc: fix the hardware limitations
Subsystems (4)
PATCH 1/1 drm/exynos/gsc: fix the hardware limitations
The maximum size of input or output rotation is 2047 x 2047. Fixed an error on limitations.
--- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 11 +++++++++-- include/uapi/drm/exynos_drm.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_gsc.c +9 -2
@@ -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; }
include/uapi/drm/exynos_drm.h +2 -0
@@ -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; };/**
Signature · 1 line
1.9.1
Inki Dae
maintainer2016년 11월 24일 16:51에 Hoegeun Kwon 이(가) 쓴 글:
Quoted 2 lines
The maximum size of input or output rotation is 2047 x 2047. Fixed an error on limitations.
You would need to consider other SoC - Exynos5250/5250/5410/5420/5433 because other have different rotation limitations like below,
Exynos5250
Maximum size : 2048x2048 for Tile Mode or Rotation
Exynos5410/5420
Maximum size : 2016x2016 for Tile mode or Rotation
In case of Exynos5433, it seems more complicated. Refer to Chapter 45.5.4 Size Constraints of TRM document.
Thanks.
Quoted 64 lines
Signed-off-by Hoegeun Kwon <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 11 +++++++++-- include/uapi/drm/exynos_drm.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/exynos/exynos_drm_gsc.c +9
-2@@ -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; }include/uapi/drm/exynos_drm.h +1
-0@@ -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;
include/uapi/drm/exynos_drm.h struct drm_exynos_ipp_prop_list { · line 217
Quoted 7 lines
include/uapi/drm/exynos_drm.h +1
-0@@ -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; };/**
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel