Re: [PATCH v3 3/3] drm: bridge: ti-sn65dsi83: Add error recovery mechanism

From: Alexander Stein
Date: Thu Jan 09 2025 - 05:45:07 EST


Hi Herve,

Am Donnerstag, 9. Januar 2025, 11:38:34 CET schrieb Herve Codina:
> Hi Alexander,
>
> On Wed, 8 Jan 2025 18:44:42 +0100
> Herve Codina <herve.codina@xxxxxxxxxxx> wrote:
>
> > > > #include <drm/drm_atomic_helper.h>
> > > > #include <drm/drm_bridge.h>
> > > > +#include <drm/drm_drv.h> /* DRM_MODESET_LOCK_ALL_BEGIN() needs drm_drv_uses_atomic_modeset() */
> > >
> > > Shouldn't this include be added to include/drm/drm_modeset_lock.h instead?
> >
> > Yes indeed. I will change that in the next iteration.
>
> I tried to add '#include <drm/drm_drv.h>' in include/drm/drm_modeset_lock.h
> but it breaks the build in several places.
>
> First, I cannot add it at the begining of drm_modeset_lock.h.
> The inclusion path leads to:
> drm_modeset_lock.h
> drm/drm_drv.h
> drm/drm_device.h
> drm/drm_mode_config.h
> struct drm_mode_config definition
>
> The struct drm_mode_config needs the struct drm_modeset_lock defined.
> struct drm_modeset_lock is defined in drm_modeset_lock.h.
>
> Even if I don't like to add include files in the middle of a header filer,
> I tried to include drm/drm_drv.h just before the DRM_MODESET_LOCK_ALL_BEGIN()
> definition in drm_modeset_lock.h.
>
> This also breaks the build in several places. For instance:
> In file included from ./include/drm/drm_modeset_lock.h:162,
> from ./include/drm/drm_mode_config.h:32,
> from ./include/drm/drm_device.h:9,
> from drivers/gpu/drm/drm_dumb_buffers.c:26:
> ./include/drm/drm_drv.h: In function ‘drm_core_check_all_features’:
> ./include/drm/drm_drv.h:522:28: error: invalid use of undefined type ‘const struct drm_device’
> 522 | u32 supported = dev->driver->driver_features & dev->driver_features;
> | ^~
>
> I stop here, go back and choose to keep '#include <drm/drm_drv.h>' in ti-sn65dsi83.c
>
> Is that ok for you?

Mh, okay. It's up to the DRM maintainer to decide what to do. I just
pointed out it looks weird to me.

Best regards,
Alexander
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/