Skip to content

Commit c813457

Browse files
committed
drm/sysfb: Add efidrm for EFI displays
JIRA: https://issues.redhat.com/browse/RHEL-113577 Upstream Status: v6.16 Only the changes to "drivers/gpu/drm/sysfb/Kconfig" and "include/video/pixel_format.h" are backported. The changes for "drivers/gpu/drm/sysfb/efidrm.c" present in the upstream patch are already available in this tree. NOTE: This commit does not compile due to missing RHEL-specific fix-ups, which are split out into separate Git commits following this one. If git bisect selected this commit, run "git bisect skip" and try again. Repeat this until it selects a commit which compiles. commit 32ae90c Author: Thomas Zimmermann <tzimmermann@suse.de> Date: Tue Apr 1 11:37:17 2025 +0200 drm/sysfb: Add efidrm for EFI displays Add support for screen_info setups with VIDEO_TYPE_EFI. 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 efidrm over simpledrm will allows for the mapping of video memory with correct caching. Simpledrm always assumes WC caching, while fully cached memory is possible with efidrm. Efidrm will also allow for the use of additional functionality provided by EFI, such as EDID information. In addition to efidrm, add struct pixel_format plus initializer macros. The type and macros describe pixel formats in a generic way on order to find the DRM format from the screen_info settings. Similar existing code in SIMPLEFB_FORMATS and fbdev is not really what is needed in efidrm, but SIMPLEFB_FORMATS can later be converted to struct pixel_format. v4: - depend on CONFIG_EFI - disallow module for now as efi_mem_desc_lookup() is not exported 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-15-tzimmermann@suse.de Signed-off-by: José Expósito <jexposit@redhat.com>
1 parent e4e1dc9 commit c813457

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

drivers/gpu/drm/sysfb/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ config DRM_SYSFB_HELPER
88
depends on DRM
99

1010
config DRM_EFIDRM
11-
tristate "EFI framebuffer driver"
12-
depends on DRM && MMU && EFI && (!SYSFB_SIMPLEFB || COMPILE_TEST)
11+
bool "EFI framebuffer driver"
12+
depends on (DRM=y) && MMU && EFI && (!SYSFB_SIMPLEFB || COMPILE_TEST)
1313
select APERTURE_HELPERS
1414
select DRM_CLIENT_SELECTION
1515
select DRM_GEM_SHMEM_HELPER

include/video/pixel_format.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
3+
#ifndef VIDEO_PIXEL_FORMAT_H
4+
#define VIDEO_PIXEL_FORMAT_H
5+
6+
struct pixel_format {
7+
unsigned char bits_per_pixel;
8+
bool indexed;
9+
union {
10+
struct {
11+
struct {
12+
unsigned char offset;
13+
unsigned char length;
14+
} alpha, red, green, blue;
15+
};
16+
struct {
17+
unsigned char offset;
18+
unsigned char length;
19+
} index;
20+
};
21+
};
22+
23+
#define PIXEL_FORMAT_XRGB1555 \
24+
{ 16, false, { .alpha = {0, 0}, .red = {10, 5}, .green = {5, 5}, .blue = {0, 5} } }
25+
26+
#define PIXEL_FORMAT_RGB565 \
27+
{ 16, false, { .alpha = {0, 0}, .red = {11, 5}, .green = {5, 6}, .blue = {0, 5} } }
28+
29+
#define PIXEL_FORMAT_RGB888 \
30+
{ 24, false, { .alpha = {0, 0}, .red = {16, 8}, .green = {8, 8}, .blue = {0, 8} } }
31+
32+
#define PIXEL_FORMAT_XRGB8888 \
33+
{ 32, false, { .alpha = {0, 0}, .red = {16, 8}, .green = {8, 8}, .blue = {0, 8} } }
34+
35+
#define PIXEL_FORMAT_XBGR8888 \
36+
{ 32, false, { .alpha = {0, 0}, .red = {0, 8}, .green = {8, 8}, .blue = {16, 8} } }
37+
38+
#define PIXEL_FORMAT_XRGB2101010 \
39+
{ 32, false, { .alpha = {0, 0}, .red = {20, 10}, .green = {10, 10}, .blue = {0, 10} } }
40+
41+
#endif

0 commit comments

Comments
 (0)