1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
|
From dd5929402cebad821285fb6f112f48f8e63a393d Mon Sep 17 00:00:00 2001
From: Joshua Ashton <joshua@froggi.es>
Date: Tue, 19 Sep 2023 10:29:31 -0100
Subject: [PATCH] HACK: Prefix new color mgmt properties with VALVE1_
Plane color mgmt properties, predefined transfer functions and CRTC
shaper/3D LUT aren't upstream properties yet, add a prefix to indicate
they are downstream props.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
index c87b64e464ed5..0a7df5984d0b8 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
@@ -226,7 +226,7 @@ amdgpu_dm_create_color_properties(struct amdgpu_device *adev)
prop = drm_property_create(adev_to_drm(adev),
DRM_MODE_PROP_BLOB,
- "AMD_PLANE_DEGAMMA_LUT", 0);
+ "VALVE1_PLANE_DEGAMMA_LUT", 0);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_degamma_lut_property = prop;
@@ -240,41 +240,41 @@ amdgpu_dm_create_color_properties(struct amdgpu_device *adev)
adev->mode_info.plane_degamma_lut_size_property = prop;
prop = amdgpu_create_tf_property(adev_to_drm(adev),
- "AMD_PLANE_DEGAMMA_TF",
+ "VALVE1_PLANE_DEGAMMA_TF",
amdgpu_eotf);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_degamma_tf_property = prop;
prop = drm_property_create_range(adev_to_drm(adev),
- 0, "AMD_PLANE_HDR_MULT", 0, U64_MAX);
+ 0, "VALVE1_PLANE_HDR_MULT", 0, U64_MAX);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_hdr_mult_property = prop;
prop = drm_property_create(adev_to_drm(adev),
DRM_MODE_PROP_BLOB,
- "AMD_PLANE_CTM", 0);
+ "VALVE1_PLANE_CTM", 0);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_ctm_property = prop;
prop = drm_property_create(adev_to_drm(adev),
DRM_MODE_PROP_BLOB,
- "AMD_PLANE_SHAPER_LUT", 0);
+ "VALVE1_PLANE_SHAPER_LUT", 0);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_shaper_lut_property = prop;
prop = drm_property_create_range(adev_to_drm(adev),
DRM_MODE_PROP_IMMUTABLE,
- "AMD_PLANE_SHAPER_LUT_SIZE", 0, UINT_MAX);
+ "VALVE1_PLANE_SHAPER_LUT_SIZE", 0, UINT_MAX);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_shaper_lut_size_property = prop;
prop = amdgpu_create_tf_property(adev_to_drm(adev),
- "AMD_PLANE_SHAPER_TF",
+ "VALVE1_PLANE_SHAPER_TF",
amdgpu_inv_eotf);
if (!prop)
return -ENOMEM;
@@ -282,41 +282,41 @@ amdgpu_dm_create_color_properties(struct amdgpu_device *adev)
prop = drm_property_create(adev_to_drm(adev),
DRM_MODE_PROP_BLOB,
- "AMD_PLANE_LUT3D", 0);
+ "VALVE1_PLANE_LUT3D", 0);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_lut3d_property = prop;
prop = drm_property_create_range(adev_to_drm(adev),
DRM_MODE_PROP_IMMUTABLE,
- "AMD_PLANE_LUT3D_SIZE", 0, UINT_MAX);
+ "VALVE1_PLANE_LUT3D_SIZE", 0, UINT_MAX);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_lut3d_size_property = prop;
prop = drm_property_create(adev_to_drm(adev),
DRM_MODE_PROP_BLOB,
- "AMD_PLANE_BLEND_LUT", 0);
+ "VALVE1_PLANE_BLEND_LUT", 0);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_blend_lut_property = prop;
prop = drm_property_create_range(adev_to_drm(adev),
DRM_MODE_PROP_IMMUTABLE,
- "AMD_PLANE_BLEND_LUT_SIZE", 0, UINT_MAX);
+ "VALVE1_PLANE_BLEND_LUT_SIZE", 0, UINT_MAX);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_blend_lut_size_property = prop;
prop = amdgpu_create_tf_property(adev_to_drm(adev),
- "AMD_PLANE_BLEND_TF",
+ "VALVE1_PLANE_BLEND_TF",
amdgpu_eotf);
if (!prop)
return -ENOMEM;
adev->mode_info.plane_blend_tf_property = prop;
prop = amdgpu_create_tf_property(adev_to_drm(adev),
- "AMD_CRTC_REGAMMA_TF",
+ "VALVE1_CRTC_REGAMMA_TF",
amdgpu_inv_eotf);
if (!prop)
return -ENOMEM;
--
GitLab
From a5ae6b501aed085d27541c284893e431776fe259 Mon Sep 17 00:00:00 2001
From: Melissa Wen <mwen@igalia.com>
Date: Mon, 25 Sep 2023 16:25:27 -0100
Subject: [PATCH] HACK: change TF API to fit current gamescope
upstream requested to identify if the type of transfer function a
property is capable to handle (basically EOTF or inv_EOTF). gamescope
understand it is implictly identified by the block/property position in
the pipeline and doesn't handle this difference yet. change the upstream
API to fit the current gamescope implementation.
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 21 +++---
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 69 ++++++++-----------
2 files changed, 38 insertions(+), 52 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index 9c1871b866cc9..feaa82f74a68f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -734,19 +734,14 @@ extern const struct amdgpu_ip_block_version dm_ip_block;
*/
enum amdgpu_transfer_function {
AMDGPU_TRANSFER_FUNCTION_DEFAULT,
- AMDGPU_TRANSFER_FUNCTION_SRGB_EOTF,
- AMDGPU_TRANSFER_FUNCTION_BT709_INV_OETF,
- AMDGPU_TRANSFER_FUNCTION_PQ_EOTF,
- AMDGPU_TRANSFER_FUNCTION_IDENTITY,
- AMDGPU_TRANSFER_FUNCTION_GAMMA22_EOTF,
- AMDGPU_TRANSFER_FUNCTION_GAMMA24_EOTF,
- AMDGPU_TRANSFER_FUNCTION_GAMMA26_EOTF,
- AMDGPU_TRANSFER_FUNCTION_SRGB_INV_EOTF,
- AMDGPU_TRANSFER_FUNCTION_BT709_OETF,
- AMDGPU_TRANSFER_FUNCTION_PQ_INV_EOTF,
- AMDGPU_TRANSFER_FUNCTION_GAMMA22_INV_EOTF,
- AMDGPU_TRANSFER_FUNCTION_GAMMA24_INV_EOTF,
- AMDGPU_TRANSFER_FUNCTION_GAMMA26_INV_EOTF,
+ AMDGPU_TRANSFER_FUNCTION_SRGB,
+ AMDGPU_TRANSFER_FUNCTION_BT709,
+ AMDGPU_TRANSFER_FUNCTION_PQ,
+ AMDGPU_TRANSFER_FUNCTION_LINEAR,
+ AMDGPU_TRANSFER_FUNCTION_UNITY,
+ AMDGPU_TRANSFER_FUNCTION_GAMMA22,
+ AMDGPU_TRANSFER_FUNCTION_GAMMA24,
+ AMDGPU_TRANSFER_FUNCTION_GAMMA26,
AMDGPU_TRANSFER_FUNCTION_COUNT
};
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
index 0a7df5984d0b8..21e0efc42a34c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
@@ -163,36 +163,31 @@ static inline struct fixed31_32 amdgpu_dm_fixpt_from_s3132(__u64 x)
static const char * const
amdgpu_transfer_function_names[] = {
[AMDGPU_TRANSFER_FUNCTION_DEFAULT] = "Default",
- [AMDGPU_TRANSFER_FUNCTION_IDENTITY] = "Identity",
- [AMDGPU_TRANSFER_FUNCTION_SRGB_EOTF] = "sRGB EOTF",
- [AMDGPU_TRANSFER_FUNCTION_BT709_INV_OETF] = "BT.709 inv_OETF",
- [AMDGPU_TRANSFER_FUNCTION_PQ_EOTF] = "PQ EOTF",
- [AMDGPU_TRANSFER_FUNCTION_GAMMA22_EOTF] = "Gamma 2.2 EOTF",
- [AMDGPU_TRANSFER_FUNCTION_GAMMA24_EOTF] = "Gamma 2.4 EOTF",
- [AMDGPU_TRANSFER_FUNCTION_GAMMA26_EOTF] = "Gamma 2.6 EOTF",
- [AMDGPU_TRANSFER_FUNCTION_SRGB_INV_EOTF] = "sRGB inv_EOTF",
- [AMDGPU_TRANSFER_FUNCTION_BT709_OETF] = "BT.709 OETF",
- [AMDGPU_TRANSFER_FUNCTION_PQ_INV_EOTF] = "PQ inv_EOTF",
- [AMDGPU_TRANSFER_FUNCTION_GAMMA22_INV_EOTF] = "Gamma 2.2 inv_EOTF",
- [AMDGPU_TRANSFER_FUNCTION_GAMMA24_INV_EOTF] = "Gamma 2.4 inv_EOTF",
- [AMDGPU_TRANSFER_FUNCTION_GAMMA26_INV_EOTF] = "Gamma 2.6 inv_EOTF",
+ [AMDGPU_TRANSFER_FUNCTION_LINEAR] = "Linear",
+ [AMDGPU_TRANSFER_FUNCTION_UNITY] = "Unity",
+ [AMDGPU_TRANSFER_FUNCTION_SRGB] = "sRGB",
+ [AMDGPU_TRANSFER_FUNCTION_BT709] = "BT.709",
+ [AMDGPU_TRANSFER_FUNCTION_PQ] = "PQ (Perceptual Quantizer)",
+ [AMDGPU_TRANSFER_FUNCTION_GAMMA22] = "Gamma 2.2",
+ [AMDGPU_TRANSFER_FUNCTION_GAMMA24] = "Gamma 2.4",
+ [AMDGPU_TRANSFER_FUNCTION_GAMMA26] = "Gamma 2.6",
};
static const u32 amdgpu_eotf =
- BIT(AMDGPU_TRANSFER_FUNCTION_SRGB_EOTF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_BT709_INV_OETF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_PQ_EOTF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA22_EOTF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA24_EOTF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA26_EOTF);
+ BIT(AMDGPU_TRANSFER_FUNCTION_SRGB) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_BT709) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_PQ) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA22) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA24) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA26);
static const u32 amdgpu_inv_eotf =
- BIT(AMDGPU_TRANSFER_FUNCTION_SRGB_INV_EOTF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_BT709_OETF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_PQ_INV_EOTF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA22_INV_EOTF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA24_INV_EOTF) |
- BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA26_INV_EOTF);
+ BIT(AMDGPU_TRANSFER_FUNCTION_SRGB) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_BT709) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_PQ) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA22) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA24) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_GAMMA26);
static struct drm_property *
amdgpu_create_tf_property(struct drm_device *dev,
@@ -201,7 +196,8 @@ amdgpu_create_tf_property(struct drm_device *dev,
{
u32 transfer_functions = supported_tf |
BIT(AMDGPU_TRANSFER_FUNCTION_DEFAULT) |
- BIT(AMDGPU_TRANSFER_FUNCTION_IDENTITY);
+ BIT(AMDGPU_TRANSFER_FUNCTION_LINEAR) |
+ BIT(AMDGPU_TRANSFER_FUNCTION_UNITY);
struct drm_prop_enum_list enum_list[AMDGPU_TRANSFER_FUNCTION_COUNT];
int i, len;
@@ -645,25 +641,20 @@ amdgpu_tf_to_dc_tf(enum amdgpu_transfer_function tf)
switch (tf) {
default:
case AMDGPU_TRANSFER_FUNCTION_DEFAULT:
- case AMDGPU_TRANSFER_FUNCTION_IDENTITY:
+ case AMDGPU_TRANSFER_FUNCTION_LINEAR:
+ case AMDGPU_TRANSFER_FUNCTION_UNITY:
return TRANSFER_FUNCTION_LINEAR;
- case AMDGPU_TRANSFER_FUNCTION_SRGB_EOTF:
- case AMDGPU_TRANSFER_FUNCTION_SRGB_INV_EOTF:
+ case AMDGPU_TRANSFER_FUNCTION_SRGB:
return TRANSFER_FUNCTION_SRGB;
- case AMDGPU_TRANSFER_FUNCTION_BT709_OETF:
- case AMDGPU_TRANSFER_FUNCTION_BT709_INV_OETF:
+ case AMDGPU_TRANSFER_FUNCTION_BT709:
return TRANSFER_FUNCTION_BT709;
- case AMDGPU_TRANSFER_FUNCTION_PQ_EOTF:
- case AMDGPU_TRANSFER_FUNCTION_PQ_INV_EOTF:
+ case AMDGPU_TRANSFER_FUNCTION_PQ:
return TRANSFER_FUNCTION_PQ;
- case AMDGPU_TRANSFER_FUNCTION_GAMMA22_EOTF:
- case AMDGPU_TRANSFER_FUNCTION_GAMMA22_INV_EOTF:
+ case AMDGPU_TRANSFER_FUNCTION_GAMMA22:
return TRANSFER_FUNCTION_GAMMA22;
- case AMDGPU_TRANSFER_FUNCTION_GAMMA24_EOTF:
- case AMDGPU_TRANSFER_FUNCTION_GAMMA24_INV_EOTF:
+ case AMDGPU_TRANSFER_FUNCTION_GAMMA24:
return TRANSFER_FUNCTION_GAMMA24;
- case AMDGPU_TRANSFER_FUNCTION_GAMMA26_EOTF:
- case AMDGPU_TRANSFER_FUNCTION_GAMMA26_INV_EOTF:
+ case AMDGPU_TRANSFER_FUNCTION_GAMMA26:
return TRANSFER_FUNCTION_GAMMA26;
}
}
--
GitLab
From 2f33df4d9d3e86546d7c67453ae799306d55b7f5 Mon Sep 17 00:00:00 2001
From: Melissa Wen <mwen@igalia.com>
Date: Sat, 22 Apr 2023 14:08:47 -0100
Subject: [PATCH] HACK: add KConfig to enable driver-specific color mgmt props
We are enabling a large set of color calibration features to enhance KMS
color mgmt but these properties are specific of AMD display HW, and
cannot be provided by other vendors. Therefore, set a config option to
enable AMD driver-private properties used on Steam Deck color mgmt
pipeline. Replace the agreed name `AMD_PRIVATE_COLOR` with
our downstream version `CONFIG_DRM_AMD_COLOR_STEAMDECK`.
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
drivers/gpu/drm/amd/display/Kconfig | 7 +++++++
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 +-
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 6 +++---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 6 +++---
5 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
index 901d1961b7392..49523fa82f92a 100644
--- a/drivers/gpu/drm/amd/display/Kconfig
+++ b/drivers/gpu/drm/amd/display/Kconfig
@@ -51,4 +51,11 @@ config DRM_AMD_SECURE_DISPLAY
This option enables the calculation of crc of specific region via
debugfs. Cooperate with specific DMCU FW.
+config DRM_AMD_COLOR_STEAMDECK
+ bool "Enable color calibration features for Steam Deck"
+ depends on DRM_AMD_DC
+ help
+ Choose this option if you want to use AMDGPU features for broader
+ color management support on Steam Deck.
+
endmenu
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 5853cf0229176..1718ddfe75083 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4074,7 +4074,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)
return r;
}
-#ifdef AMD_PRIVATE_COLOR
+#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
if (amdgpu_dm_create_color_properties(adev))
return -ENOMEM;
#endif
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
index 21e0efc42a34c..8f8d2a8fb2921 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
@@ -97,7 +97,7 @@ static inline struct fixed31_32 amdgpu_dm_fixpt_from_s3132(__u64 x)
return val;
}
-#ifdef AMD_PRIVATE_COLOR
+#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
/* Pre-defined Transfer Functions (TF)
*
* AMD driver supports pre-defined mathematical functions for transferring
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
index 6e715ef3a5566..ab9992f24ae21 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
@@ -290,7 +290,7 @@ static int amdgpu_dm_crtc_late_register(struct drm_crtc *crtc)
}
#endif
-#ifdef AMD_PRIVATE_COLOR
+#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
/**
* dm_crtc_additional_color_mgmt - enable additional color properties
* @crtc: DRM CRTC
@@ -372,7 +372,7 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = {
#if defined(CONFIG_DEBUG_FS)
.late_register = amdgpu_dm_crtc_late_register,
#endif
-#ifdef AMD_PRIVATE_COLOR
+#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
.atomic_set_property = amdgpu_dm_atomic_crtc_set_property,
.atomic_get_property = amdgpu_dm_atomic_crtc_get_property,
#endif
@@ -551,7 +551,7 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);
-#ifdef AMD_PRIVATE_COLOR
+#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
dm_crtc_additional_color_mgmt(&acrtc->base);
#endif
return 0;
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index 8a4c40b4c27e4..5d87c24f0461f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1468,7 +1468,7 @@ static void amdgpu_dm_plane_drm_plane_destroy_state(struct drm_plane *plane,
drm_atomic_helper_plane_destroy_state(plane, state);
}
-#ifdef AMD_PRIVATE_COLOR
+#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
static void
dm_atomic_plane_attach_color_mgmt_properties(struct amdgpu_display_manager *dm,
struct drm_plane *plane)
@@ -1659,7 +1659,7 @@ static const struct drm_plane_funcs dm_plane_funcs = {
.atomic_duplicate_state = amdgpu_dm_plane_drm_plane_duplicate_state,
.atomic_destroy_state = amdgpu_dm_plane_drm_plane_destroy_state,
.format_mod_supported = amdgpu_dm_plane_format_mod_supported,
-#ifdef AMD_PRIVATE_COLOR
+#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
.atomic_set_property = dm_atomic_plane_set_property,
.atomic_get_property = dm_atomic_plane_get_property,
#endif
@@ -1742,7 +1742,7 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
drm_plane_helper_add(plane, &dm_plane_helper_funcs);
-#ifdef AMD_PRIVATE_COLOR
+#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
dm_atomic_plane_attach_color_mgmt_properties(dm, plane);
#endif
/* Create (reset) the plane state */
--
GitLab
From b938468f07222b4faab5ae5cf5391eccd9532bb0 Mon Sep 17 00:00:00 2001
From: Bouke Sybren Haarsma <boukehaarsma23@gmail.com>
Date: Fri, 15 Dec 2023 11:14:58 +0100
Subject: [PATCH] Don't create color_mgmt_properties on asics < SIENNA_CICHLID
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index 2ed20e6e439bb5..65ee8745e96540 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1742,7 +1742,8 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
drm_plane_helper_add(plane, &dm_plane_helper_funcs);
#ifdef CONFIG_DRM_AMD_COLOR_STEAMDECK
- dm_atomic_plane_attach_color_mgmt_properties(dm, plane);
+ if (dm->adev->asic_type >= CHIP_SIENNA_CICHLID)
+ dm_atomic_plane_attach_color_mgmt_properties(dm, plane);
#endif
/* Create (reset) the plane state */
if (plane->funcs->reset)
--
2.43.0
|