[PATCH 14/15] drm/amd: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()

Fernando Ramos greenfoo at u92.eu
Sat Sep 18 09:42:40 UTC 2021


On 21/09/18 01:17AM, Fernando Ramos wrote:

> > > +#include <drm/drm_drv.h>
> > 
> > Top-level headers generally come above the driver headers. Also, now that I think
> > about this a bit more, all of the new includes in this set should probably be
> > for 'drm_modeset_lock.h' instead of 'drm_drv.h'.
> 
> Ok. Let me try that.

Turns out that the DRM_MODESET_LOCK_ALL_*() macros expansion includes a call
to drm_drv_uses_atomic_modeset() which is defined in "drm_drv.h".

Thus, #include'ing <drm/drm_drv.h> cannot be avoided.

This makes me wonder...

  1. "drm_drv.h" includes "drm_device.h", which includes "drm_mode_config.h",
     which includes "drm_modeset_lock.h"

  2. "drm_modeset_lock.h" defines DRM_MODESET_LOCK_ALL_*() which expands into
     drm_drv_uses_atomic_modeset()

  3. drm_drv_uses_atomic_modeset() is declared in "drm_drv.h"

There seems to be a circular dependency here.

We can try to fix this, but I suggest to do it in a different patch series.



More information about the amd-gfx mailing list