Changes in kernel/arch/sparc64/src/drivers/scr.c [a71c158:bdfd3cdd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/drivers/scr.c
ra71c158 rbdfd3cdd 42 42 #include <console/chardev.h> 43 43 #include <console/console.h> 44 #include < arch/types.h>45 #include <str ing.h>44 #include <typedefs.h> 45 #include <str.h> 46 46 #include <align.h> 47 47 #include <print.h> … … 77 77 else if (str_cmp(name, "cgsix") == 0) 78 78 scr_type = SCR_CGSIX; 79 else if (str_cmp(name, "QEMU,VGA") == 0) 80 scr_type = SCR_QEMU_VGA; 79 81 80 82 if (scr_type == SCR_UNKNOWN) { … … 228 230 229 231 break; 232 233 case SCR_QEMU_VGA: 234 if (prop->size / sizeof(ofw_pci_reg_t) < 2) { 235 printf("Too few screen registers.\n"); 236 return; 237 } 238 239 pci_reg = &((ofw_pci_reg_t *) prop->value)[1]; 240 241 if (!ofw_pci_reg_absolutize(node, pci_reg, &pci_abs_reg)) { 242 printf("Failed to absolutize fb register.\n"); 243 return; 244 } 245 246 if (!ofw_pci_apply_ranges(node->parent, &pci_abs_reg, 247 &fb_addr)) { 248 printf("Failed to determine screen address.\n"); 249 return; 250 } 251 252 switch (fb_depth) { 253 case 8: 254 fb_scanline = fb_linebytes * (fb_depth >> 3); 255 visual = VISUAL_INDIRECT_8; 256 break; 257 case 16: 258 fb_scanline = fb_linebytes * (fb_depth >> 3); 259 visual = VISUAL_RGB_5_6_5_BE; 260 break; 261 case 24: 262 fb_scanline = fb_linebytes * 4; 263 visual = VISUAL_BGR_8_8_8_0; 264 break; 265 case 32: 266 fb_scanline = fb_linebytes * (fb_depth >> 3); 267 visual = VISUAL_RGB_0_8_8_8; 268 break; 269 default: 270 printf("Unsupported bits per pixel.\n"); 271 return; 272 } 273 break; 274 230 275 default: 231 276 panic("Unexpected type.");
Note:
See TracChangeset
for help on using the changeset viewer.