History

drm/fourcc: Add macros to determine the modifier vendor

When working with framebuffer modifiers, it can be useful to extract the vendor identifier or check a modifier against a given vendor identifier. Add one macro that extracts the vendor identifier and a helper to check a modifier against a given vendor identifier.

Thierry Reding committed 5 years ago

Commit 32a4eb01 parent 7b812171 file · +6 −0Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/drm/drm_fourcc.h+6−0
@@ -373,6 +373,12 @@ extern "C" { · 372 unmodified lines
373373
374374 #define DRM_FORMAT_RESERVED ((1ULL << 56) - 1)
375375
376+#define fourcc_mod_get_vendor(modifier) \
377+ (((modifier) >> 56) & 0xff)
378+
379+#define fourcc_mod_is_vendor(modifier, vendor) \
380+ (fourcc_mod_get_vendor(modifier) == DRM_FORMAT_MOD_VENDOR_## vendor)
381+
376382 #define fourcc_mod_code(vendor, val) \
377383 ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
378384

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t