Changeset aa2b32c in mainline for kernel/genarch/src/fb/fb.c


Ignore:
Timestamp:
2013-04-29T12:44:05Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a269d05
Parents:
06b0211b (diff), 9e7898e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/fb/fb.c

    r06b0211b raa2b32c  
    3535
    3636#include <genarch/fb/font-8x16.h>
    37 #include <genarch/fb/logo-196x66.h>
    3837#include <genarch/fb/fb.h>
    3938#include <console/chardev.h>
     
    5352#include <byteorder.h>
    5453
    55 #define BG_COLOR     0x000080
    56 #define FG_COLOR     0xffff00
     54#define BG_COLOR     0x001620
     55#define FG_COLOR     0xf3cf65
    5756#define INV_COLOR    0xaaaaaa
    5857
     
    9392        unsigned int yres;
    9493       
    95         unsigned int ylogo;
    96         unsigned int ytrim;
    9794        unsigned int rowtrim;
    9895       
     
    213210}
    214211
    215 /** Hide logo and refresh screen
    216  *
    217  */
    218 static void logo_hide(fb_instance_t *instance)
    219 {
    220         instance->ylogo = 0;
    221         instance->ytrim = instance->yres;
    222         instance->rowtrim = instance->rows;
    223        
    224         if ((!instance->parea.mapped) || (console_override))
    225                 fb_redraw_internal(instance);
    226 }
    227 
    228212/** Draw character at given position
    229213 *
     
    236220        unsigned int yd;
    237221       
    238         if (y >= instance->ytrim)
    239                 logo_hide(instance);
    240        
    241222        if (!overlay)
    242223                instance->backbuf[BB_POS(instance, col, row)] = glyph;
     
    244225        if ((!instance->parea.mapped) || (console_override)) {
    245226                for (yd = 0; yd < FONT_SCANLINES; yd++)
    246                         memcpy(&instance->addr[FB_POS(instance, x, y + yd + instance->ylogo)],
     227                        memcpy(&instance->addr[FB_POS(instance, x, y + yd)],
    247228                            &instance->glyphs[GLYPH_POS(instance, glyph, yd)],
    248229                            instance->glyphscanline);
     
    256237static void screen_scroll(fb_instance_t *instance)
    257238{
    258         if (instance->ylogo > 0) {
    259                 logo_hide(instance);
    260                 return;
    261         }
    262        
    263239        if ((!instance->parea.mapped) || (console_override)) {
    264240                unsigned int row;
     
    412388static void fb_redraw_internal(fb_instance_t *instance)
    413389{
    414         if (instance->ylogo > 0) {
    415                 unsigned int y;
    416                
    417                 for (y = 0; y < LOGO_HEIGHT; y++) {
    418                         unsigned int x;
    419                        
    420                         for (x = 0; x < instance->xres; x++)
    421                                 instance->rgb_conv(&instance->addr[FB_POS(instance, x, y)],
    422                                     (x < LOGO_WIDTH) ?
    423                                     fb_logo[y * LOGO_WIDTH + x] :
    424                                     LOGO_COLOR);
    425                 }
    426         }
    427        
    428390        unsigned int row;
    429391       
    430392        for (row = 0; row < instance->rowtrim; row++) {
    431                 unsigned int y = instance->ylogo + ROW2Y(row);
     393                unsigned int y = ROW2Y(row);
    432394                unsigned int yd;
    433395               
     
    452414                    (instance->xres - COL2X(instance->cols)) * instance->pixelbytes;
    453415               
    454                 for (y = instance->ylogo; y < instance->yres; y++)
     416                for (y = 0; y < instance->yres; y++)
    455417                        memcpy(&instance->addr[FB_POS(instance, COL2X(instance->cols), y)],
    456418                            instance->bgscan, size);
    457419        }
    458420       
    459         if (ROW2Y(instance->rowtrim) + instance->ylogo < instance->yres) {
     421        if (ROW2Y(instance->rowtrim) < instance->yres) {
    460422                unsigned int y;
    461423               
    462                 for (y = ROW2Y(instance->rowtrim) + instance->ylogo;
    463                     y < instance->yres; y++)
     424                for (y = ROW2Y(instance->rowtrim); y < instance->yres; y++)
    464425                        memcpy(&instance->addr[FB_POS(instance, 0, y)],
    465426                            instance->bgscan, instance->bgscanbytes);
     
    567528        instance->rows = Y2ROW(instance->yres);
    568529       
    569         if (instance->yres > LOGO_HEIGHT) {
    570                 instance->ylogo = LOGO_HEIGHT;
    571                 instance->rowtrim = instance->rows - Y2ROW(instance->ylogo);
    572                 if (instance->ylogo % FONT_SCANLINES > 0)
    573                         instance->rowtrim--;
    574                 instance->ytrim = ROW2Y(instance->rowtrim);
    575         } else {
    576                 instance->ylogo = 0;
    577                 instance->ytrim = instance->yres;
    578                 instance->rowtrim = instance->rows;
    579         }
     530        instance->rowtrim = instance->rows;
    580531       
    581532        instance->glyphscanline = FONT_WIDTH * instance->pixelbytes;
Note: See TracChangeset for help on using the changeset viewer.