Skip to content

Commit 8c6c761

Browse files
Finomniscfriedt
authored andcommitted
display: add PIXEL_FORMAT_AL_88
When rendering an overlay on top of something like a video stream on a monochrome display, the only way to achieve this right now is by using ARGB8888 and discarding two of the colors, which is not ideal. This introduces the new AL_88 pixel format, which is much more efficient for this usecase. This change is somewhat inspired by LVGL, which also supports AL_88 natively. Signed-off-by: Martin Stumpf <[email protected]>
1 parent 1ffea47 commit 8c6c761

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

doc/releases/release-notes-4.3.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ New APIs and options
8585

8686
* :c:struct:`bt_audio_codec_cfg` now contains a target_latency and a target_phy option
8787

88+
* Display
89+
90+
* Added new pixel format :c:enum:`PIXEL_FORMAT_AL_88`
91+
8892
* Logging:
8993

9094
* Added rate-limited logging macros to prevent log flooding when messages are generated frequently.

include/zephyr/drivers/display.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ enum display_pixel_format {
6868
PIXEL_FORMAT_BGR_565 = BIT(5),
6969
PIXEL_FORMAT_L_8 = BIT(6), /**< 8-bit Grayscale/Luminance, equivalent to */
7070
/**< GRAY, GREY, GRAY8, Y8, R8, etc... */
71+
PIXEL_FORMAT_AL_88 = BIT(7), /**< 8-bit Grayscale/Luminance with alpha */
7172
};
7273

7374
/**
@@ -84,7 +85,8 @@ enum display_pixel_format {
8485
(((fmt & PIXEL_FORMAT_ARGB_8888) >> 3) * 32U) + \
8586
(((fmt & PIXEL_FORMAT_RGB_565) >> 4) * 16U) + \
8687
(((fmt & PIXEL_FORMAT_BGR_565) >> 5) * 16U) + \
87-
(((fmt & PIXEL_FORMAT_L_8) >> 6) * 8U))
88+
(((fmt & PIXEL_FORMAT_L_8) >> 6) * 8U) + \
89+
(((fmt & PIXEL_FORMAT_AL_88) >> 7) * 16U))
8890

8991
/**
9092
* @brief Display screen information

include/zephyr/dt-bindings/display/panel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define PANEL_PIXEL_FORMAT_RGB_565 (0x1 << 4)
3131
#define PANEL_PIXEL_FORMAT_BGR_565 (0x1 << 5)
3232
#define PANEL_PIXEL_FORMAT_L_8 (0x1 << 6)
33+
#define PANEL_PIXEL_FORMAT_AL_88 (0x1 << 7)
3334

3435
/**
3536
* @}

0 commit comments

Comments
 (0)