From patchwork Thu Nov 24 07:51:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoegeun Kwon X-Patchwork-Id: 9444933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 63ABD6075F for ; Thu, 24 Nov 2016 07:51:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 597EB269E2 for ; Thu, 24 Nov 2016 07:51:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E45726E81; Thu, 24 Nov 2016 07:51:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D68D8269E2 for ; Thu, 24 Nov 2016 07:51:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D69889FE6; Thu, 24 Nov 2016 07:51:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id E97296E1BB for ; Thu, 24 Nov 2016 07:51:42 +0000 (UTC) Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OH400G5FZ64YK20@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 24 Nov 2016 16:51:40 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-ed-58369c0c436a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 21.EB.25310.C0C96385; Thu, 24 Nov 2016 16:51:40 +0900 (KST) Received: from khg_DeskTop.10.32.193.11 ([10.113.63.38]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OH400INNZ61M730@mmp2.samsung.com>; Thu, 24 Nov 2016 16:51:40 +0900 (KST) From: Hoegeun Kwon To: inki.dae@samsung.com, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos/gsc: fix the hardware limitations Date: Thu, 24 Nov 2016 16:51:36 +0900 Message-id: <1479973896-26902-1-git-send-email-hoegeun.kwon@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFLMWRmVeSWpSXmKPExsVy+t9jQV2eOWYRBl/6uS2ufH3PZvF+eReb xaT7E1gsZpzfx+TA4nG/+ziTR9+WVYwenzfJBTBHudlkpCampBYppOYl56dk5qXbKoWGuOla KCnkJeam2ipF6PqGBCkplCXmlAJ5RgZowME5wD1YSd8uwS1j+odjTAWXRCpat75iamC8J9DF yMkhIWAi8WFmDwuELSZx4d56ti5GLg4hgVmMEk/OvWYFSQgJ/GKUmDwrHsRmE9CV+NpznQnE FhGwlFg5u4sZxGYWsJfY8XYy0CAODmEBW4mr38DmswioSmxu7GcDsXkFPCRunrzIBrFLTuLk scmsExi5FzAyrGKUSC1ILihOSs81zEst1ytOzC0uzUvXS87P3cQIDrdnUjsYD+5yP8QowMGo xMP7wMwsQog1say4MvcQowQHs5IIr91soBBvSmJlVWpRfnxRaU5q8SFGU6ADJjJLiSbnA2Mh ryTe0MTcxNzYwMLc0tLESEmct3H2s3AhgfTEktTs1NSC1CKYPiYOTqkGRqFD77W/z28RDfta vXbbNAWrxykZQZnSaquWfROofMYfGsBpZKc8aeOHxzfdjU7KJfI2FU5e8lz4cvON6dMcQ0Um +Ifs2/WM9YS7i/yST6qXXh2dHui0vvaB+Qnnm0Hr1vlceXnn8tyVqYLxkybNmVDiMe3ZeSPP hnkOtvqvd1Z7eW9p49W8sV6JpTgj0VCLuag4EQDfFx92TQIAAA== X-MTR: 20000000000000000@CPGS Cc: linux-samsung-soc@vger.kernel.org, hoegeun.kwon@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The maximum size of input or output rotation is 2047 x 2047. Fixed an error on limitations. Signed-off-by: Hoegeun Kwon --- 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; }; /**