[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65cd8976-3e07-4886-8eaa-f9a6094f6f1e@suse.de>
Date: Wed, 26 Mar 2025 10:29:39 +0100
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Lyude Paul <lyude@...hat.com>, Maxime Ripard <mripard@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
"open list:RUST:Keyword:b(?i:rust)b" <rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH 1/2] drm/edid: Use unsigned int in drm_add_modes_noedid()
Hi
Am 25.03.25 um 22:27 schrieb Lyude Paul:
> A negative resolution doesn't really make any sense, no one goes into a TV
> store and says "Hello sir, I would like a negative 4K TV please", that
> would make everyone look at you funny.
>
> So, let's make these parameters a bit more reasonable and ensure that
> they're unsigned - which makes the resulting rust bindings for this
> function a bit easier to understand and work with.
>
> Signed-off-by: Lyude Paul <lyude@...hat.com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Maxime Ripard <mripard@...nel.org>
> ---
> drivers/gpu/drm/drm_edid.c | 2 +-
> include/drm/drm_edid.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 13bc4c290b17d..2e2e1d2347397 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -7099,7 +7099,7 @@ EXPORT_SYMBOL(drm_add_edid_modes);
> * Return: The number of modes added or 0 if we couldn't find any.
> */
> int drm_add_modes_noedid(struct drm_connector *connector,
> - int hdisplay, int vdisplay)
> + unsigned int hdisplay, unsigned int vdisplay)
You should also remove these branches:
https://elixir.bootlin.com/linux/v6.13.7/source/drivers/gpu/drm/drm_edid.c#L7109
Best regards
Thomas
> {
> int i, count, num_modes = 0;
> struct drm_display_mode *mode;
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index eaac5e665892a..b38409670868d 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -437,7 +437,7 @@ bool drm_detect_monitor_audio(const struct edid *edid);
> enum hdmi_quantization_range
> drm_default_rgb_quant_range(const struct drm_display_mode *mode);
> int drm_add_modes_noedid(struct drm_connector *connector,
> - int hdisplay, int vdisplay);
> + unsigned int hdisplay, unsigned int vdisplay);
>
> int drm_edid_header_is_valid(const void *edid);
> bool drm_edid_is_valid(struct edid *edid);
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
Powered by blists - more mailing lists