From patchwork Tue Jan 9 10:56:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123871 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp305542edr; Tue, 9 Jan 2018 02:57:05 -0800 (PST) X-Google-Smtp-Source: ACJfBosYjEqdCYwCisLS7MwuhhiHnKZOZbs6d4IhsQSbFzeBppjlr6f5G3yVO/VnN+FM8bAKpFud X-Received: by 10.159.235.130 with SMTP id f2mr15495189plr.43.1515495424968; Tue, 09 Jan 2018 02:57:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495424; cv=none; d=google.com; s=arc-20160816; b=zd0dI6QHORtUainuE1uDL1TxZYon5hAvJL03hZVlQn5hvi7bDLDBP+r6tIYd0/pb6m CdAniGvOFJ2SlzHTv9c/lPQs4UOMsXcmq3zG314GRvutdu1rWdkVeD7WmFNHArWBiFxL nQlAI8J2BZhMCSrehbQYTAQL/1SV+0R19HtK+oiefPN5mC7DYmtHTYDobaLgw+lSrcvW 9pbQzcmfNPy2K2oH7EfV4z+EQO8rnd0WzIBexvo2S4IOCI7HtbV6Pu02QCDp+THg6tRd p+wzhIN//jOnVbrpF6iTtgsaw5rkXtpQ5PqL3Nr36cZAdsgF8dopNhNdFmdow+S1Zxyd 1teQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=6eUC4xTn3jqFs9VhhNwETpQFf5QZ0oIKDSsMMIbJb44=; b=J/OQvVlQMEEISIdKANQAh/LO+h9GV0hCNR+AuZtOfAcrDhaAoKT1PC1ZWptprlmE6l mSvjjqdciiuQC/4CCV8l76tHPbM04iL1NuFVVymUNHmeHjJlJfWCdOPiqmKjtczqHbSV a8Ip/CPdKaZ8IAQ7/bBEe2JwUS8od7pqj/PXMNrNZqLA1dDDXx3Y9jZ9siPEyij2ld2b iLNkfEXopHp6aYc6qC9h8ZiAaqV2+GxCHkyNeE/cTfRwuZeCmiWZBm9UcfF114uOokNA 7VNDemhJTh5qxQoclt/PrvVtaxeCIJ8eiWJiLnSQIa7WR/IU6UwHrufULn93J8K0Tx92 IrNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id u91si10252150plb.50.2018.01.09.02.57.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 02:57:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for 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: best guess record for 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 F1B966E059; Tue, 9 Jan 2018 10:57:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B6066E046 for ; Tue, 9 Jan 2018 10:57:03 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 863B120727; Tue, 9 Jan 2018 11:57:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 29DEC207AA; Tue, 9 Jan 2018 11:56:43 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Subject: [PATCH 03/19] drm/exynos: Use the alpha format helper Date: Tue, 9 Jan 2018 11:56:22 +0100 Message-Id: <345b8966460f13af7e29d2700876572d34f06cf4.1515494838.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Thomas Petazzoni , Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , linux-arm-kernel@lists.infradead.org, thomas@vitsch.nl 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" Now that the core has a drm format helper to tell if a format embeds an alpha component in it, let's use it. Cc: Inki Dae Cc: Joonyoung Shim Cc: Kyungmin Park Cc: Seung-Woo Kim Signed-off-by: Maxime Ripard Acked-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_mixer.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index dc5d79465f9b..d7339a6d072c 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -179,18 +179,6 @@ static const u8 filter_cr_horiz_tap4[] = { 70, 59, 48, 37, 27, 19, 11, 5, }; -static inline bool is_alpha_format(unsigned int pixel_format) -{ - switch (pixel_format) { - case DRM_FORMAT_ARGB8888: - case DRM_FORMAT_ARGB1555: - case DRM_FORMAT_ARGB4444: - return true; - default: - return false; - } -} - static inline u32 vp_reg_read(struct mixer_context *ctx, u32 reg_id) { return readl(ctx->vp_regs + reg_id); @@ -625,7 +613,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx, mixer_reg_write(ctx, MXR_GRAPHIC_BASE(win), dma_addr); mixer_cfg_layer(ctx, win, priority, true); - mixer_cfg_gfx_blend(ctx, win, is_alpha_format(fb->format->format)); + mixer_cfg_gfx_blend(ctx, win, drm_format_has_alpha(fb->format->format)); /* layer update mandatory for mixer 16.0.33.0 */ if (ctx->mxr_ver == MXR_VER_16_0_33_0 ||