diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2022-12-19 17:05:08 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2023-01-13 12:54:28 +0100 |
commit | 82dcb90b651bcbb2c2849d1bd386f3ae88b4a463 (patch) | |
tree | a2e2440d2dce32ada0ec94472cabb0d83f2ec745 /drivers/video/fbdev/efifb.c | |
parent | e12fa3544469b761ba72b070190d272e2a644e54 (diff) | |
download | lwn-82dcb90b651bcbb2c2849d1bd386f3ae88b4a463.tar.gz lwn-82dcb90b651bcbb2c2849d1bd386f3ae88b4a463.zip |
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: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-11-tzimmermann@suse.de
Diffstat (limited to 'drivers/video/fbdev/efifb.c')
-rw-r--r-- | drivers/video/fbdev/efifb.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 16c1aaae9afa..694013f62781 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -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 */ +struct efifb_par { + u32 pseudo_palette[16]; +}; + static struct fb_var_screeninfo efifb_defined = { .activate = FB_ACTIVATE_NOW, .height = -1, @@ -351,6 +355,7 @@ static u64 bar_offset; static int efifb_probe(struct platform_device *dev) { struct fb_info *info; + struct efifb_par *par; int err, orientation; unsigned int size_vmode; unsigned int size_remap; @@ -447,14 +452,14 @@ static int efifb_probe(struct platform_device *dev) efifb_fix.smem_start); } - info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); + info = framebuffer_alloc(sizeof(*par), &dev->dev); if (!info) { err = -ENOMEM; goto err_release_mem; } platform_set_drvdata(dev, info); - info->pseudo_palette = info->par; - info->par = NULL; + par = info->par; + info->pseudo_palette = par->pseudo_palette; info->apertures = alloc_apertures(1); if (!info->apertures) { |