Hi Noralf, I'll leave aside your comments on the code, since we'll use your implementation. On Sun, Nov 06, 2022 at 05:33:48PM +0100, Noralf Trønnes wrote: > Den 26.10.2022 17.33, skrev maxime@xxxxxxxxxx: > > + > > + if (cmdline->tv_mode_specified) > > + default_mode = cmdline->tv_mode; > > I realised that we don't verify tv_mode coming from the command line, > not here and not in the reset helper. Should we do that? A driver should > be programmed defensively to handle an illegal/unsupported value, but it > doesn't feel right to allow an illegal enum value coming through the > core/helpers. I don't think we can end up with an invalid value here if it's been specified. We parse the command line through drm_mode_parse_tv_mode() (introduced in patch 13 "drm/modes: Introduce the tv_mode property as a command-line option") that will pick the tv mode part of the command line, and call drm_get_tv_mode_from_name() using it. drm_get_tv_mode_from_name() will return a EINVAL if it's not a value we expect, and mode->tv_mode is only set on success. And AFAIK, there's no other path that will set tv_mode. Maxime
Attachment:
signature.asc
Description: PGP signature