Subversion Repositories HelenOS

Rev

Rev 3618 | Rev 3742 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3618 Rev 3664
Line 59... Line 59...
59
   
59
   
60
    name = ofw_tree_node_name(node);
60
    name = ofw_tree_node_name(node);
61
   
61
   
62
    if (strcmp(name, "SUNW,m64B") == 0)
62
    if (strcmp(name, "SUNW,m64B") == 0)
63
        scr_type = SCR_ATYFB;
63
        scr_type = SCR_ATYFB;
-
 
64
    else if (strcmp(name, "SUNW,XVR-100") == 0)
-
 
65
        scr_type = SCR_XVR;
64
    else if (strcmp(name, "SUNW,ffb") == 0)
66
    else if (strcmp(name, "SUNW,ffb") == 0)
65
        scr_type = SCR_FFB;
67
        scr_type = SCR_FFB;
66
    else if (strcmp(name, "cgsix") == 0)
68
    else if (strcmp(name, "cgsix") == 0)
67
        scr_type = SCR_CGSIX;
69
        scr_type = SCR_CGSIX;
68
   
70
   
69
    if (scr_type == SCR_UNKNOWN) {
71
    if (scr_type == SCR_UNKNOWN) {
70
        printf("Unknown keyboard device.\n");
72
        printf("Unknown screen device.\n");
71
        return;
73
        return;
72
    }
74
    }
73
   
75
   
74
    uintptr_t fb_addr;
76
    uintptr_t fb_addr;
75
    uint32_t fb_width = 0;
77
    uint32_t fb_width = 0;
Line 140... Line 142...
140
            printf("Unsupported bits per pixel.\n");
142
            printf("Unsupported bits per pixel.\n");
141
            return;
143
            return;
142
        }
144
        }
143
       
145
       
144
        break;
146
        break;
-
 
147
    case SCR_XVR:
-
 
148
    {
-
 
149
        if (prop->size / sizeof(ofw_pci_reg_t) < 2) {
-
 
150
            printf("Too few screen registers.\n");
-
 
151
            return;
-
 
152
        }
-
 
153
   
-
 
154
        ofw_pci_reg_t *fb_reg = &((ofw_pci_reg_t *) prop->value)[1];
-
 
155
        ofw_pci_reg_t abs_reg;
-
 
156
       
-
 
157
        if (!ofw_pci_reg_absolutize(node, fb_reg, &abs_reg)) {
-
 
158
            printf("Failed to absolutize fb register.\n");
-
 
159
            return;
-
 
160
        }
-
 
161
   
-
 
162
        if (!ofw_pci_apply_ranges(node->parent, &abs_reg , &fb_addr)) {
-
 
163
            printf("Failed to determine screen address.\n");
-
 
164
            return;
-
 
165
        }
-
 
166
 
-
 
167
        switch (fb_depth) {
-
 
168
        case 8:
-
 
169
            fb_scanline = fb_linebytes * (fb_depth >> 3);
-
 
170
            visual = VISUAL_SB1500_PALETTE;
-
 
171
            break;
-
 
172
        case 16:
-
 
173
            fb_scanline = fb_linebytes * (fb_depth >> 3);
-
 
174
            visual = VISUAL_RGB_5_6_5;
-
 
175
            break;
-
 
176
        case 24:
-
 
177
            fb_scanline = fb_linebytes * 4;
-
 
178
            visual = VISUAL_RGB_8_8_8_0;
-
 
179
            break;
-
 
180
        case 32:
-
 
181
            fb_scanline = fb_linebytes * (fb_depth >> 3);
-
 
182
            visual = VISUAL_RGB_0_8_8_8;
-
 
183
            break;
-
 
184
        default:
-
 
185
            printf("Unsupported bits per pixel.\n");
-
 
186
            return;
-
 
187
        }
-
 
188
       
-
 
189
        break;
-
 
190
    }
145
    case SCR_FFB:  
191
    case SCR_FFB:  
146
        fb_scanline = 8192;
192
        fb_scanline = 8192;
147
        visual = VISUAL_BGR_0_8_8_8;
193
        visual = VISUAL_BGR_0_8_8_8;
148
 
194
 
149
        ofw_upa_reg_t *reg = &((ofw_upa_reg_t *) prop->value)[FFB_REG_24BPP];
195
        ofw_upa_reg_t *reg = &((ofw_upa_reg_t *) prop->value)[FFB_REG_24BPP];