Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751131AbeAPAuF (ORCPT + 1 other); Mon, 15 Jan 2018 19:50:05 -0500 Received: from regular1.263xmail.com ([211.150.99.141]:58663 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbeAPAuE (ORCPT ); Mon, 15 Jan 2018 19:50:04 -0500 X-Greylist: delayed 434 seconds by postgrey-1.27 at vger.kernel.org; Mon, 15 Jan 2018 19:50:03 EST X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: hjc@rock-chips.com X-FST-TO: sandy.huang@rock-chips.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: hjc@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH 04/19] drm/rockchip: Use the alpha format helper To: Maxime Ripard , Chen-Yu Tsai , Daniel Vetter , Jani Nikula , Sean Paul Cc: Thomas Petazzoni , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, thomas@vitsch.nl, linux-arm-kernel@lists.infradead.org References: From: Sandy Huang Message-ID: Date: Tue, 16 Jan 2018 08:42:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 在 2018/1/9 18:56, Maxime Ripard 写道: > 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 > --- > 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) | > remove dead email: Mark Yao Acked-by: Sandy huang