Subversion Repositories HelenOS

Rev

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

Rev 3684 Rev 4377
Line 35... Line 35...
35
#include <arch/drivers/scr.h>
35
#include <arch/drivers/scr.h>
36
#include <genarch/ofw/ofw_tree.h>
36
#include <genarch/ofw/ofw_tree.h>
37
#include <genarch/fb/fb.h>
37
#include <genarch/fb/fb.h>
38
#include <genarch/fb/visuals.h>
38
#include <genarch/fb/visuals.h>
39
#include <arch/types.h>
39
#include <arch/types.h>
40
#include <func.h>
40
#include <string.h>
41
#include <align.h>
41
#include <align.h>
42
#include <print.h>
42
#include <print.h>
43
 
43
 
44
#define FFB_REG_24BPP   7
44
#define FFB_REG_24BPP   7
45
 
45
 
Line 61... Line 61...
61
    ofw_sbus_reg_t *sbus_reg;
61
    ofw_sbus_reg_t *sbus_reg;
62
    const char *name;
62
    const char *name;
63
   
63
   
64
    name = ofw_tree_node_name(node);
64
    name = ofw_tree_node_name(node);
65
   
65
   
66
    if (strcmp(name, "SUNW,m64B") == 0)
66
    if (str_cmp(name, "SUNW,m64B") == 0)
67
        scr_type = SCR_ATYFB;
67
        scr_type = SCR_ATYFB;
68
    else if (strcmp(name, "SUNW,XVR-100") == 0)
68
    else if (str_cmp(name, "SUNW,XVR-100") == 0)
69
        scr_type = SCR_XVR;
69
        scr_type = SCR_XVR;
70
    else if (strcmp(name, "SUNW,ffb") == 0)
70
    else if (str_cmp(name, "SUNW,ffb") == 0)
71
        scr_type = SCR_FFB;
71
        scr_type = SCR_FFB;
72
    else if (strcmp(name, "cgsix") == 0)
72
    else if (str_cmp(name, "cgsix") == 0)
73
        scr_type = SCR_CGSIX;
73
        scr_type = SCR_CGSIX;
74
   
74
   
75
    if (scr_type == SCR_UNKNOWN) {
75
    if (scr_type == SCR_UNKNOWN) {
76
        printf("Unknown screen device.\n");
76
        printf("Unknown screen device.\n");
77
        return;
77
        return;
Line 102... Line 102...
102
    if (prop && prop->value)
102
    if (prop && prop->value)
103
        fb_linebytes = *((uint32_t *) prop->value);
103
        fb_linebytes = *((uint32_t *) prop->value);
104
 
104
 
105
    prop = ofw_tree_getprop(node, "reg");
105
    prop = ofw_tree_getprop(node, "reg");
106
    if (!prop)
106
    if (!prop)
107
        panic("Can't find \"reg\" property.\n");
107
        panic("Cannot find 'reg' property.");
108
 
108
 
109
    switch (scr_type) {
109
    switch (scr_type) {
110
    case SCR_ATYFB:
110
    case SCR_ATYFB:
111
        if (prop->size / sizeof(ofw_pci_reg_t) < 2) {
111
        if (prop->size / sizeof(ofw_pci_reg_t) < 2) {
112
            printf("Too few screen registers.\n");
112
            printf("Too few screen registers.\n");
Line 221... Line 221...
221
            return;
221
            return;
222
        }
222
        }
223
   
223
   
224
        break;
224
        break;
225
    default:
225
    default:
226
        panic("Unexpected type.\n");
226
        panic("Unexpected type.");
227
    }
227
    }
228
 
228
 
229
    fb_properties_t props = {
229
    fb_properties_t props = {
230
        .addr = fb_addr,
230
        .addr = fb_addr,
231
        .offset = fb_offset,
231
        .offset = fb_offset,
Line 235... Line 235...
235
        .visual = visual,
235
        .visual = visual,
236
    };
236
    };
237
    fb_init(&props);
237
    fb_init(&props);
238
}
238
}
239
 
239
 
-
 
240
void scr_redraw(void)
-
 
241
{
-
 
242
    fb_redraw();
-
 
243
}
-
 
244
 
240
/** @}
245
/** @}
241
 */
246
 */