Re: [PATCH] drm/tegra: Remove existing framebuffer only if we support display

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 31 Aug 2023 at 08:33, Mikko Perttunen <cyndis@xxxxxxxx> wrote:
>
> On 8/30/23 13:19, Thomas Zimmermann wrote:
> > Hi
> >
> > Am 25.08.23 um 15:22 schrieb Thierry Reding:
> >> From: Thierry Reding <treding@xxxxxxxxxx>
> >>
> >> Tegra DRM doesn't support display on Tegra234 and later, so make sure
> >> not to remove any existing framebuffers in that case.
> >>
> >> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
> >> ---
> >>   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) {
> >
> > If you don't support the hardware, wouldn't it be better to return
> > -ENODEV if !num_crtc?
>
> While display is not supported through TegraDRM on Tegra234+, certain
> multimedia accelerators are supported, so we need to finish probe for those.

Ideally you also register the tegra driver without DRIVER_MODESET |
DRIVER_ATOMIC in that case, to avoid unecessary userspace confusion.
Most userspace can cope with a display driver without any crtc, but I
think xorg-modesettting actually falls over. Or at least I've seen
some hacks that the agx people added to make sure X doesn't
accidentally open the wrong driver.
-Sima

>
> Cheers,
> Mikko
>
> >
> > Best regards
> > Thomas
> >
> >> +        err = drm_aperture_remove_framebuffers(&tegra_drm_driver);
> >> +        if (err < 0)
> >> +            goto hub;
> >> +    }
> >>       err = drm_dev_register(drm, 0);
> >>       if (err < 0)
> >
>


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux