You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RP1 VEC: "tv_mode" property is not correctly inherited from command line "video" #5864
RP1 VEC has a tv_norm string parameter which affects
The set of named DRM modes advertised
The colour system and pedestal used in some of those modes
(by default it supports all TV modes, prefers NTSC, and guesses NTSC or PAL depending on the active mode).
It can successfully be set as a module parameter from the command line (so there is no urgent problem). However, the more standard video/tv_mode command line setting appears to be ignored.
Furthermore, the private enum of tv_norms used by RP1 VEC driver does not quite match DRM's enum drm_connector_tv_mode. It would cause confusion if an enumerated value were to get passed from the connector to our driver (which we do at least attempt to do, via drm_object_attach_property()). The same thing is true for VC4 VEC.
Steps to reproduce the behaviour
When using RP1 VEC, compare different behaviour between video=Composite-1,tv_mode=NTSC-J
and video=Composite-1 drm-rp1-vec.tv_norm=NTSC-J
Device (s)
Other
System
Raspberry Pi 5
rpi-6.1.y as at Thu 18 Jan 11:32:27 GMT 2024
drm_mode_create_tv_properties_legacy is documented as being legacy and
* NOTE: This functions registers the deprecated "mode" connector
* property to select the analog TV mode (ie, NTSC, PAL, etc.). New
* drivers must use drm_mode_create_tv_properties() instead.
We're a new driver, so for upstream will need to do the job properly.
OK, I may even try to fix it properly with the new property. Will it mean we no longer need the "tv_norm" parameter?
The VEC driver never rejects a "foreign" video mode, so non-atomic changes should be safe. It should also be OK to merge PAL and PAL60, with minor code changes.
It's a pity that the standard enum lacks a "monochrome" option, which we might have liked to add (such an option could also have been a good place to hide/reveal the "vintage" 405- and 819-line TV modes).
I think I have a working fix. Will make a branch and PR for 6.6
[Edited] Now I'm planning to do away with the OF "tv_norm" property, which needlessly duplicates the "tv_norm" module parameter and "tv_mode" DRM property. (I've narrowly decided to keep the module parameter as people might be using it.)
All combinations of DRM mode and TV mode are considered valid (meaningless combinations will default to NTSC[-M] for 60Hz or PAL[-BDGHIK] for 50Hz), to avoid breaking any existing use cases.
FWIW vc4 VEC has deliberately retained part of the old property via 91112a6, which explains some of the weirdness in vc4_vec over which property is being used. Change one, and the other is updated to match (either immediately, or converted back again in get_property).
It's a pity that the standard enum lacks a "monochrome" option, which we might have liked to add (such an option could also have been a good place to hide/reveal the "vintage" 405- and 819-line TV modes).
There's nothing stopping us adding an extra standard into the enum, and upstreaming it. There have been previous requests for a way to disable the colour burst in the way that sdtv_disable_colourburst used to with the firmware driver, and that seems the obvious way to do it.
Activity
njhollinghurst commentedon Jan 22, 2024
On Linux 6.7, that call to
drm_object_attach_property()seems to crash.It's early in the function so it's probably one of the dereferences in the first couple of declarations.
6by9 commentedon Jan 22, 2024
drm_mode_create_tv_propertiescreatesdev->mode_config.tv_mode_propertydrm_mode_create_tv_properties_legacycreatesdev->mode_config.legacy_tv_mode_propertyThe driver is currently calling
drm_mode_create_tv_properties_legacybut attachingdev->mode_config.tv_mode_property.njhollinghurst commentedon Jan 22, 2024
Yikes -- 6.6 crashes also! Urgent fix required. Should I just remove the offending call (starting from 6.1)?
6by9 commentedon Jan 22, 2024
Quickest fix is
drm_mode_create_tv_properties_legacyis documented as being legacy andWe're a new driver, so for upstream will need to do the job properly.
njhollinghurst commentedon Jan 22, 2024
OK, I may even try to fix it properly with the new property. Will it mean we no longer need the "tv_norm" parameter?
The VEC driver never rejects a "foreign" video mode, so non-atomic changes should be safe. It should also be OK to merge PAL and PAL60, with minor code changes.
It's a pity that the standard enum lacks a "monochrome" option, which we might have liked to add (such an option could also have been a good place to hide/reveal the "vintage" 405- and 819-line TV modes).
njhollinghurst commentedon Jan 23, 2024
I think I have a working fix. Will make a branch and PR for 6.6
[Edited] Now I'm planning to do away with the OF "tv_norm" property, which needlessly duplicates the "tv_norm" module parameter and "tv_mode" DRM property. (I've narrowly decided to keep the module parameter as people might be using it.)
All combinations of DRM mode and TV mode are considered valid (meaningless combinations will default to NTSC[-M] for 60Hz or PAL[-BDGHIK] for 50Hz), to avoid breaking any existing use cases.
6by9 commentedon Jan 23, 2024
FWIW vc4 VEC has deliberately retained part of the old property via 91112a6, which explains some of the weirdness in vc4_vec over which property is being used. Change one, and the other is updated to match (either immediately, or converted back again in get_property).
There's nothing stopping us adding an extra standard into the enum, and upstreaming it. There have been previous requests for a way to disable the colour burst in the way that
sdtv_disable_colourburstused to with the firmware driver, and that seems the obvious way to do it.