lkml.org 
[lkml]   [1998]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject[PATCH] framebuffer devfs support, new bootlogo too (2.1.112-pre2)
Attatched are patches for adding devfs support to the framebuffer devices.
I use devfs exclusivly and i wanted to use framebuffer stuff so i had to
add support. The patch is based upon 2.1.112-pre2. The 3dfx patch is a
modification of the device driver Daryll Strauss wrote for 3dfx support.
It has been modified to work in the kernel and act as an option (config..)
it has devfs support, and seems to work.

Also there is a REALY COOL 2.1.x bootlogo patch attached which kicks the
krap out of the fbcon one. It actualy blanks the screen, and holds the
image for a second (so we can see it) and it works w/o fbcon.


NOTE: PLEASE TEST THESE, framebuffer seems to work, 3dfx.. i dont know
I did not write the bootlogo patch, and it has worked every time
and seems stable
Sincerely,
Mark Guzman
--- ./drivers/video/old/Makefile Mon Jul 27 17:43:51 1998
+++ drivers/video/Makefile Mon Jul 27 17:50:16 1998
@@ -32,7 +32,14 @@
ifeq ($(CONFIG_PROM_CONSOLE),y)
L_OBJS += promcon.o
endif
-
+ifeq ($(CONFIG_3DFX),y)
+ L_OBJS += 3dfx.o
+ else
+ ifeq ($(CONFIG_3DFX),m)
+ M_OBJS += 3dfx.o
+ endif
+endif
+
ifeq ($(CONFIG_FB),y)
L_OBJS += fonts.o
OX_OBJS += fbcon.o fbcmap.o
--- ./drivers/video/old/Config.in Mon Jul 27 17:55:12 1998
+++ drivers/video/Config.in Mon Jul 27 17:40:03 1998
@@ -1,7 +1,7 @@
#
# Video configuration
#
-
+define_bool CONFIG_3DFX n
if [ "$CONFIG_FB" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
--- ./Documentation/old/Configure.help Mon Jul 27 17:58:46 1998
+++ Documentation/Configure.help Mon Jul 27 17:37:04 1998
@@ -1494,10 +1494,10 @@
If you want to play with it, say Y here and to the driver for your
graphics board, below. If unsure, say N.

+3dfx Card support
+CONFIG_3DFX
+ This is the device driver for 3dfx cards, creating /dev/3dfx
+ You also need the glide library (glide.xxedgexx.com).

Acorn VIDC support
CONFIG_FB_ACORN
--- init/main.c.old Tue Jul 28 13:23:20 1998
+++ init/main.c Tue Jul 28 12:54:31 1998
@@ -314,6 +314,10 @@
extern void md_setup(char *str,int *ints) __init;
#endif

+#ifdef CONFIG_3DFX
+extern void init_3dfx(void);
+#endif
+
#ifdef __sparc__
extern int serial_console;
#endif
@@ -1176,6 +1180,9 @@
#ifdef CONFIG_ARCH_ACORN
ecard_init();
#endif
+#ifdef CONFIG_3DFX
+ init_3dfx();
+#endif

/*
* We count on the initial thread going ok
--- /dev/null Wed Dec 31 19:00:00 1969
+++ drivers/video/3dfx.c Tue Jul 28 12:52:49 1998
@@ -0,0 +1,539 @@
+
+/* Compile with "gcc -O -DMODULE -D__KERNEL__ -c 3dfx.c" */
+
+#ifdef MODULE
+#include <linux/module.h>
+#include <linux/version.h>
+#else
+#define MOD_INC_USE_COUNT
+#define MOD_DEC_USE_COUNT
+#endif
+
+#include <linux/types.h>
+#include <linux/fs.h>
+#include <linux/mm.h> /* for verify_area */
+#include <linux/errno.h> /* for -EBUSY */
+#include <linux/pci.h> /* device list */
+#include <linux/poll.h> /*poll stuff */
+//#include <linux/bios32.h> /* pci bios calls */ Obsolete (M.G.)
+#include <asm/segment.h> /* for put_user_byte */
+#include <asm/ioctl.h>
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/processor.h>
+
+#ifdef CONFIG_DEVFS_FS
+#include <linux/major.h>
+#include <linux/devfs_fs.h>
+#endif /*CONFIG_DEVFS_FS*/
+
+#define MAJOR_3DFX 107
+#define DEVICE_VOODOO 0
+
+#define PCI_VENDOR_ID_LINUX 0x0
+#define PCI_DEVICE_ID_LINUX 0x2
+#define PCI_COMMAND_LINUX 0x4
+#define PCI_REVISION_ID_LINUX 0x8
+#define PCI_BASE_ADDRESS_0_LINUX 0x10
+#define SST1_PCI_SPECIAL1_LINUX 0x40
+#define SST1_PCI_SPECIAL2_LINUX 0x44
+#define SST1_PCI_SPECIAL3_LINUX 0x48
+#define SST1_PCI_SPECIAL4_LINUX 0x54
+
+#define VGA_INPUT_STATUS_1C 0x3DA
+#define VGA_MISC_OUTPUT_READ 0x3cc
+#define VGA_MISC_OUTPUT_WRITE 0x3c2
+#define SC_INDEX 0x3c4
+#define SC_DATA 0x3c5
+
+#ifndef PCI_VENDOR_ID_3DFX
+#define PCI_VENDOR_ID_3DFX 0x121a
+#endif
+
+#ifndef PCI_VENDOR_ID_ALLIANCE
+#define PCI_VENDOR_ID_ALLIANCE 0x1142
+#endif
+
+#ifndef PCI_DEVICE_ID_3DFX_VOODOO2
+#define PCI_DEVICE_ID_3DFX_VOODOO2 2
+#endif
+
+#ifndef PCI_DEVICE_ID_ALLIANCE_AT3D
+#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d
+#endif
+
+#ifdef DEBUG
+#define DEBUGMSG printk
+#else
+inline void noop() {}
+#define DEBUGMSG noop
+#endif
+
+typedef struct pioData_t {
+ short port;
+ short size;
+ int device;
+ void *value;
+} pioData;
+
+typedef struct cardInfo_t {
+ int vendor;
+ int type;
+ int addr;
+ unsigned char bus;
+ unsigned char dev;
+ struct file *curFile;
+} cardInfo;
+
+#define MAXCARDS 16
+
+cardInfo cards[MAXCARDS];
+static int major_3dfx=0;
+static int numCards=0;
+
+static void findCardType(int vendor, int device) {
+ int i;
+
+ for (i=0; numCards<MAXCARDS; i++) {
+ if (pcibios_find_device(vendor, device, i,
+ &cards[numCards].bus, &cards[numCards].dev))
+ return;
+ pcibios_read_config_dword(cards[numCards].bus,
+ cards[numCards].dev, PCI_BASE_ADDRESS_0,
+ &cards[numCards].addr);
+ cards[numCards].addr&=~0xF;
+ cards[numCards].vendor=vendor;
+ cards[numCards].type=device;
+ cards[numCards].curFile=0;
+
+ DEBUGMSG("3dfx board vendor %d type %d @ %x bus %d dev %d\n",
+ vendor, device,
+ cards[numCards].addr, cards[numCards].bus, cards[numCards].dev);
+ numCards++;
+ }
+}
+
+static int findCards() {
+ if (!pcibios_present()) return 0;
+ numCards=0;
+ findCardType(PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO);
+ findCardType(PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO2);
+ findCardType(PCI_VENDOR_ID_ALLIANCE, 0x643d);
+ return numCards;
+}
+
+static int open_3dfx(struct inode *inode, struct file * file) {
+ if (!numCards) {
+ DEBUGMSG("No 3Dfx cards found\n");
+ return -EIO;
+ }
+ MOD_INC_USE_COUNT;
+ return 0;
+}
+
+static void release_3dfx(struct inode *inode, struct file * file) {
+ int i;
+
+ for (i=0; i<numCards; i++)
+ if (cards[i].curFile==file) cards[i].curFile=0;
+ MOD_DEC_USE_COUNT;
+}
+
+static int mmap_3dfx(struct inode * inode, struct file * file, struct vm_area_struct * vma)
+{
+ size_t len;
+ int i;
+
+ for (i=0; i<numCards; i++) {
+ if (cards[i].addr==vma->vm_offset) break;
+ }
+ if (i==numCards) {
+ DEBUGMSG("Couldn't match address %lx to a card\n", vma->vm_offset);
+ return -EPERM;
+ }
+ if (cards[i].curFile) {
+ DEBUGMSG("3Dfx card already in use\n");
+ return -EBUSY;
+ }
+
+ if ((vma->vm_offset) & ~PAGE_MASK) {
+ DEBUGMSG("Map request not page aligned\n");
+ return -ENXIO;
+ }
+ len=vma->vm_end-vma->vm_start;
+ if ((len<0) || (len>0x1000000)) {
+ DEBUGMSG("Invalid mapping size requested\n");
+ return -EINVAL;
+ }
+#if defined(__i386__)
+ pgprot_val(vma->vm_page_prot)|=_PAGE_PCD;
+#endif
+ if (remap_page_range(vma->vm_start, vma->vm_offset,
+ len, vma->vm_page_prot)) {
+ DEBUGMSG("Page remap failed\n");
+ return -EAGAIN;
+ }
+ //vma->vm_inode=inode;
+ inode->i_count++;
+ cards[i].curFile=file;
+ return 0;
+}
+
+static int doQueryBoards() {
+ return numCards;
+}
+
+static int doQueryFetch(pioData *desc) {
+ int retval;
+ char retchar;
+ short retword;
+ int retlong;
+
+ if (desc->device<0 || desc->device>=numCards) return -EINVAL;
+ if ((retval=verify_area(VERIFY_WRITE, desc->value, desc->size)))
+ return retval;
+ switch (desc->port) {
+ case PCI_VENDOR_ID_LINUX:
+ if (desc->size!=2) return -EINVAL;
+ memcpy(desc->value, &cards[desc->device].vendor, desc->size);
+ return 0; /*tofs*/
+ case PCI_DEVICE_ID_LINUX:
+ if (desc->size!=2) return -EINVAL;
+ memcpy(desc->value, &cards[desc->device].type, desc->size);
+ return 0;
+ case PCI_BASE_ADDRESS_0_LINUX:
+ if (desc->size!=4) return -EINVAL;
+ memcpy(desc->value, &cards[desc->device].addr, desc->size);
+ return 0;
+ case SST1_PCI_SPECIAL1_LINUX:
+ if (desc->size!=4) return -EINVAL;
+ break;
+ case PCI_REVISION_ID:
+ if (desc->size!=1) return -EINVAL;
+ break;
+ case SST1_PCI_SPECIAL4_LINUX:
+ if (desc->size!=4) return -EINVAL;
+ break;
+ default:
+ return -EINVAL;
+ }
+ switch (desc->size) {
+ case 1:
+ pcibios_read_config_byte(cards[desc->device].bus,
+ cards[desc->device].dev, desc->port, &retchar);
+ memcpy(desc->value, &retchar, 1);
+ break;
+ case 2:
+ pcibios_read_config_word(cards[desc->device].bus,
+ cards[desc->device].dev, desc->port, &retword);
+ memcpy(desc->value, &retword, 2);
+ break;
+ case 4:
+ pcibios_read_config_dword(cards[desc->device].bus,
+ cards[desc->device].dev, desc->port, &retlong);
+ memcpy(desc->value, &retlong, 4);
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int doQueryUpdate(pioData *desc) {
+ int retval;
+ int preval;
+ int mask;
+ char retchar;
+ short retword;
+ int retlong;
+
+ if (desc->device<0 || desc->device>=numCards) return -EINVAL;
+ if ((retval=verify_area(VERIFY_WRITE, desc->value, desc->size)))
+ return retval;
+ switch (desc->port) {
+ case PCI_COMMAND_LINUX:
+ if (desc->size!=2) return -EINVAL;
+ break;
+ case SST1_PCI_SPECIAL1_LINUX:
+ if (desc->size!=4) return -EINVAL;
+ break;
+ case SST1_PCI_SPECIAL2_LINUX:
+ if (desc->size!=4) return -EINVAL;
+ break;
+ case SST1_PCI_SPECIAL3_LINUX:
+ if (desc->size!=4) return -EINVAL;
+ break;
+ case SST1_PCI_SPECIAL4_LINUX:
+ if (desc->size!=4) return -EINVAL;
+ break;
+ default:
+ return -EINVAL;
+ }
+ pcibios_read_config_dword(cards[desc->device].bus,
+ cards[desc->device].dev, desc->port & ~0x3,
+ &retval);
+ switch (desc->size) {
+ case 1:
+ memcpy(&retchar, desc->value, 1);
+ preval=retchar<<(8*(desc->port&0x3));
+ mask=0xFF<<(8*(desc->port&0x3));
+ break;
+ case 2:
+ memcpy(&retword, desc->value, 2);
+ preval=retword<<(8*(desc->port&0x3));
+ mask=0xFFFF<<(8*(desc->port&0x3));
+ break;
+ case 4:
+ memcpy(&retlong, desc->value, 4); /* _fromfs */
+ preval=retlong;
+ mask=~0;
+ break;
+ default:
+ return -EINVAL;
+ }
+ retval = (retval & ~mask) | preval;
+ pcibios_write_config_dword(cards[desc->device].bus,
+ cards[desc->device].dev, desc->port, retval);
+ return 0;
+}
+
+static int doQuery(unsigned int cmd, unsigned long arg) {
+ pioData desc;
+ int retval;
+
+ if (_IOC_NR(cmd)==2) return doQueryBoards();
+ if ((retval=verify_area(VERIFY_READ, (void*)arg, sizeof(pioData))))
+ return retval;
+ memcpy(&desc, (void*)arg, sizeof(pioData)); /* _fromfs */
+ if (_IOC_NR(cmd)==3) return doQueryFetch(&desc);
+ if (_IOC_NR(cmd)==4) return doQueryUpdate(&desc);
+ return -EINVAL;
+}
+
+static int doPIORead(pioData *desc) {
+ int retval;
+ char retchar;
+ short retword;
+ int retlong;
+
+ if ((retval=verify_area(VERIFY_WRITE, desc->value, desc->size)))
+ return retval;
+ switch (desc->port) {
+ case VGA_INPUT_STATUS_1C:
+ break;
+ case SC_INDEX:
+ break;
+ case SC_DATA:
+ break;
+ case VGA_MISC_OUTPUT_READ:
+ break;
+ default:
+ return -EPERM;
+ }
+ if (desc->size!=1) {
+ return -EINVAL;
+ }
+ switch (desc->size) {
+ case 1:
+ retchar=inb(desc->port);
+ memcpy(desc->value, &retchar, sizeof(char));
+ break; /* _tofs */
+ case 2:
+ retword=inw(desc->port);
+ memcpy(desc->value, &retword, sizeof(short));
+ break;
+ case 4:
+ retlong=inl(desc->port);
+ memcpy(desc->value, &retlong, sizeof(int));
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int doPIOWrite(pioData *desc) {
+ int retval;
+ char retchar;
+ short retword;
+ int retlong;
+
+ if ((retval=verify_area(VERIFY_READ, desc->value, desc->size)))
+ return retval;
+ switch (desc->port) {
+ case SC_INDEX:
+ break;
+ case SC_DATA:
+ break;
+ case VGA_MISC_OUTPUT_WRITE:
+ break;
+ default:
+ return -EPERM;
+ }
+ if (desc->size!=1) {
+ return -EINVAL;
+ }
+ switch (desc->size) {
+ case 1:
+ memcpy(&retchar, desc->value, sizeof(char));
+ outb(retchar, desc->port);
+ break; /* _fromfs */
+ case 2:
+ memcpy(&retword, desc->value, sizeof(short));
+ outw(retword, desc->port);
+ break;
+ case 4:
+ memcpy(&retlong, desc->value, sizeof(int));
+ outl(retlong, desc->port);
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int doPIO(unsigned int cmd, unsigned long arg) {
+ pioData desc;
+ int retval;
+
+ if ((retval=verify_area(VERIFY_READ, (void*)arg, sizeof(pioData))))
+ return retval;
+ memcpy(&desc, (void*)arg, sizeof(pioData)); /* _fromfs */
+ if (_IOC_DIR(cmd)==_IOC_READ) return doPIORead(&desc);
+ if (_IOC_DIR(cmd)==_IOC_WRITE) return doPIOWrite(&desc);
+ return -EINVAL;
+}
+
+static int ioctl_3dfx(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ switch (_IOC_TYPE(cmd)) {
+ case '3':
+ return doQuery(cmd, arg);
+ case 0:
+ return doPIO(cmd, arg);
+ default:
+ DEBUGMSG("Unknown 3dfx request made\n");
+ return -EINVAL;
+ }
+}
+
+static struct file_operations fops_3dfx = {
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ ioctl_3dfx,
+ mmap_3dfx,
+ open_3dfx,
+ release_3dfx,
+ 0,
+ 0,
+ 0,
+ 0
+};
+
+/* segfault - Mon Jul 27 1998 - 3dfx devfs support */
+/* `- this was added so that devfs would support the damned thing */
+#ifdef CONFIG_DEVFS_FS
+#define DEVFS_3DFX_DIRECTORY "3DFX"
+#define FX_DEV 0
+/* These device names follow the official Linux device list,
+ * Documentation/devices.txt. Let us know if there are other
+ * common names we should support for compatibility.
+ */
+static const struct {
+ unsigned short minor;
+ char *name;
+ umode_t mode;
+ int *num;
+} dev_list[] = { /* list of minor devices */
+ {FX_DEV, "3dfx", S_IRUGO | S_IWUGO, NULL},
+};
+static char *
+fx_make_name(char *buf, char *name, int idx) {
+ if (idx==0)
+ sprintf(buf, DEVFS_3DFX_DIRECTORY "/" "%s", name);
+ else
+ sprintf(buf, DEVFS_3DFX_DIRECTORY "/" "%s%d", name, idx);
+ return buf;
+}
+/* Register 3dfx entries */
+static void
+fx_register_devfs(void)
+{
+ char name_buf[32];
+ int i, j, num;
+
+ for (i=0; i<sizeof(dev_list)/sizeof(*dev_list); i++) {
+ num = (dev_list[i].num==NULL)?0:*dev_list[i].num;
+ for (j=0; j<num || j==0; j++) {
+ fx_make_name(name_buf, dev_list[i].name, j);
+ devfs_register(name_buf, 0, DEVFS_FL_NONE,
+ MAJOR_3DFX, dev_list[i].minor+(j*0x10),
+ S_IFCHR | dev_list[i].mode, 0, 0, &fops_3dfx, NULL);
+
+ devfs_mk_symlink(NULL, name_buf+sizeof(DEVFS_3DFX_DIRECTORY), 0,
+ DEVFS_FL_NONE,
+ name_buf, 0, NULL);
+
+ }
+ }
+}
+
+/* segfault - Mon Jul 27 1998 - end of 3dfx support functions */
+
+static void *devfs_handle = NULL;
+#endif /*CONFIG_DEVFS_FS*/
+
+#ifdef MODULE
+int init_module(void)
+{
+#ifndef CONFIG_DEVFS_FS
+ if ((major_3dfx = register_chrdev(MAJOR_3DFX, "3dfx", &fops_3dfx)) == -EBUSY) {
+ DEBUGMSG("unable to get major for 3dfx device\n");
+ return -EIO;
+ }
+#else /*CONFIG_DEVFS_FS*/
+ if (devfs_register_chrdev(MAJOR_3DFX, "3dfx", &fops_3dfx)==-EBUSY)
+ {
+ DEBUGMSG("unable to get major for 3dfx device\n");
+ return -EIO;
+ }
+ devfs_handle = NULL;
+ fx_register_devfs();
+#endif /*CONFIG_DEVFS_FS*/
+
+ findCards();
+ return 0;
+}
+#else
+void init_3dfx(void) {
+#ifndef CONFIG_DEVFS_FS
+ if (major_3dfx = register_chrdev(MAJOR_3DFX, "3dfx", &fops_3dfx))
+ DEBUGMSG("unable to get major for 3dfx device\n");
+#else /*CONFIG_DEVFS_FS*/
+ if (devfs_register_chrdev(MAJOR_3DFX, "3dfx", &fops_3dfx))
+ DEBUGMSG("unable to get major for 3dfx device\n");
+ fx_register_devfs();
+#endif /*CONFIG_DEVFS_FS*/
+ findCards();
+ return 0;
+}
+#endif
+
+
+#ifdef MODULE
+void cleanup_module(void) {
+ #ifndef CONFIG_DEVFS_FS
+ unregister_chrdev(MAJOR_3DFX, "3dfx");
+ #else /*CONFIG_DEVFS_FS
+ /* We have nothing to really do here - we know the lists must be
+ empty */
+
+ devfs_unregister_chrdev(MAJOR_3DFX, "3dfx");
+ devfs_unregister (devfs_handle);
+ #endif /*CONFIG_DEVFS_FS*/
+}
+#endifdiff -u /mnt/src/linux/drivers/video/Config.in drivers/video/Config.in
--- /mnt/src/linux/drivers/video/Config.in Tue Jul 28 13:30:38 1998
+++ drivers/video/Config.in Tue Jul 28 03:52:07 1998
@@ -1,7 +1,7 @@
#
# Video configuration
#
-
+tristate '3Dfx device support' CONFIG_3DFX
if [ "$CONFIG_FB" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
diff -u /mnt/src/linux/drivers/video/Makefile drivers/video/Makefile
--- /mnt/src/linux/drivers/video/Makefile Tue Jul 28 13:30:38 1998
+++ drivers/video/Makefile Tue Jul 28 03:05:52 1998
@@ -32,7 +32,14 @@
ifeq ($(CONFIG_PROM_CONSOLE),y)
L_OBJS += promcon.o promcon_tbl.o
endif
-
+ifeq ($(CONFIG_3DFX),y)
+ L_OBJS += 3dfx.o
+ else
+ ifeq ($(CONFIG_3DFX),m)
+ M_OBJS += 3dfx.o
+ endif
+endif
+
ifeq ($(CONFIG_FB),y)
L_OBJS += fonts.o
OX_OBJS += fbcon.o fbcmap.o
diff -u /mnt/src/linux/drivers/video/S3triofb.c drivers/video/S3triofb.c
--- /mnt/src/linux/drivers/video/S3triofb.c Tue Jul 21 13:28:24 1998
+++ drivers/video/S3triofb.c Tue Jul 28 05:07:15 1998
@@ -612,6 +612,11 @@
}
#endif /* CONFIG_FB_COMPAT_XPMAC) */

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return;

diff -u /mnt/src/linux/drivers/video/acornfb.c drivers/video/acornfb.c
--- /mnt/src/linux/drivers/video/acornfb.c Tue Jul 21 13:28:24 1998
+++ drivers/video/acornfb.c Tue Jul 28 05:06:49 1998
@@ -376,6 +376,11 @@
acornfb_set_disp(-1);
fb_set_cmap(fb_default_cmap(current_par.palette_size), &fb_display[0].var,
1, acornfb_vidc20_setcolreg, &fb_info);
+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
register_framebuffer(&fb_info);

return mem_start;
diff -u /mnt/src/linux/drivers/video/amifb.c drivers/video/amifb.c
--- /mnt/src/linux/drivers/video/amifb.c Tue Jul 21 13:28:24 1998
+++ drivers/video/amifb.c Tue Jul 28 05:06:28 1998
@@ -1901,6 +1901,11 @@

amifb_set_var(&amifb_default, -1, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return;

diff -u /mnt/src/linux/drivers/video/atafb.c drivers/video/atafb.c
--- /mnt/src/linux/drivers/video/atafb.c Tue Jul 28 13:30:38 1998
+++ drivers/video/atafb.c Tue Jul 28 05:06:06 1998
@@ -2827,6 +2827,11 @@
atafb_set_disp(-1, &fb_info);
do_install_cmap(0, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return;

diff -u /mnt/src/linux/drivers/video/atyfb.c drivers/video/atyfb.c
--- /mnt/src/linux/drivers/video/atyfb.c Tue Jul 28 13:30:38 1998
+++ drivers/video/atyfb.c Tue Jul 28 05:05:41 1998
@@ -2471,6 +2471,11 @@
disp->dispsw = &info->dispsw;
atyfb_set_var(&var, -1, &info->fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&info->fb_info) < 0)
return 0;

diff -u /mnt/src/linux/drivers/video/chipsfb.c drivers/video/chipsfb.c
--- /mnt/src/linux/drivers/video/chipsfb.c Tue Jul 21 13:28:24 1998
+++ drivers/video/chipsfb.c Tue Jul 28 05:04:14 1998
@@ -451,6 +451,11 @@
p->palette[i].blue = default_blu[j];
}

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&p->info) < 0) {
kfree(p);
return;
diff -u /mnt/src/linux/drivers/video/clgenfb.c drivers/video/clgenfb.c
--- /mnt/src/linux/drivers/video/clgenfb.c Tue Jul 28 13:30:38 1998
+++ drivers/video/clgenfb.c Tue Jul 28 05:03:49 1998
@@ -1551,6 +1551,11 @@
fbgen_set_disp(-1, &fb_info->gen);
fbgen_install_cmap(0, &fb_info->gen);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
err = register_framebuffer(&fb_info->gen.info);
if (err)
{
diff -u /mnt/src/linux/drivers/video/controlfb.c drivers/video/controlfb.c
--- /mnt/src/linux/drivers/video/controlfb.c Tue Jul 28 13:30:38 1998
+++ drivers/video/controlfb.c Tue Jul 28 05:03:03 1998
@@ -466,7 +466,12 @@
par->xoffset = par->yoffset = 0;

control_par_to_all(p, 1);
-
+
+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&p->info) < 0) {
kfree(p);
return;
diff -u /mnt/src/linux/drivers/video/cyberfb.c drivers/video/cyberfb.c
--- /mnt/src/linux/drivers/video/cyberfb.c Tue Jul 28 13:30:38 1998
+++ drivers/video/cyberfb.c Tue Jul 28 05:02:26 1998
@@ -1054,6 +1054,11 @@
cyberfb_set_disp(-1, &fb_info);
do_install_cmap(0, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return;

diff -u /mnt/src/linux/drivers/video/dnfb.c drivers/video/dnfb.c
--- /mnt/src/linux/drivers/video/dnfb.c Tue Jul 28 13:30:38 1998
+++ drivers/video/dnfb.c Tue Jul 28 05:01:58 1998
@@ -333,6 +333,11 @@
dnfb_get_var(&disp[0].var, 0, &fb_info);
dnfb_set_disp(-1, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
panic("unable to register apollo frame buffer\n");

diff -u /mnt/src/linux/drivers/video/hpfb.c drivers/video/hpfb.c
--- /mnt/src/linux/drivers/video/hpfb.c Fri Jul 10 18:18:31 1998
+++ drivers/video/hpfb.c Tue Jul 28 05:01:28 1998
@@ -365,6 +365,11 @@
hpfb_get_var(&disp.var, -1, &fb_info);
hpfb_set_disp(-1);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return 1;

diff -u /mnt/src/linux/drivers/video/macfb.c drivers/video/macfb.c
--- /mnt/src/linux/drivers/video/macfb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/macfb.c Tue Jul 28 05:01:04 1998
@@ -425,6 +425,12 @@
* Register the nubus hook
*/

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
+
register_nubus_device(&nb_video);

if (register_framebuffer(&fb_info) < 0)
diff -u /mnt/src/linux/drivers/video/mdafb.c drivers/video/mdafb.c
--- /mnt/src/linux/drivers/video/mdafb.c Tue Jul 21 13:28:24 1998
+++ drivers/video/mdafb.c Tue Jul 28 05:00:23 1998
@@ -415,6 +415,11 @@

mdafb_set_var(&fb_var, -1, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return;

diff -u /mnt/src/linux/drivers/video/offb.c drivers/video/offb.c
--- /mnt/src/linux/drivers/video/offb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/offb.c Tue Jul 28 05:00:01 1998
@@ -454,6 +454,11 @@
}
offb_set_var(var, -1, &info->info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&info->info) < 0) {
kfree(info);
return;
diff -u /mnt/src/linux/drivers/video/platinumfb.c drivers/video/platinumfb.c
--- /mnt/src/linux/drivers/video/platinumfb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/platinumfb.c Tue Jul 28 04:59:37 1998
@@ -496,6 +496,12 @@
par->xoffset = par->yoffset = 0;

platinum_par_to_all(p, 1);
+
+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+

if (register_framebuffer(&p->info) < 0) {
kfree(p);
diff -u /mnt/src/linux/drivers/video/retz3fb.c drivers/video/retz3fb.c
--- /mnt/src/linux/drivers/video/retz3fb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/retz3fb.c Tue Jul 28 04:58:58 1998
@@ -1539,6 +1539,11 @@

do_install_cmap(0, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return;

diff -u /mnt/src/linux/drivers/video/sbusfb.c drivers/video/sbusfb.c
--- /mnt/src/linux/drivers/video/sbusfb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/sbusfb.c Tue Jul 28 04:58:30 1998
@@ -1052,6 +1052,11 @@

sbusfb_set_var(var, -1, &fb->info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb->info) < 0) {
kfree(fb);
return;
diff -u /mnt/src/linux/drivers/video/skeletonfb.c drivers/video/skeletonfb.c
--- /mnt/src/linux/drivers/video/skeletonfb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/skeletonfb.c Tue Jul 28 04:57:58 1998
@@ -296,6 +296,11 @@
fbgen_do_set_var(var, 1, &fbinfo.gen);
fbgen_set_disp(-1, &fb_info.gen.info);
fbgen_install_cmap(0, &fb_info.gen);
+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info.gen.info) < 0)
return;
printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node),
diff -u /mnt/src/linux/drivers/video/tgafb.c drivers/video/tgafb.c
--- /mnt/src/linux/drivers/video/tgafb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/tgafb.c Tue Jul 28 04:56:42 1998
@@ -769,6 +769,11 @@

tgafb_set_var(&fb_var, -1, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return;

diff -u /mnt/src/linux/drivers/video/vesafb.c drivers/video/vesafb.c
--- /mnt/src/linux/drivers/video/vesafb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/vesafb.c Tue Jul 28 04:56:03 1998
@@ -463,6 +463,11 @@
fb_info.blank=&vesafb_blank;
vesafb_set_disp(-1);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info)<0)
return;

diff -u /mnt/src/linux/drivers/video/vfb.c drivers/video/vfb.c
--- /mnt/src/linux/drivers/video/vfb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/vfb.c Tue Jul 28 04:53:58 1998
@@ -436,6 +436,11 @@

vfb_set_var(&vfb_default, -1, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0) {
vfree((void *)videomemory);
return;
diff -u /mnt/src/linux/drivers/video/vgacon.c drivers/video/vgacon.c
--- /mnt/src/linux/drivers/video/vgacon.c Tue Jul 28 13:30:39 1998
+++ drivers/video/vgacon.c Tue Jul 28 04:14:32 1998
@@ -64,7 +64,7 @@
*/
#undef TRIDENT_GLITCH

-#undef VGA_CAN_DO_64KB
+#define VGA_CAN_DO_64KB

#define dac_reg 0x3c8
#define dac_val 0x3c9
@@ -684,7 +684,7 @@
charmap = (char *)VGA_MAP_MEM(colourmap);
beg = 0x0e;
#ifdef VGA_CAN_DO_64KB
- if (video_type == VIDEO_TYPE_VGAC)
+ if (vga_video_type == VIDEO_TYPE_VGAC)
beg = 0x06;
#endif
} else {
diff -u /mnt/src/linux/drivers/video/vgafb.c drivers/video/vgafb.c
--- /mnt/src/linux/drivers/video/vgafb.c Tue Jul 21 13:28:24 1998
+++ drivers/video/vgafb.c Tue Jul 28 04:55:34 1998
@@ -11,7 +11,7 @@
* more details.
*/

-
+#define VGA_CAN_DO_64KB


/* KNOWN PROBLEMS/TO DO ===================================================== *
@@ -620,7 +620,10 @@
fb_info.blank = &vgafbcon_blank;

vgafb_set_var(&fb_var, -1, &fb_info);
-
+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
if (register_framebuffer(&fb_info) < 0)
return;

diff -u /mnt/src/linux/drivers/video/virgefb.c drivers/video/virgefb.c
--- /mnt/src/linux/drivers/video/virgefb.c Tue Jul 28 13:30:39 1998
+++ drivers/video/virgefb.c Tue Jul 28 04:54:52 1998
@@ -1066,6 +1066,11 @@
virgefb_set_disp(-1, &fb_info);
do_install_cmap(0, &fb_info);

+ /* segfault - July 28 1998 - devfs framebuffer support */
+ #ifdef CONFIG_DEVFS_FS
+ framebuffer_register_devfs();
+ #endif /*CONFIG_DEVFS_FS*/
+
if (register_framebuffer(&fb_info) < 0)
return;

--- /mnt/src/linux/drivers/char/fbmem.c Tue Jul 28 13:30:35 1998
+++ drivers/char/fbmem.c Tue Jul 28 09:12:27 1998
@@ -28,6 +28,9 @@
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
+#ifdef CONFIG_DEVFS_FS
+#include <linux/devfs_fs.h>
+#endif /*CONFIG_DEVFS_FS*/

#ifdef __mc68000__
#include <asm/setup.h>
@@ -500,7 +503,7 @@

if (first) {
first = 0;
- take_over_console(&fb_con, 12, MAX_NR_CONSOLES-1, 1);
+ take_over_console(&fb_con, 0, MAX_NR_CONSOLES-1, 1);
}

return 0;
@@ -526,6 +529,59 @@
static struct proc_dir_entry *proc_fbmem;
#endif

+/* segfault - July 28 1998 - framebuffer devfs support */
+/* `- added this to make it work right w/ devfs */
+#ifdef CONFIG_DEVFS_FS
+#define FB_MINOR 0
+#define DEVFS_FB_DIRECTORY "fb"
+/* These device names follow the official Linux device list,
+ * Documentation/devices.txt. Let us know if there are other
+ * common names we should support for compatibility.
+ */
+const struct {
+ unsigned short minor;
+ char *name;
+ umode_t mode;
+ int *num;
+} dev_list[] = { /* list of minor devices */
+ {FB_MINOR+0x10, "fb0", S_IRUGO | S_IWUGO, NULL},
+ {FB_MINOR+0x20, "fb1", S_IRUGO | S_IWUGO, NULL},
+ {FB_MINOR+0x30, "fb2", S_IRUGO | S_IWUGO, NULL},
+};
+char *
+framebuffer_make_name(char *buf, char *name, int idx) {
+ if (idx==0)
+ sprintf(buf, DEVFS_FB_DIRECTORY "/" "%s", name);
+ else
+ sprintf(buf, DEVFS_FB_DIRECTORY "/" "%s%d", name, idx);
+ return buf;
+}
+/* Register framebuffer entries */
+void
+framebuffer_register_devfs(void)
+{
+ char name_buf[32];
+ int i, j, num;
+
+ for (i=0; i<sizeof(dev_list)/sizeof(*dev_list); i++) {
+ num = (dev_list[i].num==NULL)?0:*dev_list[i].num;
+ for (j=0; j<num || j==0; j++) {
+ framebuffer_make_name(name_buf, dev_list[i].name, j);
+ devfs_register(name_buf, 0, DEVFS_FL_NONE,
+ FB_MAJOR, dev_list[i].minor+(j*0x10),
+ S_IFCHR | dev_list[i].mode, 0, 0, &fb_fops, NULL);
+
+ devfs_mk_symlink(NULL, name_buf+sizeof(DEVFS_FB_DIRECTORY), 0,
+ DEVFS_FL_NONE,
+ name_buf, 0, NULL);
+
+ }
+ }
+}
+#endif /*CONFIG_DEVFS_FS*/
+/* segfault - July 28 1998 - framebuffer support for devfs*/
+
+
__initfunc(void
fbmem_init(void))
{
@@ -651,3 +707,4 @@

EXPORT_SYMBOL(register_framebuffer);
EXPORT_SYMBOL(unregister_framebuffer);
+EXPORT_SYMBOL(framebuffer_register_devfs);[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2005-03-22 13:43    [W:1.817 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site