index 49510a0957c7..8704b6f71000 100644
> --- a/drivers/gpu/drm/vkms/vkms_config.h
> +++ b/drivers/gpu/drm/vkms/vkms_config.h
> @@ -44,6 +44,7 @@ struct vkms_config {
>   *
>   * @link: Link to the others planes in vkms_config
>   * @config: The vkms_config this plane belongs to
> + * @name: Name of the plane
>   * @type: Type of the plane. The creator of configuration needs to ensures 
> that
>   *        at least one primary plane is present.
>   * @possible_crtcs: Array of CRTCs that can be used with this plane
> @@ -56,6 +57,7 @@ struct vkms_config_plane {
>       struct list_head link;
>       struct vkms_config *config;
>  
> +     const char *name;
>       enum drm_plane_type type;
>       struct xarray possible_crtcs;
>       bool default_pipeline;
> @@ -342,6 +344,39 @@ vkms_config_plane_set_default_pipeline(struct 
> vkms_config_plane *plane_cfg,
>       plane_cfg->default_pipeline = default_pipeline;
>  }
>  
> +/**
> + * vkms_config_plane_set_name() - Set the plane name
> + * @plane_cfg: Plane to set the name to
> + * @name: New plane name. The name is copied.
> + *
> + * Returns: -ENOMEM if the memory allocation failed, 0 in case of success
> + */
> +static inline int __must_check
> +vkms_config_plane_set_name(struct vkms_config_plane *plane_cfg,
> +                        const char *name, size_t name_len)
> +{
> +     char *new_name;
> +
> +     new_name = kmemdup_nul(name, name_len, GFP_KERNEL);
> +     if (name && !new_name)
> +             return -ENOMEM;
> +
> +     kfree(plane_cfg->name);
> +     plane_cfg->name = new_name;
> +
> +     return 0;
> +}
> +
> +/**
> + * vkms_config_plane_get_name - Get the plane name
> + * @plane_cfg: Plane to get the name from
> + */
> +static inline const char *
> +vkms_config_plane_get_name(const struct vkms_config_plane *plane_cfg)
> +{
> +     return plane_cfg->name;
> +}
> +
>  /**
>   * vkms_config_plane_attach_crtc - Attach a plane to a CRTC
>   * @plane_cfg: Plane to attach
 
Sorry, only noticed this now --one tiny things: this helper is ten lines with 
an allocation, sitting in a header. coding-style keeps inline under~3 lines, so 
maybe vkms_config.c is a better home for it? :)

Reply via email to