Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4785622yba; Mon, 20 May 2019 03:50:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLqJyH0FPrFVTdc4RQkHqTpA5g1KiFdk1lSXY6cyj7oebU287Ur6CP7G+kph4m7HWjfG0X X-Received: by 2002:aa7:8f22:: with SMTP id y2mr67748193pfr.22.1558349425826; Mon, 20 May 2019 03:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558349425; cv=none; d=google.com; s=arc-20160816; b=dnXglsPAhWgvBxYbdk7ioOZVS0OO9mK2Kete0fwogN/jkoGSDD6jRDnkNMx/Vv2SXt tOtjYJX4rAm/cKDTE41Tc6cIQg5ugd0xp5ehCz0tePYozGKmENvHX20hEIxiU2UeTuWz AYDdyF6Sd2qN5Fervk0IWAeu627tA0kMtTIzJg9g2DoMa3EyOTKsp4m+qolqGw9BkNtp QpieDopjkNlQBromKBwNBNb19H83EUmpVec96FvQs+5Y8YYxXDGa7R9oKOqJESQ34BgN CnOYDgo4ncQdiXeLBxaYbPtXKqn9LySKdQFVwdHNkvmBeVZ3t87Mv5NPjacYWpUuZAPK gztA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=rDIInf+EKpoqSGdWhxq+PmBTBCsJAlE3Tv1I+Tmwz4g=; b=OVoAqlIVeux/cg+fTIv3KJhuE+cuVYxADQk3IbLkKK57uPYrGraeZoCLLKYV2UfY7M T2/78iC/KsNtZH52ohVN+09Rue/NXrEGdggzW8GhESrUqS8LgZ85ZIyadCZKbGDWes81 Apaq+bqafGPhdPf6YlzSqpY1trUtMyWgZA0kzpFKnyOgKni9436MLONX5SgiU0V41TXL /b7yTvTE1R+0Hrq2ktF+E8OtlWj2+O4iKaIzzIXhyO6pftCsFdplYdhDPYfBc861Pquy 9FYfK/LMOChyjYYH1kOjPQqqX+5LDnFfFjc5wAgLBMLwAuNZNZTyUT8RjII7Gj0u+HsJ AgEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si17480080pgt.305.2019.05.20.03.50.10; Mon, 20 May 2019 03:50:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732320AbfETJmT (ORCPT + 99 others); Mon, 20 May 2019 05:42:19 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:40301 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732151AbfETJmT (ORCPT ); Mon, 20 May 2019 05:42:19 -0400 Received: from aptenodytes (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 8254E100005; Mon, 20 May 2019 09:42:15 +0000 (UTC) Message-ID: <5966b22a64602ce297f9a3b4bfd4ff7af72bab32.camel@bootlin.com> Subject: Re: [PATCH v3 1/7] drm/rockchip: Change the scl_vop_cal_scl_fac to pass drm_format_info From: Paul Kocialkowski To: Maxime Ripard , Daniel Vetter , David Airlie , Maarten Lankhorst , Sean Paul Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Date: Mon, 20 May 2019 11:42:14 +0200 In-Reply-To: <27b0041c7977402df4a087c78d2849ffe51c9f1c.1558002671.git-series.maxime.ripard@bootlin.com> References: <27b0041c7977402df4a087c78d2849ffe51c9f1c.1558002671.git-series.maxime.ripard@bootlin.com> Organization: Bootlin Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, 2019-05-16 at 12:31 +0200, Maxime Ripard wrote: > The Rockchip VOP driver has a function, scl_vop_cal_scl_fac, that will > lookup the drm_format_info structure from the fourcc passed to it by its > caller. > > However, its only caller already derefences the drm_format_info structure > it has access to to retrieve that fourcc. Change the prototype of that > function to pass the drm_format_info structure directly, removing the need > for an extra lookup. > > Suggested-by: Philipp Zabel > Signed-off-by: Maxime Ripard Reviewed-by: Paul Kocialkowski Cheers, Paul > --- > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > index 20a9c296d027..9c0d6b367709 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > @@ -315,14 +315,13 @@ static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src, > > static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win, > uint32_t src_w, uint32_t src_h, uint32_t dst_w, > - uint32_t dst_h, uint32_t pixel_format) > + uint32_t dst_h, const struct drm_format_info *info) > { > uint16_t yrgb_hor_scl_mode, yrgb_ver_scl_mode; > uint16_t cbcr_hor_scl_mode = SCALE_NONE; > uint16_t cbcr_ver_scl_mode = SCALE_NONE; > - int hsub = drm_format_horz_chroma_subsampling(pixel_format); > - int vsub = drm_format_vert_chroma_subsampling(pixel_format); > - const struct drm_format_info *info; > + int hsub = drm_format_horz_chroma_subsampling(info->format); > + int vsub = drm_format_vert_chroma_subsampling(info->format); > bool is_yuv = false; > uint16_t cbcr_src_w = src_w / hsub; > uint16_t cbcr_src_h = src_h / vsub; > @@ -331,8 +330,6 @@ static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win, > uint32_t val; > int vskiplines; > > - info = drm_format_info(pixel_format); > - > if (info->is_yuv) > is_yuv = true; > > @@ -856,7 +853,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane, > if (win->phy->scl) > scl_vop_cal_scl_fac(vop, win, actual_w, actual_h, > drm_rect_width(dest), drm_rect_height(dest), > - fb->format->format); > + fb->format); > > VOP_WIN_SET(vop, win, act_info, act_info); > VOP_WIN_SET(vop, win, dsp_info, dsp_info); > > base-commit: a802303934b3bd4df6e2fc8bf2e4ebced1c37556 -- Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com