Changeset b4fa652 in mainline for boot


Ignore:
Timestamp:
2006-08-04T08:21:30Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b006a2c8
Parents:
d7e3fa66
Message:

Support 24bpp framebuffers with 4 pixelbytes (each pixel aligned on 32-bits).

At least on sparc64, the OpenFirmware linebytes property specifies the number
of pixels between consecutive scan lines of the display. Fix scanilne calculation,
including possible alignment.

Add note to 8bpp pixel functions pointing out drawbacks of that mode.

Location:
boot/arch/sparc64/loader
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/loader/main.c

    rd7e3fa66 rb4fa652  
    3232#include "_components.h"
    3333#include <ofw.h>
     34#include "ofwarch.h"
    3435#include <align.h>
    3536
     
    6061        }
    6162        bootinfo.screen.addr = ofw_translate(bootinfo.screen.addr);
     63        /* transform scanline to bytes with respect to potential alignment */
     64        bootinfo.screen.scanline = bootinfo.screen.scanline*bpp2align[bootinfo.screen.bpp >> 3];
    6265       
    6366        if (!ofw_keyboard(&bootinfo.keyboard))
    6467                printf("Error: unable to get keyboard properties\n");
    65        
     68
    6669        printf("\nDevice statistics\n");
    6770        printf(" memory: %dM\n", bootinfo.memmap.total>>20);
  • boot/arch/sparc64/loader/ofwarch.c

    rd7e3fa66 rb4fa652  
    3636#include <printf.h>
    3737
     38int bpp2align[] = {
     39        [0] = 0,                /** Invalid bpp. */
     40        [1] = 1,                /** 8bpp is not aligned. */
     41        [2] = 2,                /** 16bpp is naturally aligned. */
     42        [3] = 4,                /** 24bpp is aligned on 4 byte boundary. */
     43        [4] = 4,                /** 32bpp is naturally aligned. */
     44};
     45
    3846void write(const char *str, const int len)
    3947{
  • boot/arch/sparc64/loader/ofwarch.h

    rd7e3fa66 rb4fa652  
    3333#define OFW_SIZE_CELLS          2
    3434
     35extern int bpp2align[];
     36
    3537#endif
Note: See TracChangeset for help on using the changeset viewer.