From patchwork Tue Nov 10 13:23:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 7590961 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 22DE19F392 for ; Tue, 10 Nov 2015 13:25:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4260A20637 for ; Tue, 10 Nov 2015 13:25:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E89620708 for ; Tue, 10 Nov 2015 13:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753131AbbKJNZB (ORCPT ); Tue, 10 Nov 2015 08:25:01 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:11119 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753111AbbKJNY6 (ORCPT ); Tue, 10 Nov 2015 08:24:58 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXL00GMRP9JV0A0@mailout4.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 10 Nov 2015 13:24:55 +0000 (GMT) X-AuditID: cbfec7f4-f79c56d0000012ee-73-5641f027b841 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id EC.23.04846.720F1465; Tue, 10 Nov 2015 13:24:55 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NXL00L9RP94NP10@eusync1.samsung.com>; Tue, 10 Nov 2015 13:24:55 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Andrzej Hajda , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tobias Jakobi , Gustavo Padovan , Javier Martinez Canillas Subject: [PATCH 16/25] drm/exynos: mixer: use ratio precalculated in exynos_state Date: Tue, 10 Nov 2015 14:23:32 +0100 Message-id: <1447161821-1877-17-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1447161821-1877-1-git-send-email-m.szyprowski@samsung.com> References: <1447161821-1877-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOLMWRmVeSWpSXmKPExsVy+t/xy7rqHxzDDN5+ErO4te4cq8XGGetZ La58fc9msfPBLnaLSfcnsFi8ebuGyeLFvYssFq9fGFrMOL+PyWLtkbvsFjMmv2SzaFv9gdVi 1a4/jA68Hjtn3WX3uN99nMnj3zF2jy39QN7OSXuZPPq2rGL0+LxJLoA9issmJTUnsyy1SN8u gSvjTsM6toIzfBXz559hbmD8wd3FyMkhIWAicf3Wd3YIW0ziwr31bF2MXBxCAksZJZ62HWQF SQgJNDFJ3LzNBGKzCRhKdL3tYgOxRQTcJJoOzwSrYRY4zCxxeGpdFyMHh7BAsETXZT4Qk0VA VWL/61qQCl4BD4lPd8+xQKySk/j/cgXYRE6g+NaPn5khNrlL3Gy6yDKBkXcBI8MqRtHU0uSC 4qT0XEO94sTc4tK8dL3k/NxNjJDg/LKDcfExq0OMAhyMSjy8E745hAmxJpYVV+YeYpTgYFYS 4WV87RgmxJuSWFmVWpQfX1Sak1p8iFGag0VJnHfurvchQgLpiSWp2ampBalFMFkmDk6pBsaS JJPyMk5T0WXfXYz3z9+07vRj99yes/dvfWyXf/hh4bH6uvz6O8fCOTmW+it9X/Yu592K/9wC gbKRF1yZ7di40/X2MK28lz352YtTLzd8efZ4Xqbe51+LnRttWGz9C8Nzg/stGX8H/Dm74dX0 iUqh1V3zJy3z1QmcJ/o2Q/3eLp033UemV/cosRRnJBpqMRcVJwIAZycx+EoCAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 cdec3c1827c6..467e98044751 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -531,33 +531,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) { @@ -597,9 +570,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;