svn commit: r276679 - in head/sys: dev/vt/hw/fb powerpc/ps3 sys
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Mon Jan 5 00:50:18 UTC 2015
Author: nwhitehorn
Date: Mon Jan 5 00:50:16 2015
New Revision: 276679
URL: https://svnweb.freebsd.org/changeset/base/276679
Log:
Make PS3 work with the userspace kboot loader. loader.ps3 will disappear
from the tree in the near future.
Done at: Hackathon
Modified:
head/sys/dev/vt/hw/fb/vt_fb.c
head/sys/powerpc/ps3/ps3_syscons.c
head/sys/sys/fbio.h
Modified: head/sys/dev/vt/hw/fb/vt_fb.c
==============================================================================
--- head/sys/dev/vt/hw/fb/vt_fb.c Mon Jan 5 00:15:27 2015 (r276678)
+++ head/sys/dev/vt/hw/fb/vt_fb.c Mon Jan 5 00:50:16 2015 (r276679)
@@ -154,6 +154,9 @@ vt_fb_setpixel(struct vt_device *vd, int
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_c
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
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);
Modified: head/sys/powerpc/ps3/ps3_syscons.c
==============================================================================
--- head/sys/powerpc/ps3/ps3_syscons.c Mon Jan 5 00:15:27 2015 (r276678)
+++ head/sys/powerpc/ps3/ps3_syscons.c Mon Jan 5 00:50:16 2015 (r276679)
@@ -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,
Modified: head/sys/sys/fbio.h
==============================================================================
--- head/sys/sys/fbio.h Mon Jan 5 00:15:27 2015 (r276678)
+++ head/sys/sys/fbio.h Mon Jan 5 00:50:16 2015 (r276679)
@@ -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];
};
More information about the svn-src-all
mailing list