| 27a7e8b6 | 26-Aug-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/sysfb: Do not deref unexisting CRTC state in atomic_disable
Do not access CRTC state in drm_sysfb_plane_helper_atomic_disable(). Use format from sysfb device for clearing scanout buffer. This is
drm/sysfb: Do not deref unexisting CRTC state in atomic_disable
Do not access CRTC state in drm_sysfb_plane_helper_atomic_disable(). Use format from sysfb device for clearing scanout buffer. This is the behavior from before commit 061963cd9e5b ("drm/sysfb: Blit to CRTC destination format").
When being disabled, the plane has no associated CRTC. Trying to deref the format pointer results in a segmentation fault. An example stack track is shown below.
[ 58.948915] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000023: 0000 [#1] SMP KASAN PTI [ 58.959971] KASAN: null-ptr-deref in range [0x0000000000000118-0x000000000000011f] [...] [ 58.979308] RIP: 0010:drm_sysfb_plane_helper_atomic_disable+0x1af/0x520 [...] [ 59.084227] Call Trace: [ 59.086682] <TASK> [ 59.088793] ? __pfx_drm_sysfb_plane_helper_atomic_disable+0x10/0x10 [ 59.095155] ? crtc_disable+0xf2/0x5a0 [ 59.098920] drm_atomic_helper_commit_planes+0x848/0x1030 [ 59.104336] drm_atomic_helper_commit_tail+0x41/0xb0 [ 59.109316] commit_tail+0x204/0x330 [ 59.112903] drm_atomic_helper_commit+0x242/0x2e0 [ 59.117618] ? __pfx_drm_atomic_helper_commit+0x10/0x10 [ 59.122851] drm_atomic_commit+0x1e1/0x290 [ 59.126957] ? drm_atomic_add_affected_connectors+0x266/0x330 [ 59.132714] ? __pfx_drm_atomic_commit+0x10/0x10 [ 59.137343] ? __pfx___drm_printfn_info+0x10/0x10 [ 59.142058] ? drm_atomic_set_crtc_for_connector+0x436/0x630 [ 59.147729] atomic_remove_fb+0x631/0x920 [ 59.151751] ? save_trace+0xcf/0x180 [ 59.155343] ? __pfx_atomic_remove_fb+0x10/0x10 [ 59.159890] ? __pfx___drm_dev_dbg+0x10/0x10 [ 59.164173] drm_framebuffer_remove+0x19a/0x710
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 061963cd9e5b ("drm/sysfb: Blit to CRTC destination format") Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14874 Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Javier Martinez Canillas <javierm@redhat.com> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://lore.kernel.org/r/20250826145044.954396-1-tzimmermann@suse.de
show more ...
|
| 7399c13f | 14-Jul-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/vesadrm: Support DRM_FORMAT_C8
Add 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 v
drm/vesadrm: Support DRM_FORMAT_C8
Add 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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250714151513.309475-10-tzimmermann@suse.de
show more ...
|
| 1adb35c2 | 14-Jul-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/vesadrm: Prepare color management for palette-based framebuffers
Distiguish between component-based formats and 'the rest' in vesadrm's color management. Scanout buffers with component-based for
drm/vesadrm: Prepare color management for palette-based framebuffers
Distiguish 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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250714151513.309475-9-tzimmermann@suse.de
show more ...
|
| cbc383ce | 14-Jul-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/vesadrm: Rename vesadrm_set_gamma_lut() to vesadrm_set_color_lut()
Rename vesadrm's gamma helpers in preparation of the upcoming support for color palettes. Gamma correction and color palettes s
drm/vesadrm: Rename vesadrm_set_gamma_lut() to vesadrm_set_color_lut()
Rename 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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250714151513.309475-8-tzimmermann@suse.de
show more ...
|
| 061963cd | 14-Jul-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/sysfb: Blit to CRTC destination format
Use the color format stored in struct drm_sysfb_crtc_state for color-format conversion instead of the scanout-buffer format announced by firmware. Currentl
drm/sysfb: Blit to CRTC destination format
Use 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
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250714151513.309475-5-tzimmermann@suse.de
show more ...
|
| c06cb85a | 20-May-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/vesadrm: Use helpers for programming gamma ramps
Replace vesadrm's code for programming the hardware gamma LUT with DRM helpers. Either load a provided gamma ramp or program a default. Set the i
drm/vesadrm: Use helpers for programming gamma ramps
Replace vesadrm's code for programming the hardware gamma LUT with DRM helpers. Either load a provided gamma ramp or program a default. Set the individual entries with a callback.
Each gamma value is given as 3 individual 16-bit values for red, green and blue. The driver reduces them to 8 bit to make them fit into hardware registers.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250520094203.30545-6-tzimmermann@suse.de
show more ...
|
| e8c08688 | 10-Apr-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/sysfb: Share helpers for screen_info validation
Share efidrm's and vesadrm's validation of struct screen_info in shared helpers. Update the drivers.
Most validation helpers test individual valu
drm/sysfb: Share helpers for screen_info validation
Share efidrm's and vesadrm's validation of struct screen_info in shared helpers. Update the drivers.
Most validation helpers test individual values against limits and can be shared as they are. For color formats, a common helper looks up the correct DRM format info from a driver-provided list of color formats.
These screen_info helpers are only available if CONFIG_SCREEN_INFO has been selected, as done by efidrm and vesadrm.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250410083834.10810-4-tzimmermann@suse.de
show more ...
|
| 6046b49b | 10-Apr-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/sysfb: Share helpers for integer validation
Provide sysfb helpers for validating framebuffer integer values against limits. Update drivers. If a driver did not specify a limit for a certain valu
drm/sysfb: Share helpers for integer validation
Provide sysfb helpers for validating framebuffer integer values against limits. Update drivers. If a driver did not specify a limit for a certain value, use INT_MAX.
v2: - declare module information near EOF (Javier)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250410083834.10810-3-tzimmermann@suse.de
show more ...
|
| b9a96a0b | 07-Apr-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/sysfb: simpledrm: Remove unused helper simpledrm_device_of_dev()
After moving most of the mode-setting pipeline into drm_sysfb_helper.c, simpledrm_device_of_dev() is no longer being used. Remove
drm/sysfb: simpledrm: Remove unused helper simpledrm_device_of_dev()
After moving most of the mode-setting pipeline into drm_sysfb_helper.c, simpledrm_device_of_dev() is no longer being used. Remove it.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reported-by: Jocelyn Falempe <jfalempe@redhat.com> Closes: https://lore.kernel.org/dri-devel/20250407131344.139878-1-jfalempe@redhat.com/ Fixes: 177dfbdb7e67 ("drm/sysfb: Merge primary-plane functions") Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250407134753.985925-3-tzimmermann@suse.de
show more ...
|
| 814d270b | 01-Apr-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/sysfb: vesadrm: Add gamma correction
Add palette support and export GAMMA properties via sysfs. User-space compositors can use this interface for programming gamma ramps or night mode.
Vesadrm
drm/sysfb: vesadrm: Add gamma correction
Add palette support and export GAMMA properties via sysfs. User-space compositors can use this interface for programming gamma ramps or night mode.
Vesadrm supports palette updates via VGA DAC registers or VESA palette calls. Up to 256 palette entries are available. Userspace always supplies gamma ramps of 256 entries. If the native color format does not match this because pixel component have less then 8 bits, vesadrm interpolates among the palette entries.
The code uses CamelCase style in a few places to match the VESA manuals.
v3: - fix coding style v2: - use CONFIG_X86_32 instead of __i386__ (checkpatch) - protect struct vesadrm.pmi with CONFIG_X86_32
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250401094056.32904-19-tzimmermann@suse.de
show more ...
|
| 9d0de9e8 | 01-Apr-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/sysfb: vesadrm: Add EDID support
Enable the connector's EDID property if edid_info contains valid data. Exports the EDID via sysfs for user-space compositors.
EDID information is not always ava
drm/sysfb: vesadrm: Add EDID support
Enable the connector's EDID property if edid_info contains valid data. Exports the EDID via sysfs for user-space compositors.
EDID information is not always available. Depending on the system and kernel configuration, it is either provided by the boot loader or read by the kernel during early boot stages.
There's only one VESA display, so EDID data always belongs to this output.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250401094056.32904-18-tzimmermann@suse.de
show more ...
|
| a84eb6ab | 01-Apr-2025 |
Thomas Zimmermann <tzimmermann@suse.de> |
drm/sysfb: Add vesadrm for VESA displays
Add support for screen_info setups with VIDEO_TYPE_VLFB. Provide the minimum functionality of reading modes, updating and clearing the display.
There is exi
drm/sysfb: Add vesadrm for VESA displays
Add support for screen_info setups with VIDEO_TYPE_VLFB. Provide the minimum functionality of reading modes, updating and clearing the display.
There is existing support for these displays provided by simpledrm with CONFIG_SYSFB_SIMPLEFB=y. Using vesadrm over simpledrm will allow for the use of additional functionality provided by VESA, such as EDID information, gamma correction and palette modes. This enhances the user experience and adds support for more display configuratons.
v4: - depend on CONFIG_X86 v3: - depend on !SYSFB_SIMPLEFB (Javier)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250401094056.32904-17-tzimmermann@suse.de
show more ...
|