logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

fourcc.lua (1222B)


  1. io.write[[
  2. /* AUTOMATICALLY GENERATED by fourcc.lua. You should modify
  3. that script instead of adding here entries manually! */
  4. static const struct drmFormatModifierInfo drm_format_modifier_table[] = {
  5. { DRM_MODIFIER_INVALID(NONE, INVALID) },
  6. { DRM_MODIFIER_LINEAR(NONE, LINEAR) },
  7. ]]
  8. local vendors = {
  9. ARM=true,
  10. SAMSUNG=true,
  11. QCOM=true,
  12. VIVANTE=true,
  13. NVIDIA=true,
  14. BROADCOM=true,
  15. ALLWINNER=true,
  16. }
  17. for line in io.lines() do
  18. local mod = line:match('^#define I915_FORMAT_MOD_([%w_]+)')
  19. if mod then
  20. io.write(string.format(' { DRM_MODIFIER_INTEL(%s, %s) },\n', mod, mod))
  21. end
  22. local vendor, mod = line:match('^#define DRM_FORMAT_MOD_(%w+)_([%w_]+)%s')
  23. if vendors[vendor] then
  24. if vendor ~= 'ARM' or not mod:match('^TYPE_') then
  25. io.write(string.format(' { DRM_MODIFIER(%s, %s, %s) },\n', vendor, mod, mod))
  26. end
  27. end
  28. local vendor = line:match('^#define DRM_FORMAT_MOD_VENDOR_([%w_]+)')
  29. if vendor then
  30. table.insert(vendors, vendor)
  31. end
  32. end
  33. io.write[[
  34. };
  35. static const struct drmFormatModifierVendorInfo drm_format_modifier_vendor_table[] = {
  36. ]]
  37. for _, vendor in ipairs(vendors) do
  38. io.write(string.format(' { DRM_FORMAT_MOD_VENDOR_%s, "%s" },\n', vendor, vendor))
  39. end
  40. io.write[[
  41. };
  42. ]]