From patchwork Mon Jan 22 10:35:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 125386 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1081233ljf; Mon, 22 Jan 2018 02:36:42 -0800 (PST) X-Google-Smtp-Source: AH8x224VzVuw5RlArLKDya9NL0E5aR5/m29pJXl8TJxqklCqVj//KKdlJG89Pm8wpt2uh3+BeDOD X-Received: by 2002:a17:902:a24:: with SMTP id 33-v6mr2504604plo.141.1516617402438; Mon, 22 Jan 2018 02:36:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516617402; cv=none; d=google.com; s=arc-20160816; b=fWgtHhKKyJaSRrcjLX00RBbgU7VW9dcFU53074Ka15VRhtnpsjWC+8eM3ZKoJfDtQw zlqyf/LP52k6B2vQu/fq6jPrteYQOYijH9inh1kIK2RVjGImYo7Hc8r7DuqxysVGp+Qg xefoBMhzFMGArpI+bbWNACDNAYUh3xg6nERkXm/z2AGpoLZtf+UeyVPzRCH04LQEnajK CDVTVYBwkwy0PC10LiVTExGTA5y3jyedSFOsSlrHXA+UubLyxGyqVEOQWEAQQFkTdaJJ zl3R6GHChPPJ/xLpwnOS3sG52WIbUV5oTrHkG2+FbMKGst2/RHC1RaFvIiwucT0Ujb0G /jmg== 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=8JyBpdTFE/CMR+G08YYr+JFijC1/vUdUVT5Gl35cIKQ=; b=F5L0VxjMJf8RveFm3ILxlVTMcTdWb6fnBxoh6sycocNfxhpgCtzqnyIWKBBYmqUgpf zpxmlJLdiwLi37eYXMwffu3gghXniqKwWD3Y5IA3xedupTDm0cBxBdCwHjrwyzmhKexj iR1DSVWyYMg9z4U0p2HHHs3W1qtqPMqZ7a2QImbPh07YH8j7lSK9PeMz/BXMO/Wp7fuc h5hF+Qh3xpnvH9TWFTu23rRtB2qQUcHdblKKEMU25hizn+uJlzrsAg6sF65mxaFf1LiY e3jfsufRRLJ2r5lUiN/I1Yu6C37QMJuhgF4phyvmBpt6EnBsODGr48e1PeFh8wByv0dX E1qQ== 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 i137si4120907pgc.258.2018.01.22.02.36.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2018 02:36:42 -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 2825D6E186; Mon, 22 Jan 2018 10:36:11 +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 807D66E155 for ; Mon, 22 Jan 2018 10:36:02 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id DCFAB203B1; 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 A58D4203B4; 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 04/19] drm/rockchip: Use the alpha format field in drm_format_info Date: Mon, 22 Jan 2018 11:35:33 +0100 Message-Id: <5a217e8c93eea6f0a7f6bc5883424b47dbb6c664.1516617243.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.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. Acked-by: Sandy huang Reviewed-by: Daniel Vetter Signed-off-by: Maxime Ripard --- 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..db6a0662be5a 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 (fb->format->has_alpha) { 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) |