Merge "Remove [email protected] from OWNERS" into main am: 9c0ffb607e am: 4f331411c9

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/drm-fourcc/+/3190972

Change-Id: I25b7e4d7ced9fe96ddd8bb16a178c55ed9b678a7
Signed-off-by: Automerger Merge Worker <[email protected]>
tree: 344e2ff0690c4b39db3c32b2629013dffb51e696
  1. .idea/
  2. patches/
  3. src/
  4. .cargo_vcs_info.json
  5. .gitignore
  6. Android.bp
  7. build.rs
  8. Cargo.toml
  9. Cargo.toml.orig
  10. cargo_embargo.json
  11. LICENSE
  12. METADATA
  13. MODULE_LICENSE_MIT
  14. OWNERS
  15. README.md
README.md

drm-fourcc

Crates.io MIT Licensed

Provides an enums representing every pixel format and format modifier supported by DRM (as of kernel version 5.10.0).

A fourcc is four bytes of ascii representing some data format. This enum contains every fourcc representing a pixel format supported by DRM, the Linux Direct Rendering Manager.

To get the bytes of the fourcc representing the format, cast to u32.

assert_eq!(DrmFourcc::Xrgb8888 as u32, 875713112);

To get the string form of the fourcc, use [DrmFourcc::string_form].

assert_eq!(DrmFourcc::Xrgb8888.string_form(), "XR24");

We also provide a type for representing a fourcc/modifier pair

let format = DrmFormat {
    code: DrmFourcc::Xrgb8888,
    modifier: DrmModifier::Linear,
};

The enums are autogenerated from the canonical list in the Linux source code.

Features

  • std: Enable functionality that requires the standard library. Enabled by default
  • build_bindings: Build the bindings based on the headers on your machine. Should not be necessary in most cases.

Contributors