Lines 96-102
Link Here
|
96 |
static int |
96 |
static int |
97 |
vt_efifb_init(struct vt_device *vd) |
97 |
vt_efifb_init(struct vt_device *vd) |
98 |
{ |
98 |
{ |
99 |
int depth, d; |
|
|
100 |
struct fb_info *info; |
99 |
struct fb_info *info; |
101 |
struct efi_fb *efifb; |
100 |
struct efi_fb *efifb; |
102 |
caddr_t kmdp; |
101 |
caddr_t kmdp; |
Lines 116-131
Link Here
|
116 |
info->fb_height = efifb->fb_height; |
115 |
info->fb_height = efifb->fb_height; |
117 |
info->fb_width = efifb->fb_width; |
116 |
info->fb_width = efifb->fb_width; |
118 |
|
117 |
|
119 |
depth = fls(efifb->fb_mask_red); |
118 |
info->fb_depth = fls(efifb->fb_mask_red | efifb->fb_mask_green | |
120 |
d = fls(efifb->fb_mask_green); |
119 |
efifb->fb_mask_blue | efifb->fb_mask_reserved); |
121 |
depth = d > depth ? d : depth; |
120 |
info->fb_bpp = info->fb_depth; |
122 |
d = fls(efifb->fb_mask_blue); |
|
|
123 |
depth = d > depth ? d : depth; |
124 |
d = fls(efifb->fb_mask_reserved); |
125 |
depth = d > depth ? d : depth; |
126 |
info->fb_depth = depth; |
127 |
|
121 |
|
128 |
info->fb_stride = efifb->fb_stride * (depth / 8); |
122 |
/* Stride in bytes, not pixels */ |
|
|
123 |
info->fb_stride = efifb->fb_stride * (info->fb_bpp >> 3); |
129 |
|
124 |
|
130 |
vt_generate_cons_palette(info->fb_cmap, COLOR_FORMAT_RGB, |
125 |
vt_generate_cons_palette(info->fb_cmap, COLOR_FORMAT_RGB, |
131 |
efifb->fb_mask_red, ffs(efifb->fb_mask_red) - 1, |
126 |
efifb->fb_mask_red, ffs(efifb->fb_mask_red) - 1, |
Lines 137-152
Link Here
|
137 |
info->fb_vbase = (intptr_t)pmap_mapdev_attr(info->fb_pbase, |
132 |
info->fb_vbase = (intptr_t)pmap_mapdev_attr(info->fb_pbase, |
138 |
info->fb_size, VM_MEMATTR_WRITE_COMBINING); |
133 |
info->fb_size, VM_MEMATTR_WRITE_COMBINING); |
139 |
|
134 |
|
140 |
/* Get pixel storage size. */ |
|
|
141 |
info->fb_bpp = info->fb_stride / info->fb_width * 8; |
142 |
|
143 |
/* |
144 |
* Early FB driver work with static window buffer, so reduce to minimal |
145 |
* size, buffer or screen. |
146 |
*/ |
147 |
info->fb_width = MIN(info->fb_width, VT_FB_DEFAULT_WIDTH); |
148 |
info->fb_height = MIN(info->fb_height, VT_FB_DEFAULT_HEIGHT); |
149 |
|
150 |
vt_fb_init(vd); |
135 |
vt_fb_init(vd); |
151 |
|
136 |
|
152 |
return (CN_INTERNAL); |
137 |
return (CN_INTERNAL); |