Updated blob layout (Rob, Daniel, Kristian, xerpi) v2: * Removed __packed, and alignment (.+) * Fix indent in drm_format_modifier fields (Liviu) * Remove duplicated modifier > 64 check (Liviu) * Change comment about modifier (Liviu) * Remove arguments to blob creation, use plane instead (Liviu) * Fix data types (Ben) * Make the blob part of uapi (Daniel) v3: Remove unused ret field. Change i, and j to unsigned int (Emil) v4: Use plane->modifier_count instead of recounting (Daniel) v5: Rename modifiers to modifiers_property (Ville) Use sizeof(__u32) instead to reflect UAPI nature (Ville) Make BUILD_BUG_ON for blob header size
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -712,6 +712,56 @@ struct drm_mode_atomic { · 711 unmodified lines | |||
| 712 | __u64 user_data; | 712 | __u64 user_data; |
| 713 | }; | 713 | }; |
| 714 | 714 | ||
| 715 | struct drm_format_modifier_blob { | ||
| 716 | #define FORMAT_BLOB_CURRENT 1 | ||
| 717 | /* Version of this blob format */ | ||
| 718 | u32 version; | ||
| 719 | |||
| 720 | /* Flags */ | ||
| 721 | u32 flags; | ||
| 722 | |||
| 723 | /* Number of fourcc formats supported */ | ||
| 724 | u32 count_formats; | ||
| 725 | |||
| 726 | /* Where in this blob the formats exist (in bytes) */ | ||
| 727 | u32 formats_offset; | ||
| 728 | |||
| 729 | /* Number of drm_format_modifiers */ | ||
| 730 | u32 count_modifiers; | ||
| 731 | |||
| 732 | /* Where in this blob the modifiers exist (in bytes) */ | ||
| 733 | u32 modifiers_offset; | ||
| 734 | |||
| 735 | /* u32 formats[] */ | ||
| 736 | /* struct drm_format_modifier modifiers[] */ | ||
| 737 | }; | ||
| 738 | |||
| 739 | struct drm_format_modifier { | ||
| 740 | /* Bitmask of formats in get_plane format list this info applies to. The | ||
| 741 | * offset allows a sliding window of which 64 formats (bits). | ||
| 742 | * | ||
| 743 | * Some examples: | ||
| 744 | * In today's world with < 65 formats, and formats 0, and 2 are | ||
| 745 | * supported | ||
| 746 | * 0x0000000000000005 | ||
| 747 | * ^-offset = 0, formats = 5 | ||
| 748 | * | ||
| 749 | * If the number formats grew to 128, and formats 98-102 are | ||
| 750 | * supported with the modifier: | ||
| 751 | * | ||
| 752 | * 0x0000003c00000000 0000000000000000 | ||
| 753 | * ^ | ||
| 754 | * |__offset = 64, formats = 0x3c00000000 | ||
| 755 | * | ||
| 756 | */ | ||
| 757 | __u64 formats; | ||
| 758 | __u32 offset; | ||
| 759 | __u32 pad; | ||
| 760 | |||
| 761 | /* The modifier that applies to the >get_plane format list bitmask. */ | ||
| 762 | __u64 modifier; | ||
| 763 | }; | ||
| 764 | |||
| 715 | /** | 765 | /** |
| 716 | * Create a new 'blob' data property, copying length bytes from data pointer, | 766 | * Create a new 'blob' data property, copying length bytes from data pointer, |
| 717 | * and returning new blob ID. | 767 | * and returning new blob ID. |