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/amd/display: Enable support for PQ 125 EOTF and Inverse

This patchset enables support for the PQ_125 EOTF and its inverse
on all existing plane 1D curve colorops, i.e., on DEGAM, SHAPER,
and BLND blocks.

With this patchset the following IGT subtests are passing:
kms_colorop --run plane-XR30-XR30-pq_125_eotf
kms_colorop --run plane-XR30-XR30-pq_125_inv_eotf
kms_colorop --run plane-XR30-XR30-pq_125_eotf-pq_125_inv_eotf
kms_colorop --run plane-XR30-XR30-pq_125_eotf-pq_125_inv_eotf-pq_125_eotf

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>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patch.msgid.link/20251115000237.3561250-33-alex.hung@amd.com

authored by

Harry Wentland and committed by
Simon Ser
ef3d703f 1b754474

+25 -12
+19 -9
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
··· 26 26 #include "amdgpu.h" 27 27 #include "amdgpu_mode.h" 28 28 #include "amdgpu_dm.h" 29 + #include "amdgpu_dm_colorop.h" 29 30 #include "dc.h" 30 31 #include "modules/color/color_gamma.h" 31 32 ··· 675 674 case DRM_COLOROP_1D_CURVE_SRGB_EOTF: 676 675 case DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF: 677 676 return TRANSFER_FUNCTION_SRGB; 677 + case DRM_COLOROP_1D_CURVE_PQ_125_EOTF: 678 + case DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF: 679 + return TRANSFER_FUNCTION_PQ; 678 680 default: 679 681 return TRANSFER_FUNCTION_LINEAR; 680 682 } ··· 1201 1197 struct drm_colorop *colorop = colorop_state->colorop; 1202 1198 struct drm_device *drm = colorop->dev; 1203 1199 1204 - if (colorop->type != DRM_COLOROP_1D_CURVE || 1205 - colorop_state->curve_1d_type != DRM_COLOROP_1D_CURVE_SRGB_EOTF) 1200 + if (colorop->type != DRM_COLOROP_1D_CURVE) 1201 + return -EINVAL; 1202 + 1203 + if (!(BIT(colorop_state->curve_1d_type) & amdgpu_dm_supported_degam_tfs)) 1206 1204 return -EINVAL; 1207 1205 1208 1206 if (colorop_state->bypass) { ··· 1236 1230 /* 1st op: 1d curve - degamma */ 1237 1231 for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) { 1238 1232 if (new_colorop_state->colorop == old_colorop && 1239 - new_colorop_state->curve_1d_type == DRM_COLOROP_1D_CURVE_SRGB_EOTF) { 1233 + (BIT(new_colorop_state->curve_1d_type) & amdgpu_dm_supported_degam_tfs)) { 1240 1234 colorop_state = new_colorop_state; 1241 1235 break; 1242 1236 } ··· 1256 1250 struct drm_colorop *colorop = colorop_state->colorop; 1257 1251 struct drm_device *drm = colorop->dev; 1258 1252 1259 - if (colorop->type != DRM_COLOROP_1D_CURVE && 1260 - colorop_state->curve_1d_type != DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF) 1253 + if (colorop->type != DRM_COLOROP_1D_CURVE) 1254 + return -EINVAL; 1255 + 1256 + if (!(BIT(colorop_state->curve_1d_type) & amdgpu_dm_supported_shaper_tfs)) 1261 1257 return -EINVAL; 1262 1258 1263 1259 if (colorop_state->bypass) { ··· 1295 1287 /* 2nd op: 1d curve - shaper */ 1296 1288 for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) { 1297 1289 if (new_colorop_state->colorop == old_colorop && 1298 - new_colorop_state->curve_1d_type == DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF) { 1290 + (BIT(new_colorop_state->curve_1d_type) & amdgpu_dm_supported_shaper_tfs)) { 1299 1291 colorop_state = new_colorop_state; 1300 1292 break; 1301 1293 } ··· 1322 1314 const struct drm_color_lut *blend_lut = NULL; 1323 1315 u32 blend_size = 0; 1324 1316 1325 - if (colorop->type != DRM_COLOROP_1D_CURVE && 1326 - colorop_state->curve_1d_type != DRM_COLOROP_1D_CURVE_SRGB_EOTF) 1317 + if (colorop->type != DRM_COLOROP_1D_CURVE) 1318 + return -EINVAL; 1319 + 1320 + if (!(BIT(colorop_state->curve_1d_type) & amdgpu_dm_supported_blnd_tfs)) 1327 1321 return -EINVAL; 1328 1322 1329 1323 if (colorop_state->bypass) { ··· 1361 1351 /* 3nd op: 1d curve - blend */ 1362 1352 for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) { 1363 1353 if (new_colorop_state->colorop == old_colorop && 1364 - new_colorop_state->curve_1d_type == DRM_COLOROP_1D_CURVE_SRGB_EOTF) { 1354 + (BIT(new_colorop_state->curve_1d_type) & amdgpu_dm_supported_blnd_tfs)) { 1365 1355 colorop_state = new_colorop_state; 1366 1356 break; 1367 1357 }
+6 -3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c
··· 32 32 #include "amdgpu_dm_colorop.h" 33 33 34 34 const u64 amdgpu_dm_supported_degam_tfs = 35 - BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF); 35 + BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) | 36 + BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF); 36 37 37 38 const u64 amdgpu_dm_supported_shaper_tfs = 38 - BIT(DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF); 39 + BIT(DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF) | 40 + BIT(DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF); 39 41 40 42 const u64 amdgpu_dm_supported_blnd_tfs = 41 - BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF); 43 + BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) | 44 + BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF); 42 45 43 46 #define MAX_COLOR_PIPELINE_OPS 10 44 47