[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1adf0b0b-3743-4b5a-9416-823b8bf903fa@gmail.com>
Date: Wed, 26 Oct 2022 23:25:20 +0200
From: Mateusz Kwiatkowski <kfyatek@...il.com>
To: maxime@...no.tech, Karol Herbst <kherbst@...hat.com>,
Emma Anholt <emma@...olt.net>, Ben Skeggs <bskeggs@...hat.com>,
Chen-Yu Tsai <wens@...e.org>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Daniel Vetter <daniel@...ll.ch>,
Thomas Zimmermann <tzimmermann@...e.de>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
Samuel Holland <samuel@...lland.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...ux.ie>,
Maxime Ripard <mripard@...nel.org>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Lyude Paul <lyude@...hat.com>
Cc: linux-sunxi@...ts.linux.dev, intel-gfx@...ts.freedesktop.org,
Phil Elwell <phil@...pberrypi.com>,
linux-arm-kernel@...ts.infradead.org,
nouveau@...ts.freedesktop.org, Hans de Goede <hdegoede@...hat.com>,
Dom Cobley <dom@...pberrypi.com>,
dri-devel@...ts.freedesktop.org,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
linux-kernel@...r.kernel.org,
Noralf Trønnes <noralf@...nnes.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH v6 14/23] drm/modes: Properly generate a drm_display_mode
from a named mode
Hi Maxime,
> +static struct drm_display_mode *drm_named_mode(struct drm_device *dev,
> + struct drm_cmdline_mode *cmd)
> +{
> + struct drm_display_mode *mode;
> + unsigned int i;
> +
> + for (i = 0; i < ARRAY_SIZE(drm_named_modes); i++) {
> + const struct drm_named_mode *named_mode = &drm_named_modes[i];
> +
> + if (strcmp(cmd->name, named_mode->name))
> + continue;
> +
> + if (!named_mode->tv_mode)
> + continue;
> +
> + mode = drm_analog_tv_mode(dev,
> + named_mode->tv_mode,
> + named_mode->pixel_clock_khz * 1000,
> + named_mode->xres,
> + named_mode->yres,
> + named_mode->flags & DRM_MODE_FLAG_INTERLACE);
> + if (!mode)
> + return NULL;
> +
> + return mode;
> + }
> +
> + return NULL;
> +}
> +
You didn't add tv_mode_specified to struct drm_named_mode, and left the
if (!named_mode->tv_mode) condition here. This will break on NTSC.
Best regards,
Mateusz Kwiatkowski
Powered by blists - more mailing lists