drm/vesadrm: Support 8-bit palettes
Thomas Zimmermann
maintainerv2 cover drm/vesadrm: Support 8-bit palettes
VESA provides a wide range of 8-bit palette modes. Add support to vesadrm. For compatibility with common userspace the driver also provides XRGB8888 on top of the palettized output.
Patches 1 to 3 prepare screen_info and struct pixel_format for indexed formats. This cleans up the code for other sysfb drivers as well. The pixel-format compare functions will be helpful in various places.
Patches 4 to 6 prepare for using RGB332 as intermediate format between XRGB8888 and C8. This requires support for format conversion and RGB332 hardware palettes.
Patches 7 to 9 update vesadrm. Patches 7 and 8 prepare the driver without adding new functionality. Patch 9 adds support for the color formats C8 and XRGB888. It adjusts output color formats in the plane's atomic_check helper as needed. Palette setup happens in atomic_flush as usual.
Tested on VGA hardware. Besides supporting odd use cases, this feature can also help with testing support for low-end displays. Such displays often have similar limitations.
v2:
- improve commenting (Javier)
Thomas Zimmermann (9):
video: pixel_format: Add compare helpers
video: screen_info: Add pixel-format helper for linear framebuffers drm/sysfb: Find screen_info format with helpers
drm/sysfb: Blit to CRTC destination format
drm/color-mgmt: Prepare for RGB332 palettes drm/format-helper: Add XRGB8888-to-RGB332 to drm_fb_blit() drm/vesadrm: Rename vesadrm_set_gamma_lut() to vesadrm_set_color_lut() drm/vesadrm: Prepare color management for palette-based framebuffers drm/vesadrm: Support DRM_FORMAT_C8
drivers/gpu/drm/drm_color_mgmt.c | 34 ++++ drivers/gpu/drm/drm_format_helper.c | 3 + drivers/gpu/drm/sysfb/drm_sysfb_helper.h | 2 +- drivers/gpu/drm/sysfb/drm_sysfb_modeset.c | 29 ++-- drivers/gpu/drm/sysfb/drm_sysfb_screen_info.c | 21 ++- drivers/gpu/drm/sysfb/vesadrm.c | 153 ++++++++++++++++-- drivers/video/screen_info_generic.c | 55 +++++++ include/drm/drm_color_mgmt.h | 1 + include/linux/screen_info.h | 2 + include/video/pixel_format.h | 61 +++++++ 10 files changed, 321 insertions(+), 40 deletions(-)
Signature · 1 line
2.50.0
Thomas Zimmermann
maintainerPATCH v2 1/9 video: pixel_format: Add compare helpers
Add helpers that compare two pixel-format descriptions against each other.
--- include/video/pixel_format.h | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
include/video/pixel_format.h +58 -0
@@ -38,4 +38,62 @@ struct pixel_format {#define PIXEL_FORMAT_XRGB2101010 \ { 32, false, { .alpha = {0, 0}, .red = {20, 10}, .green = {10, 10}, .blue = {0, 10} } } +#define __pixel_format_cmp_field (lhs, rhs, name) \ + { \ + int ret = ((lhs)->name) - ((rhs)->name); \ + if (ret) \ + return ret; \ + } + +#define __pixel_format_cmp_bitfield (lhs, rhs, name) \ + { \ + __pixel_format_cmp_field(lhs, rhs, name.offset); \ + __pixel_format_cmp_field(lhs, rhs, name.length); \ + } + +/** +* pixel_format_cmp - Compares two pixel-format descriptions +* +* @lhs: a pixel-format description +* @rhs: a pixel-format description +* +* Compares two pixel-format descriptions for their order. The semantics +* are equivalent to memcmp(). +* +* Returns: +* 0 if both arguments describe the same pixel format, less-than-zero if lhs < rhs, +* or greater-than-zero if lhs > rhs. +*/ +static inline int pixel_format_cmp (const struct pixel_format *lhs,const struct pixel_format *rhs) +{ +__pixel_format_cmp_field (lhs, rhs, bits_per_pixel); +__pixel_format_cmp_field (lhs, rhs, indexed); + +if (lhs->indexed) { +__pixel_format_cmp_bitfield (lhs, rhs, index); + }else { +__pixel_format_cmp_bitfield (lhs, rhs, alpha); +__pixel_format_cmp_bitfield (lhs, rhs, red); +__pixel_format_cmp_bitfield (lhs, rhs, green); +__pixel_format_cmp_bitfield (lhs, rhs, blue); + } + +return 0 ; +} + +/** +* pixel_format_equal - Compares two pixel-format descriptions for equality +* +* @lhs: a pixel-format description +* @rhs: a pixel-format description +* +* Returns: +* True if both arguments describe the same pixel format, or false otherwise. +*/ +static inline bool pixel_format_equal (const struct pixel_format *lhs, +const struct pixel_format *rhs) +{ +return !pixel_format_cmp (lhs, rhs); +} +#endif
Signature · 1 line
2.50.0
Thomas Zimmermann
maintainerPATCH v2 2/9 video: screen_info: Add pixel-format helper for linear framebuffers
In reply to Thomas ZimmermannAdd screen_info_pixel_format(), which converts a screen_info's information about the color format to struct pixel_format. The encoding within the screen_info structure is complex and therefore prone to errors. Later patches will convert callers to use the pixel format.
--- drivers/video/screen_info_generic.c | 55 +++++++++++++++++++++++++++++ include/linux/screen_info.h | 2 ++ 2 files changed, 57 insertions(+)
drivers/video/screen_info_generic.c +55 -0
@@ -5,6 +5,8 @@#include <linux/screen_info.h> #include <linux/string.h> +#include <video/pixel_format.h> +static void resource_init_named (struct resource *r,resource_size_t start,resource_size_t size,const char *name,unsigned int flags)
@@ -180,3 +182,56 @@ u32 __screen_info_lfb_bits_per_pixel(const struct screen_info *si)return bits_per_pixel; }EXPORT_SYMBOL (__screen_info_lfb_bits_per_pixel); + +static int __screen_info_lfb_pixel_format (const struct screen_info *si,struct pixel_format *f) +{ +u32 bits_per_pixel =__screen_info_lfb_bits_per_pixel (si); + +if (bits_per_pixel >U8_MAX ) +return -EINVAL ; + + f->bits_per_pixel = bits_per_pixel; + +if (si->lfb_depth >8 ) { + f->indexed = false; + f->alpha.offset =0 ; + f->alpha.length =0 ; + f->red.offset = si->red_pos; + f->red.length = si->red_size; + f->green.offset = si->green_pos; + f->green.length = si->green_size; + f->blue.offset = si->blue_pos; + f->blue.length = si->blue_size; + }else { + f->indexed = true; + f->index.offset =0 ; + f->index.length = si->lfb_depth; + } + +return 0 ; +} + +/** +* screen_info_pixel_format - Returns the screen-info format as pixel-format description +* +* @si: the screen_info +* @f: pointer to return pixel-format description +* +* Returns: +* 0 on success, or a negative errno code otherwise. +*/ +int screen_info_pixel_format (const struct screen_info *si,struct pixel_format *f) +{ +unsigned int type =screen_info_video_type (si); + +/* TODO: Add support for additional types as needed. */ +switch (type) { +case VIDEO_TYPE_VLFB : +case VIDEO_TYPE_EFI : +return __screen_info_lfb_pixel_format (si, f); + } + +/* not supported */ +return -EINVAL ; +} +EXPORT_SYMBOL (screen_info_pixel_format);
include/linux/screen_info.h +2 -0
@@ -12,6 +12,7 @@#define SCREEN_INFO_MAX_RESOURCES 3struct pci_dev ; +struct pixel_format ;struct resource ;static inline bool __screen_info_has_lfb (unsigned int type)
@@ -136,6 +137,7 @@ static inline u32 __screen_info_vesapm_info_base(const struct screen_info *si)ssize_t screen_info_resources (const struct screen_info *si,struct resource *r,size_t num);u32 __screen_info_lfb_bits_per_pixel (const struct screen_info *si); +int screen_info_pixel_format (const struct screen_info *si,struct pixel_format *f);#if defined(CONFIG_PCI )void screen_info_apply_fixups (void );
Signature · 1 line
2.50.0
Thomas Zimmermann
maintainerPATCH v2 3/9 drm/sysfb: Find screen_info format with helpers
In reply to Thomas ZimmermannConvert drm_sysfb_get_format_si() to lookup the screen_info color format as struct pixel_format with screen_info_pixel_format(). Then search the list of given formats for the screen_info format with pixel_format_equal().
Replaces custom code with helpers. The pixel-compare helper pixel_format_equal() also handles indexed color formats. Prepares for sysfb drivers to support color palettes.
--- drivers/gpu/drm/sysfb/drm_sysfb_screen_info.c | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-)
drivers/gpu/drm/sysfb/drm_sysfb_screen_info.c +9 -12
@@ -79,22 +79,19 @@ const struct drm_format_info *drm_sysfb_get_format_si(struct drm_device *dev, const struct screen_info *si) {const struct drm_format_info *format =NULL ; -u32 bits_per_pixel; +struct pixel_format pixel;size_t i; +int ret; - bits_per_pixel =__screen_info_lfb_bits_per_pixel (si); + ret =screen_info_pixel_format (si, &pixel); +if (ret) +return NULL ;for (i =0 ; i < nformats; ++i) { -const struct pixel_format *f = &formats[i].pixel; - -if (bits_per_pixel == f->bits_per_pixel && - si->red_size == f->red.length && - si->red_pos == f->red.offset && - si->green_size == f->green.length && - si->green_pos == f->green.offset && - si->blue_size == f->blue.length && - si->blue_pos == f->blue.offset) { - format =drm_format_info (formats[i].fourcc); +const struct drm_sysfb_format *f = &formats[i]; + +if (pixel_format_equal (&pixel, &f->pixel)) { + format =drm_format_info (f->fourcc);break ; } }
Signature · 1 line
2.50.0
Thomas Zimmermann
maintainerPATCH v2 4/9 drm/sysfb: Blit to CRTC destination format
In reply to Thomas ZimmermannUse the color format stored in struct drm_sysfb_crtc_state for color-format conversion instead of the scanout-buffer format announced by firmware. Currently, both values are identical.
This will allow drivers to modify the CRTC's input format to a certain extend. Specifically, vesadrm will be able to display RGB framebuffers when the scanout buffer is of C8 format. With color- format conversion to RGB332 and correct setup of the C8 palette, displaying XRGB8888-based buffers under C8 can be achieved.
v2:
- refer to RGB332 as CRTC input format
--- drivers/gpu/drm/sysfb/drm_sysfb_helper.h | 2 +- drivers/gpu/drm/sysfb/drm_sysfb_modeset.c | 29 +++++++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-)
drivers/gpu/drm/sysfb/drm_sysfb_helper.h +1 -1
@@ -132,7 +132,7 @@ int drm_sysfb_plane_helper_get_scanout_buffer(struct drm_plane *plane,struct drm_sysfb_crtc_state {struct drm_crtc_state base; -/* Primary-plane format; required for color mgmt. */ +/* CRTC input color format; required for color mgmt. */ const struct drm_format_info *format; };
drivers/gpu/drm/sysfb/drm_sysfb_modeset.c +19 -10
@@ -210,7 +210,12 @@ int drm_sysfb_plane_helper_atomic_check(struct drm_plane *plane,else if (!new_plane_state->visible)return 0 ; -if (new_fb->format != sysfb->fb_format) { + new_crtc_state =drm_atomic_get_new_crtc_state (new_state, new_plane_state->crtc); + + new_sysfb_crtc_state =to_drm_sysfb_crtc_state (new_crtc_state); + new_sysfb_crtc_state->format = sysfb->fb_format; + +if (new_fb->format != new_sysfb_crtc_state->format) {void *buf;/* format conversion necessary; reserve buffer */
@@ -220,11 +225,6 @@ int drm_sysfb_plane_helper_atomic_check(struct drm_plane *plane,return -ENOMEM ; } - new_crtc_state =drm_atomic_get_new_crtc_state (new_state, new_plane_state->crtc); - - new_sysfb_crtc_state =to_drm_sysfb_crtc_state (new_crtc_state); - new_sysfb_crtc_state->format = new_fb->format; -return 0 ; }EXPORT_SYMBOL (drm_sysfb_plane_helper_atomic_check);
@@ -238,7 +238,10 @@ void drm_sysfb_plane_helper_atomic_update(struct drm_plane *plane, struct drm_atstruct drm_shadow_plane_state *shadow_plane_state =to_drm_shadow_plane_state (plane_state);struct drm_framebuffer *fb = plane_state->fb;unsigned int dst_pitch = sysfb->fb_pitch; -const struct drm_format_info *dst_format = sysfb->fb_format; +struct drm_crtc_state *crtc_state = crtc_state = +drm_atomic_get_new_crtc_state (state, plane_state->crtc); +struct drm_sysfb_crtc_state *sysfb_crtc_state =to_drm_sysfb_crtc_state (crtc_state); +const struct drm_format_info *dst_format = sysfb_crtc_state->format;struct drm_atomic_helper_damage_iter iter;struct drm_rect damage;int ret, idx;
@@ -278,7 +281,10 @@ void drm_sysfb_plane_helper_atomic_disable(struct drm_plane *plane,struct drm_plane_state *plane_state =drm_atomic_get_new_plane_state (state, plane);void __iomem *dst_vmap = dst.vaddr_iomem;/* TODO: Use mapping abstraction */ unsigned int dst_pitch = sysfb->fb_pitch; -const struct drm_format_info *dst_format = sysfb->fb_format; +struct drm_crtc_state *crtc_state = crtc_state = +drm_atomic_get_new_crtc_state (state, plane_state->crtc); +struct drm_sysfb_crtc_state *sysfb_crtc_state =to_drm_sysfb_crtc_state (crtc_state); +const struct drm_format_info *dst_format = sysfb_crtc_state->format;struct drm_rect dst_clip;unsigned long lines, linepixels, i;int idx;
@@ -370,16 +376,19 @@ EXPORT_SYMBOL(drm_sysfb_crtc_helper_atomic_check);void drm_sysfb_crtc_reset (struct drm_crtc *crtc) { +struct drm_sysfb_device *sysfb =to_drm_sysfb_device (crtc->dev);struct drm_sysfb_crtc_state *sysfb_crtc_state;if (crtc->state)drm_sysfb_crtc_state_destroy (to_drm_sysfb_crtc_state (crtc->state)); sysfb_crtc_state =kzalloc (sizeof (*sysfb_crtc_state),GFP_KERNEL ); -if (sysfb_crtc_state) +if (sysfb_crtc_state) { + sysfb_crtc_state->format = sysfb->fb_format;__drm_atomic_helper_crtc_reset (crtc, &sysfb_crtc_state->base); -else + }else {__drm_atomic_helper_crtc_reset (crtc,NULL ); + } }EXPORT_SYMBOL (drm_sysfb_crtc_reset);
Signature · 1 line
2.50.0
Re: [PATCH v2 4/9] drm/sysfb: Blit to CRTC destination format
Quoted 3 lines · Thomas Zimmermann
Use the color format stored in struct
drm_sysfb_crtc_statefor color-format conversion instead of the scanout-buffer format announced by firmware. Currently, both values are identical.
This patch, which is in -next as 061963cd9e5b60672695e9a592be440469a6bf72, breaks boot on the original Raspberry Pi. We get an oops after initialising the console:
[ 4.057189] Console: switching to colour dummy device 80x30 [ 4.057903] 8<--- cut here --- [ 4.057990] Unable to handle kernel NULL pointer dereference at virtual address 00000048 when read
...
[ 4.423159] Call trace: [ 4.423196] drm_sysfb_plane_helper_atomic_disable from drm_atomic_helper_commit_planes+0x188/0x274 [ 4.434958] drm_atomic_helper_commit_planes from drm_atomic_helper_commit_tail+0x30/0x68 [ 4.443259] drm_atomic_helper_commit_tail from commit_tail+0x144/0x154 [ 4.449984] commit_tail from drm_atomic_helper_commit+0xfc/0x10c [ 4.456183] drm_atomic_helper_commit from drm_atomic_commit+0xc4/0xf4 [ 4.462842] drm_atomic_commit from drm_framebuffer_remove+0x220/0x4f0 [ 4.469495] drm_framebuffer_remove from drm_mode_rmfb_work_fn+0x70/0x78 [ 4.476306] drm_mode_rmfb_work_fn from process_scheduled_works+0x198/0x290 [ 4.483378] process_scheduled_works from worker_thread+0x16c/0x1f8
Full log:
https://lava.sirena.org.uk/scheduler/job/1741780#L776
Bisect log, with links to additional logs:
# bad: [3c642997252eef4449cb6b6e02af3dc22515d817] Add linux-next specific files for 20250827
# good: [f51af24f910debef214edf108f7efad30874bc4f] Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git
# good: [a12b74d2bd4724ee1883bc97ec93eac8fafc8d3c] ASoC: tlv320aic32x4: use dev_err_probe() for regulators
# good: [f840737d1746398c2993be34bfdc80bdc19ecae2] ASoC: SOF: imx: Remove the use of dev_err_probe()
# good: [d78e48ebe04e9566f8ecbf51471e80da3adbceeb] ASoC: dt-bindings: Minor whitespace cleanup in example
# good: [96bcb34df55f7fee99795127c796315950c94fed] ASoC: test-component: Use kcalloc() instead of kzalloc()
# good: [c232495d28ca092d0c39b10e35d3d613bd2414ab] ASoC: dt-bindings: omap-twl4030: convert to DT schema
# good: [27848c082ba0b22850fd9fb7b185c015423dcdc7] spi: s3c64xx: Remove the use of dev_err_probe()
# good: [ec0be3cdf40b5302248f3fb27a911cc630e8b855] regulator: consumer.rst: document bulk operations
# good: [da9881d00153cc6d3917f6b74144b1d41b58338c] ASoC: qcom: audioreach: add support for SMECNS module
# good: [c1dd310f1d76b4b13f1854618087af2513140897] spi: SPISG: Use devm_kcalloc() in aml_spisg_clk_init()
# good: [2a55135201d5e24b80b7624880ff42eafd8e320c] ASoC: Intel: avs: Streamline register-component function names
# good: [550bc517e59347b3b1af7d290eac4fb1411a3d4e] regulator: bd718x7: Use kcalloc() instead of kzalloc()
# good: [0056b410355713556d8a10306f82e55b28d33ba8] spi: offload trigger: adi-util-sigma-delta: clean up imports
# good: [cf65182247761f7993737b710afe8c781699356b] ASoC: codecs: wsa883x: Handle shared reset GPIO for WSA883x speakers
# good: [90179609efa421b1ccc7d8eafbc078bafb25777c] spi: spl022: use min_t() to improve code
# good: [daf855f76a1210ceed9541f71ac5dd9be02018a6] ASoC: es8323: enable DAPM power widgets for playback DAC
# good: [48124569bbc6bfda1df3e9ee17b19d559f4b1aa3] spi: remove unneeded 'fast_io' parameter in regmap_config
# good: [258384d8ce365dddd6c5c15204de8ccd53a7ab0a] ASoC: es8323: enable DAPM power widgets for playback DAC and output
# good: [6d068f1ae2a2f713d7f21a9a602e65b3d6b6fc6d] regulator: rt5133: Fix spelling mistake "regualtor" -> "regulator"
# good: [a46e95c81e3a28926ab1904d9f754fef8318074d] ASoC: wl1273: Remove
# good: [0e62438e476494a1891a8822b9785bc6e73e9c3f] ASoC: Intel: sst: Remove redundant semicolons
# good: [37533933bfe92cd5a99ef4743f31dac62ccc8de0] regulator: remove unneeded 'fast_io' parameter in regmap_config
# good: [5c36b86d2bf68fbcad16169983ef7ee8c537db59] regmap: Remove superfluous check for !config in __regmap_init()
# good: [714165e1c4b0d5b8c6d095fe07f65e6e7047aaeb] regulator: rt5133: Add RT5133 PMIC regulator Support
# good: [9c45f95222beecd6a284fd1284d54dd7a772cf59] spi: spi-qpic-snand: handle 'use_ecc' parameter of qcom_spi_config_cw_read()
# good: [bab4ab484a6ca170847da9bffe86f1fa90df4bbe] ASoC: dt-bindings: Convert brcm,bcm2835-i2s to DT schema
# good: [b832b19318534bb4f1673b24d78037fee339c679] spi: loopback-test: Don't use %pK through printk
# good: [8c02c8353460f8630313aef6810f34e134a3c1ee] ASoC: dt-bindings: realtek,alc5623: convert to DT schema
# good: [6b7e2aa50bdaf88cd4c2a5e2059a7bf32d85a8b1] spi: spi-qpic-snand: remove 'clr*status' members of struct 'qpic_ecc'
# good: [2291a2186305faaf8525d57849d8ba12ad63f5e7] MAINTAINERS: Add entry for FourSemi audio amplifiers
# good: [a54ef14188519a0994d0264f701f5771815fa11e] regulator: dt-bindings: Clean-up active-semi,act8945a duplication
# good: [cf25eb8eae91bcae9b2065d84b0c0ba0f6d9dd34] ASoC: soc-component: unpack snd_soc_component_init_bias_level()
# good: [595b7f155b926460a00776cc581e4dcd01220006] ASoC: Intel: avs: Conditional-path support
# good: [a1d0b0ae65ae3f32597edfbb547f16c75601cd87] spi: spi-qpic-snand: avoid double assignment in qcom_spi_probe()
# good: [3059067fd3378a5454e7928c08d20bf3ef186760] ASoC: cs48l32: Use PTR_ERR_OR_ZERO() to simplify code
# good: [9a200cbdb54349909a42b45379e792e4b39dd223] rust: regulator: implement Send and Sync for Regulator<T>
# good: [2d86d2585ab929a143d1e6f8963da1499e33bf13] ASoC: pxa: add GPIOLIB_LEGACY dependency
# good: [886f42ce96e7ce80545704e7168a9c6b60cd6c03] regmap: mmio: Add missing MODULE_DESCRIPTION()
# good: [162e23657e5379f07c6404dbfbf4367cb438ea7d] regulator: pf0900: Add PMIC PF0900 support
git bisect start '3c642997252eef4449cb6b6e02af3dc22515d817' 'f51af24f910debef214edf108f7efad30874bc4f' 'a12b74d2bd4724ee1883bc97ec93eac8fafc8d3c' 'f840737d1746398c2993be34bfdc80bdc19ecae2' 'd78e48ebe04e9566f8ecbf51471e80da3adbceeb' '96bcb34df55f7fee99795127c796315950c94fed' 'c232495d28ca092d0c39b10e35d3d613bd2414ab' '27848c082ba0b22850fd9fb7b185c015423dcdc7' 'ec0be3cdf40b5302248f3fb27a911cc630e8b855' 'da9881d00153cc6d3917f6b74144b1d41b58338c' 'c1dd310f1d76b4b13f1854618087af2513140897' '2a55135201d5e24b80b7624880ff42eafd8e320c' '550bc517e59347b3b1af7d290eac4fb1411a3d4e' '0056b410355713556d8a10306f82e55b28d33ba8' 'cf65182247761f7993737b710afe8c781699356b' '90179609efa421b1ccc7d8eafbc078bafb25777c' 'daf855f76a1210ceed9541f71ac5dd9be02018a6' '48124569bbc6bfda1df3e9ee17b19d559f4b1aa3' '258384d8ce365dddd6c5c15204de8ccd53a7ab0a' '6d068f1ae2a2f713d7f21a9a602e65b3d6b6fc6d' 'a46e95c81e3a28926ab1904d9f754fef8318074d' '0e62438e476494a1891a8822b9785bc6e73e9c3f' '37533933bfe92cd5a99ef4743f31dac62ccc8de0' '5c36b86d2bf68fbcad16169983ef7ee8c537db59' '714165e1c4b0d5b8c6d095fe07f65e6e7047aaeb' '9c45f95222beecd6a284fd1284d54dd7a772cf59' 'bab4ab484a6ca170847da9bffe86f1fa90df4bbe' 'b832b19318534bb4f1673b24d78037fee339c679' '8c02c8353460f8630313aef6810f34e134a3c1ee' '6b7e2aa50bdaf88cd4c2a5e2059a7bf32d85a8b1' '2291a2186305faaf8525d57849d8ba12ad63f5e7' 'a54ef14188519a0994d0264f701f5771815fa11e' 'cf25eb8eae91bcae9b2065d84b0c0ba0f6d9dd34' '595b7f155b926460a00776cc581e4dcd01220006' 'a1d0b0ae65ae3f32597edfbb547f16c75601cd87' '3059067fd3378a5454e7928c08d20bf3ef186760' '9a200cbdb54349909a42b45379e792e4b39dd223' '2d86d2585ab929a143d1e6f8963da1499e33bf13' '886f42ce96e7ce80545704e7168a9c6b60cd6c03' '162e23657e5379f07c6404dbfbf4367cb438ea7d'
# test job: [a12b74d2bd4724ee1883bc97ec93eac8fafc8d3c] https://lava.sirena.org.uk/scheduler/job/1734135 # test job: [f840737d1746398c2993be34bfdc80bdc19ecae2] https://lava.sirena.org.uk/scheduler/job/1727230 # test job: [d78e48ebe04e9566f8ecbf51471e80da3adbceeb] https://lava.sirena.org.uk/scheduler/job/1706206 # test job: [96bcb34df55f7fee99795127c796315950c94fed] https://lava.sirena.org.uk/scheduler/job/1699727 # test job: [c232495d28ca092d0c39b10e35d3d613bd2414ab] https://lava.sirena.org.uk/scheduler/job/1699713 # test job: [27848c082ba0b22850fd9fb7b185c015423dcdc7] https://lava.sirena.org.uk/scheduler/job/1693185 # test job: [ec0be3cdf40b5302248f3fb27a911cc630e8b855] https://lava.sirena.org.uk/scheduler/job/1694260 # test job: [da9881d00153cc6d3917f6b74144b1d41b58338c] https://lava.sirena.org.uk/scheduler/job/1693330 # test job: [c1dd310f1d76b4b13f1854618087af2513140897] https://lava.sirena.org.uk/scheduler/job/1693130 # test job: [2a55135201d5e24b80b7624880ff42eafd8e320c] https://lava.sirena.org.uk/scheduler/job/1685827 # test job: [550bc517e59347b3b1af7d290eac4fb1411a3d4e] https://lava.sirena.org.uk/scheduler/job/1685690 # test job: [0056b410355713556d8a10306f82e55b28d33ba8] https://lava.sirena.org.uk/scheduler/job/1685834 # test job: [cf65182247761f7993737b710afe8c781699356b] https://lava.sirena.org.uk/scheduler/job/1687590 # test job: [90179609efa421b1ccc7d8eafbc078bafb25777c] https://lava.sirena.org.uk/scheduler/job/1685811 # test job: [daf855f76a1210ceed9541f71ac5dd9be02018a6] https://lava.sirena.org.uk/scheduler/job/1685552 # test job: [48124569bbc6bfda1df3e9ee17b19d559f4b1aa3] https://lava.sirena.org.uk/scheduler/job/1670240 # test job: [258384d8ce365dddd6c5c15204de8ccd53a7ab0a] https://lava.sirena.org.uk/scheduler/job/1673449 # test job: [6d068f1ae2a2f713d7f21a9a602e65b3d6b6fc6d] https://lava.sirena.org.uk/scheduler/job/1673208 # test job: [a46e95c81e3a28926ab1904d9f754fef8318074d] https://lava.sirena.org.uk/scheduler/job/1673819 # test job: [0e62438e476494a1891a8822b9785bc6e73e9c3f] https://lava.sirena.org.uk/scheduler/job/1669629 # test job: [37533933bfe92cd5a99ef4743f31dac62ccc8de0] https://lava.sirena.org.uk/scheduler/job/1669021 # test job: [5c36b86d2bf68fbcad16169983ef7ee8c537db59] https://lava.sirena.org.uk/scheduler/job/1667994 # test job: [714165e1c4b0d5b8c6d095fe07f65e6e7047aaeb] https://lava.sirena.org.uk/scheduler/job/1667749 # test job: [9c45f95222beecd6a284fd1284d54dd7a772cf59] https://lava.sirena.org.uk/scheduler/job/1667650 # test job: [bab4ab484a6ca170847da9bffe86f1fa90df4bbe] https://lava.sirena.org.uk/scheduler/job/1664754 # test job: [b832b19318534bb4f1673b24d78037fee339c679] https://lava.sirena.org.uk/scheduler/job/1659321 # test job: [8c02c8353460f8630313aef6810f34e134a3c1ee] https://lava.sirena.org.uk/scheduler/job/1659043 # test job: [6b7e2aa50bdaf88cd4c2a5e2059a7bf32d85a8b1] https://lava.sirena.org.uk/scheduler/job/1656611 # test job: [2291a2186305faaf8525d57849d8ba12ad63f5e7] https://lava.sirena.org.uk/scheduler/job/1655785 # test job: [a54ef14188519a0994d0264f701f5771815fa11e] https://lava.sirena.org.uk/scheduler/job/1656081 # test job: [cf25eb8eae91bcae9b2065d84b0c0ba0f6d9dd34] https://lava.sirena.org.uk/scheduler/job/1653063 # test job: [595b7f155b926460a00776cc581e4dcd01220006] https://lava.sirena.org.uk/scheduler/job/1653171 # test job: [a1d0b0ae65ae3f32597edfbb547f16c75601cd87] https://lava.sirena.org.uk/scheduler/job/1653632 # test job: [3059067fd3378a5454e7928c08d20bf3ef186760] https://lava.sirena.org.uk/scheduler/job/1653613 # test job: [9a200cbdb54349909a42b45379e792e4b39dd223] https://lava.sirena.org.uk/scheduler/job/1653627 # test job: [2d86d2585ab929a143d1e6f8963da1499e33bf13] https://lava.sirena.org.uk/scheduler/job/1653200 # test job: [886f42ce96e7ce80545704e7168a9c6b60cd6c03] https://lava.sirena.org.uk/scheduler/job/1653187 # test job: [162e23657e5379f07c6404dbfbf4367cb438ea7d] https://lava.sirena.org.uk/scheduler/job/1653604 # test job: [3c642997252eef4449cb6b6e02af3dc22515d817] https://lava.sirena.org.uk/scheduler/job/1741780 # bad: [3c642997252eef4449cb6b6e02af3dc22515d817] Add linux-next specific files for 20250827 git bisect bad 3c642997252eef4449cb6b6e02af3dc22515d817 # test job: [7902969a2e75fae35b04772a3e75a29737d463bd] https://lava.sirena.org.uk/scheduler/job/1741974 # good: [7902969a2e75fae35b04772a3e75a29737d463bd] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git git bisect good 7902969a2e75fae35b04772a3e75a29737d463bd # test job: [c72c1b7d500f2e37ae06630ee20add5b68c7723c] https://lava.sirena.org.uk/scheduler/job/1742110 # bad: [c72c1b7d500f2e37ae06630ee20add5b68c7723c] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git git bisect bad c72c1b7d500f2e37ae06630ee20add5b68c7723c # test job: [9f26ae24e6a8435d88cfb8c01f7d02c348eb4868] https://lava.sirena.org.uk/scheduler/job/1742182 # good: [9f26ae24e6a8435d88cfb8c01f7d02c348eb4868] Merge branch 'drm-next' of https://gitlab.freedesktop.org/drm/kernel.git git bisect good 9f26ae24e6a8435d88cfb8c01f7d02c348eb4868 # test job: [257ad6623adaf1685878a0d8724d5c40aa838e93] https://lava.sirena.org.uk/scheduler/job/1742260 # bad: [257ad6623adaf1685878a0d8724d5c40aa838e93] Merge branch 'drm-next' of https://gitlab.freedesktop.org/agd5f/linux.git git bisect bad 257ad6623adaf1685878a0d8724d5c40aa838e93 # test job: [615471b860d628f7e7d9ffdf4b92477493e0a31c] https://lava.sirena.org.uk/scheduler/job/1742299 # good: [615471b860d628f7e7d9ffdf4b92477493e0a31c] drm/amd/pm: Remove cache logic from SMUv13.0.12 git bisect good 615471b860d628f7e7d9ffdf4b92477493e0a31c # test job: [e3bd536580fe553d5768673660b1745ff1bb3b91] https://lava.sirena.org.uk/scheduler/job/1742396 # good: [e3bd536580fe553d5768673660b1745ff1bb3b91] drm/radeon: Use vmalloc_array and vcalloc to simplify code git bisect good e3bd536580fe553d5768673660b1745ff1bb3b91 # test job: [9d3cc361252ee8ff60d7277a97950300e0340ec4] https://lava.sirena.org.uk/scheduler/job/1742517 # good: [9d3cc361252ee8ff60d7277a97950300e0340ec4] drm/amd/display: Consider sink max slice width limitation for dsc git bisect good 9d3cc361252ee8ff60d7277a97950300e0340ec4 # test job: [efe927b9702643a1d80472664c2642f0304cb608] https://lava.sirena.org.uk/scheduler/job/1742628 # good: [efe927b9702643a1d80472664c2642f0304cb608] drm/msm: fix msm_gem_vma_new() allocations for managed GPUVMs git bisect good efe927b9702643a1d80472664c2642f0304cb608 # test job: [b3c7edd5e50e0e92ead8794b084e92d89002dd6f] https://lava.sirena.org.uk/scheduler/job/1742784 # bad: [b3c7edd5e50e0e92ead8794b084e92d89002dd6f] drm/format-helper: Add XRGB8888-to-RGB332 to drm_fb_blit() git bisect bad b3c7edd5e50e0e92ead8794b084e92d89002dd6f # test job: [d6d05e2af796ca25094f80a73d8841505d54368b] https://lava.sirena.org.uk/scheduler/job/1742821 # good: [d6d05e2af796ca25094f80a73d8841505d54368b] video: screen_info: Add pixel-format helper for linear framebuffers git bisect good d6d05e2af796ca25094f80a73d8841505d54368b # test job: [061963cd9e5b60672695e9a592be440469a6bf72] https://lava.sirena.org.uk/scheduler/job/1742968 # bad: [061963cd9e5b60672695e9a592be440469a6bf72] drm/sysfb: Blit to CRTC destination format git bisect bad 061963cd9e5b60672695e9a592be440469a6bf72 # test job: [31eea29d727ce35b747e68c6be350ca07b7ecd9b] https://lava.sirena.org.uk/scheduler/job/1743040 # good: [31eea29d727ce35b747e68c6be350ca07b7ecd9b] drm/sysfb: Find screen_info format with helpers git bisect good 31eea29d727ce35b747e68c6be350ca07b7ecd9b # first bad commit: [061963cd9e5b60672695e9a592be440469a6bf72] drm/sysfb: Blit to CRTC destination format
Thomas Zimmermann
maintainerRe: [PATCH v2 4/9] drm/sysfb: Blit to CRTC destination format
Hi
Am 27.08.25 um 13:07 schrieb Mark Brown:
Quoted 7 lines · Thomas Zimmermann
Quoted 3 lines
Use the color format stored in struct
drm_sysfb_crtc_statefor color-format conversion instead of the scanout-buffer format announced by firmware. Currently, both values are identical.This patch, which is in -next as
061963cd9e5b60672695e9a592be440469a6bf72, breaks boot on the original Raspberry Pi. We get an oops after initialising the console:
Thanks for reporting the bug. A patch is available at [1]. Waiting for reviewers.
[1] https://lore.kernel.org/dri-devel/[email protected]/
Best regards
Thomas
Quoted 143 lines
[ 4.057189] Console: switching to colour dummy device 80x30 [ 4.057903] 8<--- cut here --- [ 4.057990] Unable to handle kernel NULL pointer dereference at virtual address 00000048 when read...
[ 4.423159] Call trace: [ 4.423196] drm_sysfb_plane_helper_atomic_disable from drm_atomic_helper_commit_planes+0x188/0x274 [ 4.434958] drm_atomic_helper_commit_planes from drm_atomic_helper_commit_tail+0x30/0x68 [ 4.443259] drm_atomic_helper_commit_tail from commit_tail+0x144/0x154 [ 4.449984] commit_tail from drm_atomic_helper_commit+0xfc/0x10c [ 4.456183] drm_atomic_helper_commit from drm_atomic_commit+0xc4/0xf4 [ 4.462842] drm_atomic_commit from drm_framebuffer_remove+0x220/0x4f0 [ 4.469495] drm_framebuffer_remove from drm_mode_rmfb_work_fn+0x70/0x78 [ 4.476306] drm_mode_rmfb_work_fn from process_scheduled_works+0x198/0x290 [ 4.483378] process_scheduled_works from worker_thread+0x16c/0x1f8Full log:
https://lava.sirena.org.uk/scheduler/job/1741780#L776Bisect log, with links to additional logs:
# bad: [
3c642997252eef4449cb6b6e02af3dc22515d817] Add linux-next specific files for 20250827
# good: [f51af24f910debef214edf108f7efad30874bc4f] Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git
# good: [a12b74d2bd4724ee1883bc97ec93eac8fafc8d3c] ASoC: tlv320aic32x4: usedev_err_probe()for regulators
# good: [f840737d1746398c2993be34bfdc80bdc19ecae2] ASoC: SOF: imx: Remove the use ofdev_err_probe()
# good: [d78e48ebe04e9566f8ecbf51471e80da3adbceeb] ASoC: dt-bindings: Minor whitespace cleanup in example
# good: [96bcb34df55f7fee99795127c796315950c94fed] ASoC: test-component: Usekcalloc()instead ofkzalloc()
# good: [c232495d28ca092d0c39b10e35d3d613bd2414ab] ASoC: dt-bindings: omap-twl4030: convert to DT schema
# good: [27848c082ba0b22850fd9fb7b185c015423dcdc7] spi: s3c64xx: Remove the use ofdev_err_probe()
# good: [ec0be3cdf40b5302248f3fb27a911cc630e8b855] regulator:consumer.rst: document bulk operations
# good: [da9881d00153cc6d3917f6b74144b1d41b58338c] ASoC: qcom: audioreach: add support for SMECNS module
# good: [c1dd310f1d76b4b13f1854618087af2513140897] spi: SPISG: Usedevm_kcalloc()inaml_spisg_clk_init()
# good: [2a55135201d5e24b80b7624880ff42eafd8e320c] ASoC: Intel: avs: Streamline register-component function names
# good: [550bc517e59347b3b1af7d290eac4fb1411a3d4e] regulator: bd718x7: Usekcalloc()instead ofkzalloc()
# good: [0056b410355713556d8a10306f82e55b28d33ba8] spi: offload trigger: adi-util-sigma-delta: clean up imports
# good: [cf65182247761f7993737b710afe8c781699356b] ASoC: codecs: wsa883x: Handle shared reset GPIO for WSA883x speakers
# good: [90179609efa421b1ccc7d8eafbc078bafb25777c] spi: spl022: usemin_t()to improve code
# good: [daf855f76a1210ceed9541f71ac5dd9be02018a6] ASoC: es8323: enable DAPM power widgets for playback DAC
# good: [48124569bbc6bfda1df3e9ee17b19d559f4b1aa3] spi: remove unneeded 'fast_io' parameter inregmap_config
# good: [258384d8ce365dddd6c5c15204de8ccd53a7ab0a] ASoC: es8323: enable DAPM power widgets for playback DAC and output
# good: [6d068f1ae2a2f713d7f21a9a602e65b3d6b6fc6d] regulator: rt5133: Fix spelling mistake "regualtor" -> "regulator"
# good: [a46e95c81e3a28926ab1904d9f754fef8318074d] ASoC: wl1273: Remove
# good: [0e62438e476494a1891a8822b9785bc6e73e9c3f] ASoC: Intel: sst: Remove redundant semicolons
# good: [37533933bfe92cd5a99ef4743f31dac62ccc8de0] regulator: remove unneeded 'fast_io' parameter inregmap_config
# good: [5c36b86d2bf68fbcad16169983ef7ee8c537db59] regmap: Remove superfluous check for !config in__regmap_init()
# good: [714165e1c4b0d5b8c6d095fe07f65e6e7047aaeb] regulator: rt5133: Add RT5133 PMIC regulator Support
# good: [9c45f95222beecd6a284fd1284d54dd7a772cf59] spi: spi-qpic-snand: handle 'use_ecc' parameter ofqcom_spi_config_cw_read()
# good: [bab4ab484a6ca170847da9bffe86f1fa90df4bbe] ASoC: dt-bindings: Convert brcm,bcm2835-i2s to DT schema
# good: [b832b19318534bb4f1673b24d78037fee339c679] spi: loopback-test: Don't use %pK through printk
# good: [8c02c8353460f8630313aef6810f34e134a3c1ee] ASoC: dt-bindings: realtek,alc5623: convert to DT schema
# good: [6b7e2aa50bdaf88cd4c2a5e2059a7bf32d85a8b1] spi: spi-qpic-snand: remove 'clr*status' members of struct 'qpic_ecc'
# good: [2291a2186305faaf8525d57849d8ba12ad63f5e7]MAINTAINERS: Add entry for FourSemi audio amplifiers
# good: [a54ef14188519a0994d0264f701f5771815fa11e] regulator: dt-bindings: Clean-up active-semi,act8945a duplication
# good: [cf25eb8eae91bcae9b2065d84b0c0ba0f6d9dd34] ASoC: soc-component: unpacksnd_soc_component_init_bias_level()
# good: [595b7f155b926460a00776cc581e4dcd01220006] ASoC: Intel: avs: Conditional-path support
# good: [a1d0b0ae65ae3f32597edfbb547f16c75601cd87] spi: spi-qpic-snand: avoid double assignment inqcom_spi_probe()
# good: [3059067fd3378a5454e7928c08d20bf3ef186760] ASoC: cs48l32: UsePTR_ERR_OR_ZERO()to simplify code
# good: [9a200cbdb54349909a42b45379e792e4b39dd223] rust: regulator: implement Send and Sync for Regulator<T>
# good: [2d86d2585ab929a143d1e6f8963da1499e33bf13] ASoC: pxa: addGPIOLIB_LEGACYdependency
# good: [886f42ce96e7ce80545704e7168a9c6b60cd6c03] regmap: mmio: Add missingMODULE_DESCRIPTION()
# good: [162e23657e5379f07c6404dbfbf4367cb438ea7d] regulator: pf0900: Add PMIC PF0900 support
git bisect start '3c642997252eef4449cb6b6e02af3dc22515d817' 'f51af24f910debef214edf108f7efad30874bc4f' 'a12b74d2bd4724ee1883bc97ec93eac8fafc8d3c' 'f840737d1746398c2993be34bfdc80bdc19ecae2' 'd78e48ebe04e9566f8ecbf51471e80da3adbceeb' '96bcb34df55f7fee99795127c796315950c94fed' 'c232495d28ca092d0c39b10e35d3d613bd2414ab' '27848c082ba0b22850fd9fb7b185c015423dcdc7' 'ec0be3cdf40b5302248f3fb27a911cc630e8b855' 'da9881d00153cc6d3917f6b74144b1d41b58338c' 'c1dd310f1d76b4b13f1854618087af2513140897' '2a55135201d5e24b80b7624880ff42eafd8e320c' '550bc517e59347b3b1af7d290eac4fb1411a3d4e' '0056b410355713556d8a10306f82e55b28d33ba8' 'cf65182247761f7993737b710afe8c781699356b' '90179609efa421b1ccc7d8eafbc078bafb25777c' 'daf855f76a1210ceed9541f71ac5dd9be02018a6' '48124569bbc6bfda1df3e9ee17b19d559f4b1aa3' '258384d8ce365dddd6c5c15204de8ccd53a7ab0a' '6d068f1ae2a2f713d7f21a9a602e65b3d6b6fc6d' 'a46e95c81e3a28926ab1904d9f754fef8318074d' '0e62438e476494a1891a8822b9785bc6e73e9c3f' '37533933bfe92cd5a99ef4743f31dac62ccc8de0' '5c36b86d2bf68fbcad16169983ef7ee8c537db59' '714165e1c4b0d5b8c6d095fe07f65e6e7047aaeb' '9c45f95222beecd6a284fd1284d54dd7a772cf59' 'bab4ab484a6ca170847da9bffe86f1fa90df4bbe' 'b832b19318534bb4f1673b24d78037fee339c679' '8c02c8353460f8630313aef6810f34e134a3c1ee' '6b7e2aa50bdaf88cd4c2a5e2059a7bf32d85a8b1' '2291a2186305faaf8525d57849d8ba12ad63f5e7' 'a54ef14188519a0994d0264f701f5771815fa11e' 'cf25eb8eae91bcae9b2065d84b0c0ba0f6d9dd34' '595b7f155b926460a00776cc581e4dcd01220006' 'a1d0b0ae65ae3f32597edfbb547f16c75601cd87' '3059067fd3378a5454e7928c08d20bf3ef186760' '9a200cbdb54349909a42b45379e792e4b39dd223' '2d86d2585ab929a143d1e6f8963da1499e33bf13' '886f42ce96e7ce80545704e7168a9c6b60cd6c03' '162e23657e5379f07c6404dbfbf4367cb438ea7d'# test job: [a12b74d2bd4724ee1883bc97ec93eac8fafc8d3c] https://lava.sirena.org.uk/scheduler/job/1734135 # test job: [f840737d1746398c2993be34bfdc80bdc19ecae2] https://lava.sirena.org.uk/scheduler/job/1727230 # test job: [d78e48ebe04e9566f8ecbf51471e80da3adbceeb] https://lava.sirena.org.uk/scheduler/job/1706206 # test job: [96bcb34df55f7fee99795127c796315950c94fed] https://lava.sirena.org.uk/scheduler/job/1699727 # test job: [c232495d28ca092d0c39b10e35d3d613bd2414ab] https://lava.sirena.org.uk/scheduler/job/1699713 # test job: [27848c082ba0b22850fd9fb7b185c015423dcdc7] https://lava.sirena.org.uk/scheduler/job/1693185 # test job: [ec0be3cdf40b5302248f3fb27a911cc630e8b855] https://lava.sirena.org.uk/scheduler/job/1694260 # test job: [da9881d00153cc6d3917f6b74144b1d41b58338c] https://lava.sirena.org.uk/scheduler/job/1693330 # test job: [c1dd310f1d76b4b13f1854618087af2513140897] https://lava.sirena.org.uk/scheduler/job/1693130 # test job: [2a55135201d5e24b80b7624880ff42eafd8e320c] https://lava.sirena.org.uk/scheduler/job/1685827 # test job: [550bc517e59347b3b1af7d290eac4fb1411a3d4e] https://lava.sirena.org.uk/scheduler/job/1685690 # test job: [0056b410355713556d8a10306f82e55b28d33ba8] https://lava.sirena.org.uk/scheduler/job/1685834 # test job: [cf65182247761f7993737b710afe8c781699356b] https://lava.sirena.org.uk/scheduler/job/1687590 # test job: [90179609efa421b1ccc7d8eafbc078bafb25777c] https://lava.sirena.org.uk/scheduler/job/1685811 # test job: [daf855f76a1210ceed9541f71ac5dd9be02018a6] https://lava.sirena.org.uk/scheduler/job/1685552 # test job: [48124569bbc6bfda1df3e9ee17b19d559f4b1aa3] https://lava.sirena.org.uk/scheduler/job/1670240 # test job: [258384d8ce365dddd6c5c15204de8ccd53a7ab0a] https://lava.sirena.org.uk/scheduler/job/1673449 # test job: [6d068f1ae2a2f713d7f21a9a602e65b3d6b6fc6d] https://lava.sirena.org.uk/scheduler/job/1673208 # test job: [a46e95c81e3a28926ab1904d9f754fef8318074d] https://lava.sirena.org.uk/scheduler/job/1673819 # test job: [0e62438e476494a1891a8822b9785bc6e73e9c3f] https://lava.sirena.org.uk/scheduler/job/1669629 # test job: [37533933bfe92cd5a99ef4743f31dac62ccc8de0] https://lava.sirena.org.uk/scheduler/job/1669021 # test job: [5c36b86d2bf68fbcad16169983ef7ee8c537db59] https://lava.sirena.org.uk/scheduler/job/1667994 # test job: [714165e1c4b0d5b8c6d095fe07f65e6e7047aaeb] https://lava.sirena.org.uk/scheduler/job/1667749 # test job: [9c45f95222beecd6a284fd1284d54dd7a772cf59] https://lava.sirena.org.uk/scheduler/job/1667650 # test job: [bab4ab484a6ca170847da9bffe86f1fa90df4bbe] https://lava.sirena.org.uk/scheduler/job/1664754 # test job: [b832b19318534bb4f1673b24d78037fee339c679] https://lava.sirena.org.uk/scheduler/job/1659321 # test job: [8c02c8353460f8630313aef6810f34e134a3c1ee] https://lava.sirena.org.uk/scheduler/job/1659043 # test job: [6b7e2aa50bdaf88cd4c2a5e2059a7bf32d85a8b1] https://lava.sirena.org.uk/scheduler/job/1656611 # test job: [2291a2186305faaf8525d57849d8ba12ad63f5e7] https://lava.sirena.org.uk/scheduler/job/1655785 # test job: [a54ef14188519a0994d0264f701f5771815fa11e] https://lava.sirena.org.uk/scheduler/job/1656081 # test job: [cf25eb8eae91bcae9b2065d84b0c0ba0f6d9dd34] https://lava.sirena.org.uk/scheduler/job/1653063 # test job: [595b7f155b926460a00776cc581e4dcd01220006] https://lava.sirena.org.uk/scheduler/job/1653171 # test job: [a1d0b0ae65ae3f32597edfbb547f16c75601cd87] https://lava.sirena.org.uk/scheduler/job/1653632 # test job: [3059067fd3378a5454e7928c08d20bf3ef186760] https://lava.sirena.org.uk/scheduler/job/1653613 # test job: [9a200cbdb54349909a42b45379e792e4b39dd223] https://lava.sirena.org.uk/scheduler/job/1653627 # test job: [2d86d2585ab929a143d1e6f8963da1499e33bf13] https://lava.sirena.org.uk/scheduler/job/1653200 # test job: [886f42ce96e7ce80545704e7168a9c6b60cd6c03] https://lava.sirena.org.uk/scheduler/job/1653187 # test job: [162e23657e5379f07c6404dbfbf4367cb438ea7d] https://lava.sirena.org.uk/scheduler/job/1653604 # test job: [3c642997252eef4449cb6b6e02af3dc22515d817] https://lava.sirena.org.uk/scheduler/job/1741780 # bad: [3c642997252eef4449cb6b6e02af3dc22515d817] Add linux-next specific files for 20250827 git bisect bad 3c642997252eef4449cb6b6e02af3dc22515d817 # test job: [7902969a2e75fae35b04772a3e75a29737d463bd] https://lava.sirena.org.uk/scheduler/job/1741974 # good: [7902969a2e75fae35b04772a3e75a29737d463bd] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git git bisect good 7902969a2e75fae35b04772a3e75a29737d463bd # test job: [c72c1b7d500f2e37ae06630ee20add5b68c7723c] https://lava.sirena.org.uk/scheduler/job/1742110 # bad: [c72c1b7d500f2e37ae06630ee20add5b68c7723c] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git git bisect bad c72c1b7d500f2e37ae06630ee20add5b68c7723c # test job: [9f26ae24e6a8435d88cfb8c01f7d02c348eb4868] https://lava.sirena.org.uk/scheduler/job/1742182 # good: [9f26ae24e6a8435d88cfb8c01f7d02c348eb4868] Merge branch 'drm-next' of https://gitlab.freedesktop.org/drm/kernel.git git bisect good 9f26ae24e6a8435d88cfb8c01f7d02c348eb4868 # test job: [257ad6623adaf1685878a0d8724d5c40aa838e93] https://lava.sirena.org.uk/scheduler/job/1742260 # bad: [257ad6623adaf1685878a0d8724d5c40aa838e93] Merge branch 'drm-next' of https://gitlab.freedesktop.org/agd5f/linux.git git bisect bad 257ad6623adaf1685878a0d8724d5c40aa838e93 # test job: [615471b860d628f7e7d9ffdf4b92477493e0a31c] https://lava.sirena.org.uk/scheduler/job/1742299 # good: [615471b860d628f7e7d9ffdf4b92477493e0a31c] drm/amd/pm: Remove cache logic from SMUv13.0.12 git bisect good 615471b860d628f7e7d9ffdf4b92477493e0a31c # test job: [e3bd536580fe553d5768673660b1745ff1bb3b91] https://lava.sirena.org.uk/scheduler/job/1742396 # good: [e3bd536580fe553d5768673660b1745ff1bb3b91] drm/radeon: Use vmalloc_array and vcalloc to simplify code git bisect good e3bd536580fe553d5768673660b1745ff1bb3b91 # test job: [9d3cc361252ee8ff60d7277a97950300e0340ec4] https://lava.sirena.org.uk/scheduler/job/1742517 # good: [9d3cc361252ee8ff60d7277a97950300e0340ec4] drm/amd/display: Consider sink max slice width limitation for dsc git bisect good 9d3cc361252ee8ff60d7277a97950300e0340ec4 # test job: [efe927b9702643a1d80472664c2642f0304cb608] https://lava.sirena.org.uk/scheduler/job/1742628 # good: [efe927b9702643a1d80472664c2642f0304cb608] drm/msm: fix msm_gem_vma_new() allocations for managed GPUVMs git bisect good efe927b9702643a1d80472664c2642f0304cb608 # test job: [b3c7edd5e50e0e92ead8794b084e92d89002dd6f] https://lava.sirena.org.uk/scheduler/job/1742784 # bad: [b3c7edd5e50e0e92ead8794b084e92d89002dd6f] drm/format-helper: Add XRGB8888-to-RGB332 to drm_fb_blit() git bisect bad b3c7edd5e50e0e92ead8794b084e92d89002dd6f # test job: [d6d05e2af796ca25094f80a73d8841505d54368b] https://lava.sirena.org.uk/scheduler/job/1742821 # good: [d6d05e2af796ca25094f80a73d8841505d54368b] video: screen_info: Add pixel-format helper for linear framebuffers git bisect good d6d05e2af796ca25094f80a73d8841505d54368b # test job: [061963cd9e5b60672695e9a592be440469a6bf72] https://lava.sirena.org.uk/scheduler/job/1742968 # bad: [061963cd9e5b60672695e9a592be440469a6bf72] drm/sysfb: Blit to CRTC destination format git bisect bad 061963cd9e5b60672695e9a592be440469a6bf72 # test job: [31eea29d727ce35b747e68c6be350ca07b7ecd9b] https://lava.sirena.org.uk/scheduler/job/1743040 # good: [31eea29d727ce35b747e68c6be350ca07b7ecd9b] drm/sysfb: Find screen_info format with helpers git bisect good 31eea29d727ce35b747e68c6be350ca07b7ecd9b # first bad commit: [061963cd9e5b60672695e9a592be440469a6bf72] drm/sysfb: Blit to CRTC destination format
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerPATCH v2 5/9 drm/color-mgmt: Prepare for RGB332 palettes
In reply to Thomas ZimmermannAdd helper drm_crtc_fill_palette_332(), which fills palettes with RGB332 color data. Each color in RGB332 format serves as an index into an 8-bit palette that stores the corresponding component-based colors.
Vesadrm will use the new helper to emulate RGB formats on top of framebuffers in C8 format.
v2:
- add comments on bit operations (Javier)
--- drivers/gpu/drm/drm_color_mgmt.c | 34 ++++++++++++++++++++++++++++++++ include/drm/drm_color_mgmt.h | 1 + 2 files changed, 35 insertions(+)
drivers/gpu/drm/drm_color_mgmt.c +34 -0
@@ -817,6 +817,40 @@ void drm_crtc_load_palette_8(struct drm_crtc *crtc, const struct drm_color_lut * }EXPORT_SYMBOL (drm_crtc_load_palette_8); +static void fill_palette_332 (struct drm_crtc *crtc,u16 r,u16 g,u16 b, +drm_crtc_set_lut_func set_palette) +{ +unsigned int i = (r <<5 ) | (g <<2 ) | b;/* 8-bit palette index */ + +/* Expand R (3-bit) G (3-bit) and B (2-bit) values to 16-bit values */ + r = (r <<13 ) | (r <<10 ) | (r <<7 ) | (r <<4 ) | (r <<1 ) | (r >>2 ); + g = (g <<13 ) | (g <<10 ) | (g <<7 ) | (g <<4 ) | (g <<1 ) | (g >>2 ); + b = (b <<14 ) | (b <<12 ) | (b <<10 ) | (b <<8 ) | (b <<6 ) | (b <<4 ) | (b <<2 ) | b; + +set_palette (crtc, i, r, g, b); +} + +/** +* drm_crtc_fill_palette_332 - Programs a default palette for R332-like formats +* @crtc: The displaying CRTC +* @set_palette: Callback for programming the hardware gamma LUT +* +* Programs an RGB332 palette to hardware. +*/ +void drm_crtc_fill_palette_332 (struct drm_crtc *crtc,drm_crtc_set_lut_func set_palette) +{ +unsigned int r, g, b; + +/* Limits of 8-8-4 are the maximum number of values for each channel. */ +for (r =0 ; r <8 ; ++r) { +for (g =0 ; g <8 ; ++g) { +for (b =0 ; b <4 ; ++b) +fill_palette_332 (crtc, r, g, b, set_palette); + } + } +} +EXPORT_SYMBOL (drm_crtc_fill_palette_332); +static void fill_palette_8 (struct drm_crtc *crtc,unsigned int i,drm_crtc_set_lut_func set_palette) {
include/drm/drm_color_mgmt.h +1 -0
@@ -143,6 +143,7 @@ void drm_crtc_fill_gamma_555(struct drm_crtc *crtc, drm_crtc_set_lut_func set_gavoid drm_crtc_load_palette_8 (struct drm_crtc *crtc,const struct drm_color_lut *lut,drm_crtc_set_lut_func set_palette); +void drm_crtc_fill_palette_332 (struct drm_crtc *crtc,drm_crtc_set_lut_func set_palette);void drm_crtc_fill_palette_8 (struct drm_crtc *crtc,drm_crtc_set_lut_func set_palette);#endif
Signature · 1 line
2.50.0
Thomas Zimmermann
maintainerPATCH v2 6/9 drm/format-helper: Add XRGB8888-to-RGB332 to drm_fb_blit()
In reply to Thomas ZimmermannList the conversion from XRGB8888-to-RGB332 in drm_fb_blit(), so that drivers based on sysfb-helpers can use it.
--- drivers/gpu/drm/drm_format_helper.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_format_helper.c +3 -0
@@ -1243,6 +1243,9 @@ int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t d }else if (dst_format ==DRM_FORMAT_BGRX8888 ) {drm_fb_swab (dst, dst_pitch, src, fb, clip, false, state);return 0 ; + }else if (dst_format ==DRM_FORMAT_RGB332 ) { +drm_fb_xrgb8888_to_rgb332 (dst, dst_pitch, src, fb, clip, state); +return 0 ; } }
Signature · 1 line
2.50.0
Thomas Zimmermann
maintainerPATCH v2 7/9 drm/vesadrm: Rename vesadrm_set_gamma_lut() to vesadrm_set_color_lut()
In reply to Thomas ZimmermannRename vesadrm's gamma helpers in preparation of the upcoming support for color palettes. Gamma correction and color palettes share the same hardware features, but the driver's old naming only indicated support for gamma LUTs.
--- drivers/gpu/drm/sysfb/vesadrm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/sysfb/vesadrm.c +8 -8
@@ -82,7 +82,7 @@ static struct vesadrm_device *to_vesadrm_device(struct drm_device *dev) }/* -* Palette +* Color LUT */ static void vesadrm_vga_cmap_write(struct vesadrm_device *vesa, unsigned int index,
@@ -128,7 +128,7 @@ static void vesadrm_pmi_cmap_write(struct vesadrm_device *vesa, unsigned int ind }#endif -static void vesadrm_set_gamma_lut (struct drm_crtc *crtc,unsigned int index, +static void vesadrm_set_color_lut (struct drm_crtc *crtc,unsigned int index,u16 red,u16 green,u16 blue) {struct drm_device *dev = crtc->dev;
@@ -149,15 +149,15 @@ static void vesadrm_fill_gamma_lut(struct vesadrm_device *vesa,switch (format->format) {case DRM_FORMAT_XRGB1555 : -drm_crtc_fill_gamma_555 (crtc, vesadrm_set_gamma_lut); +drm_crtc_fill_gamma_555 (crtc, vesadrm_set_color_lut);break ;case DRM_FORMAT_RGB565 : -drm_crtc_fill_gamma_565 (crtc, vesadrm_set_gamma_lut); +drm_crtc_fill_gamma_565 (crtc, vesadrm_set_color_lut);break ;case DRM_FORMAT_RGB888 :case DRM_FORMAT_XRGB8888 :case DRM_FORMAT_BGRX8888 : -drm_crtc_fill_gamma_888 (crtc, vesadrm_set_gamma_lut); +drm_crtc_fill_gamma_888 (crtc, vesadrm_set_color_lut);break ;default : drm_warn_once(dev, "Unsupported format %p4cc for gamma correction\n",
@@ -175,15 +175,15 @@ static void vesadrm_load_gamma_lut(struct vesadrm_device *vesa,switch (format->format) {case DRM_FORMAT_XRGB1555 : -drm_crtc_load_gamma_555_from_888 (crtc, lut, vesadrm_set_gamma_lut); +drm_crtc_load_gamma_555_from_888 (crtc, lut, vesadrm_set_color_lut);break ;case DRM_FORMAT_RGB565 : -drm_crtc_load_gamma_565_from_888 (crtc, lut, vesadrm_set_gamma_lut); +drm_crtc_load_gamma_565_from_888 (crtc, lut, vesadrm_set_color_lut);break ;case DRM_FORMAT_RGB888 :case DRM_FORMAT_XRGB8888 :case DRM_FORMAT_BGRX8888 : -drm_crtc_load_gamma_888 (crtc, lut, vesadrm_set_gamma_lut); +drm_crtc_load_gamma_888 (crtc, lut, vesadrm_set_color_lut);break ;default : drm_warn_once(dev, "Unsupported format %p4cc for gamma correction\n",
Signature · 1 line
2.50.0
Thomas Zimmermann
maintainerPATCH v2 8/9 drm/vesadrm: Prepare color management for palette-based framebuffers
In reply to Thomas ZimmermannDistiguish between component-based formats and 'the rest' in vesadrm's color management. Scanout buffers with component-based format allow for gamma correction. Palette-based formats (i.e., 'the rest') require palette setup.
--- drivers/gpu/drm/sysfb/vesadrm.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/gpu/drm/sysfb/vesadrm.c +15 -8
@@ -223,15 +223,22 @@ static void vesadrm_crtc_helper_atomic_flush(struct drm_crtc *crtc,* plane's color format. */ if (crtc_state->enable && crtc_state->color_mgmt_changed) { -if (sysfb_crtc_state->format == sysfb->fb_format) { -if (crtc_state->gamma_lut) -vesadrm_load_gamma_lut (vesa, - sysfb_crtc_state->format, - crtc_state->gamma_lut->data); -else +switch (sysfb->fb_format->format) { +/* +* Component formats +*/ +default : +if (sysfb_crtc_state->format == sysfb->fb_format) { +if (crtc_state->gamma_lut) +vesadrm_load_gamma_lut (vesa, + sysfb_crtc_state->format, + crtc_state->gamma_lut->data); +else +vesadrm_fill_gamma_lut (vesa, sysfb_crtc_state->format); + }else {vesadrm_fill_gamma_lut (vesa, sysfb_crtc_state->format); - }else { -vesadrm_fill_gamma_lut (vesa, sysfb_crtc_state->format); + } +break ; } } }
Signature · 1 line
2.50.0
Thomas Zimmermann
maintainerPATCH v2 9/9 drm/vesadrm: Support DRM_FORMAT_C8
In reply to Thomas ZimmermannAdd support for DRM_FORMAT_C8 to vesadrm. The new pixel-format description PIXEL_FORMAT_C8 describes the layout. Vesadrm's helpers vesadrm_fill_palette_lut() and vesadrm_load_palette_lut() set the hardware palette according to the CRTC's output format.
The driver emulates XRGB8888 by converting the source buffer to RGB332 and using the resulting 256 colors as index into the hardware palette. The hardware palette converts back to RGB during scanout. This has no overhead compared to other format conversion, but allows common userspace, such as Wayland compositors, to operate on the display.
--- drivers/gpu/drm/sysfb/vesadrm.c | 114 +++++++++++++++++++++++++++++++- include/video/pixel_format.h | 3 + 2 files changed, 116 insertions(+), 1 deletion(-)
drivers/gpu/drm/sysfb/vesadrm.c +113 -1
@@ -46,6 +46,7 @@ static const struct drm_format_info *vesadrm_get_format_si(struct drm_device *de { PIXEL_FORMAT_RGB888, DRM_FORMAT_RGB888, }, { PIXEL_FORMAT_XRGB8888, DRM_FORMAT_XRGB8888, }, { PIXEL_FORMAT_XBGR8888, DRM_FORMAT_XBGR8888, }, + { PIXEL_FORMAT_C8, DRM_FORMAT_C8, }, };return drm_sysfb_get_format_si (dev, formats,ARRAY_SIZE (formats), si);
@@ -192,6 +193,44 @@ static void vesadrm_load_gamma_lut(struct vesadrm_device *vesa, } } +static void vesadrm_fill_palette_lut (struct vesadrm_device *vesa, +const struct drm_format_info *format) +{ +struct drm_device *dev = &vesa->sysfb.dev; +struct drm_crtc *crtc = &vesa->crtc; + +switch (format->format) { +case DRM_FORMAT_C8 : +drm_crtc_fill_palette_8 (crtc, vesadrm_set_color_lut); +break ; +case DRM_FORMAT_RGB332 : +drm_crtc_fill_palette_332 (crtc, vesadrm_set_color_lut); +break ; +default : +drm_warn_once (dev,"Unsupported format %p4cc for palette\n" , + &format->format); +break ; + } +} + +static void vesadrm_load_palette_lut (struct vesadrm_device *vesa, +const struct drm_format_info *format, +struct drm_color_lut *lut) +{ +struct drm_device *dev = &vesa->sysfb.dev; +struct drm_crtc *crtc = &vesa->crtc; + +switch (format->format) { +case DRM_FORMAT_C8 : +drm_crtc_load_palette_8 (crtc, lut, vesadrm_set_color_lut); +break ; +default : +drm_warn_once (dev,"Unsupported format %p4cc for gamma correction\n" , + &format->format); +break ; + } +} +/* * Modesetting */
@@ -200,8 +239,67 @@ static const u64 vesadrm_primary_plane_format_modifiers[] = { DRM_SYSFB_PLANE_FORMAT_MODIFIERS, }; +static int vesadrm_primary_plane_helper_atomic_check (struct drm_plane *plane, +struct drm_atomic_state *new_state) +{ +struct drm_sysfb_device *sysfb =to_drm_sysfb_device (plane->dev); +struct drm_plane_state *new_plane_state =drm_atomic_get_new_plane_state (new_state, plane); +struct drm_framebuffer *new_fb = new_plane_state->fb; +struct drm_crtc_state *new_crtc_state; +struct drm_sysfb_crtc_state *new_sysfb_crtc_state; +int ret; + + ret =drm_sysfb_plane_helper_atomic_check (plane, new_state); +if (ret) +return ret; +else if (!new_plane_state->visible) +return 0 ; + +/* +* Fix up format conversion for specific cases +*/ + +switch (sysfb->fb_format->format) { +case DRM_FORMAT_C8 : + new_crtc_state =drm_atomic_get_new_crtc_state (new_state, new_plane_state->crtc); + new_sysfb_crtc_state =to_drm_sysfb_crtc_state (new_crtc_state); + +switch (new_fb->format->format) { +case DRM_FORMAT_XRGB8888 : +/* +* Reduce XRGB8888 to RGB332. Each resulting pixel is an index +* into the C8 hardware palette, which stores RGB332 colors. +*/ +if (new_sysfb_crtc_state->format->format !=DRM_FORMAT_RGB332 ) { + new_sysfb_crtc_state->format = +drm_format_info (DRM_FORMAT_RGB332 ); + new_crtc_state->color_mgmt_changed = true; + } +break ; +case DRM_FORMAT_C8 : +/* +* Restore original output. Emulation of XRGB8888 set RBG332 +* output format and hardware palette. This needs to be undone +* when we switch back to DRM_FORMAT_C8. +*/ +if (new_sysfb_crtc_state->format->format ==DRM_FORMAT_RGB332 ) { + new_sysfb_crtc_state->format = sysfb->fb_format; + new_crtc_state->color_mgmt_changed = true; + } +break ; + } +break ; + }; + +return 0 ; +} +static const struct drm_plane_helper_funcs vesadrm_primary_plane_helper_funcs = { -DRM_SYSFB_PLANE_HELPER_FUNCS , +DRM_GEM_SHADOW_PLANE_HELPER_FUNCS , + .atomic_check = vesadrm_primary_plane_helper_atomic_check, + .atomic_update = drm_sysfb_plane_helper_atomic_update, + .atomic_disable = drm_sysfb_plane_helper_atomic_disable, + .get_scanout_buffer = drm_sysfb_plane_helper_get_scanout_buffer, };static const struct drm_plane_funcs vesadrm_primary_plane_funcs = {
@@ -224,6 +322,20 @@ static void vesadrm_crtc_helper_atomic_flush(struct drm_crtc *crtc,*/ if (crtc_state->enable && crtc_state->color_mgmt_changed) {switch (sysfb->fb_format->format) { +/* +* Index formats +*/ +case DRM_FORMAT_C8 : +if (sysfb_crtc_state->format->format ==DRM_FORMAT_RGB332 ) { +vesadrm_fill_palette_lut (vesa, sysfb_crtc_state->format); + }else if (crtc->state->gamma_lut) { +vesadrm_load_palette_lut (vesa, + sysfb_crtc_state->format, + crtc_state->gamma_lut->data); + }else { +vesadrm_fill_palette_lut (vesa, sysfb_crtc_state->format); + } +break ;/* * Component formats */
include/video/pixel_format.h +3 -0
@@ -20,6 +20,9 @@ struct pixel_format { }; }; +#define PIXEL_FORMAT_C8 \ + { 8, true, { .index = {0, 8}, } } +#define PIXEL_FORMAT_XRGB1555 \ { 16, false, { .alpha = {0, 0}, .red = {10, 5}, .green = {5, 5}, .blue = {0, 5} } }
Signature · 1 line
2.50.0