* [PATCH] drm/fbdev-client: Ignore EOPNOTSUPP errors
@ 2025-04-12 7:00 Thierry Reding
2025-04-26 5:52 ` Dmitry Baryshkov
2025-05-08 8:52 ` Thomas Zimmermann
0 siblings, 2 replies; 4+ messages in thread
From: Thierry Reding @ 2025-04-12 7:00 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann
Cc: dri-devel, linux-tegra, Jonathan Hunter
From: Thierry Reding <treding@nvidia.com>
Recent generations of Tegra have moved the display components outside of
host1x, leading to a device that has no CRTCs attached and hence doesn't
support any of the modesetting functionality. When this is detected, the
driver clears the DRIVER_MODESET and DRIVER_ATOMIC flags for the device.
Unfortunately, this causes the following errors during boot:
[ 15.418958] ERR KERN drm drm: [drm] *ERROR* Failed to register client: -95
[ 15.425311] WARNING KERN drm drm: [drm] Failed to set up DRM client; error -95
These originate from the fbdev client checking for the presence of the
DRIVER_MODESET flag and returning -EOPNOTSUPP. However, if a driver does
not support DRIVER_MODESET this is entirely expected and the error isn't
helpful.
One solution would have been to conditionally call drm_client_setup()
only if modesetting is supported. This seems a bit redundant, however,
and could further complicate things if ever any DRM clients are added
that do not rely on modesetting.
Instead, simply add an extra check to ignore this expected error and
skip the fbdev client registration.
Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/gpu/drm/clients/drm_fbdev_client.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/clients/drm_fbdev_client.c b/drivers/gpu/drm/clients/drm_fbdev_client.c
index f894ba52bdb5..8c8552ed912e 100644
--- a/drivers/gpu/drm/clients/drm_fbdev_client.c
+++ b/drivers/gpu/drm/clients/drm_fbdev_client.c
@@ -152,7 +152,11 @@ int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info
ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs);
if (ret) {
- drm_err(dev, "Failed to register client: %d\n", ret);
+ if (ret != -EOPNOTSUPP)
+ drm_err(dev, "Failed to register client: %d\n", ret);
+ else
+ ret = 0;
+
goto err_drm_client_init;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drm/fbdev-client: Ignore EOPNOTSUPP errors
2025-04-12 7:00 [PATCH] drm/fbdev-client: Ignore EOPNOTSUPP errors Thierry Reding
@ 2025-04-26 5:52 ` Dmitry Baryshkov
2025-05-07 15:42 ` Thierry Reding
2025-05-08 8:52 ` Thomas Zimmermann
1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Baryshkov @ 2025-04-26 5:52 UTC (permalink / raw)
To: Thierry Reding
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
linux-tegra, Jonathan Hunter
On Sat, Apr 12, 2025 at 09:00:47AM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Recent generations of Tegra have moved the display components outside of
> host1x, leading to a device that has no CRTCs attached and hence doesn't
> support any of the modesetting functionality. When this is detected, the
> driver clears the DRIVER_MODESET and DRIVER_ATOMIC flags for the device.
>
> Unfortunately, this causes the following errors during boot:
>
> [ 15.418958] ERR KERN drm drm: [drm] *ERROR* Failed to register client: -95
> [ 15.425311] WARNING KERN drm drm: [drm] Failed to set up DRM client; error -95
>
> These originate from the fbdev client checking for the presence of the
> DRIVER_MODESET flag and returning -EOPNOTSUPP. However, if a driver does
> not support DRIVER_MODESET this is entirely expected and the error isn't
> helpful.
>
> One solution would have been to conditionally call drm_client_setup()
> only if modesetting is supported. This seems a bit redundant, however,
> and could further complicate things if ever any DRM clients are added
> that do not rely on modesetting.
>
> Instead, simply add an extra check to ignore this expected error and
> skip the fbdev client registration.
>
> Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> drivers/gpu/drm/clients/drm_fbdev_client.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/clients/drm_fbdev_client.c b/drivers/gpu/drm/clients/drm_fbdev_client.c
> index f894ba52bdb5..8c8552ed912e 100644
> --- a/drivers/gpu/drm/clients/drm_fbdev_client.c
> +++ b/drivers/gpu/drm/clients/drm_fbdev_client.c
> @@ -152,7 +152,11 @@ int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info
>
> ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs);
> if (ret) {
> - drm_err(dev, "Failed to register client: %d\n", ret);
> + if (ret != -EOPNOTSUPP)
> + drm_err(dev, "Failed to register client: %d\n", ret);
> + else
> + ret = 0;
> +
Wouldn't it be better to explicitly return 0 in the beginning of the
function if !drm_core_check_feature(dev, DRIVER_MODESET) ?
> goto err_drm_client_init;
> }
>
> --
> 2.49.0
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/fbdev-client: Ignore EOPNOTSUPP errors
2025-04-26 5:52 ` Dmitry Baryshkov
@ 2025-05-07 15:42 ` Thierry Reding
0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2025-05-07 15:42 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
linux-tegra, Jonathan Hunter
[-- Attachment #1: Type: text/plain, Size: 2883 bytes --]
On Sat, Apr 26, 2025 at 08:52:40AM +0300, Dmitry Baryshkov wrote:
> On Sat, Apr 12, 2025 at 09:00:47AM +0200, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > Recent generations of Tegra have moved the display components outside of
> > host1x, leading to a device that has no CRTCs attached and hence doesn't
> > support any of the modesetting functionality. When this is detected, the
> > driver clears the DRIVER_MODESET and DRIVER_ATOMIC flags for the device.
> >
> > Unfortunately, this causes the following errors during boot:
> >
> > [ 15.418958] ERR KERN drm drm: [drm] *ERROR* Failed to register client: -95
> > [ 15.425311] WARNING KERN drm drm: [drm] Failed to set up DRM client; error -95
> >
> > These originate from the fbdev client checking for the presence of the
> > DRIVER_MODESET flag and returning -EOPNOTSUPP. However, if a driver does
> > not support DRIVER_MODESET this is entirely expected and the error isn't
> > helpful.
> >
> > One solution would have been to conditionally call drm_client_setup()
> > only if modesetting is supported. This seems a bit redundant, however,
> > and could further complicate things if ever any DRM clients are added
> > that do not rely on modesetting.
> >
> > Instead, simply add an extra check to ignore this expected error and
> > skip the fbdev client registration.
> >
> > Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> > drivers/gpu/drm/clients/drm_fbdev_client.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/clients/drm_fbdev_client.c b/drivers/gpu/drm/clients/drm_fbdev_client.c
> > index f894ba52bdb5..8c8552ed912e 100644
> > --- a/drivers/gpu/drm/clients/drm_fbdev_client.c
> > +++ b/drivers/gpu/drm/clients/drm_fbdev_client.c
> > @@ -152,7 +152,11 @@ int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info
> >
> > ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs);
> > if (ret) {
> > - drm_err(dev, "Failed to register client: %d\n", ret);
> > + if (ret != -EOPNOTSUPP)
> > + drm_err(dev, "Failed to register client: %d\n", ret);
> > + else
> > + ret = 0;
> > +
>
> Wouldn't it be better to explicitly return 0 in the beginning of the
> function if !drm_core_check_feature(dev, DRIVER_MODESET) ?
It'd return a bit earlier in that case, so there's that. On the other
hand I think it becomes a little less clear what's going on. In the
above, we already have the appropriate check in a central location and
we reuse that here.
I don't feel very strongly either way, though.
Thierry
>
> > goto err_drm_client_init;
> > }
> >
> > --
> > 2.49.0
> >
>
> --
> With best wishes
> Dmitry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/fbdev-client: Ignore EOPNOTSUPP errors
2025-04-12 7:00 [PATCH] drm/fbdev-client: Ignore EOPNOTSUPP errors Thierry Reding
2025-04-26 5:52 ` Dmitry Baryshkov
@ 2025-05-08 8:52 ` Thomas Zimmermann
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2025-05-08 8:52 UTC (permalink / raw)
To: Thierry Reding, Maarten Lankhorst, Maxime Ripard
Cc: dri-devel, linux-tegra, Jonathan Hunter
Hi,
sorry for the late review. I've been away for a few days.
Am 12.04.25 um 09:00 schrieb Thierry Reding:
> From: Thierry Reding <treding@nvidia.com>
>
> Recent generations of Tegra have moved the display components outside of
> host1x, leading to a device that has no CRTCs attached and hence doesn't
> support any of the modesetting functionality. When this is detected, the
> driver clears the DRIVER_MODESET and DRIVER_ATOMIC flags for the device.
>
> Unfortunately, this causes the following errors during boot:
>
> [ 15.418958] ERR KERN drm drm: [drm] *ERROR* Failed to register client: -95
> [ 15.425311] WARNING KERN drm drm: [drm] Failed to set up DRM client; error -95
>
> These originate from the fbdev client checking for the presence of the
> DRIVER_MODESET flag and returning -EOPNOTSUPP. However, if a driver does
> not support DRIVER_MODESET this is entirely expected and the error isn't
> helpful.
>
> One solution would have been to conditionally call drm_client_setup()
> only if modesetting is supported. This seems a bit redundant, however,
> and could further complicate things if ever any DRM clients are added
> that do not rely on modesetting.
These default in-kernel clients are all somewhat legacy by definition
and the only viable use cases involve display output. There won't be any
clients that don't output to the display. Best would be to put that
check around drm_client_setup() in the tegra driver. [1]
if (drm->driver_features & MODESET)
drm_client_setup()
[1]
https://elixir.bootlin.com/linux/v6.14.5/source/drivers/gpu/drm/tegra/drm.c#L1274
If you want to get fancy, you could also add that test at the very top
of drm_client_setup() itself; with a drm_dbg() statement noting the
absense of modesetting.
Best regards
Thomas
>
> Instead, simply add an extra check to ignore this expected error and
> skip the fbdev client registration.
>
> Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> drivers/gpu/drm/clients/drm_fbdev_client.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/clients/drm_fbdev_client.c b/drivers/gpu/drm/clients/drm_fbdev_client.c
> index f894ba52bdb5..8c8552ed912e 100644
> --- a/drivers/gpu/drm/clients/drm_fbdev_client.c
> +++ b/drivers/gpu/drm/clients/drm_fbdev_client.c
> @@ -152,7 +152,11 @@ int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info
>
> ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs);
> if (ret) {
> - drm_err(dev, "Failed to register client: %d\n", ret);
> + if (ret != -EOPNOTSUPP)
> + drm_err(dev, "Failed to register client: %d\n", ret);
> + else
> + ret = 0;
> +
> goto err_drm_client_init;
> }
>
--
--
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)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-05-08 8:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12 7:00 [PATCH] drm/fbdev-client: Ignore EOPNOTSUPP errors Thierry Reding
2025-04-26 5:52 ` Dmitry Baryshkov
2025-05-07 15:42 ` Thierry Reding
2025-05-08 8:52 ` Thomas Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).