• Home
  • Raw
  • Download

Lines Matching +full:assigned +full:- +full:resolution +full:- +full:bits

1 // SPDX-License-Identifier: GPL-2.0
5 * (c) 2006 Edgar Hucek <gimli@dark-green.com>
6 * Original efi driver written by Gerd Knorr <kraxel@goldbach.in-berlin.de>
12 #include <linux/efi-bgrt.h>
51 .height = -1,
52 .width = -1,
78 if (regno >= info->cmap.len) in efifb_setcolreg()
82 red >>= 16 - info->var.red.length; in efifb_setcolreg()
83 green >>= 16 - info->var.green.length; in efifb_setcolreg()
84 blue >>= 16 - info->var.blue.length; in efifb_setcolreg()
85 ((u32 *)(info->pseudo_palette))[regno] = in efifb_setcolreg()
86 (red << info->var.red.offset) | in efifb_setcolreg()
87 (green << info->var.green.offset) | in efifb_setcolreg()
88 (blue << info->var.blue.offset); in efifb_setcolreg()
105 while (width--) { in efifb_copy_bmp()
109 *dst++ = (r << si->red_pos) | in efifb_copy_bmp()
110 (g << si->green_pos) | in efifb_copy_bmp()
111 (b << si->blue_pos); in efifb_copy_bmp()
117 * On x86 some firmwares use a low non native resolution for the display when
119 * for the native resolution. If the bgrt image intended for the native
120 * resolution still fits, it will be displayed very close to the right edge of
129 u32 expected_xoffset = (si->lfb_width - bmp_width) / 2; in efifb_bgrt_sanity_check()
147 u8 *dst = info->screen_base; in efifb_show_boot_graphics()
158 pr_info("efifb: BGRT rotation bits set, not showing boot graphics\n"); in efifb_show_boot_graphics()
168 if (si->lfb_depth != 32) { in efifb_show_boot_graphics()
169 pr_info("efifb: not 32 bits, not showing boot graphics\n"); in efifb_show_boot_graphics()
184 if (file_header->id != 0x4d42 || file_header->reserved != 0) in efifb_show_boot_graphics()
188 if (dib_header->dib_header_size != 40 || dib_header->width < 0 || in efifb_show_boot_graphics()
189 dib_header->planes != 1 || dib_header->bpp != 24 || in efifb_show_boot_graphics()
190 dib_header->compression != 0) in efifb_show_boot_graphics()
193 bmp_width = dib_header->width; in efifb_show_boot_graphics()
194 bmp_height = abs(dib_header->height); in efifb_show_boot_graphics()
196 screen_pitch = si->lfb_linelength; in efifb_show_boot_graphics()
198 if ((file_header->bitmap_offset + bmp_pitch * bmp_height) > in efifb_show_boot_graphics()
202 if ((bgrt_tab.image_offset_x + bmp_width) > si->lfb_width || in efifb_show_boot_graphics()
203 (bgrt_tab.image_offset_y + bmp_height) > si->lfb_height) in efifb_show_boot_graphics()
211 for (y = 0; y < si->lfb_height; y++, dst += si->lfb_linelength) { in efifb_show_boot_graphics()
215 memset(dst, 0, 4 * si->lfb_width); in efifb_show_boot_graphics()
219 src_y = y - bgrt_tab.image_offset_y; in efifb_show_boot_graphics()
221 if (dib_header->height > 0) in efifb_show_boot_graphics()
222 src_y = (bmp_height - 1) - src_y; in efifb_show_boot_graphics()
226 efifb_copy_bmp(bgrt_image + file_header->bitmap_offset + in efifb_show_boot_graphics()
230 memset((u32 *)dst + dst_x, 0, (si->lfb_width - dst_x) * 4); in efifb_show_boot_graphics()
246 if (info->screen_base) { in efifb_destroy()
248 iounmap(info->screen_base); in efifb_destroy()
250 memunmap(info->screen_base); in efifb_destroy()
253 release_mem_region(info->apertures->ranges[0].base, in efifb_destroy()
254 info->apertures->ranges[0].size); in efifb_destroy()
255 fb_dealloc_cmap(&info->cmap); in efifb_destroy()
351 return -ENODEV; in efifb_probe()
354 return -ENODEV; in efifb_probe()
362 return -ENODEV; in efifb_probe()
370 return -ENODEV; in efifb_probe()
396 bar_resource->start + bar_offset != efifb_fix.smem_start) { in efifb_probe()
397 dev_info(&efifb_pci_dev->dev, in efifb_probe()
399 efifb_fix.smem_start = bar_resource->start + bar_offset; in efifb_probe()
407 /* size_vmode -- that is the amount of memory needed for the in efifb_probe()
412 /* size_total -- all video memory we have. Used for in efifb_probe()
419 /* size_remap -- the amount of video memory we are going to in efifb_probe()
427 size_remap += PAGE_SIZE - (size_remap % PAGE_SIZE); in efifb_probe()
439 info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); in efifb_probe()
441 err = -ENOMEM; in efifb_probe()
445 info->pseudo_palette = info->par; in efifb_probe()
446 info->par = NULL; in efifb_probe()
448 info->apertures = alloc_apertures(1); in efifb_probe()
449 if (!info->apertures) { in efifb_probe()
450 err = -ENOMEM; in efifb_probe()
453 info->apertures->ranges[0].base = efifb_fix.smem_start; in efifb_probe()
454 info->apertures->ranges[0].size = size_remap; in efifb_probe()
462 err = -EIO; in efifb_probe()
477 info->screen_base = ioremap_wc(efifb_fix.smem_start, in efifb_probe()
480 info->screen_base = ioremap(efifb_fix.smem_start, in efifb_probe()
483 info->screen_base = memremap(efifb_fix.smem_start, in efifb_probe()
486 info->screen_base = memremap(efifb_fix.smem_start, in efifb_probe()
488 if (!info->screen_base) { in efifb_probe()
491 err = -EIO; in efifb_probe()
540 info->fbops = &efifb_ops; in efifb_probe()
541 info->var = efifb_defined; in efifb_probe()
542 info->fix = efifb_fix; in efifb_probe()
543 info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE; in efifb_probe()
549 info->fbcon_rotate_hint = FB_ROTATE_UR; in efifb_probe()
552 info->fbcon_rotate_hint = FB_ROTATE_UD; in efifb_probe()
555 info->fbcon_rotate_hint = FB_ROTATE_CCW; in efifb_probe()
558 info->fbcon_rotate_hint = FB_ROTATE_CW; in efifb_probe()
562 err = sysfs_create_groups(&dev->dev.kobj, efifb_groups); in efifb_probe()
567 err = fb_alloc_cmap(&info->cmap, 256, 0); in efifb_probe()
577 fb_info(info, "%s frame buffer device\n", info->fix.id); in efifb_probe()
581 fb_dealloc_cmap(&info->cmap); in efifb_probe()
583 sysfs_remove_groups(&dev->dev.kobj, efifb_groups); in efifb_probe()
586 iounmap(info->screen_base); in efifb_probe()
588 memunmap(info->screen_base); in efifb_probe()
602 sysfs_remove_groups(&pdev->dev.kobj, efifb_groups); in efifb_remove()
610 .name = "efi-framebuffer",
629 dev_err(&dev->dev, in record_efifb_bar_resource()
630 "BAR %d: assigned to efifb but device is disabled!\n", in record_efifb_bar_resource()
635 bar_resource = &dev->resource[idx]; in record_efifb_bar_resource()
638 dev_info(&dev->dev, "BAR %d: assigned to efifb\n", idx); in record_efifb_bar_resource()
657 struct resource *res = &dev->resource[i]; in efifb_fixup_resources()
659 if (!(res->flags & IORESOURCE_MEM)) in efifb_fixup_resources()
662 if (res->start <= base && res->end >= base + size - 1) { in efifb_fixup_resources()
663 record_efifb_bar_resource(dev, i, base - res->start); in efifb_fixup_resources()