Changeset 2bc137c2 in mainline for kernel/arch/sparc64


Ignore:
Timestamp:
2006-11-22T12:36:59Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ccb0cbc
Parents:
33dc0ad
Message:

make framebuffer code more generic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/drivers/scr.c

    r33dc0ad r2bc137c2  
    3636#include <genarch/ofw/ofw_tree.h>
    3737#include <genarch/fb/fb.h>
     38#include <genarch/fb/visuals.h>
    3839#include <arch/types.h>
    3940#include <typedefs.h>
     
    7677        uint32_t fb_linebytes = 0;
    7778        uint32_t fb_scanline = 0;
     79        unsigned int visual;
    7880
    7981        prop = ofw_tree_getprop(node, "width");
     
    116118                        return;
    117119                }
    118 
    119                 if (fb_depth == 24)
     120               
     121                switch (fb_depth) {
     122                case 8:
     123                        fb_scanline = fb_linebytes * (fb_depth >> 3);
     124                        visual = VISUAL_INDIRECT_8;
     125                        break;
     126                case 16:
     127                        fb_scanline = fb_linebytes * (fb_depth >> 3);
     128                        visual = VISUAL_RGB_5_6_5;
     129                        break;
     130                case 24:
    120131                        fb_scanline = fb_linebytes * 4;
    121                 else
     132                        visual = VISUAL_RGB_8_8_8_0;
     133                        break;
     134                case 32:
    122135                        fb_scanline = fb_linebytes * (fb_depth >> 3);
     136                        visual = VISUAL_RGB_0_8_8_8;
     137                        break;
     138                default:
     139                        printf("Unsupported bits per pixel.\n");
     140                        return;
     141                }
    123142               
    124143                break;
    125144        case SCR_FFB:   
    126                 fb_depth = 32;
    127145                fb_scanline = 8192;
     146                visual = VISUAL_RGB_0_8_8_8;
    128147
    129148                ofw_upa_reg_t *reg = &((ofw_upa_reg_t *) prop->value)[FFB_REG_24BPP];
     
    138157        }
    139158
    140         fb_init(fb_addr, fb_width, fb_height, fb_depth, fb_scanline, true);
     159        fb_init(fb_addr, fb_width, fb_height, fb_scanline, visual);
    141160}
    142161
Note: See TracChangeset for help on using the changeset viewer.