mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

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
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef VIDEO_PIXEL_FORMAT_H
|
|
#define VIDEO_PIXEL_FORMAT_H
|
|
|
|
struct pixel_format {
|
|
unsigned char bits_per_pixel;
|
|
bool indexed;
|
|
union {
|
|
struct {
|
|
struct {
|
|
unsigned char offset;
|
|
unsigned char length;
|
|
} alpha, red, green, blue;
|
|
};
|
|
struct {
|
|
unsigned char offset;
|
|
unsigned char length;
|
|
} index;
|
|
};
|
|
};
|
|
|
|
#define PIXEL_FORMAT_XRGB1555 \
|
|
{ 16, false, { .alpha = {0, 0}, .red = {10, 5}, .green = {5, 5}, .blue = {0, 5} } }
|
|
|
|
#define PIXEL_FORMAT_RGB565 \
|
|
{ 16, false, { .alpha = {0, 0}, .red = {11, 5}, .green = {5, 6}, .blue = {0, 5} } }
|
|
|
|
#define PIXEL_FORMAT_RGB888 \
|
|
{ 24, false, { .alpha = {0, 0}, .red = {16, 8}, .green = {8, 8}, .blue = {0, 8} } }
|
|
|
|
#define PIXEL_FORMAT_XRGB8888 \
|
|
{ 32, false, { .alpha = {0, 0}, .red = {16, 8}, .green = {8, 8}, .blue = {0, 8} } }
|
|
|
|
#define PIXEL_FORMAT_XBGR8888 \
|
|
{ 32, false, { .alpha = {0, 0}, .red = {0, 8}, .green = {8, 8}, .blue = {16, 8} } }
|
|
|
|
#define PIXEL_FORMAT_XRGB2101010 \
|
|
{ 32, false, { .alpha = {0, 0}, .red = {20, 10}, .green = {10, 10}, .blue = {0, 10} } }
|
|
|
|
#endif
|