Skip to content

Commit 8e8c66a

Browse files
thierryredinggregkh
authored andcommitted
drm/tegra: Remove existing framebuffer only if we support display
[ Upstream commit 86bf8cf ] 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 Fixes: 6848c29 ("drm/aperture: Convert drivers to aperture interfaces") Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Robert Foss <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 274bf3c commit 8e8c66a

File tree

1 file changed

+20
-3
lines changed
  • drivers/gpu/drm/tegra

1 file changed

+20
-3
lines changed

drivers/gpu/drm/tegra/drm.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,9 +1242,26 @@ static int host1x_drm_probe(struct host1x_device *dev)
12421242

12431243
drm_mode_config_reset(drm);
12441244

1245-
err = drm_aperture_remove_framebuffers(&tegra_drm_driver);
1246-
if (err < 0)
1247-
goto hub;
1245+
/*
1246+
* Only take over from a potential firmware framebuffer if any CRTCs
1247+
* have been registered. This must not be a fatal error because there
1248+
* are other accelerators that are exposed via this driver.
1249+
*
1250+
* Another case where this happens is on Tegra234 where the display
1251+
* hardware is no longer part of the host1x complex, so this driver
1252+
* will not expose any modesetting features.
1253+
*/
1254+
if (drm->mode_config.num_crtc > 0) {
1255+
err = drm_aperture_remove_framebuffers(&tegra_drm_driver);
1256+
if (err < 0)
1257+
goto hub;
1258+
} else {
1259+
/*
1260+
* Indicate to userspace that this doesn't expose any display
1261+
* capabilities.
1262+
*/
1263+
drm->driver_features &= ~(DRIVER_MODESET | DRIVER_ATOMIC);
1264+
}
12481265

12491266
err = drm_dev_register(drm, 0);
12501267
if (err < 0)

0 commit comments

Comments
 (0)