aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThierry Reding2017-11-14 11:50:30 -0600
committerThierry Reding2018-02-19 07:58:57 -0600
commitab5aaf6c8eb93462c15007e9b54f4447c1ea8148 (patch)
treed541cc706820c36b9be3f2bfa5793a528f2cd8b4 /tests
parentb3c4c79e16f13a72e8124f69453a37135329f968 (diff)
downloadexternal-libgbm-ab5aaf6c8eb93462c15007e9b54f4447c1ea8148.tar.gz
external-libgbm-ab5aaf6c8eb93462c15007e9b54f4447c1ea8148.tar.xz
external-libgbm-ab5aaf6c8eb93462c15007e9b54f4447c1ea8148.zip
drm/tegra: Sanitize format modifiers
The existing format modifier definitions were merged prematurely, and recent work has unveiled that the definitions are suboptimal in several ways: - The format specifiers, except for one, are not Tegra specific, but the names don't reflect that. - The number space is split into two, reserving 32 bits for some "parameter" which most of the modifiers are not going to have. - Symbolic names for the modifiers are not using the standard DRM_FORMAT_MOD_* prefix, which makes them awkward to use. - The vendor prefix NV is somewhat ambiguous. Fortunately, nobody's started using these modifiers, so we can still fix the above issues. Do so by using the standard prefix. Also, remove TEGRA from the name of those modifiers that exist on NVIDIA GPUs as well. In case of the block linear modifiers, make the "parameter" smaller (4 bits, though only 6 values are valid) and don't let that leak into any of the other modifiers. Finally, also use the more canonical NVIDIA instead of the ambiguous NV prefix. This is based on commit 5843f4e02fbe86a59981e35adc6cabebee46fdc0 from Linux v4.16-rc1 and also updates modetest to use the new defines. Acked-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/modetest/modetest.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 0773bd02..fb9f15fc 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -278,20 +278,20 @@ static const char *modifier_to_string(uint64_t modifier)
278 return "VIVANTE_SPLIT_TILED"; 278 return "VIVANTE_SPLIT_TILED";
279 case DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED: 279 case DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED:
280 return "VIVANTE_SPLIT_SUPER_TILED"; 280 return "VIVANTE_SPLIT_SUPER_TILED";
281 case NV_FORMAT_MOD_TEGRA_TILED: 281 case DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED:
282 return "MOD_TEGRA_TILED"; 282 return "NVIDIA_TEGRA_TILED";
283 case NV_FORMAT_MOD_TEGRA_16BX2_BLOCK(0): 283 case DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(0):
284 return "MOD_TEGRA_16BX2_BLOCK(0)"; 284 return "NVIDIA_16BX2_BLOCK(0)";
285 case NV_FORMAT_MOD_TEGRA_16BX2_BLOCK(1): 285 case DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(1):
286 return "MOD_TEGRA_16BX2_BLOCK(1)"; 286 return "NVIDIA_16BX2_BLOCK(1)";
287 case NV_FORMAT_MOD_TEGRA_16BX2_BLOCK(2): 287 case DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(2):
288 return "MOD_TEGRA_16BX2_BLOCK(2)"; 288 return "NVIDIA_16BX2_BLOCK(2)";
289 case NV_FORMAT_MOD_TEGRA_16BX2_BLOCK(3): 289 case DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(3):
290 return "MOD_TEGRA_16BX2_BLOCK(3)"; 290 return "NVIDIA_16BX2_BLOCK(3)";
291 case NV_FORMAT_MOD_TEGRA_16BX2_BLOCK(4): 291 case DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(4):
292 return "MOD_TEGRA_16BX2_BLOCK(4)"; 292 return "NVIDIA_16BX2_BLOCK(4)";
293 case NV_FORMAT_MOD_TEGRA_16BX2_BLOCK(5): 293 case DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(5):
294 return "MOD_TEGRA_16BX2_BLOCK(5)"; 294 return "NVIDIA_16BX2_BLOCK(5)";
295 case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: 295 case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
296 return "MOD_BROADCOM_VC4_T_TILED"; 296 return "MOD_BROADCOM_VC4_T_TILED";
297 default: 297 default: