Changeset bdfd3cdd in mainline


Ignore:
Timestamp:
2010-06-02T21:59:48Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c992538a
Parents:
f8d07859
Message:

Support for QEMU,VGA frame buffer on sparc64.
(Contributed by Igor Kovalenko.)

Location:
kernel/arch/sparc64
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/drivers/scr.h

    rf8d07859 rbdfd3cdd  
    4444        SCR_FFB,
    4545        SCR_CGSIX,
    46         SCR_XVR
     46        SCR_XVR,
     47        SCR_QEMU_VGA
    4748} scr_type_t;
    4849
  • kernel/arch/sparc64/src/drivers/scr.c

    rf8d07859 rbdfd3cdd  
    7777        else if (str_cmp(name, "cgsix") == 0)
    7878                scr_type = SCR_CGSIX;
     79        else if (str_cmp(name, "QEMU,VGA") == 0)
     80                scr_type = SCR_QEMU_VGA;
    7981       
    8082        if (scr_type == SCR_UNKNOWN) {
     
    228230       
    229231                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
    230275        default:
    231276                panic("Unexpected type.");
Note: See TracChangeset for help on using the changeset viewer.