Also add notes that for atomic drivers it's really somewhere else and no longer in struct drm_crtc. Maybe we should put a bigger warning here that this is confusing, since the pixel format is a plane property, but the GAMMA_LUT property is on the crtc. But I think we can fix this if/when someone finds a need for a per-plane CLUT, since I'm not sure such hw even exists. I'm also not sure whether even hardware with a CLUT and a full color correction pipeline with degamm/cgm/gamma exists. Motivated by comments from Geert that we have a gap here. v2: More names for color luts (Laurent).
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -285,6 +285,10 @@ struct drm_crtc_state { · 284 unmodified lines | ||
| 285 | 285 | * Lookup table for converting pixel data after the color conversion |
| 286 | 286 | * matrix @ctm. See drm_crtc_enable_color_mgmt(). The blob (if not |
| 287 | 287 | * NULL) is an array of &struct drm_color_lut. |
| 288 | + * | |
| 289 | + * Note that for mostly historical reasons stemming from Xorg heritage, | |
| 290 | + * this is also used to store the color map (also sometimes color lut, | |
| 291 | + * CLUT or color palette) for indexed formats like DRM_FORMAT_C8. | |
| 288 | 292 | */ |
| 289 | 293 | struct drm_property_blob *gamma_lut; |
| 290 | 294 | |
| @@ -1075,12 +1079,18 @@ struct drm_crtc { · 784 unmodified lines | ||
| 1075 | 1079 | /** |
| 1076 | 1080 | * @gamma_size: Size of legacy gamma ramp reported to userspace. Set up |
| 1077 | 1081 | * by calling drm_mode_crtc_set_gamma_size(). |
| 1082 | + * | |
| 1083 | + * Note that atomic drivers need to instead use | |
| 1084 | + * &drm_crtc_state.gamma_lut. See drm_crtc_enable_color_mgmt(). | |
| 1078 | 1085 | */ |
| 1079 | 1086 | uint32_t gamma_size; |
| 1080 | 1087 | |
| 1081 | 1088 | /** |
| 1082 | 1089 | * @gamma_store: Gamma ramp values used by the legacy SETGAMMA and |
| 1083 | 1090 | * GETGAMMA IOCTls. Set up by calling drm_mode_crtc_set_gamma_size(). |
| 1091 | + * | |
| 1092 | + * Note that atomic drivers need to instead use | |
| 1093 | + * &drm_crtc_state.gamma_lut. See drm_crtc_enable_color_mgmt(). | |
| 1084 | 1094 | */ |
| 1085 | 1095 | uint16_t *gamma_store; |
| 1086 | 1096 | |