From patchwork Fri Mar 1 12:20:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10835085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 63866922 for ; Fri, 1 Mar 2019 12:21:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52CEC2097A for ; Fri, 1 Mar 2019 12:21:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 472C72D900; Fri, 1 Mar 2019 12:21:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E17A22097A for ; Fri, 1 Mar 2019 12:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388199AbfCAMVO (ORCPT ); Fri, 1 Mar 2019 07:21:14 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:36654 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388156AbfCAMVN (ORCPT ); Fri, 1 Mar 2019 07:21:13 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190301122112euoutp011165b09b2ec28e125c20dd65f248bf4b~H1RKkSW7l1400414004euoutp011; Fri, 1 Mar 2019 12:21:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190301122112euoutp011165b09b2ec28e125c20dd65f248bf4b~H1RKkSW7l1400414004euoutp011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1551442872; bh=etuAz+B4tjFxongWFMq4xgwecflkYEh95FK1Mb0jXrY=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=XUeZBVlDW913yH9r+J/dSfTVJ6IULt3tMs99KH3TwZc/SjMvZX8KIOqv6fNou7npy ZTk5iBuOqgaoG3GWf3xO3tfoArWW8WKn02EVAcUTJJRSQ1rRvwjU2n/E1zzNEFGM/4 IpTnDVZATjwi00yomiVUU3+BXo94dPwjrDR/ciWQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190301122112eucas1p1eadf6e5fd3218ffb311925edf5d9de9e~H1RKMN3Za2241422414eucas1p1l; Fri, 1 Mar 2019 12:21:12 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 4D.CC.04294.7B3297C5; Fri, 1 Mar 2019 12:21:11 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190301122111eucas1p2c0184ad8117054056ac10e6afd949a9f~H1RJfYabb1879518795eucas1p2O; Fri, 1 Mar 2019 12:21:11 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-0e-5c7923b76716 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B8.23.04284.7B3297C5; Fri, 1 Mar 2019 12:21:11 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.43.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PNO007ENSZ56Z20@eusync3.samsung.com>; Fri, 01 Mar 2019 12:21:11 +0000 (GMT) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 15/23] drm/exynos: add GSCALER plane capability Date: Fri, 01 Mar 2019 13:20:47 +0100 Message-id: <20190301122055.7135-16-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20190301122055.7135-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42LZduznOd3typUxBlc32FjcWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw Zcy/fJGpYJVQRVf3Y+YGxq38XYycHBICJhK/Dhxn7GLk4hASWMEocXTKMjYI5zOjxMdNLUxd jBxgVWc3eEHElzFKdN5ewAzh/GeU+LP5HwvIKDYBTYm/m2+ygdgiAsoSq/a1s4MUMQtcYpR4 fbKbESQhLGAv0dQ7lRlkKouAqsSuXR4gYV4BC4kf3d9YIE6Sl1i94QAziM0JFD+4EmKOhMBH VomPe24wQhS5SLQeboSyZSQ6Ow4yQdj1Ek0zrzBDNHQwSpxYvJwNImEtcfj4RVYQm1mAT2LS tunMEK/xSnS0CUGYHhIv//OBVAgJdAM9diF5AqPEAkaGVYziqaXFuempxUZ5qeV6xYm5xaV5 6XrJ+bmbGIFxdPrf8S87GHf9STrEKMDBqMTDm/CyPEaINbGsuDL3EKMEB7OSCC8fQ2WMEG9K YmVValF+fFFpTmrxIUZpDhYlcd5qhgfRQgLpiSWp2ampBalFMFkmDk6pBsYs+c1H2j51Ntzj u3KWSVzUXv8r83+dnW3uS9v3q3A/CE5QeB8+w2TTqjXbvsqcEmTcxaPDJfXIS+X3bZtLX3+e 38s846qvzsHVZVcX3chZ/XjrwnqrkJYlz+RWZTCfT3w0M4z/mcIZtqx3gifsxaMN8p8v+3jQ Sdj64xFLt1nvYzxCZgj/N29WYinOSDTUYi4qTgQA1CuukJ8CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGJMWRmVeSWpSXmKPExsVy+t/xq7rblStjDE72K1jcWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw Zcy/fJGpYJVQRVf3Y+YGxq38XYwcHBICJhJnN3h1MXJxCAksYZTY+2QzM4TTyCRx/fgu9i5G Tg42AU2Jv5tvsoHYIgLKEqv2tbODFDELXGGUaP/WBVYkLGAv0dQ7lRlkKouAqsSuXR4gYV4B C4kf3d9YQGwJAXmJ1RsOMIPYnEDxgytB5nAALTOX2HQ6agIjzwJGhlWMIqmlxbnpucWGesWJ ucWleel6yfm5mxiBobHt2M/NOxgvbQw+xCjAwajEw5vwsjxGiDWxrLgy9xCjBAezkggvH0Nl jBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHe8waVUUIC6YklqdmpqQWpRTBZJg5OqQbGmUxvSi3m 7xM6nlAhlhvyMLjrKffeo1fVWSanHPzIvWm31mdLhyPcLD82vFvhZ7es9NqHRb114SdYtqp1 HeHYm/fO1shl/1FFs2Wy1wNf8u38wbRnwcXe3OQTZlvFjoflZz45IfVmocWvTVrruQzrVV+7 1b0qtntTuD0v5pgkc/lZmbu3gsOeKrEUZyQaajEXFScCACkkPRkJAgAA X-CMS-MailID: 20190301122111eucas1p2c0184ad8117054056ac10e6afd949a9f CMS-TYPE: 201P X-CMS-RootMailID: 20190301122111eucas1p2c0184ad8117054056ac10e6afd949a9f References: <20190301122055.7135-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This bit will indicate the plane is provided by GSCALER. Tests shows that GSCALER does not like to convert from/to too small buffers. Since exact constraints are not provided by documentation rough estimate of 64 pixel has been applied. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 + drivers/gpu/drm/exynos/exynos_drm_plane.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 5d06e796dc80..7bdbac639b2b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -75,6 +75,7 @@ to_exynos_plane_state(struct drm_plane_state *state) #define EXYNOS_DRM_PLANE_CAP_TILE (1 << 3) #define EXYNOS_DRM_PLANE_CAP_PIX_BLEND (1 << 4) #define EXYNOS_DRM_PLANE_CAP_WIN_BLEND (1 << 5) +#define EXYNOS_DRM_PLANE_CAP_GSCALER (1 << 6) struct exynos_drm_plane; struct exynos_drm_plane_ops { diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 5f8f56b69369..89168157e1e2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -198,6 +198,11 @@ exynos_drm_plane_check_format(struct exynos_drm_plane_state *state) return 0; } +static bool is_in_range(int val, int min, int max) +{ + return (val >= min) && (val < max); +} + static int exynos_drm_plane_check_size(struct exynos_drm_plane_state *state) { @@ -205,7 +210,7 @@ exynos_drm_plane_check_size(struct exynos_drm_plane_state *state) bool width_ok = false, height_ok = false; if (plane->capabilities & EXYNOS_DRM_PLANE_CAP_SCALE) - return 0; + width_ok = height_ok = true; if (state->src.w == state->crtc.w) width_ok = true; @@ -221,6 +226,13 @@ exynos_drm_plane_check_size(struct exynos_drm_plane_state *state) state->v_ratio == (1 << 15)) height_ok = true; + if (plane->capabilities & EXYNOS_DRM_PLANE_CAP_GSCALER) { + width_ok = is_in_range(state->src.w, 64, 4800) && + is_in_range(state->crtc.w, 64, 4800); + height_ok = is_in_range(state->src.h, 64, 3344) && + is_in_range(state->crtc.h, 64, 3344); + } + if (width_ok && height_ok) return 0;