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: 10178153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6189360224 for ; Mon, 22 Jan 2018 10:37:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50B1826E79 for ; Mon, 22 Jan 2018 10:37:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44C4C27F85; Mon, 22 Jan 2018 10:37:10 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C28DD26E79 for ; Mon, 22 Jan 2018 10:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=xIGPwzEPk5gbm/z05oN9WGncRN2qgPQyrczfdCWuDJk=; b=eGtUxwnrw3k5ePwVLn0YqGVXlp P9Ij4xbTbsvdImohf7H8H7CuCiIlv2kVRO5IIamoyuX+JCuZuRJ6W8A1UlTtqeSdMMAGsFWl+UR4s Cs+cop01R+BtqrjnybLIwcUDT0xlKsRBZiRRGmjiXajsQ1oUNhD5VI5u2ClCs7ILy2aSjkUnPmdej jsAf1qbG/q2DcKeuO9PaU6AnWAXRm2XwpWcgyZixNVOf/tnZhFo0wYTfdjpS+qWqQtiefdOL8OYTC TK9sfPOmwg2xPvxdZoG5tq0n1ik6RG5PSChLK3qwN0hoW2RFW7JNOlUYx45AbsqWfIGUojBJPWmYs +6FuhmpA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1edZTQ-0008SZ-34; Mon, 22 Jan 2018 10:37:08 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1edZSV-0007F5-KM for linux-arm-kernel@lists.infradead.org; Mon, 22 Jan 2018 10:36:16 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 802012039D; Mon, 22 Jan 2018 11:36:01 +0100 (CET) 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: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joonyoung Shim , Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , linux-arm-kernel@lists.infradead.org, thomas@vitsch.nl MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 ||