All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Maxime Ripard <maxime.ripard@bootlin.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	David Airlie <airlied@linux.ie>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Sean Paul <seanpaul@chromium.org>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 1/7] drm/rockchip: Change the scl_vop_cal_scl_fac to pass drm_format_info
Date: Mon, 20 May 2019 11:42:14 +0200	[thread overview]
Message-ID: <5966b22a64602ce297f9a3b4bfd4ff7af72bab32.camel@bootlin.com> (raw)
In-Reply-To: <27b0041c7977402df4a087c78d2849ffe51c9f1c.1558002671.git-series.maxime.ripard@bootlin.com>

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 <p.zabel@pengutronix.de>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

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


      parent reply	other threads:[~2019-05-20  9:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 10:31 [PATCH v3 1/7] drm/rockchip: Change the scl_vop_cal_scl_fac to pass drm_format_info Maxime Ripard
2019-05-16 10:31 ` [PATCH v3 2/7] drm: Remove users of drm_format_num_planes Maxime Ripard
2019-05-16 10:31   ` Maxime Ripard
2019-05-16 10:31 ` [PATCH v3 3/7] drm: Remove users of drm_format_(horz|vert)_chroma_subsampling Maxime Ripard
2019-05-16 10:31   ` Maxime Ripard
2019-05-16 10:31 ` [PATCH v3 4/7] drm/fourcc: Pass the format_info pointer to drm_format_plane_cpp Maxime Ripard
2019-05-20 11:18   ` Paul Kocialkowski
2019-05-16 10:31 ` [PATCH v3 5/7] drm/fourcc: Pass the format_info pointer to drm_format_plane_width/height Maxime Ripard
2019-05-20 11:32   ` Paul Kocialkowski
2019-05-20 11:32     ` Paul Kocialkowski
2019-05-16 10:31 ` [PATCH v3 6/7] drm: Replace instances of drm_format_info by drm_get_format_info Maxime Ripard
2019-05-16 10:31   ` Maxime Ripard
2019-05-16 10:31 ` [PATCH v3 7/7] drm: Remove users of drm_format_num_planes Maxime Ripard
2019-05-20 11:20   ` Paul Kocialkowski
2019-05-20 11:20     ` Paul Kocialkowski
2019-05-20 12:07     ` Maxime Ripard
2019-05-20  9:42 ` Paul Kocialkowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5966b22a64602ce297f9a3b4bfd4ff7af72bab32.camel@bootlin.com \
    --to=paul.kocialkowski@bootlin.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.