From 18dd847ec7c8a4aa72d2cc2d595dd7161a7d6102 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Mon, 15 Apr 2024 23:01:24 +0200 Subject: [PATCH] Emit MIPI DSI Picture Parameter Set command --- mipi.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mipi.py b/mipi.py index a4a63d1..7a67b80 100644 --- a/mipi.py +++ b/mipi.py @@ -224,6 +224,14 @@ def _generate_compression_mode(t: Transaction, payload: bytes, options: Options) 'set compression mode') +def _generate_picture_parameter_set(t: Transaction, payload: bytes, options: Options) -> str: + text = f'\t// TODO: Autogenerate `struct drm_dsc_picture_parameter_set` via `drm_dsc_pps_payload_pack()`\n' + text += wrap.join(f'\tconst u8 pps[{hex(len(payload))}] = {{', ',', '};\n', _get_params_hex(payload), force=0) + + return text + _generate_checked_call('mipi_dsi_picture_parameter_set', ['dsi', '(const struct drm_dsc_picture_parameter_set *)pps'], + 'picture parameter set') + + def _generate_ignore(t: Transaction, payload: bytes, options: Options) -> str: print(f"WARNING: Ignoring weird {t.name}") return f"\t// WARNING: Ignoring weird {t.name}" @@ -270,7 +278,7 @@ class Transaction(Enum): GENERIC_LONG_WRITE = 0x29, -1, _generate_generic_write DCS_LONG_WRITE = 0x39, -1, _generate_dcs_write - PICTURE_PARAMETER_SET = 0x0a, + PICTURE_PARAMETER_SET = 0x0a, -1, _generate_picture_parameter_set COMPRESSED_PIXEL_STREAM = 0x0b, LOOSELY_PACKED_PIXEL_STREAM_YCBCR20 = 0x0c,