diff options
| author | Michael Forney <mforney@mforney.org> | 2024-02-08 22:49:01 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2024-02-08 22:49:01 -0800 |
| commit | bc9548d3a2251dcff4a5834ed40e0fa1763652bd (patch) | |
| tree | 13a1e15a31fcdfd93564eff50a145c3069134410 /pkg/libdrm/fourcc.lua | |
| parent | 59de97e9412dab937702d9d9d1f91fa6c6fcb562 (diff) | |
libdrm: Update to 2.4.120
Diffstat (limited to 'pkg/libdrm/fourcc.lua')
| -rw-r--r-- | pkg/libdrm/fourcc.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pkg/libdrm/fourcc.lua b/pkg/libdrm/fourcc.lua new file mode 100644 index 00000000..0a0deaaa --- /dev/null +++ b/pkg/libdrm/fourcc.lua @@ -0,0 +1,44 @@ +io.write[[ +/* AUTOMATICALLY GENERATED by fourcc.lua. You should modify + that script instead of adding here entries manually! */ +static const struct drmFormatModifierInfo drm_format_modifier_table[] = { + { DRM_MODIFIER_INVALID(NONE, INVALID) }, + { DRM_MODIFIER_LINEAR(NONE, LINEAR) }, +]] + +local vendors = { + ARM=true, + SAMSUNG=true, + QCOM=true, + VIVANTE=true, + NVIDIA=true, + BROADCOM=true, + ALLWINNER=true, +} +for line in io.lines() do + local mod = line:match('^#define I915_FORMAT_MOD_([%w_]+)') + if mod then + io.write(string.format(' { DRM_MODIFIER_INTEL(%s, %s) },\n', mod, mod)) + end + local vendor, mod = line:match('^#define DRM_FORMAT_MOD_(%w+)_([%w_]+)%s') + if vendors[vendor] then + if vendor ~= 'ARM' or not mod:match('^TYPE_') then + io.write(string.format(' { DRM_MODIFIER(%s, %s, %s) },\n', vendor, mod, mod)) + end + end + local vendor = line:match('^#define DRM_FORMAT_MOD_VENDOR_([%w_]+)') + if vendor then + table.insert(vendors, vendor) + end +end + +io.write[[ +}; +static const struct drmFormatModifierVendorInfo drm_format_modifier_vendor_table[] = { +]] +for _, vendor in ipairs(vendors) do + io.write(string.format(' { DRM_FORMAT_MOD_VENDOR_%s, "%s" },\n', vendor, vendor)) +end +io.write[[ +}; +]] |
