[PATCH] drm: document better that drivers shouldn't use drm_minor directly

Melissa Wen mwen at igalia.com
Thu Jan 5 12:07:39 UTC 2023


On 01/04, Daniel Vetter wrote:
> The documentation for struct drm_minor already states this, but that's
> not always that easy to find.
> 
> Also due to historical reasons we still have the minor-centric (like
> drm_debugfs_create_files), but since this is now getting fixed we can
> put a few more pointers in place as to how this should be done
> ideally.
> 
> Motvated by some discussion with Rodrigo on irc about how drm/xe
> should lay out its sysfs interfaces.
> 
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: Wambui Karuga <wambui.karugax at gmail.com>
> Cc: Maíra Canal <mcanal at igalia.com>
> Cc: Maxime Ripard <maxime at cerno.tech>
> Cc: Melissa Wen <mwen at igalia.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  include/drm/drm_device.h | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
> index 9923c7a6885e..b40e07e004ee 100644
> --- a/include/drm/drm_device.h
> +++ b/include/drm/drm_device.h
> @@ -87,10 +87,23 @@ struct drm_device {
>  	 */
>  	void *dev_private;
>  
> -	/** @primary: Primary node */
> +	/**
> +	 * @primary:
> +	 *
> +	 * Primary node. Drivers should not interact with this
> +	 * directly. debugfs interface can be registered with
> +	 * drm_debugfs_add_file(), and sysfs should be directly added on the
> +	 * hardwire struct device @dev.
> +	 */
>  	struct drm_minor *primary;
>  
> -	/** @render: Render node */
> +	/**
> +	 * @render:
> +	 *
> +	 * Render node. Drivers should not interact with this directly ever.
> +	 * Drivers should not expose any additional interfaces in debugfs or
> +	 * sysfs on thise node.
> +	 */
>  	struct drm_minor *render;
>  
>  	/**

yeah, with those typos fixed, LGTM.

Reviewed-by: Melissa Wen <mwen at igalia.com>

Thanks!

> -- 
> 2.37.2
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230105/7f00c73c/attachment.sig>


More information about the dri-devel mailing list