dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chaoyi Chen" <kernel@airkyi.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/rockchip: vop2: Use drm_format_info_min_pitch() for plane offsets
Date: Thu, 22 Oct 2026 07:26:47 +0000	[thread overview]
Message-ID: <sashiko-outbox-181126@kernel.org> (raw)
In-Reply-To: <20261022071737.508-2-kernel@airkyi.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/rockchip: vop2: dead store to UV offset in vop2_plane_atomic_update()
--

commit 6df46f75e1463ad71a6132367733e70876d282fa
Author: Chaoyi Chen <chaoyi.chen@rock-chips.com>

drm/rockchip: vop2: Use drm_format_info_min_pitch() for plane offsets

This commit updates vop2_plane_atomic_update() to calculate plane horizontal
byte offsets using drm_format_info_min_pitch() instead of fb->format->cpp[]
to support block-based 10-bit formats.

> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index bfb3841425687..410a8fea3ff4a 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -1290,7 +1290,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
>  
>  	afbc_en = drm_is_afbc(fb->modifier);
>  
> -	offset = (src->x1 >> 16) * fb->format->cpp[0];
> +	offset = drm_format_info_min_pitch(fb->format, 0, src->x1 >> 16);
>  
>  	/*
>  	 * AFBC HDR_PTR must set to the zero offset of the framebuffer.
> @@ -1309,6 +1309,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
>  		int hsub = fb->format->hsub;
>  		int vsub = fb->format->vsub;
>  
> +		offset = drm_format_info_min_pitch(fb->format, 1, src->x1 >> 16) / hsub;
>  		offset = (src->x1 >> 16) * fb->format->cpp[1] / hsub;

[Severity: High]
In vop2_plane_atomic_update() in
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c, should the old
fb->format->cpp[1] assignment be removed here?

Leaving it in place immediately overwrites the offset returned by
drm_format_info_min_pitch() when fb->format->is_yuv is true, so planes with
a non-zero src->x1 on block-based 10-bit formats will still compute an
incorrect uv_mst address.

>  		offset += (src->y1 >> 16) * fb->pitches[1] / vsub;
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261022071737.508-1-kernel@airkyi.com?part=1

  reply	other threads:[~2026-10-22  7:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  7:17 [PATCH 0/3] drm/rockchip: vop2: Add 8K support for RK3588 vop2 Chaoyi Chen
2026-10-22  7:17 ` [PATCH 1/3] drm/rockchip: vop2: Use drm_format_info_min_pitch() for plane offsets Chaoyi Chen
2026-10-22  7:26   ` sashiko-bot [this message]
2026-10-22 12:59   ` Heiko Stübner
2026-10-23  1:10     ` Chaoyi Chen
2026-10-22  7:17 ` [PATCH 2/3] drm/rockchip: vop2: Skip UV plane setup for packed YUV formats Chaoyi Chen
2026-10-22  7:17 ` [PATCH 3/3] drm/rockchip: vop2: Support 8K output by splicing two video ports Chaoyi Chen
2026-10-22  7:46   ` sashiko-bot

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=sashiko-outbox-181126@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@airkyi.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox