Make PS3 work with the userspace kboot loader. loader.ps3 will disappear
from the tree in the near future. Done at: Hackathon
This commit is contained in:
parent
e97b30d879
commit
f1d2752f31
@ -154,6 +154,9 @@ vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color)
|
||||
c = info->fb_cmap[color];
|
||||
o = info->fb_stride * y + x * FBTYPE_GET_BYTESPP(info);
|
||||
|
||||
if (info->fb_flags & FB_FLAG_NOWRITE)
|
||||
return;
|
||||
|
||||
KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer"));
|
||||
|
||||
switch (FBTYPE_GET_BYTESPP(info)) {
|
||||
@ -205,6 +208,9 @@ vt_fb_blank(struct vt_device *vd, term_color_t color)
|
||||
info = vd->vd_softc;
|
||||
c = info->fb_cmap[color];
|
||||
|
||||
if (info->fb_flags & FB_FLAG_NOWRITE)
|
||||
return;
|
||||
|
||||
KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer"));
|
||||
|
||||
switch (FBTYPE_GET_BYTESPP(info)) {
|
||||
@ -260,6 +266,9 @@ vt_fb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw,
|
||||
b = m = 0;
|
||||
bpl = (width + 7) >> 3; /* Bytes per source line. */
|
||||
|
||||
if (info->fb_flags & FB_FLAG_NOWRITE)
|
||||
return;
|
||||
|
||||
KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer"));
|
||||
|
||||
line = (info->fb_stride * y) + (x * bpp);
|
||||
|
@ -155,7 +155,8 @@ ps3fb_remap(void)
|
||||
sc->fb_info.fb_pbase = fb_paddr;
|
||||
for (va = 0; va < PS3FB_SIZE; va += PAGE_SIZE)
|
||||
pmap_kenter_attr(0x10000000 + va, fb_paddr + va,
|
||||
VM_MEMATTR_WRITE_COMBINING);
|
||||
VM_MEMATTR_WRITE_COMBINING);
|
||||
sc->fb_info.fb_flags &= ~FB_FLAG_NOWRITE;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -175,10 +176,12 @@ ps3fb_init(struct vt_device *vd)
|
||||
sc->fb_info.fb_bpp = sc->fb_info.fb_stride / sc->fb_info.fb_width * 8;
|
||||
|
||||
/*
|
||||
* The loader puts the FB at 0x10000000, so use that for now.
|
||||
* Arbitrarily choose address for the framebuffer
|
||||
*/
|
||||
|
||||
sc->fb_info.fb_vbase = 0x10000000;
|
||||
sc->fb_info.fb_flags |= FB_FLAG_NOWRITE; /* Not available yet */
|
||||
sc->fb_info.fb_cmsize = 16;
|
||||
|
||||
/* 32-bit VGA palette */
|
||||
vt_generate_cons_palette(sc->fb_info.fb_cmap, COLOR_FORMAT_RGB,
|
||||
|
@ -135,9 +135,10 @@ struct fb_info {
|
||||
void *fb_priv; /* First argument for read/write. */
|
||||
const char *fb_name;
|
||||
uint32_t fb_flags;
|
||||
#define FB_FLAG_NOMMAP 1 /* mmap unsupported. */
|
||||
#define FB_FLAG_NOWRITE 2 /* disable writes for the time being */
|
||||
int fb_stride;
|
||||
int fb_bpp; /* bits per pixel */
|
||||
#define FB_FLAG_NOMMAP 1 /* mmap unsupported. */
|
||||
uint32_t fb_cmap[16];
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user