All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Joey Lu" <a0987203069@gmail.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 5/6] drm/verisilicon: add DCUltraLite chip identity to HWDB
Date: Tue, 08 Sep 2026 10:15:08 +0000	[thread overview]
Message-ID: <20260908101508.B9C021F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260908092840.225220-6-a0987203069@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Negative cursor coordinates are programmed incorrectly because the offset values are not shifted before being passed to regmap_update_bits().
--

commit 71dc0bfa33a2021c1ba93da0095ed32939fb4009
Author: Joey Lu <a0987203069@gmail.com>

drm/verisilicon: add DCUltraLite chip identity to HWDB
    
The Nuvoton MA35D1 chip contains a DCUltraLite display controller with
model number 0x0 (sic, the model name contains no number either),
revision 0x5560 and customer ID 0x305.  It has a similar register map
with DC8000, only one display output and only 32x32 cursor supported.

> diff --git a/drivers/gpu/drm/verisilicon/vs_hwdb.c b/drivers/gpu/drm/verisilicon/vs_hwdb.c
> index 91524d16f7785..7d630a667a3f0 100644
> --- a/drivers/gpu/drm/verisilicon/vs_hwdb.c
> +++ b/drivers/gpu/drm/verisilicon/vs_hwdb.c
[ ... ]
> @@ -129,6 +129,16 @@ static struct vs_chip_identity vs_chip_identities[] = {
>  		.max_cursor_size = 64,
>  		.formats = &vs_formats_no_yuv444,
>  	},
> +	{
> +		.model = 0x0,		/* DCUltraLite */
> +		.revision = 0x5560,
> +		.customer_id = 0x305,
> +
> +		.generation = VSDC_GEN_DC8000,
> +		.display_count = 1,
> +		.max_cursor_size = 32,
> +		.formats = &vs_formats_no_yuv444,
> +	},
>  };

[Severity: High]
This isn't a bug introduced by this patch, but while reviewing the cursor
handling code related to this new controller, I noticed an issue with how
negative cursor coordinates are programmed.

Looking at vs_cursor_plane_atomic_update() in
drivers/gpu/drm/verisilicon/vs_cursor_plane.c, when handling negative
X coordinates:

	} else {
		regmap_update_bits(dc->regs, VSDC_CURSOR_CONFIG(output),
				   VSDC_CURSOR_CONFIG_X_OFF_MASK,
				   -state->crtc_x);
		regmap_update_bits(dc->regs, VSDC_CURSOR_LOCATION(output),
				   VSDC_CURSOR_LOCATION_X_MASK, 0);
	}

Is the unshifted X offset (-state->crtc_x) completely masked out to 0 by
regmap_update_bits() because it lacks the necessary shift macro (like
VSDC_CURSOR_CONFIG_X_OFF)?

Similarly, for the Y coordinate:

	} else {
		regmap_update_bits(dc->regs, VSDC_CURSOR_CONFIG(output),
				   VSDC_CURSOR_CONFIG_Y_OFF_MASK,
				   -state->crtc_y);
		regmap_update_bits(dc->regs, VSDC_CURSOR_LOCATION(output),
				   VSDC_CURSOR_LOCATION_Y_MASK, 0);
	}

Does this also cause the unshifted Y offset (-state->crtc_y) to be
masked out to 0?

When the cursor is moved off the left or top edge of the screen, the hardware
offset is intended to clip the cursor.

However, if the unshifted offset value is masked out by regmap_update_bits(),
it results in an offset of 0.

This would cause the cursor to stick at the edge of the screen fully visible,
rather than sliding smoothly off-screen.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260908092840.225220-1-a0987203069@gmail.com?part=5

  reply	other threads:[~2026-09-08 10:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08  9:28 [PATCH v6 0/6] drm/verisilicon: add Nuvoton MA35D1 DCU Lite support Joey Lu
2026-09-08  9:28 ` [PATCH v6 1/6] dt-bindings: display: verisilicon,dc: add support for nuvoton,ma35d1-dcu Joey Lu
2026-09-08  9:28   ` [PATCH v6 1/6] dt-bindings: display: verisilicon, dc: add support for nuvoton, ma35d1-dcu Joey Lu
2026-09-08  9:36   ` [PATCH v6 1/6] dt-bindings: display: verisilicon,dc: add support for nuvoton,ma35d1-dcu sashiko-bot
2026-09-08 17:55   ` Conor Dooley
2026-09-08 17:55     ` [PATCH v6 1/6] dt-bindings: display: verisilicon, dc: " Conor Dooley
2026-09-09  5:44   ` [PATCH v6 1/6] dt-bindings: display: verisilicon,dc: " Icenowy Zheng
2026-09-10  1:52     ` Joey Lu
2026-09-10  1:52       ` [PATCH v6 1/6] dt-bindings: display: verisilicon, dc: " Joey Lu
2026-09-10  7:08       ` [PATCH v6 1/6] dt-bindings: display: verisilicon,dc: " Icenowy Zheng
2026-09-08  9:28 ` [PATCH v6 2/6] drm/verisilicon: add register-level macros for DC8000 Joey Lu
2026-09-08  9:28 ` [PATCH v6 3/6] drm/verisilicon: introduce per-variant hardware ops table Joey Lu
2026-09-08  9:51   ` sashiko-bot
2026-09-08  9:28 ` [PATCH v6 4/6] drm/verisilicon: add DC8000 (DCUltraLite) display controller support Joey Lu
2026-09-08 10:04   ` sashiko-bot
2026-09-10  7:25   ` Icenowy Zheng
2026-09-08  9:28 ` [PATCH v6 5/6] drm/verisilicon: add DCUltraLite chip identity to HWDB Joey Lu
2026-09-08 10:15   ` sashiko-bot [this message]
2026-09-08  9:28 ` [PATCH v6 6/6] drm/verisilicon: extend Kconfig to support ARCH_MA35 platforms Joey Lu
2026-09-08 10:25   ` 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=20260908101508.B9C021F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=a0987203069@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh@kernel.org \
    --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 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.