[V7 12/45] drm/plane: Add COLOR PIPELINE property
Simon Ser
contact at emersion.fr
Mon Jan 13 18:08:30 UTC 2025
> +int
> +drm_atomic_add_affected_colorops(struct drm_atomic_state *state,
> + struct drm_plane *plane)
> +{
> + struct drm_colorop *colorop;
> + struct drm_colorop_state *colorop_state;
> +
> + WARN_ON(!drm_atomic_get_new_plane_state(state, plane));
> +
> + drm_dbg_atomic(plane->dev,
> + "Adding all current colorops for [plane:%d:%s] to %p\n",
> + plane->base.id, plane->name, state);
Nit: we use upper-case "[PLANE:%d:%s]" when pretty-printing.
> +#define MAX_COLOR_PIPELINES 5
Is this kind of arbitrary, or is there a real reason behind this?
This is not strictly the max number of color pipelines, since a driver can
create more. This is the max number of choices for the COLOR_PIPELINE property.
Should this be renamed to e.g. MAX_COLOR_PIPLINE_PROP_ENTRIES?
> +/**
> + * drm_plane_create_color_pipeline_property - create a new color pipeline
> + * property
> + *
> + * @plane: drm plane
> + * @pipelines: list of pipelines
> + * @num_pipelines: number of pipelines
> + *
> + * Create the COLOR_PIPELINE plane property to specific color pipelines on
> + * the plane.
> + *
> + * RETURNS:
> + * Zero for success or -errno
> + */
> +int drm_plane_create_color_pipeline_property(struct drm_plane *plane,
> + struct drm_prop_enum_list *pipelines,
Nit: this argument can be const.
> + int num_pipelines)
> +{
> + struct drm_prop_enum_list all_pipelines[MAX_COLOR_PIPELINES];
> + int len = 0;
> + int i;
> + struct drm_property *prop;
> +
> + if (num_pipelines > (MAX_COLOR_PIPELINES - 1))
> + return -EINVAL;
Probably this should be a drm_WARN_ON?
More information about the wayland-devel
mailing list