From patchwork Tue Jan 9 10:56:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123873 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp305672edr; Tue, 9 Jan 2018 02:57:14 -0800 (PST) X-Google-Smtp-Source: ACJfBosswt47JM3NKUBsxARDptjyapAR7g4xrkBchNXKdMi9H+ZjHkoXhs0VLrx3j1V13n4Bp0fu X-Received: by 10.159.230.13 with SMTP id u13mr262359plq.114.1515495433998; Tue, 09 Jan 2018 02:57:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495433; cv=none; d=google.com; s=arc-20160816; b=dJdeba2G+GjSAERiwTYJxnDp+4JGs0uP9mhNaHy+e7VeS5F/wiGXDfAzoWWdavq58n gYjv4javGDu0p7gcpHQtlIqNK8URQtH8Fob1jcG/2ivvp39kQTk1f/mygIgglQwxjrIc wRbcWjTLi4kH3zHl9MvzhkRzQL4oM47oLV8DrHv98LLaz8TNKp5VSuCgRNHJm9wKO5nX CbvkqF2Sly8YWbeZHdS716ggGJdz564o+ofthLsI/9S1ctUWGXGuztr+9YJ8O6D/gwTQ YwfurLWLXtrJbhYgd5RHOyrp6iI4vI3qLWeBka+5sgGPxp8VJj7RIJgftIu07nCfj7ks PxgQ== 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=FaTSOD06rq2Dj/x2CwVHBz8M17uT/yE4DLn8yXVllFE=; b=rDrrlJliCmoI7k5MfejKXAf4i7O8YSVvpGIK1D2Sg+EvaV0pvCCQd+2SU38WHIbEwO 4KXEZXqgvr2QamC6/i4m+csoQ+5jT58Go5am+FoD5vxyAdNjcK3uMd8XZH+2hBlWfT/x X6/fdmlhlnslIG59VNct0qFDuWJ8hxPToO/zMUm0Kfii7uUsPiX3fOYUS8tniXEYKGoE 9g0THqXxmJA3YPYhTUGwzgJ+NNTX+lhutOCFmMeAG46JOQMA4snGYx42FDy1xKZDmPx2 tw2gGnLOkLqB2Gy02/9RORmJ51OvVMj7lPmW9KakRWSZAU8myvwHogQQboFL+t8fDsQU 7DYg== 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 t2si8932184pgr.148.2018.01.09.02.57.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 02:57:13 -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 33F1F6E04E; Tue, 9 Jan 2018 10:57:04 +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 193536E04E for ; Tue, 9 Jan 2018 10:57:03 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 8D76E2072D; 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 8E339207D8; 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 04/19] drm/rockchip: Use the alpha format helper Date: Tue, 9 Jan 2018 11:56:23 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Thomas Petazzoni , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, thomas@vitsch.nl, linux-arm-kernel@lists.infradead.org, Mark Yao 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: Mark Yao Signed-off-by: Maxime Ripard Acked-by: Sandy huang --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 19128b4dea54..cfc4d4909185 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -253,17 +253,6 @@ static bool is_yuv_support(uint32_t format) } } -static bool is_alpha_support(uint32_t format) -{ - switch (format) { - case DRM_FORMAT_ARGB8888: - case DRM_FORMAT_ABGR8888: - return true; - default: - return false; - } -} - static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src, uint32_t dst, bool is_horizontal, int vsu_mode, int *vskiplines) @@ -790,7 +779,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane, rb_swap = has_rb_swapped(fb->format->format); VOP_WIN_SET(vop, win, rb_swap, rb_swap); - if (is_alpha_support(fb->format->format)) { + if (drm_format_has_alpha(fb->format->format)) { VOP_WIN_SET(vop, win, dst_alpha_ctl, DST_FACTOR_M0(ALPHA_SRC_INVERSE)); val = SRC_ALPHA_EN(1) | SRC_COLOR_M0(ALPHA_SRC_PRE_MUL) |