drm/tegra: Remove existing framebuffer only if we support display
PATCH v2 1/1 drm/tegra: Remove existing framebuffer only if we support display
From: Thierry Reding <[email protected]>
Tegra DRM doesn't support display on Tegra234 and later, so make sure not to remove any existing framebuffers in that case.
v2: - add comments explaining how this situation can come about
- clear DRIVER_MODESET and DRIVER_ATOMIC feature bits
--- drivers/gpu/drm/tegra/drm.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
drivers/gpu/drm/tegra/drm.c +20 -3
@@ -1220,9 +1220,26 @@ static int host1x_drm_probe(struct host1x_device *dev)drm_mode_config_reset (drm); - err =drm_aperture_remove_framebuffers (&tegra_drm_driver); -if (err <0 ) - goto hub; +/* +* Only take over from a potential firmware framebuffer if any CRTCs +* have been registered. This must not be a fatal error because there +* are other accelerators that are exposed via this driver. +* +* Another case where this happens is on Tegra234 where the display +* hardware is no longer part of the host1x complex, so this driver +* will not expose any modesetting features. +*/ +if (drm->mode_config.num_crtc >0 ) { + err =drm_aperture_remove_framebuffers (&tegra_drm_driver); +if (err <0 ) + goto hub; + }else { +/* +* Indicate to userspace that this doesn't expose any display +* capabilities. +*/ + drm->driver_features &= ~(DRIVER_MODESET |DRIVER_ATOMIC ); + } err =drm_dev_register (drm,0 );if (err <0 )
Signature · 1 line
2.43.2
Thierry Reding <[email protected]> writes:
Hello Thierry,
Quoted 10 lines
From: Thierry Reding <[email protected]>
Tegra DRM doesn't support display on Tegra234 and later, so make sure not to remove any existing framebuffers in that case.
v2: - add comments explaining how this situation can come about
- clearDRIVER_MODESETandDRIVER_ATOMICfeature bitsSigned-off-by Thierry Reding <[email protected]>---
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Hi
Am 23.02.24 um 16:03 schrieb Thierry Reding:
Quoted 9 lines
From: Thierry Reding <[email protected]>
Tegra DRM doesn't support display on Tegra234 and later, so make sure not to remove any existing framebuffers in that case.
v2: - add comments explaining how this situation can come about
- clearDRIVER_MODESETandDRIVER_ATOMICfeature bitsSigned-off-by Thierry Reding <[email protected]>
Makes sense as far as the aperture helpers are concerned.
Best regards
Thomas
Quoted 38 lines
--- drivers/gpu/drm/tegra/drm.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)drivers/gpu/drm/tegra/drm.c +20
-3@@ -1220,9 +1220,26 @@ static int host1x_drm_probe(struct host1x_device *dev)drm_mode_config_reset (drm); - err =drm_aperture_remove_framebuffers (&tegra_drm_driver); -if (err <0 ) - goto hub; +/* +* Only take over from a potential firmware framebuffer if any CRTCs +* have been registered. This must not be a fatal error because there +* are other accelerators that are exposed via this driver. +* +* Another case where this happens is on Tegra234 where the display +* hardware is no longer part of the host1x complex, so this driver +* will not expose any modesetting features. +*/ +if (drm->mode_config.num_crtc >0 ) { + err =drm_aperture_remove_framebuffers (&tegra_drm_driver); +if (err <0 ) + goto hub; + }else { +/* +* Indicate to userspace that this doesn't expose any display +* capabilities. +*/ + drm->driver_features &= ~(DRIVER_MODESET |DRIVER_ATOMIC ); + } err =drm_dev_register (drm,0 );if (err <0 )
Signature · 7 lines
-- 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)
Quoted 8 lines · Thomas Zimmermann
Hi
Am 23.02.24 um 16:03 schrieb Thierry Reding:
Quoted 5 lines
From: Thierry Reding <[email protected]>
Tegra DRM doesn't support display on Tegra234 and later, so make sure not to remove any existing framebuffers in that case.
Quoted 9 lines
Quoted 4 lines
v2: - add comments explaining how this situation can come about
- clearDRIVER_MODESETandDRIVER_ATOMICfeature bitsSigned-off-by Thierry Reding <[email protected]>Makes sense as far as the aperture helpers are concerned.
Reviewed-by Thomas Zimmermann <[email protected]>
I believe this is drm-misc-fixes material. Since the tegra DRM will remove simple{fb,drm} for Tegra234, even when the driver does not support display on that platform, leaving the system with no display output at all.
Are you going to push this patch or is going to be done by Thierry?
Quoted 3 lines
Best regards
Thomas
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Quoted 6 lines · Javier Martinez Canillas
Quoted 3 lines · Thomas Zimmermann
Hi
Am 23.02.24 um 16:03 schrieb Thierry Reding:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
From: Thierry Reding <[email protected]>
Tegra DRM doesn't support display on Tegra234 and later, so make sure not to remove any existing framebuffers in that case.
v2: - add comments explaining how this situation can come about
- clearDRIVER_MODESETandDRIVER_ATOMICfeature bits
Maybe this is more of a philosophical question, but either the introduction of this hardware generation is where this regression was introduced or this possibly this commit.
Either way, I'd like to get this into the drm-misc-fixes branch.
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>Makes sense as far as the aperture helpers are concerned.
Quoted 8 lines
Quoted 2 lines
Reviewed-by Thomas Zimmermann <[email protected]>I believe this is drm-misc-fixes material. Since the tegra DRM will remove simple{fb,drm} for Tegra234, even when the driver does not support display on that platform, leaving the system with no display output at all.
Are you going to push this patch or is going to be done by Thierry?
I'm on it.
Quoted 12 lines
Quoted 4 lines
Best regards
Thomas--
Best regards,Javier Martinez Canillas
Core Platforms
Red Hat
Quoted 17 lines · Robert Foss
Quoted 6 lines · Javier Martinez Canillas
Quoted 3 lines · Thomas Zimmermann
Hi
Am 23.02.24 um 16:03 schrieb Thierry Reding:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
From: Thierry Reding <[email protected]>
Tegra DRM doesn't support display on Tegra234 and later, so make sure not to remove any existing framebuffers in that case.
v2: - add comments explaining how this situation can come about
- clearDRIVER_MODESETandDRIVER_ATOMICfeature bits
Quoted 7 lines
Fixes 6848c291a54f ("drm/aperture: Convert drivers to aperture interfaces")Maybe this is more of a philosophical question, but either the introduction of this hardware generation is where this regression was introduced or this possibly this commit.
Either way, I'd like to get this into the drm-misc-fixes branch.
That commit looks about right. Technically Tegra234 support was introduced in Linux 5.10 but the first platform where you we would've seen this wasn't added until 5.17. The above commit is from 5.14, which puts it about right in between there, so I think that's fine.
Backporting to anything before 5.14 would need to be manual and isn't worth it.
Thierry
Robert Foss
AppliedQuoted 9 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Tegra DRM doesn't support display on Tegra234 and later, so make sure not to remove any existing framebuffers in that case.
v2: - add comments explaining how this situation can come about
- clearDRIVER_MODESETandDRIVER_ATOMICfeature bits[...]
Applied, thanks!
[1/1] drm/tegra: Remove existing framebuffer only if we support display
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=86bf8cfda6d2
Rob