linux/drivers/video/fbdev/efifb.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Framebuffer driver for EFI/UEFI based system
 *
 * (c) 2006 Edgar Hucek <[email protected]>
 * Original efi driver written by Gerd Knorr <[email protected]>
 *
 */

#include <linux/aperture.h>
#include <linux/kernel.h>
#include <linux/efi.h>
#include <linux/efi-bgrt.h>
#include <linux/errno.h>
#include <linux/fb.h>
#include <linux/platform_device.h>
#include <linux/printk.h>
#include <linux/screen_info.h>
#include <video/vga.h>
#include <asm/efi.h>
#include <drm/drm_utils.h> /* For drm_get_panel_orientation_quirk */
#include <drm/drm_connector.h>  /* For DRM_MODE_PANEL_ORIENTATION_* */

struct bmp_file_header {} __packed;

struct bmp_dib_header {} __packed;

static bool use_bgrt =;
static bool request_mem_succeeded =;
static u64 mem_flags =;

struct efifb_par {};

static struct fb_var_screeninfo efifb_defined =;

static struct fb_fix_screeninfo efifb_fix =;

static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green,
			   unsigned blue, unsigned transp,
			   struct fb_info *info)
{}

/*
 * If fbcon deffered console takeover is configured, the intent is for the
 * framebuffer to show the boot graphics (e.g. vendor logo) until there is some
 * (error) message to display. But the boot graphics may have been destroyed by
 * e.g. option ROM output, detect this and restore the boot graphics.
 */
#if defined CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER && \
    defined CONFIG_ACPI_BGRT
static void efifb_copy_bmp(u8 *src, u32 *dst, int width, const struct screen_info *si)
{}

#ifdef CONFIG_X86
/*
 * On x86 some firmwares use a low non native resolution for the display when
 * they have shown some text messages. While keeping the bgrt filled with info
 * for the native resolution. If the bgrt image intended for the native
 * resolution still fits, it will be displayed very close to the right edge of
 * the display looking quite bad. This function checks for this.
 */
static bool efifb_bgrt_sanity_check(const struct screen_info *si, u32 bmp_width)
{}
#else
static bool efifb_bgrt_sanity_check(const struct screen_info *si, u32 bmp_width)
{
	return true;
}
#endif

static void efifb_show_boot_graphics(struct fb_info *info, const struct screen_info *si)
{}
#else
static inline void efifb_show_boot_graphics(struct fb_info *info, const struct screen_info *si)
{ }
#endif

/*
 * fb_ops.fb_destroy is called by the last put_fb_info() call at the end
 * of unregister_framebuffer() or fb_release(). Do any cleanup here.
 */
static void efifb_destroy(struct fb_info *info)
{}

static const struct fb_ops efifb_ops =;

static int efifb_setup(struct screen_info *si, char *options)
{}

static inline bool fb_base_is_valid(struct screen_info *si)
{}

#define efifb_attr_decl(name, fmt)

efifb_attr_decl();
efifb_attr_decl();
efifb_attr_decl();
efifb_attr_decl();
efifb_attr_decl();

static struct attribute *efifb_attrs[] =;
ATTRIBUTE_GROUPS();

static int efifb_probe(struct platform_device *dev)
{}

static struct platform_driver efifb_driver =;

builtin_platform_driver();