forked from canonical/mir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drm_formats.cpp
723 lines (681 loc) · 18.5 KB
/
drm_formats.cpp
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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
/*
* Copyright © Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 2 or 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mir/graphics/drm_formats.h"
#include "mir_toolkit/common.h"
#include <cstdint>
#include <drm_fourcc.h>
#include <stdexcept>
#include <memory>
#include <array>
#include <boost/throw_exception.hpp>
#ifdef MIR_HAVE_DRM_GET_MODIFIER_NAME
#include <xf86drm.h>
#endif
namespace mg = mir::graphics;
namespace
{
constexpr auto drm_format_to_string(uint32_t format) -> char const*
{
#define STRINGIFY(val) \
case val: \
return #val;
if (!(format & DRM_FORMAT_BIG_ENDIAN))
{
switch (format)
{
#include "drm-formats"
default:
return "Unknown DRM format; rebuild Mir against newer DRM headers?";
}
}
#undef STRINGIFY
#define STRINGIFY_BIG_ENDIAN(val) \
case val: \
return #val " (big endian)";
switch (format & (~DRM_FORMAT_BIG_ENDIAN))
{
#include "drm-formats-big-endian"
default:
return "Unknown DRM format; rebuild Mir against newer DRM headers?";
}
#undef STRINGIFY_BIGENDIAN
}
}
struct mg::DRMFormat::FormatInfo
{
uint32_t format;
bool has_alpha;
uint32_t opaque_equivalent;
uint32_t alpha_equivalent;
std::optional<mg::DRMFormat::RGBComponentInfo> components;
};
namespace
{
constexpr std::array const formats = {
mg::DRMFormat::FormatInfo{
DRM_FORMAT_XRGB4444,
false,
DRM_FORMAT_XRGB4444,
DRM_FORMAT_ARGB4444,
mg::DRMFormat::RGBComponentInfo{
4, 4, 4, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_XBGR4444,
false,
DRM_FORMAT_XBGR4444,
DRM_FORMAT_ABGR4444,
mg::DRMFormat::RGBComponentInfo{
4, 4, 4, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGBX4444,
false,
DRM_FORMAT_RGBX4444,
DRM_FORMAT_RGBA4444,
mg::DRMFormat::RGBComponentInfo{
4, 4, 4, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGRX4444,
false,
DRM_FORMAT_BGRX4444,
DRM_FORMAT_BGRA4444,
mg::DRMFormat::RGBComponentInfo{
4, 4, 4, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_ARGB4444,
true,
DRM_FORMAT_XRGB4444,
DRM_FORMAT_ARGB4444,
mg::DRMFormat::RGBComponentInfo{
4, 4, 4, 4
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_ABGR4444,
true,
DRM_FORMAT_XBGR4444,
DRM_FORMAT_ABGR4444,
mg::DRMFormat::RGBComponentInfo{
4, 4, 4, 4
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGBA4444,
true,
DRM_FORMAT_RGBX4444,
DRM_FORMAT_RGBA4444,
mg::DRMFormat::RGBComponentInfo{
4, 4, 4, 4
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGRA4444,
true,
DRM_FORMAT_BGRX4444,
DRM_FORMAT_BGRA4444,
mg::DRMFormat::RGBComponentInfo{
4, 4, 4, 4
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_XRGB1555,
false,
DRM_FORMAT_XRGB1555,
DRM_FORMAT_ARGB1555,
mg::DRMFormat::RGBComponentInfo{
5, 5, 5, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_XBGR1555,
false,
DRM_FORMAT_XBGR1555,
DRM_FORMAT_ABGR1555,
mg::DRMFormat::RGBComponentInfo{
5, 5, 5, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGBX5551,
false,
DRM_FORMAT_RGBX5551,
DRM_FORMAT_RGBA5551,
mg::DRMFormat::RGBComponentInfo{
5, 5, 5, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGRX5551,
false,
DRM_FORMAT_BGRX5551,
DRM_FORMAT_BGRA5551,
mg::DRMFormat::RGBComponentInfo{
5, 5, 5, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_ARGB1555,
true,
DRM_FORMAT_XRGB1555,
DRM_FORMAT_ARGB1555,
mg::DRMFormat::RGBComponentInfo{
5, 5, 5, 1
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_ABGR1555,
true,
DRM_FORMAT_XBGR1555,
DRM_FORMAT_ABGR1555,
mg::DRMFormat::RGBComponentInfo{
5, 5, 5, 1
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGBA5551,
true,
DRM_FORMAT_RGBX5551,
DRM_FORMAT_RGBA5551,
mg::DRMFormat::RGBComponentInfo{
5, 5, 5, 1
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGRA5551,
true,
DRM_FORMAT_BGRX5551,
DRM_FORMAT_BGRA5551,
mg::DRMFormat::RGBComponentInfo{
5, 5, 5, 1
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGB565,
false,
DRM_FORMAT_RGB565,
DRM_FORMAT_INVALID,
mg::DRMFormat::RGBComponentInfo{
5, 6, 5, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGR565,
false,
DRM_FORMAT_BGR565,
DRM_FORMAT_INVALID,
mg::DRMFormat::RGBComponentInfo{
5, 6, 5, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGB888,
false,
DRM_FORMAT_RGB888,
DRM_FORMAT_INVALID,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGR888,
false,
DRM_FORMAT_BGR888,
DRM_FORMAT_INVALID,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_XRGB8888,
false,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_ARGB8888,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_XBGR8888,
false,
DRM_FORMAT_XBGR8888,
DRM_FORMAT_ABGR8888,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGBX8888,
false,
DRM_FORMAT_RGBX8888,
DRM_FORMAT_RGBA8888,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGRX8888,
false,
DRM_FORMAT_BGRX8888,
DRM_FORMAT_BGRA8888,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_ARGB8888,
true,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_ARGB8888,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, 8
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_ABGR8888,
true,
DRM_FORMAT_XBGR8888,
DRM_FORMAT_ABGR8888,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, 8
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGBA8888,
true,
DRM_FORMAT_RGBX8888,
DRM_FORMAT_RGBA8888,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, 8
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGRA8888,
true,
DRM_FORMAT_BGRX8888,
DRM_FORMAT_BGRA8888,
mg::DRMFormat::RGBComponentInfo{
8, 8, 8, 8
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_XRGB2101010,
false,
DRM_FORMAT_XRGB2101010,
DRM_FORMAT_ARGB2101010,
mg::DRMFormat::RGBComponentInfo{
10, 10, 10, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_XBGR2101010,
false,
DRM_FORMAT_XBGR2101010,
DRM_FORMAT_ABGR2101010,
mg::DRMFormat::RGBComponentInfo{
10, 10, 10, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGBX1010102,
false,
DRM_FORMAT_RGBX1010102,
DRM_FORMAT_RGBA1010102,
mg::DRMFormat::RGBComponentInfo{
10, 10, 10, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGRX1010102,
false,
DRM_FORMAT_BGRX1010102,
DRM_FORMAT_BGRA1010102,
mg::DRMFormat::RGBComponentInfo{
10, 10, 10, {}
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_ARGB2101010,
true,
DRM_FORMAT_XRGB2101010,
DRM_FORMAT_ARGB2101010,
mg::DRMFormat::RGBComponentInfo{
10, 10, 10, 2
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_ABGR2101010,
true,
DRM_FORMAT_XBGR2101010,
DRM_FORMAT_ABGR2101010,
mg::DRMFormat::RGBComponentInfo{
10, 10, 10, 2
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_RGBA1010102,
true,
DRM_FORMAT_RGBX1010102,
DRM_FORMAT_RGBA1010102,
mg::DRMFormat::RGBComponentInfo{
10, 10, 10, 2
},
},
mg::DRMFormat::FormatInfo{
DRM_FORMAT_BGRA1010102,
true,
DRM_FORMAT_BGRX1010102,
DRM_FORMAT_BGRA1010102,
mg::DRMFormat::RGBComponentInfo{
10, 10, 10, 2
},
},
};
constexpr auto find_format_info(uint32_t fourcc) -> mg::DRMFormat::FormatInfo const*
{
for (auto const& format: formats)
{
if (format.format == fourcc)
return &format;
}
/* The format array doesn't cover all DRM_FORMAT_*, only the ones relevant to Mir
* (and not all of them, yet: eg YUV formats), so we must have a sentinel value
* for the missing ones
*/
return nullptr;
}
/* Generate a bunch of variables named format_info_DRM_FORMAT_FOO pointing to associated FormatInfo */
#define STRINGIFY(format) \
constexpr mg::DRMFormat::FormatInfo const* format_info_##format = find_format_info(format);
#include "drm-formats"
#undef STRINGIFY
constexpr auto maybe_info_for_format(uint32_t fourcc_format) -> mg::DRMFormat::FormatInfo const*
{
switch (fourcc_format)
{
#define STRINGIFY(format) \
case format: \
return format_info_##format; \
#include "drm-formats"
#undef STRINGIFY
default:
BOOST_THROW_EXCEPTION((
std::runtime_error{
std::string{"Unknown DRM format "} + std::to_string(fourcc_format) +
" (may need to rebuild Mir against newer DRM headers?)"}));
}
}
constexpr auto info_for_format(uint32_t fourcc_format) -> mg::DRMFormat::FormatInfo const&
{
auto const info = maybe_info_for_format(fourcc_format);
if (info)
{
return *info;
}
BOOST_THROW_EXCEPTION((
std::runtime_error{
std::string{"Unsupported DRM format: "} + drm_format_to_string(fourcc_format)}));
}
}
mg::DRMFormat::DRMFormat(uint32_t fourcc_format)
: info{&info_for_format(fourcc_format)}
{
}
auto mg::DRMFormat::name() const -> const char*
{
return drm_format_to_string(info->format);
}
auto mg::DRMFormat::opaque_equivalent() const -> const std::optional<DRMFormat>
{
if (info->opaque_equivalent != DRM_FORMAT_INVALID)
{
return DRMFormat{info->opaque_equivalent};
}
return {};
}
auto mg::DRMFormat::alpha_equivalent() const -> const std::optional<DRMFormat>
{
if (info->alpha_equivalent != DRM_FORMAT_INVALID)
{
return DRMFormat{info->alpha_equivalent};
}
return {};
}
bool mg::DRMFormat::has_alpha() const
{
return info->has_alpha;
}
auto mg::DRMFormat::components() const -> std::optional<RGBComponentInfo> const&
{
return info->components;
}
mg::DRMFormat::operator uint32_t() const
{
return info->format;
}
auto mg::DRMFormat::as_mir_format() const -> std::optional<MirPixelFormat>
{
switch (info->format)
{
case DRM_FORMAT_ARGB8888:
return mir_pixel_format_argb_8888;
case DRM_FORMAT_XRGB8888:
return mir_pixel_format_xrgb_8888;
case DRM_FORMAT_RGBA4444:
return mir_pixel_format_rgba_4444;
case DRM_FORMAT_RGBA5551:
return mir_pixel_format_rgba_5551;
case DRM_FORMAT_RGB565:
return mir_pixel_format_rgb_565;
case DRM_FORMAT_RGB888:
return mir_pixel_format_rgb_888;
case DRM_FORMAT_BGR888:
return mir_pixel_format_bgr_888;
case DRM_FORMAT_XBGR8888:
return mir_pixel_format_xbgr_8888;
case DRM_FORMAT_ABGR8888:
return mir_pixel_format_abgr_8888;
default:
return std::nullopt;
}
}
auto mg::DRMFormat::from_mir_format(MirPixelFormat format)
-> DRMFormat
{
switch (format)
{
case mir_pixel_format_argb_8888:
return DRMFormat{DRM_FORMAT_ARGB8888};
case mir_pixel_format_xrgb_8888:
return DRMFormat{DRM_FORMAT_XRGB8888};
case mir_pixel_format_abgr_8888:
return DRMFormat{DRM_FORMAT_ABGR8888};
case mir_pixel_format_xbgr_8888:
return DRMFormat{DRM_FORMAT_XBGR8888};
case mir_pixel_format_bgr_888:
return DRMFormat{DRM_FORMAT_BGR888};
case mir_pixel_format_rgb_888:
return DRMFormat{DRM_FORMAT_RGB888};
case mir_pixel_format_rgb_565:
return DRMFormat{DRM_FORMAT_RGB565};
case mir_pixel_format_rgba_5551:
return DRMFormat{DRM_FORMAT_RGBA5551};
case mir_pixel_format_rgba_4444:
return DRMFormat{DRM_FORMAT_RGBA4444};
case mir_pixel_format_invalid:
/* We *could* do something with DRM_FORMAT_INVALID here, but
* let's not. Let's maintain that DRMFormat is always valid
*/
BOOST_THROW_EXCEPTION((std::runtime_error{"Attempt to look up DRM format info of invalid pixel format"}));
case mir_pixel_formats:
BOOST_THROW_EXCEPTION((std::logic_error{"Attempt to look up format info of sentinel pixel format"}));
#ifndef __clang__
/* Clang accepts that the above cases are exhaustive, gcc does not
* Have a default clause here to pacify gcc, but omit it for clang
* so that we fail to build if the above is *not* exhaustive.
*/
default:
BOOST_THROW_EXCEPTION((std::logic_error{"Exhaustive switch needs updating"}));
#endif
}
}
auto mg::drm_modifier_to_string(uint64_t modifier) -> std::string
{
#ifdef MIR_HAVE_DRM_GET_MODIFIER_NAME
struct CStrDeleter
{
public:
void operator()(char* c_str)
{
if (c_str)
{
free (c_str);
}
}
};
auto const vendor =
[&]() -> std::string
{
std::unique_ptr<char[], CStrDeleter> vendor{drmGetFormatModifierVendor(modifier)};
if (vendor)
{
return vendor.get();
}
return "(UNKNOWN VENDOR)";
}();
auto const name =
[&]() -> std::string
{
std::unique_ptr<char[], CStrDeleter> name{drmGetFormatModifierName(modifier)};
if (name)
{
return name.get();
}
return "(UNKNOWN MODIFIER)";
}();
return vendor + ":" + name;
}
#else
#define STRINGIFY(val) \
case val: \
return #val;
switch (modifier)
{
#ifdef DRM_FORMAT_MOD_INVALID
STRINGIFY(DRM_FORMAT_MOD_INVALID)
#endif
#ifdef DRM_FORMAT_MOD_LINEAR
STRINGIFY(DRM_FORMAT_MOD_LINEAR)
#endif
#ifdef I915_FORMAT_MOD_X_TILED
STRINGIFY(I915_FORMAT_MOD_X_TILED)
#endif
#ifdef I915_FORMAT_MOD_Y_TILED
STRINGIFY(I915_FORMAT_MOD_Y_TILED)
#endif
#ifdef I915_FORMAT_MOD_Yf_TILED
STRINGIFY(I915_FORMAT_MOD_Yf_TILED)
#endif
#ifdef I915_FORMAT_MOD_Y_TILED_CCS
STRINGIFY(I915_FORMAT_MOD_Y_TILED_CCS)
#endif
#ifdef I915_FORMAT_MOD_Yf_TILED_CCS
STRINGIFY(I915_FORMAT_MOD_Yf_TILED_CCS)
#endif
#ifdef I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS
STRINGIFY(I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS)
#endif
#ifdef I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS
STRINGIFY(I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS)
#endif
#ifdef DRM_FORMAT_MOD_SAMSUNG_64_32_TILE
STRINGIFY(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE)
#endif
#ifdef DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
STRINGIFY(DRM_FORMAT_MOD_SAMSUNG_16_16_TILE)
#endif
#ifdef DRM_FORMAT_MOD_QCOM_COMPRESSED
STRINGIFY(DRM_FORMAT_MOD_QCOM_COMPRESSED)
#endif
#ifdef DRM_FORMAT_MOD_VIVANTE_TILED
STRINGIFY(DRM_FORMAT_MOD_VIVANTE_TILED)
#endif
#ifdef DRM_FORMAT_MOD_VIVANTE_SUPER_TILED
STRINGIFY(DRM_FORMAT_MOD_VIVANTE_SUPER_TILED)
#endif
#ifdef DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED
STRINGIFY(DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED)
#endif
#ifdef DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED
STRINGIFY(DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED)
#endif
#ifdef DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED
STRINGIFY(DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED)
#endif
#ifdef DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB
STRINGIFY(DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB)
#endif
#ifdef DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB
STRINGIFY(DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB)
#endif
#ifdef DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB
STRINGIFY(DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB)
#endif
#ifdef DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB
STRINGIFY(DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB)
#endif
#ifdef DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB
STRINGIFY(DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB)
#endif
#ifdef DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB
STRINGIFY(DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB)
#endif
#ifdef DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED
STRINGIFY(DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED)
#endif
#ifdef DRM_FORMAT_MOD_BROADCOM_SAND32
STRINGIFY(DRM_FORMAT_MOD_BROADCOM_SAND32)
#endif
#ifdef DRM_FORMAT_MOD_BROADCOM_SAND64
STRINGIFY(DRM_FORMAT_MOD_BROADCOM_SAND64)
#endif
#ifdef DRM_FORMAT_MOD_BROADCOM_SAND128
STRINGIFY(DRM_FORMAT_MOD_BROADCOM_SAND128)
#endif
#ifdef DRM_FORMAT_MOD_BROADCOM_SAND256
STRINGIFY(DRM_FORMAT_MOD_BROADCOM_SAND256)
#endif
#ifdef DRM_FORMAT_MOD_BROADCOM_UIF
STRINGIFY(DRM_FORMAT_MOD_BROADCOM_UIF)
#endif
#ifdef DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED
STRINGIFY(DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED)
#endif
#ifdef DRM_FORMAT_MOD_ALLWINNER_TILED
STRINGIFY(DRM_FORMAT_MOD_ALLWINNER_TILED)
#endif
default:
return "(unknown)";
}
#undef STRINGIFY
}
#endif