|
10 | 10 | # Copyright (C) 2006 Nokia Corporation |
11 | 11 | # Author: Imre Deak <[email protected]> |
12 | 12 | # |
| 13 | +# Some code adapted from: |
| 14 | +# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/drm_mipi_dsi.c |
| 15 | +# |
| 16 | +# Copyright (C) 2012-2013, Samsung Electronics, Co., Ltd. |
| 17 | +# Andrzej Hajda <[email protected]> |
| 18 | +# |
13 | 19 | from __future__ import annotations |
14 | 20 |
|
15 | 21 | from enum import IntEnum, unique, Enum |
@@ -296,5 +302,27 @@ def identifier(self): |
296 | 302 | def description(self): |
297 | 303 | return self.name.lower().replace('_', ' ') |
298 | 304 |
|
| 305 | + @property |
| 306 | + def is_long(self): |
| 307 | + # From mipi_dsi_packet_format_is_long() |
| 308 | + return self in [ |
| 309 | + Transaction.NULL_PACKET, |
| 310 | + Transaction.BLANKING_PACKET, |
| 311 | + Transaction.GENERIC_LONG_WRITE, |
| 312 | + Transaction.DCS_LONG_WRITE, |
| 313 | + Transaction.PICTURE_PARAMETER_SET, |
| 314 | + Transaction.COMPRESSED_PIXEL_STREAM, |
| 315 | + Transaction.LOOSELY_PACKED_PIXEL_STREAM_YCBCR20, |
| 316 | + Transaction.PACKED_PIXEL_STREAM_YCBCR24, |
| 317 | + Transaction.PACKED_PIXEL_STREAM_YCBCR16, |
| 318 | + Transaction.PACKED_PIXEL_STREAM_30, |
| 319 | + Transaction.PACKED_PIXEL_STREAM_36, |
| 320 | + Transaction.PACKED_PIXEL_STREAM_YCBCR12, |
| 321 | + Transaction.PACKED_PIXEL_STREAM_16, |
| 322 | + Transaction.PACKED_PIXEL_STREAM_18, |
| 323 | + Transaction.PIXEL_STREAM_3BYTE_18, |
| 324 | + Transaction.PACKED_PIXEL_STREAM_24, |
| 325 | + ] |
| 326 | + |
299 | 327 | def generate(self, payload: bytes, options: Options) -> str: |
300 | 328 | return self._generate(self, payload, options) |
0 commit comments