drm/tegra: Sanitize format modifiers
authorThierry Reding <treding@nvidia.com>
Tue, 14 Nov 2017 17:50:30 +0000 (18:50 +0100)
committerThierry Reding <treding@nvidia.com>
Mon, 19 Feb 2018 13:58:57 +0000 (14:58 +0100)
commitab5aaf6c8eb93462c15007e9b54f4447c1ea8148
treed541cc706820c36b9be3f2bfa5793a528f2cd8b4
parentb3c4c79e16f13a72e8124f69453a37135329f968
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>
include/drm/drm_fourcc.h
tests/modetest/modetest.c