From patchwork Mon Jan 22 10:35:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 125397 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1081787ljf; Mon, 22 Jan 2018 02:38:03 -0800 (PST) X-Google-Smtp-Source: AH8x226s5GvcLYpuTruU92Um5Op+IvEx2lFvlg2MyiQZU05DmNWprnSnJCBk+0Fxu+SKYKiWcK+k X-Received: by 10.98.152.149 with SMTP id d21mr8086044pfk.108.1516617483337; Mon, 22 Jan 2018 02:38:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516617483; cv=none; d=google.com; s=arc-20160816; b=C3dfLjFTo03Zprg+DqI4vIey0q7SiWJyhiQunDAvncGEwRA90EVAUW2KGRLpQYjNE5 SFwvw6/GER8y3nn0vPn+NPUE/BYQP/ElsZuGPZentu2RpVSgoIZbYC9PuUuh5N3DmOlL NkhroDRo1LJ3Kv4zl5zW0VprQhbDu82Lq7EZY3+mrAZjmmt5FbD7TsF1s7R424chdfom bgAx6YlEsAFKPMIl4uQjBTpgjLScuOR5N09BqkSoTPNUrO742nRGBTivINDmyq39darP CjMk23/BWQnHvzxDvW0obtwl4NaIFJkeJRVDPa6013whaFyyXiojuLGv9JIl12/8YaR+ zcXw== 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=SJuk50us1PJ4eTFi213YuSVXedT1hYdttlPhHpAq0ls=; b=yvxPn5s+fNd+z/bf/TGtWeve/2QAEMaZ6bbEjM36E35Lojc/QQ6DMme2bMAIgLXinJ kWt1MiiHElxtor7uTH5GPHxLh3bwlNDDNdhB7wC2x6hEUSPMPO3Xj5eZNtu2Jc8iNbOi xPw509SbpliqVAIxi470361Y47AA5muuUf9Vxeya3TXzmzkjNsDJSYx2LH1FCr/4qOfj pUS3UMutz8kwDjWbCZPlIwSGdRVJDU/mE5gdmZwnukfogtLZaADt97cdBhu2hKapH94z v9XvfnDJQ+7nRDTmIYKFcqpBEMwdNkLbnWTLXIaUtXQEct2I8dCacmuJYZRGZR1i6LfW lpUA== 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 h190si13718556pge.146.2018.01.22.02.38.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2018 02:38:03 -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 8CFA36E1DB; Mon, 22 Jan 2018 10:36:47 +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 267116E155 for ; Mon, 22 Jan 2018 10:36:02 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 802012039D; Mon, 22 Jan 2018 11:36: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 46955203B1; Mon, 22 Jan 2018 11:35:51 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , daniel.vetter@intel.com, jani.nikula@linux.intel.com, seanpaul@chromium.org Subject: [PATCH v2 03/19] drm/atmel-exynos: Use the alpha format field in drm_format_info Date: Mon, 22 Jan 2018 11:35:32 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: 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 drm_format_info has a alpha field to tell if a format embeds an alpha component in it, let's use it. Cc: Joonyoung Shim Cc: Kyungmin Park Cc: Seung-Woo Kim Acked-by: Inki Dae Reviewed-by: Daniel Vetter Signed-off-by: Maxime Ripard --- 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..257299ec95c4 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, fb->format->has_alpha); /* layer update mandatory for mixer 16.0.33.0 */ if (ctx->mxr_ver == MXR_VER_16_0_33_0 ||