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 TYPE property

Add a read-only TYPE property. The TYPE specifies the colorop
type, such as enumerated curve, 1D LUT, CTM, 3D LUT, PWL LUT,
etc.

For now we're only introducing an enumerated 1D LUT type to
illustrate the concept.

Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
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-6-alex.hung@amd.com

authored by

Harry Wentland and committed by
Simon Ser
84423e56 cfc27680

+63 -3
+2 -2
drivers/gpu/drm/drm_atomic.c
··· 634 634 state->colorops[index].new_state = colorop_state; 635 635 colorop_state->state = state; 636 636 637 - drm_dbg_atomic(colorop->dev, "Added [COLOROP:%d] %p state to %p\n", 638 - colorop->base.id, colorop_state, state); 637 + drm_dbg_atomic(colorop->dev, "Added [COLOROP:%d:%d] %p state to %p\n", 638 + colorop->base.id, colorop->type, colorop_state, state); 639 639 640 640 return colorop_state; 641 641 }
+6 -1
drivers/gpu/drm/drm_atomic_uapi.c
··· 666 666 const struct drm_colorop_state *state, 667 667 struct drm_property *property, uint64_t *val) 668 668 { 669 - return -EINVAL; 669 + if (property == colorop->type_property) 670 + *val = colorop->type; 671 + else 672 + return -EINVAL; 673 + 674 + return 0; 670 675 } 671 676 672 677 static int drm_atomic_set_writeback_fb_for_connector(
+12
drivers/gpu/drm/drm_colorop.c
··· 101 101 if (colorop->state) 102 102 __drm_colorop_reset(colorop, colorop->state); 103 103 } 104 + 105 + static const char * const colorop_type_name[] = { 106 + [DRM_COLOROP_1D_CURVE] = "1D Curve", 107 + }; 108 + 109 + const char *drm_get_colorop_type_name(enum drm_colorop_type type) 110 + { 111 + if (WARN_ON(type >= ARRAY_SIZE(colorop_type_name))) 112 + return "unknown"; 113 + 114 + return colorop_type_name[type]; 115 + }
+24
include/drm/drm_colorop.h
··· 112 112 /** @properties: property tracking for this colorop */ 113 113 struct drm_object_properties properties; 114 114 115 + /** 116 + * @type: 117 + * 118 + * Read-only 119 + * Type of color operation 120 + */ 121 + enum drm_colorop_type type; 122 + 123 + /** 124 + * @type_property: 125 + * 126 + * Read-only "TYPE" property for specifying the type of 127 + * this color operation. The type is enum drm_colorop_type. 128 + */ 129 + struct drm_property *type_property; 115 130 }; 116 131 117 132 #define obj_to_colorop(x) container_of(x, struct drm_colorop, base) ··· 180 165 181 166 #define drm_for_each_colorop(colorop, dev) \ 182 167 list_for_each_entry(colorop, &(dev)->mode_config.colorop_list, head) 168 + 169 + /** 170 + * drm_get_colorop_type_name - return a string for colorop type 171 + * @type: colorop type to compute name of 172 + * 173 + * In contrast to the other drm_get_*_name functions this one here returns a 174 + * const pointer and hence is threadsafe. 175 + */ 176 + const char *drm_get_colorop_type_name(enum drm_colorop_type type); 183 177 184 178 #endif /* __DRM_COLOROP_H__ */
+19
include/uapi/drm/drm_mode.h
··· 859 859 }; 860 860 861 861 /** 862 + * enum drm_colorop_type - Type of color operation 863 + * 864 + * drm_colorops can be of many different types. Each type behaves differently 865 + * and defines a different set of properties. This enum defines all types and 866 + * gives a high-level description. 867 + */ 868 + enum drm_colorop_type { 869 + /** 870 + * @DRM_COLOROP_1D_CURVE: 871 + * 872 + * enum string "1D Curve" 873 + * 874 + * A 1D curve that is being applied to all color channels. The 875 + * curve is specified via the CURVE_1D_TYPE colorop property. 876 + */ 877 + DRM_COLOROP_1D_CURVE 878 + }; 879 + 880 + /** 862 881 * struct drm_plane_size_hint - Plane size hints 863 882 * @width: The width of the plane in pixel 864 883 * @height: The height of the plane in pixel