Lines Matching +full:simple +full:- +full:framebuffer

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (c) 2012-2013 David Herrmann <dh.herrmann@gmail.com>
8 * simple-framebuffer probing
9 * Try to convert "screen_info" into a "simple-framebuffer" compatible mode.
26 /* try parsing screen_info into a simple-framebuffer mode struct */
34 type = si->orig_video_isVGA; in sysfb_parse_mode()
39 * The meaning of depth and bpp for direct-color formats is in sysfb_parse_mode()
42 * - DRM format info specifies depth as the number of color in sysfb_parse_mode()
44 * - Linux' EFI platform code computes lfb_depth from the in sysfb_parse_mode()
46 * - VBE 1.1 defines lfb_depth for XRGB1555 as 16, but later in sysfb_parse_mode()
48 * - On the kernel command line, 'bpp' of 32 is usually in sysfb_parse_mode()
59 if (si->lfb_depth > 8) { in sysfb_parse_mode()
60 bits_per_pixel = max(max3(si->red_size + si->red_pos, in sysfb_parse_mode()
61 si->green_size + si->green_pos, in sysfb_parse_mode()
62 si->blue_size + si->blue_pos), in sysfb_parse_mode()
63 si->rsvd_size + si->rsvd_pos); in sysfb_parse_mode()
64 bits_per_pixel = max_t(u32, bits_per_pixel, si->lfb_depth); in sysfb_parse_mode()
66 bits_per_pixel = si->lfb_depth; in sysfb_parse_mode()
72 if (f->transp.length) in sysfb_parse_mode()
75 if (bits_per_pixel == f->bits_per_pixel && in sysfb_parse_mode()
76 si->red_size == f->red.length && in sysfb_parse_mode()
77 si->red_pos == f->red.offset && in sysfb_parse_mode()
78 si->green_size == f->green.length && in sysfb_parse_mode()
79 si->green_pos == f->green.offset && in sysfb_parse_mode()
80 si->blue_size == f->blue.length && in sysfb_parse_mode()
81 si->blue_pos == f->blue.offset) { in sysfb_parse_mode()
82 mode->format = f->name; in sysfb_parse_mode()
83 mode->width = si->lfb_width; in sysfb_parse_mode()
84 mode->height = si->lfb_height; in sysfb_parse_mode()
85 mode->stride = si->lfb_linelength; in sysfb_parse_mode()
107 base = si->lfb_base; in sysfb_create_simplefb()
108 if (si->capabilities & VIDEO_CAPABILITY_64BIT_BASE) in sysfb_create_simplefb()
109 base |= (u64)si->ext_lfb_base << 32; in sysfb_create_simplefb()
112 return ERR_PTR(-EINVAL); in sysfb_create_simplefb()
118 * need, that is, the part where the framebuffer is located. But verify in sysfb_create_simplefb()
123 size = si->lfb_size; in sysfb_create_simplefb()
124 if (si->orig_video_isVGA == VIDEO_TYPE_VLFB) in sysfb_create_simplefb()
126 length = mode->height * mode->stride; in sysfb_create_simplefb()
129 return ERR_PTR(-EINVAL); in sysfb_create_simplefb()
133 /* setup IORESOURCE_MEM as framebuffer memory */ in sysfb_create_simplefb()
138 res.end = res.start + length - 1; in sysfb_create_simplefb()
140 return ERR_PTR(-EINVAL); in sysfb_create_simplefb()
142 pd = platform_device_alloc("simple-framebuffer", 0); in sysfb_create_simplefb()
144 return ERR_PTR(-ENOMEM); in sysfb_create_simplefb()