diff options
author | marius <marius@FreeBSD.org> | 2007-12-12 06:10:55 +0800 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2007-12-12 06:10:55 +0800 |
commit | 693f55075d69952ffedfbc2f97641241daea9d44 (patch) | |
tree | e24a388510e639672f1fb3dbe95208197a3594d6 | |
parent | 8a47f3f1a9126580606d71b8210dc45c26ec7c73 (diff) | |
download | freebsd-ports-graphics-693f55075d69952ffedfbc2f97641241daea9d44.tar.gz freebsd-ports-graphics-693f55075d69952ffedfbc2f97641241daea9d44.tar.zst freebsd-ports-graphics-693f55075d69952ffedfbc2f97641241daea9d44.zip |
- Ever since this port was converted to use a rc.d startup it announces
the uploading of the microcode. Printing this out via the framebuffer
turned out to sometimes being delayed until during the upload of the
microcode to it, resulting in a concurrent access which freezes the
machine. So change afbinit(8) to no longer announce the upload. Of
course the proper way to solve this would be to do the upload in the
kernel with proper locking, if the licenses of both the afbinit(8)
code and the microcode allowed.
- Re-read the board type after uploading the microcode so the right one
is displayed.
- Fix GCC4 warnings.
Approved by: netchild
-rw-r--r-- | sysutils/afbinit/Makefile | 2 | ||||
-rw-r--r-- | sysutils/afbinit/files/patch-afbinit.c | 32 |
2 files changed, 21 insertions, 13 deletions
diff --git a/sysutils/afbinit/Makefile b/sysutils/afbinit/Makefile index c737a957816..c5e6ffbbce6 100644 --- a/sysutils/afbinit/Makefile +++ b/sysutils/afbinit/Makefile @@ -7,7 +7,7 @@ PORTNAME= afbinit PORTVERSION= 1.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils graphics MASTER_SITES= ${MASTER_SITE_DEBIAN} MASTER_SITE_SUBDIR= pool/contrib/a/afbinit diff --git a/sysutils/afbinit/files/patch-afbinit.c b/sysutils/afbinit/files/patch-afbinit.c index bc2b2857c45..f659aa893ce 100644 --- a/sysutils/afbinit/files/patch-afbinit.c +++ b/sysutils/afbinit/files/patch-afbinit.c @@ -1,5 +1,3 @@ -This patch is based on code marked: - /* * Creator, Creator3D and Elite3D framebuffer driver. * @@ -26,7 +24,17 @@ This patch is based on code marked: --- afbinit.c.orig Fri Nov 30 03:04:21 2001 +++ afbinit.c Mon Sep 15 17:33:19 2003 -@@ -184,7 +184,7 @@ +@@ -12,7 +12,9 @@ + #include <sys/mman.h> + #include <unistd.h> + #include <fcntl.h> ++#include <stdlib.h> + #include <stdio.h> ++#include <string.h> + + /* Define this to debug the microcode loading procedure. */ + #undef DEBUG_UCODE_LOAD +@@ -184,7 +186,7 @@ static void usage(char *me) { @@ -35,7 +43,7 @@ This patch is based on code marked: exit(1); } -@@ -193,13 +193,14 @@ +@@ -193,13 +195,14 @@ struct afb_ucode_header { char ident[8]; unsigned int ucode_words; @@ -51,7 +59,7 @@ This patch is based on code marked: if(argc != 2 && argc != 3) usage(argp[0]); -@@ -222,7 +223,7 @@ +@@ -222,7 +225,7 @@ perror("Read UCODE header"); exit(1); } @@ -60,7 +68,7 @@ This patch is based on code marked: if(ucode == NULL) { fprintf(stderr, "Cannot malloc %d bytes for UCODE.\n", ucheader.ucode_words << 2); -@@ -236,7 +237,7 @@ +@@ -236,7 +239,7 @@ /* MMAP the registers. */ uregs = mmap(0, 0x2000, PROT_READ | PROT_WRITE, @@ -69,7 +77,7 @@ This patch is based on code marked: afb_fd, 0x04000000); if (uregs == (void *)-1L) { -@@ -246,7 +247,7 @@ +@@ -246,7 +249,7 @@ kregs = mmap(0, 0x2000, PROT_READ | PROT_WRITE, @@ -78,15 +86,15 @@ This patch is based on code marked: afb_fd, 0x0bc04000); if (kregs == (void *)-1L) { -@@ -254,14 +255,26 @@ +@@ -254,14 +257,26 @@ exit(1); } - /* Say what UCODE version we are loading. */ -+ fem = (*((volatile unsigned int *)AFB_UREG_FEM(uregs))) & 0x7f; ++ fem = *AFB_UREG_FEM(uregs) & 0x7f; + if (fem == 0x07 || fem == 0x3f) { + fprintf(stderr, "%s: Elite3D/M%s microcode already loaded.\n", -+ afb_fname, fem == 0x07 ? "3" : "6"); ++ afb_fname, fem == 0x07 ? "3" : "6"); + exit(1); + } + if (fem != 0x01) { @@ -94,13 +102,13 @@ This patch is based on code marked: + exit(1); + } + -+ printf("%s: Loading microcode...\n", afb_fname); + afb_ucode_upload((char *)ucode, ucheader.ucode_words / 16, uregs, + kregs); ucode_version = *(ucode + (0x404 / sizeof(unsigned int))); - printf("Revision-%d.%d.%d ", ++ fem = *AFB_UREG_FEM(uregs) & 0x7f; + printf("%s: Elite3D/M%s microcode revision %d.%d.%d loaded.\n", -+ afb_fname, fem == 0x07 ? "3" : "6", ++ afb_fname, fem == 0x07 ? "3" : "6", (ucode_version >> 16) & 0xff, (ucode_version >> 8) & 0xff, (ucode_version >> 0) & 0xff); |