dzfranklin / drm-fourcc-rs Goto Github PK
View Code? Open in Web Editor NEWProvides an enum with every valid Direct Rendering Manager (DRM) format fourcc
License: MIT License
Provides an enum with every valid Direct Rendering Manager (DRM) format fourcc
License: MIT License
I noticed that Debug and Display will output the same thing. For example if I create a DrmFourcc::Argb8888
, the Debug and Display implementations both return AR24
. It might be useful if Debug could return Argb8888
instead.
Thanks for this!
Citing the drm_fourcc.h inline comments:
In addition to the
fourcc code, a Format Modifier may optionally be provided, in order to
further describe the buffer's format - for example tiling or compression.
Could this crate also expose the DRM_FORMAT_MOD
constants in a separate enum?
To be specific:
pub const DRM_FOURCC_I915_Yf_TILED: u64 = 72057594037927939;
pub const DRM_FOURCC_I915_Yf_TILED_CCS: u64 = 72057594037927941;
I tried regenerating the bindings locally but that didn't change anything. They are defined at https://github.com/torvalds/linux/blob/d615b5416f8a1afeb82d13b238f8152c572d59c0/include/uapi/drm/drm_fourcc.h#L497-L530
Steps to reproduce:
println!("{:?}", DrmFourcc::R8);
It appears that the representation of this format is 0x20203852
, which translates to ['R', '8', ' ', ' ']
, while the fourcc_string_form
function expects the 3 first bytes to be alphanumeric, which is not the case here.
The assumed header location in the buildscript does not work on Arch Linux.
pkg-config should be used to find the header instead.
This library is quite useful for low-level interaction with other system components or for embedded image interchange. In those cases, including and depending on all of Rust's std
is quite heavy. It also isn't really integral to any use case addressed here.
The only current interface (unless I've overlooked any) is DrmFourcc::string_form
. However, it's not necessary at all as Display
can be written without an allocated container such as String
—making string_form
redundant because it would then be a call to the standard to_string
for those callers that desire it.
I'd be willing to provide a PR if desired, this will be a breaking change to 3.0
though.
The generator code is extremely messy and needs to be refactored
Like DRM_FORMAT_BGRX8888_A8
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.