[QP] Minor cleanup and support for RGB888 surface (#25706)

Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
Pablo Martínez 2025-10-08 04:10:38 +02:00 committed by GitHub
parent 8f86f9794e
commit 0550830909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 194 additions and 53 deletions

View file

@ -534,6 +534,8 @@ QUANTUM_PAINTER_DRIVERS += surface
Creating a surface in firmware can then be done with the following APIs:
```c
// 24bpp RGB888 surface:
painter_device_t qp_make_rgb888_surface(uint16_t panel_width, uint16_t panel_height, void *buffer);
// 16bpp RGB565 surface:
painter_device_t qp_make_rgb565_surface(uint16_t panel_width, uint16_t panel_height, void *buffer);
// 1bpp monochrome surface:

View file

@ -36,7 +36,7 @@ uint32_t qp_comms_spi_send_data(painter_device_t device, const void *data, uint3
const uint32_t max_msg_length = 1024;
while (bytes_remaining > 0) {
uint32_t bytes_this_loop = QP_MIN(bytes_remaining, max_msg_length);
uint32_t bytes_this_loop = MIN(bytes_remaining, max_msg_length);
spi_transmit(p, bytes_this_loop);
p += bytes_this_loop;
bytes_remaining -= bytes_this_loop;

View file

@ -50,6 +50,16 @@ painter_device_t qp_make_rgb565_surface(uint16_t panel_width, uint16_t panel_hei
*/
painter_device_t qp_make_mono1bpp_surface(uint16_t panel_width, uint16_t panel_height, void *buffer);
/**
* Factory method for an RGB888 surface (aka framebuffer).
*
* @param panel_width[in] the width of the display panel
* @param panel_height[in] the height of the display panel
* @param buffer[in] pointer to a preallocated uint8_t buffer of size `SURFACE_REQUIRED_BUFFER_BYTE_SIZE(panel_width, panel_height, 16)`
* @return the device handle used with all drawing routines in Quantum Painter
*/
painter_device_t qp_make_rgb888_surface(uint16_t panel_width, uint16_t panel_height, void *buffer);
/**
* Helper method to draw the contents of the framebuffer to the target device.
*

View file

@ -45,6 +45,7 @@ typedef struct surface_painter_device_t {
void * buffer;
uint8_t * u8buffer;
uint16_t *u16buffer;
rgb_t * rgbbuffer;
};
// Manually manage the viewport for streaming pixel data to the display

View file

@ -52,7 +52,7 @@ static bool qp_surface_pixdata_rgb565(painter_device_t device, const void *pixel
// Pixel colour conversion
static bool qp_surface_palette_convert_rgb565_swapped(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) {
for (int16_t i = 0; i < palette_size; ++i) {
rgb_t rgb = hsv_to_rgb_nocie((hsv_t){palette[i].hsv888.h, palette[i].hsv888.s, palette[i].hsv888.v});
rgb_t rgb = hsv_to_rgb_nocie(palette[i].hsv888);
uint16_t rgb565 = (((uint16_t)rgb.r) >> 3) << 11 | (((uint16_t)rgb.g) >> 2) << 5 | (((uint16_t)rgb.b) >> 3);
palette[i].rgb565 = __builtin_bswap16(rgb565);
}

View file

@ -0,0 +1,143 @@
// Copyright 2022 Nick Brassel (@tzarc)
// SPDX-License-Identifier: GPL-2.0-or-later
#ifdef QUANTUM_PAINTER_SURFACE_ENABLE
# include "color.h"
# include "qp_draw.h"
# include "qp_surface_internal.h"
# include "qp_comms_dummy.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Surface driver impl: rgb888
static inline void setpixel_rgb888(surface_painter_device_t *surface, uint16_t x, uint16_t y, rgb_t rgb888) {
uint16_t w = surface->base.panel_width;
uint16_t h = surface->base.panel_height;
// Drop out if it's off-screen
if (x >= w || y >= h) {
return;
}
// Skip messing with the dirty info if the original value already matches
if (memcmp(&surface->rgbbuffer[y * w + x], &rgb888, sizeof(rgb_t)) != 0) {
// Update the dirty region
qp_surface_update_dirty(&surface->dirty, x, y);
// Update the pixel data in the buffer
surface->rgbbuffer[y * w + x] = rgb888;
}
}
static inline void append_pixel_rgb888(surface_painter_device_t *surface, rgb_t rgb888) {
setpixel_rgb888(surface, surface->viewport.pixdata_x, surface->viewport.pixdata_y, rgb888);
qp_surface_increment_pixdata_location(&surface->viewport);
}
static inline void stream_pixdata_rgb888(surface_painter_device_t *surface, const rgb_t *data, uint32_t native_pixel_count) {
for (uint32_t pixel_counter = 0; pixel_counter < native_pixel_count; ++pixel_counter) {
append_pixel_rgb888(surface, data[pixel_counter]);
}
}
// Stream pixel data to the current write position in GRAM
static bool qp_surface_pixdata_rgb888(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) {
painter_driver_t * driver = (painter_driver_t *)device;
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
stream_pixdata_rgb888(surface, (const rgb_t *)pixel_data, native_pixel_count);
return true;
}
// Pixel colour conversion
static bool qp_surface_palette_convert_rgb888(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) {
for (int16_t i = 0; i < palette_size; ++i) {
palette[i].rgb888 = hsv_to_rgb_nocie(palette[i].hsv888);
}
return true;
}
// Append pixels to the target location, keyed by the pixel index
static bool qp_surface_append_pixels_rgb888(painter_device_t device, uint8_t *target_buffer, qp_pixel_t *palette, uint32_t pixel_offset, uint32_t pixel_count, uint8_t *palette_indices) {
rgb_t *buf = (rgb_t *)target_buffer;
for (uint32_t i = 0; i < pixel_count; ++i) {
buf[pixel_offset + i] = palette[palette_indices[i]].rgb888;
}
return true;
}
static bool rgb888_target_pixdata_transfer(painter_driver_t *surface_driver, painter_driver_t *target_driver, uint16_t x, uint16_t y, bool entire_surface) {
surface_painter_device_t *surface_handle = (surface_painter_device_t *)surface_driver;
uint16_t l = entire_surface ? 0 : surface_handle->dirty.l;
uint16_t t = entire_surface ? 0 : surface_handle->dirty.t;
uint16_t r = entire_surface ? (surface_handle->base.panel_width - 1) : surface_handle->dirty.r;
uint16_t b = entire_surface ? (surface_handle->base.panel_height - 1) : surface_handle->dirty.b;
// Set the target drawing area
bool ok = qp_viewport((painter_device_t)target_driver, x + l, y + t, x + r, y + b);
if (!ok) {
qp_dprintf("rgb888_target_pixdata_transfer: fail (could not set target viewport)\n");
return false;
}
// Housekeeping of the amount of pixels to transfer
uint32_t total_pixel_count = (8 * QUANTUM_PAINTER_PIXDATA_BUFFER_SIZE) / surface_driver->native_bits_per_pixel;
uint32_t pixel_counter = 0;
rgb_t * target_buffer = (rgb_t *)qp_internal_global_pixdata_buffer;
// Fill the global pixdata area so that we can start transferring to the panel
for (uint16_t y = t; y <= b; ++y) {
for (uint16_t x = l; x <= r; ++x) {
// Update the target buffer
target_buffer[pixel_counter++] = surface_handle->rgbbuffer[y * surface_handle->base.panel_width + x];
// If we've accumulated enough data, send it
if (pixel_counter == total_pixel_count) {
ok = qp_pixdata((painter_device_t)target_driver, qp_internal_global_pixdata_buffer, pixel_counter);
if (!ok) {
qp_dprintf("rgb888_target_pixdata_transfer: fail (could not stream pixdata to target)\n");
return false;
}
// Reset the counter
pixel_counter = 0;
}
}
}
// If there's any leftover data, send it
if (pixel_counter > 0) {
ok = qp_pixdata((painter_device_t)target_driver, qp_internal_global_pixdata_buffer, pixel_counter);
if (!ok) {
qp_dprintf("rgb888_target_pixdata_transfer: fail (could not stream pixdata to target)\n");
return false;
}
}
return true;
}
static bool qp_surface_append_pixdata_rgb888(painter_device_t device, uint8_t *target_buffer, uint32_t pixdata_offset, uint8_t pixdata_byte) {
target_buffer[pixdata_offset] = pixdata_byte;
return true;
}
const surface_painter_driver_vtable_t rgb888_surface_driver_vtable = {
.base =
{
.init = qp_surface_init,
.power = qp_surface_power,
.clear = qp_surface_clear,
.flush = qp_surface_flush,
.pixdata = qp_surface_pixdata_rgb888,
.viewport = qp_surface_viewport,
.palette_convert = qp_surface_palette_convert_rgb888,
.append_pixels = qp_surface_append_pixels_rgb888,
.append_pixdata = qp_surface_append_pixdata_rgb888,
},
.target_pixdata_transfer = rgb888_target_pixdata_transfer,
};
SURFACE_FACTORY_FUNCTION_IMPL(qp_make_rgb888_surface, rgb888_surface_driver_vtable, 24);
#endif // QUANTUM_PAINTER_SURFACE_ENABLE

View file

@ -90,7 +90,7 @@ static uint32_t qp_comms_spi_send_data_odd_cs_pulse(painter_device_t device, con
gpio_write_pin_high(comms_config->dc_pin);
while (bytes_remaining > 0) {
uint32_t bytes_this_loop = QP_MIN(bytes_remaining, max_msg_length);
uint32_t bytes_this_loop = MIN(bytes_remaining, max_msg_length);
bool odd_bytes = bytes_this_loop & 1;
// send data

View file

@ -90,7 +90,7 @@ bool qp_tft_panel_pixdata(painter_device_t device, const void *pixel_data, uint3
bool qp_tft_panel_palette_convert_rgb565_swapped(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) {
for (int16_t i = 0; i < palette_size; ++i) {
rgb_t rgb = hsv_to_rgb_nocie((hsv_t){palette[i].hsv888.h, palette[i].hsv888.s, palette[i].hsv888.v});
rgb_t rgb = hsv_to_rgb_nocie(palette[i].hsv888);
uint16_t rgb565 = (((uint16_t)rgb.r) >> 3) << 11 | (((uint16_t)rgb.g) >> 2) << 5 | (((uint16_t)rgb.b) >> 3);
palette[i].rgb565 = __builtin_bswap16(rgb565);
}
@ -99,10 +99,7 @@ bool qp_tft_panel_palette_convert_rgb565_swapped(painter_device_t device, int16_
bool qp_tft_panel_palette_convert_rgb888(painter_device_t device, int16_t palette_size, qp_pixel_t *palette) {
for (int16_t i = 0; i < palette_size; ++i) {
rgb_t rgb = hsv_to_rgb_nocie((hsv_t){palette[i].hsv888.h, palette[i].hsv888.s, palette[i].hsv888.v});
palette[i].rgb888.r = rgb.r;
palette[i].rgb888.g = rgb.g;
palette[i].rgb888.b = rgb.b;
palette[i].rgb888 = hsv_to_rgb_nocie(palette[i].hsv888);
}
return true;
}

View file

@ -22,7 +22,7 @@
#define QFF_FONT_DESCRIPTOR_TYPEID 0x00
typedef struct QP_PACKED qff_font_descriptor_v1_t {
typedef struct PACKED qff_font_descriptor_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x00, .neg_type_id = (~0x00), .length = 20 }
uint32_t magic : 24; // constant, equal to 0x464651 ("QFF")
uint8_t qff_version; // constant, equal to 0x01
@ -51,13 +51,13 @@ STATIC_ASSERT(sizeof(qff_font_descriptor_v1_t) == (sizeof(qgf_block_header_v1_t)
#define QFF_GLYPH_OFFSET_BITS 18
#define QFF_GLYPH_OFFSET_MASK (((1 << QFF_GLYPH_OFFSET_BITS) - 1) << QFF_GLYPH_WIDTH_BITS)
typedef struct QP_PACKED qff_ascii_glyph_v1_t {
typedef struct PACKED qff_ascii_glyph_v1_t {
uint32_t value : 24; // Uses QFF_GLYPH_*_(BITS|MASK) as bitfield ordering is compiler-defined
} qff_ascii_glyph_v1_t;
STATIC_ASSERT(sizeof(qff_ascii_glyph_v1_t) == 3, "qff_ascii_glyph_v1_t must be 3 bytes in v1 of QFF");
typedef struct QP_PACKED qff_ascii_glyph_table_v1_t {
typedef struct PACKED qff_ascii_glyph_table_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x01, .neg_type_id = (~0x01), .length = 285 }
qff_ascii_glyph_v1_t glyph[95]; // 95 glyphs, 0x20..0x7E
} qff_ascii_glyph_table_v1_t;
@ -69,14 +69,14 @@ STATIC_ASSERT(sizeof(qff_ascii_glyph_table_v1_t) == (sizeof(qgf_block_header_v1_
#define QFF_UNICODE_GLYPH_DESCRIPTOR_TYPEID 0x02
typedef struct QP_PACKED qff_unicode_glyph_v1_t {
typedef struct PACKED qff_unicode_glyph_v1_t {
uint32_t code_point : 24;
uint32_t value : 24; // Uses QFF_GLYPH_*_(BITS|MASK) as bitfield ordering is compiler-defined
} qff_unicode_glyph_v1_t;
STATIC_ASSERT(sizeof(qff_unicode_glyph_v1_t) == 6, "qff_unicode_glyph_v1_t must be 6 bytes in v1 of QFF");
typedef struct QP_PACKED qff_unicode_glyph_table_v1_t {
typedef struct PACKED qff_unicode_glyph_table_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x02, .neg_type_id = (~0x02), .length = (N * 6) }
qff_unicode_glyph_v1_t glyph[0]; // Extent of '0' signifies that this struct is immediately followed by the glyph data
} qff_unicode_glyph_table_v1_t;

View file

@ -26,7 +26,7 @@ bool qgf_validate_block_header(qgf_block_header_v1_t *desc, uint8_t expected_typ
bool qgf_parse_format(qp_image_format_t format, uint8_t *bpp, bool *has_palette, bool *is_panel_native) {
// clang-format off
static const struct QP_PACKED {
static const struct PACKED {
uint8_t bpp;
bool has_palette;
bool is_panel_native;

View file

@ -19,7 +19,7 @@
/////////////////////////////////////////
// Common block header
typedef struct QP_PACKED qgf_block_header_v1_t {
typedef struct PACKED qgf_block_header_v1_t {
uint8_t type_id; // See each respective block type below.
uint8_t neg_type_id; // Negated type ID, used for detecting parsing errors.
uint32_t length : 24; // 24-bit blob length, allowing for block sizes of a maximum of 16MB.
@ -32,7 +32,7 @@ STATIC_ASSERT(sizeof(qgf_block_header_v1_t) == 5, "qgf_block_header_v1_t must be
#define QGF_GRAPHICS_DESCRIPTOR_TYPEID 0x00
typedef struct QP_PACKED qgf_graphics_descriptor_v1_t {
typedef struct PACKED qgf_graphics_descriptor_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x00, .neg_type_id = (~0x00), .length = 18 }
uint32_t magic : 24; // constant, equal to 0x464751 ("QGF")
uint8_t qgf_version; // constant, equal to 0x01
@ -52,7 +52,7 @@ STATIC_ASSERT(sizeof(qgf_graphics_descriptor_v1_t) == (sizeof(qgf_block_header_v
#define QGF_FRAME_OFFSET_DESCRIPTOR_TYPEID 0x01
typedef struct QP_PACKED qgf_frame_offsets_v1_t {
typedef struct PACKED qgf_frame_offsets_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x01, .neg_type_id = (~0x01), .length = (N * sizeof(uint32_t)) }
uint32_t offset[0]; // '0' signifies that this struct is immediately followed by the frame offsets
} qgf_frame_offsets_v1_t;
@ -64,7 +64,7 @@ STATIC_ASSERT(sizeof(qgf_frame_offsets_v1_t) == sizeof(qgf_block_header_v1_t), "
#define QGF_FRAME_DESCRIPTOR_TYPEID 0x02
typedef struct QP_PACKED qgf_frame_v1_t {
typedef struct PACKED qgf_frame_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x02, .neg_type_id = (~0x02), .length = 6 }
qp_image_format_t format : 8; // Frame format, see qp_internal_formats.h.
uint8_t flags; // Frame flags, see below.
@ -83,7 +83,7 @@ STATIC_ASSERT(sizeof(qgf_frame_v1_t) == (sizeof(qgf_block_header_v1_t) + 6), "qg
#define QGF_FRAME_PALETTE_DESCRIPTOR_TYPEID 0x03
typedef struct QP_PACKED qgf_palette_entry_v1_t {
typedef struct PACKED qgf_palette_entry_v1_t {
uint8_t h; // hue component: `[0,360)` degrees is mapped to `[0,255]` uint8_t.
uint8_t s; // saturation component: `[0,1]` is mapped to `[0,255]` uint8_t.
uint8_t v; // value component: `[0,1]` is mapped to `[0,255]` uint8_t.
@ -91,7 +91,7 @@ typedef struct QP_PACKED qgf_palette_entry_v1_t {
STATIC_ASSERT(sizeof(qgf_palette_entry_v1_t) == 3, "Palette entry is not 3 bytes in size");
typedef struct QP_PACKED qgf_palette_v1_t {
typedef struct PACKED qgf_palette_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x03, .neg_type_id = (~0x03), .length = (N * 3 * sizeof(uint8_t)) }
qgf_palette_entry_v1_t hsv[0]; // N * hsv, where N is the number of palette entries depending on the frame format in the descriptor
} qgf_palette_v1_t;
@ -103,7 +103,7 @@ STATIC_ASSERT(sizeof(qgf_palette_v1_t) == sizeof(qgf_block_header_v1_t), "qgf_pa
#define QGF_FRAME_DELTA_DESCRIPTOR_TYPEID 0x04
typedef struct QP_PACKED qgf_delta_v1_t {
typedef struct PACKED qgf_delta_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x04, .neg_type_id = (~0x04), .length = 8 }
uint16_t left; // The left pixel location to draw the delta image
uint16_t top; // The top pixel location to draw the delta image
@ -118,7 +118,7 @@ STATIC_ASSERT(sizeof(qgf_delta_v1_t) == (sizeof(qgf_block_header_v1_t) + 8), "qg
#define QGF_FRAME_DATA_DESCRIPTOR_TYPEID 0x05
typedef struct QP_PACKED qgf_data_v1_t {
typedef struct PACKED qgf_data_v1_t {
qgf_block_header_v1_t header; // = { .type_id = 0x05, .neg_type_id = (~0x05), .length = N }
uint8_t data[0]; // 0 signifies that this struct is immediately followed by the length of data specified in the header
} qgf_data_v1_t;

View file

@ -52,7 +52,7 @@ bool qp_internal_setpixel_impl(painter_device_t device, uint16_t x, uint16_t y)
void qp_internal_fill_pixdata(painter_device_t device, uint32_t num_pixels, uint8_t hue, uint8_t sat, uint8_t val) {
painter_driver_t *driver = (painter_driver_t *)device;
uint32_t pixels_in_pixdata = qp_internal_num_pixels_in_buffer(device);
num_pixels = QP_MIN(pixels_in_pixdata, num_pixels);
num_pixels = MIN(pixels_in_pixdata, num_pixels);
// Convert the color to native pixel format
qp_pixel_t color = {.hsv888 = {.h = hue, .s = sat, .v = val}};
@ -232,17 +232,17 @@ bool qp_internal_fillrect_helper_impl(painter_device_t device, uint16_t left, ui
uint32_t pixels_in_pixdata = qp_internal_num_pixels_in_buffer(device);
painter_driver_t *driver = (painter_driver_t *)device;
uint16_t l = QP_MIN(left, right);
uint16_t r = QP_MAX(left, right);
uint16_t t = QP_MIN(top, bottom);
uint16_t b = QP_MAX(top, bottom);
uint16_t l = MIN(left, right);
uint16_t r = MAX(left, right);
uint16_t t = MIN(top, bottom);
uint16_t b = MAX(top, bottom);
uint16_t w = r - l + 1;
uint16_t h = b - t + 1;
uint32_t remaining = w * h;
driver->driver_vtable->viewport(device, l, t, r, b);
while (remaining > 0) {
uint32_t transmit = QP_MIN(remaining, pixels_in_pixdata);
uint32_t transmit = MIN(remaining, pixels_in_pixdata);
if (!driver->driver_vtable->pixdata(device, qp_internal_global_pixdata_buffer, transmit)) {
return false;
}
@ -260,10 +260,10 @@ bool qp_rect(painter_device_t device, uint16_t left, uint16_t top, uint16_t righ
}
// Cater for cases where people have submitted the coordinates backwards
uint16_t l = QP_MIN(left, right);
uint16_t r = QP_MAX(left, right);
uint16_t t = QP_MIN(top, bottom);
uint16_t b = QP_MAX(top, bottom);
uint16_t l = MIN(left, right);
uint16_t r = MAX(left, right);
uint16_t t = MIN(top, bottom);
uint16_t b = MAX(top, bottom);
uint16_t w = r - l + 1;
uint16_t h = b - t + 1;
@ -281,7 +281,7 @@ bool qp_rect(painter_device_t device, uint16_t left, uint16_t top, uint16_t righ
ret = qp_internal_fillrect_helper_impl(device, l, t, r, b);
} else {
// Fill up the pixdata buffer with the required number of native pixels
qp_internal_fill_pixdata(device, QP_MAX(w, h), hue, sat, val);
qp_internal_fill_pixdata(device, MAX(w, h), hue, sat, val);
// Draw 4x filled single-width rects to create an outline
if (!qp_internal_fillrect_helper_impl(device, l, t, r, t) || !qp_internal_fillrect_helper_impl(device, l, b, r, b) || !qp_internal_fillrect_helper_impl(device, l, t + 1, l, b - 1) || !qp_internal_fillrect_helper_impl(device, r, t + 1, r, b - 1)) {

View file

@ -75,7 +75,7 @@ bool qp_ellipse(painter_device_t device, uint16_t x, uint16_t y, uint16_t sizex,
int16_t dx = 0;
int16_t dy = ((int16_t)sizey);
qp_internal_fill_pixdata(device, QP_MAX(sizex, sizey), hue, sat, val);
qp_internal_fill_pixdata(device, MAX(sizex, sizey), hue, sat, val);
if (!qp_comms_start(device)) {
qp_dprintf("qp_ellipse: fail (could not start comms)\n");

View file

@ -5,17 +5,11 @@
#include "quantum.h"
#include "qp.h"
#include "util.h" // PACKED/MIN/MAX
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Helpers
// Mark certain types that there should be no padding bytes between members.
#define QP_PACKED __attribute__((packed))
// Min/max defines
#define QP_MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
#define QP_MAX(X, Y) (((X) > (Y)) ? (X) : (Y))
#ifdef QUANTUM_PAINTER_DEBUG
# include <debug.h>
# include <print.h>

View file

@ -3,6 +3,7 @@
#pragma once
#include "color.h"
#include "compiler_support.h"
#include "qp_internal.h"
@ -10,21 +11,13 @@
// Quantum Painter pixel formats
// Datatype containing a pixel's color. The internal member used is dependent on the external context.
typedef union QP_PACKED qp_pixel_t {
typedef union PACKED qp_pixel_t {
uint8_t mono;
uint8_t palette_idx;
struct QP_PACKED {
uint8_t h;
uint8_t s;
uint8_t v;
} hsv888;
hsv_t hsv888;
struct QP_PACKED {
uint8_t r;
uint8_t g;
uint8_t b;
} rgb888;
rgb_t rgb888;
uint16_t rgb565;

View file

@ -247,7 +247,8 @@ ifeq ($(strip $(QUANTUM_PAINTER_NEEDS_SURFACE)), yes)
SRC += \
$(DRIVER_PATH)/painter/generic/qp_surface_common.c \
$(DRIVER_PATH)/painter/generic/qp_surface_mono1bpp.c \
$(DRIVER_PATH)/painter/generic/qp_surface_rgb565.c
$(DRIVER_PATH)/painter/generic/qp_surface_rgb565.c \
$(DRIVER_PATH)/painter/generic/qp_surface_rgb888.c
endif
# If dummy comms is needed, set up the required files