Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/colorop: Add NEXT property

We'll construct color pipelines out of drm_colorop by
chaining them via the NEXT pointer. NEXT will point to
the next drm_colorop in the pipeline, or by 0 if we're
at the end of the pipeline.

Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patch.msgid.link/20251115000237.3561250-9-alex.hung@amd.com

authored by

Harry Wentland and committed by
Simon Ser
78a5add8 8c5ea174

+44
+27
drivers/gpu/drm/drm_colorop.c
··· 57 57 colorop->dev = dev; 58 58 colorop->type = type; 59 59 colorop->plane = plane; 60 + colorop->next = NULL; 60 61 61 62 list_add_tail(&colorop->head, &config->colorop_list); 62 63 colorop->index = config->num_colorop++; ··· 89 88 drm_object_attach_property(&colorop->base, 90 89 colorop->bypass_property, 91 90 1); 91 + 92 + /* next */ 93 + prop = drm_property_create_object(dev, DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_ATOMIC, 94 + "NEXT", DRM_MODE_OBJECT_COLOROP); 95 + if (!prop) 96 + return -ENOMEM; 97 + colorop->next_property = prop; 98 + drm_object_attach_property(&colorop->base, 99 + colorop->next_property, 100 + 0); 92 101 93 102 return ret; 94 103 } ··· 271 260 272 261 return colorop_curve_1d_type_names[type]; 273 262 } 263 + 264 + /** 265 + * drm_colorop_set_next_property - sets the next pointer 266 + * @colorop: drm colorop 267 + * @next: next colorop 268 + * 269 + * Should be used when constructing the color pipeline 270 + */ 271 + void drm_colorop_set_next_property(struct drm_colorop *colorop, struct drm_colorop *next) 272 + { 273 + drm_object_property_set_value(&colorop->base, 274 + colorop->next_property, 275 + next ? next->base.id : 0); 276 + colorop->next = next; 277 + } 278 + EXPORT_SYMBOL(drm_colorop_set_next_property);
+17
include/drm/drm_colorop.h
··· 172 172 enum drm_colorop_type type; 173 173 174 174 /** 175 + * @next: 176 + * 177 + * Read-only 178 + * Pointer to next drm_colorop in pipeline 179 + */ 180 + struct drm_colorop *next; 181 + 182 + /** 175 183 * @type_property: 176 184 * 177 185 * Read-only "TYPE" property for specifying the type of ··· 205 197 * Sub-type for DRM_COLOROP_1D_CURVE type. 206 198 */ 207 199 struct drm_property *curve_1d_type_property; 200 + 201 + /** 202 + * @next_property: 203 + * 204 + * Read-only property to next colorop in the pipeline 205 + */ 206 + struct drm_property *next_property; 208 207 209 208 }; 210 209 ··· 287 272 * const pointer and hence is threadsafe. 288 273 */ 289 274 const char *drm_get_colorop_curve_1d_type_name(enum drm_colorop_curve_1d_type type); 275 + 276 + void drm_colorop_set_next_property(struct drm_colorop *colorop, struct drm_colorop *next); 290 277 291 278 #endif /* __DRM_COLOROP_H__ */