From patchwork Mon Nov 30 13:53:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 57454 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1486473lbb; Mon, 30 Nov 2015 05:54:23 -0800 (PST) X-Received: by 10.98.75.142 with SMTP id d14mr71242654pfj.91.1448891637578; Mon, 30 Nov 2015 05:53:57 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id p17si3731818pfi.151.2015.11.30.05.53.57; Mon, 30 Nov 2015 05:53:57 -0800 (PST) Received-SPF: pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 153336E5B4; Mon, 30 Nov 2015 05:53:54 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC53F6E5B0 for ; Mon, 30 Nov 2015 05:53:52 -0800 (PST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYM008STRXRQEB0@mailout2.w1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 30 Nov 2015 13:53:51 +0000 (GMT) X-AuditID: cbfec7f4-f79026d00000418a-27-565c54ee4100 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 2C.BC.16778.EE45C565; Mon, 30 Nov 2015 13:53:50 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYM007NRRXFE700@eusync2.samsung.com>; Mon, 30 Nov 2015 13:53:50 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 12/22] drm/exynos: mixer: use ratio precalculated in exynos_state Date: Mon, 30 Nov 2015 14:53:27 +0100 Message-id: <1448891617-18830-13-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1448891617-18830-1-git-send-email-m.szyprowski@samsung.com> References: <1448891617-18830-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFLMWRmVeSWpSXmKPExsVy+t/xK7rvQmLCDHo+mFrcWneO1WLjjPWs Fle+vmez2PlgF7vFpPsTWCzevF3DZPHi3kUWi9cvDC1mnN/HZLH2yF12ixmTX7JZtK3+wGqx atcfRgdej52z7rJ73O8+zuTx7xi7x5Z+IG/npL1MHn1bVjF6fN4kF8AexWWTkpqTWZZapG+X wJWxeH8re0EPf8X0yWvZGxg383QxcnJICJhIbH95iQnCFpO4cG89WxcjF4eQwFJGiZPPmpgg nCYmifN/9jKDVLEJGEp0ve1iA7FFBNwkmg7PZAWxmQUOM0scnloHYgsLhEnsP3YOrIZFQFXi xby5YBt4BTwlup/eZYfYJifx/+UKsDgnUPzJ2dNgcSEBD4kNM44xTWDkXcDIsIpRNLU0uaA4 KT3XUK84Mbe4NC9dLzk/dxMjJES/7GBcfMzqEKMAB6MSD6+EWXSYEGtiWXFl7iFGCQ5mJRHe QNOYMCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8c3e9DxESSE8sSc1OTS1ILYLJMnFwSjUwuj// Yh+cIT+/iunOjmO+9lPPqlidjQr25fz7W3JS3btJM4Rrz39fOOV5lvIlw4T7mZ+2sYif/26T vCBf7tm6wM+nbqakq2iVrWxn2DLp74+iRxNsF0XLcJZNSXASfZS5xbogUPXYkfV3Dz/kuzr1 8fKwFTdrmicbnZNd3Hp0zY7H2dZrmx32tCuxFGckGmoxFxUnAgBRIeZPTQIAAA== Cc: Javier Martinez Canillas , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Andrzej Hajda , Tobias Jakobi , Marek Szyprowski 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" Common plane code already calculates and checks for supported scalling modes, so additional code in mixer driver can be now removed. Signed-off-by: Marek Szyprowski Reviewed-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_mixer.c | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 4190285798ef..dfb35e2da4db 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -528,33 +528,6 @@ static void mixer_layer_update(struct mixer_context *ctx) mixer_reg_writemask(res, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE); } -static int mixer_setup_scale(const struct exynos_drm_plane *plane, - unsigned int *x_ratio, unsigned int *y_ratio) -{ - struct exynos_drm_plane_state *state = - to_exynos_plane_state(plane->base.state); - - if (state->crtc.w != state->src.w) { - if (state->crtc.w == 2 * state->src.w) - *x_ratio = 1; - else - goto fail; - } - - if (state->crtc.h != state->src.h) { - if (state->crtc.h == 2 * state->src.h) - *y_ratio = 1; - else - goto fail; - } - - return 0; - -fail: - DRM_DEBUG_KMS("only 2x width/height scaling of plane supported\n"); - return -ENOTSUPP; -} - static void mixer_graph_buffer(struct mixer_context *ctx, struct exynos_drm_plane *plane) { @@ -594,9 +567,9 @@ static void mixer_graph_buffer(struct mixer_context *ctx, return; } - /* check if mixer supports requested scaling setup */ - if (mixer_setup_scale(plane, &x_ratio, &y_ratio)) - return; + /* ratio is already checked by common plane code */ + x_ratio = state->h_ratio == (1 << 15); + y_ratio = state->v_ratio == (1 << 15); dst_x_offset = state->crtc.x; dst_y_offset = state->crtc.y;