[PATCH] drm/tegra: Remove existing framebuffer only if we support display
Javier Martinez Canillas
javierm at redhat.com
Wed Aug 30 06:13:04 UTC 2023
Thierry Reding <thierry.reding at gmail.com> writes:
Hello Thierry,
> From: Thierry Reding <treding at nvidia.com>
>
> Tegra DRM doesn't support display on Tegra234 and later, so make sure
> not to remove any existing framebuffers in that case.
>
I see, this makes sense to me.
Acked-by: Javier Martinez Canillas <javierm at redhat.com>
A couple of comments below though:
> Signed-off-by: Thierry Reding <treding at nvidia.com>
> ---
> drivers/gpu/drm/tegra/drm.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index b1e1a78e30c6..7a38dadbc264 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -1220,9 +1220,11 @@ 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;
> + if (drm->mode_config.num_crtc > 0) {
Maybe you can add a comment here explaining why the check is needed?
I also wonder if is worth to move the drm_num_crtcs() function from
drivers/gpu/drm/drm_crtc.c to include/drm/drm_crtc.h and use that helper
instead?
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
More information about the dri-devel
mailing list