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: 10151837 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 5D642603ED for ; Tue, 9 Jan 2018 11:48:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4273427FB7 for ; Tue, 9 Jan 2018 11:48:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 371742854A; Tue, 9 Jan 2018 11:48:43 +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 A692D27FB7 for ; Tue, 9 Jan 2018 11:48:42 +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=lmpfUTFzlgU13FpTCmGfZjuNXIEaC0tw/LYZtNXLSDk=; b=RBLJ+YjExHKE9u9TFYl+w/KWS8 ti9GaoHytfViMFhiyjc/uPih3inFJ+SWlmLALvCd8Q4MhO93BDeUFmhcqIa7/nFVJlIi9vy8VDWlD VgMxzeaPBfrIpYhaxsG3CouHd4o+Aj/xPTSiZZCJOBrUNChZsidHI6KUtHSWXGRGfWxs/QXQgEF4D XKATloWk3q0/RkBXaJbgFr55UJtDVaiM6lwbuVcsAcKLOEobsg9FBL8qeL60lW4dTyJ3LJUSh34kd 1AKAwzq4Ug+dhrln4tvZFuGzZBSy/oKRjPMRGilBvTY1ME6qNHx+3pVscMntDpnSYzlXyhAO01x0b FxdTXL2A==; 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 1eYsOS-00058B-AC; Tue, 09 Jan 2018 11:48:36 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYsKj-0001Qu-Lv for linux-arm-kernel@bombadil.infradead.org; Tue, 09 Jan 2018 11:44:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=n85d4tB9ks255n4sMGMiNvjhHqJ8rP0lNZcVHjlI43o=; b=qCEl1PJC6Wva5RWM5WYrRYbR4 00sGnbtJs6zNI+9UkcbfVgERCxVgb7L27R36OWjQyClhXRl02Ip4vvkjkRKe/yTV6SUHBZvT2qMXv IE7S/z6TBtUI6vygJ2FzjM84SmP1dzNLge58eNqmgWeXz6fV+vVFmGJ8/HbbRGFBV9MS27d6uDMIE SZhqyx8WGIH7gt2sD67/Nffjz16oZ4yvI9KqVCvEPpAeHWwEY2OdjZpbGPJylgaW8wFG6vNE20upS NLVGqzpTps3nDFGHkL3QLISI2cC0j8+WNOFmzrjkypcrONx/aAxX/PyGC3r4OmSRc3puYHK5qxzrR lIuSmzEfQ==; Received: from mail.free-electrons.com ([62.4.15.54]) by merlin.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eYram-00085G-2P for linux-arm-kernel@lists.infradead.org; Tue, 09 Jan 2018 10:57:17 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 8D76E2072D; Tue, 9 Jan 2018 11:57: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 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: 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: Thomas Petazzoni , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, thomas@vitsch.nl, linux-arm-kernel@lists.infradead.org, Mark Yao 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 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) |