diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-01-31 20:37:21 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-02-01 22:33:55 +0200 |
commit | 7c496f1c54dd5846925183471b30fec227624a65 (patch) | |
tree | adf3e062b403da3a93a575c9ad3ed4ff6347d52a | |
parent | 78f49d5e348814ae8d7c6bd0c2686112f790ca88 (diff) |
utils: gen-formats: Support big-endian DRM formats
DRM 4CCs are defined in little-endian, and can be declined in a
big-endian version by setting bit 31 (DRM_FORMAT_BIG_ENDIAN) in the 4CC
value.
Add support for such formats in the gen-formats.py script.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rwxr-xr-x | utils/gen-formats.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/gen-formats.py b/utils/gen-formats.py index 60dcecc3..da79a8bb 100755 --- a/utils/gen-formats.py +++ b/utils/gen-formats.py @@ -59,10 +59,13 @@ def generate_h(formats, drm_fourcc): for format in formats: name, format = format.popitem() + fourcc = drm_fourcc.fourcc(format['fourcc']) + if format.get('big-endian'): + fourcc += '| DRM_FORMAT_BIG_ENDIAN' data = { 'name': name, - 'fourcc': drm_fourcc.fourcc(format['fourcc']), + 'fourcc': fourcc, 'mod': '0, 0', } |