Commit 82dcb90b authored by Thomas Zimmermann's avatar Thomas Zimmermann

fbdev/efifb: Add struct efifb_par for driver data

The efifb_par structure holds the palette for efifb. It will also
be useful for storing the device's aperture range.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-11-tzimmermann@suse.de
parent e12fa354
...@@ -49,6 +49,10 @@ static u64 mem_flags = EFI_MEMORY_WC | EFI_MEMORY_UC; ...@@ -49,6 +49,10 @@ static u64 mem_flags = EFI_MEMORY_WC | EFI_MEMORY_UC;
static struct pci_dev *efifb_pci_dev; /* dev with BAR covering the efifb */ static struct pci_dev *efifb_pci_dev; /* dev with BAR covering the efifb */
struct efifb_par {
u32 pseudo_palette[16];
};
static struct fb_var_screeninfo efifb_defined = { static struct fb_var_screeninfo efifb_defined = {
.activate = FB_ACTIVATE_NOW, .activate = FB_ACTIVATE_NOW,
.height = -1, .height = -1,
...@@ -351,6 +355,7 @@ static u64 bar_offset; ...@@ -351,6 +355,7 @@ static u64 bar_offset;
static int efifb_probe(struct platform_device *dev) static int efifb_probe(struct platform_device *dev)
{ {
struct fb_info *info; struct fb_info *info;
struct efifb_par *par;
int err, orientation; int err, orientation;
unsigned int size_vmode; unsigned int size_vmode;
unsigned int size_remap; unsigned int size_remap;
...@@ -447,14 +452,14 @@ static int efifb_probe(struct platform_device *dev) ...@@ -447,14 +452,14 @@ static int efifb_probe(struct platform_device *dev)
efifb_fix.smem_start); efifb_fix.smem_start);
} }
info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); info = framebuffer_alloc(sizeof(*par), &dev->dev);
if (!info) { if (!info) {
err = -ENOMEM; err = -ENOMEM;
goto err_release_mem; goto err_release_mem;
} }
platform_set_drvdata(dev, info); platform_set_drvdata(dev, info);
info->pseudo_palette = info->par; par = info->par;
info->par = NULL; info->pseudo_palette = par->pseudo_palette;
info->apertures = alloc_apertures(1); info->apertures = alloc_apertures(1);
if (!info->apertures) { if (!info->apertures) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment