Skip to content

Commit 92e98d0

Browse files
committed
Downward compatibility
1 parent 12b7ee5 commit 92e98d0

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

libsrc/grabber/drm/DRMFrameGrabber.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717

1818
Q_LOGGING_CATEGORY(grabber_drm, "grabber.drm")
1919

20+
21+
// Add missing AMD format modifier definitions for downward compatibility
22+
#ifndef AMD_FMT_MOD_TILE_VER_GFX11
23+
#define AMD_FMT_MOD_TILE_VER_GFX11 4
24+
#endif
25+
#ifndef AMD_FMT_MOD_TILE_VER_GFX12
26+
#define AMD_FMT_MOD_TILE_VER_GFX12 5
27+
#endif
28+
29+
2030
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
2131
#define ALIGN(v, a) (((v) + (a) - 1) & ~((a) - 1))
2232

@@ -57,7 +67,7 @@ static QString getDrmModifierName(uint64_t modifier)
5767
case I915_FORMAT_MOD_Yf_TILED_CCS:
5868
return "I915_FORMAT_MOD_Yf_TILED_CCS";
5969
default:
60-
return "DRM_FORMAT_MOD_INTEL_UNKNOWN";
70+
return QString("DRM_FORMAT_MOD_INTEL_UNKNOWN [0x%1]").arg(mod, 14, 16, QChar('0'));
6171
}
6272
case DRM_FORMAT_MOD_VENDOR_AMD:
6373
if (mod & AMD_FMT_MOD_TILE_VER_GFX9)
@@ -66,15 +76,17 @@ static QString getDrmModifierName(uint64_t modifier)
6676
return "AMD_FMT_MOD_TILE_VER_GFX10";
6777
if (mod & AMD_FMT_MOD_TILE_VER_GFX11)
6878
return "AMD_FMT_MOD_TILE_VER_GFX11";
79+
if (mod & AMD_FMT_MOD_TILE_VER_GFX12)
80+
return "AMD_FMT_MOD_TILE_VER_GFX12";
6981
if (mod & AMD_FMT_MOD_DCC_BLOCK_128B)
7082
return "AMD_FMT_MOD_DCC_BLOCK_128B";
7183
if (mod & AMD_FMT_MOD_DCC_BLOCK_256B)
7284
return "AMD_FMT_MOD_DCC_BLOCK_256B";
73-
return "DRM_FORMAT_MOD_AMD_UNKNOWN";
85+
return QString("DRM_FORMAT_MOD_AMD_UNKNOWN [0x%1]").arg(mod, 14, 16, QChar('0'));
7486
case DRM_FORMAT_MOD_VENDOR_NVIDIA:
7587
if (mod & 0x10)
7688
return "DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D";
77-
return "DRM_FORMAT_MOD_NVIDIA_UNKNOWN";
89+
return QString("DRM_FORMAT_MOD_NVIDIA_UNKNOWN [0x%1]").arg(mod , 14, 16, QChar('0'));
7890
case DRM_FORMAT_MOD_VENDOR_BROADCOM:
7991
switch (fourcc_mod_broadcom_mod(modifier))
8092
{
@@ -89,12 +101,12 @@ static QString getDrmModifierName(uint64_t modifier)
89101
case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
90102
return "DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED";
91103
default:
92-
return "DRM_FORMAT_MOD_BROADCOM_UNKNOWN";
104+
return QString("DRM_FORMAT_MOD_BROADCOM_UNKNOWN [0x%1]").arg(mod, 14, 16, QChar('0'));
93105
}
94106
case DRM_FORMAT_MOD_VENDOR_ARM:
95107
if ((modifier & DRM_FORMAT_MOD_ARM_AFBC(0)) == DRM_FORMAT_MOD_ARM_AFBC(0))
96108
return "DRM_FORMAT_MOD_ARM_AFBC";
97-
return "DRM_FORMAT_MOD_ARM_UNKNOWN";
109+
return QString("DRM_FORMAT_MOD_ARM_UNKNOWN [0x%1]").arg(mod, 14, 16, QChar('0'));
98110

99111
default:
100112
break;

0 commit comments

Comments
 (0)