Closed soreau closed 5 years ago
If we auto-generate code for formats, we should probably do the same for modifiers too.
For reference, here's a similar Python script that generates Go: https://git.sr.ht/~emersion/go-drm/tree/master/fourcc.py
Here we don't need the #define
values so it's not necessary to go as far as compiling and running a C executable to get them. Also the pkg-config
stuff can be taken from Meson (as you do currently).
For reference, here's a similar Python script that generates Go: https://git.sr.ht/~emersion/go-drm/tree/master/fourcc.py
This was a huge help, thanks.
If we auto-generate code for formats, we should probably do the same for modifiers too.
Done.
I'd accept something which is written in Python 3
Done.
@ascent12 I think I've addressed all your concerns, let me know if there's anything else.
The build bot doesn't seem to be able to import python module but it builds fine here.
@emersion Thanks for the review.
I found that '^#define (DRM_FORMAT_MOD_BROADCOM\w+(?=\s))'
is more correct and doesn't require stripping the result.
Thanks
This eliminates the need to maintain a list of formats used for converting from fourcc codes to the prettier version by parsing drm_fourcc.h directly and building a header for use in pretty.c