[linux-fbdev] [patch] ATY 128 framebuffer for 2.2.14 (fwd)

James A Simmons (jsimmons@acsu.buffalo.edu)
Fri, 7 Jan 2000 10:03:05 -0500 (EST)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--r5Pyd7+fXNt84Ff3
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.GSO.4.05.10001071002502.18599@joxer.acsu.buffalo.edu>

---------- Forwarded message ----------
Date: Thu, 6 Jan 2000 21:57:06 -0500
From: Daniel Jacobowitz <drow@false.org>
To: linux-fbdev@vuser.vu.union.edu
Subject: [linux-fbdev] [patch] ATY 128 framebuffer for 2.2.14

Here are the fairly straight-forward changes needed to make aty128fb work in
a Linus 2.2.14 kernel. The first patch is against the stock 2.2.14 kernel
and add supporting changes; then copy the latest versions of aty128.h and
aty128fb.h (from Brad's patch) into drivers/video/ and apply the second
patch.

It works like a charm on x86 - well, somewhat... if I didn't set -accel to
false, scrolling was unbearably slow (twenty seconds to advance a page in
less, on a dual-466 mHz SMP, is not ok).

Dan

/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 |
| Debian GNU/Linux Developer __ Carnegie Mellon University |
| dan@debian.org | | dmj+@andrew.cmu.edu |
\--------------------------------/ \--------------------------------/

--r5Pyd7+fXNt84Ff3
Content-Type: TEXT/PLAIN; CHARSET=us-ascii
Content-ID: <Pine.GSO.4.05.10001071002503.18599@joxer.acsu.buffalo.edu>
Content-Description:
Content-Disposition: ATTACHMENT; FILENAME="aty128-2.2.14.diff"

diff -uNr -x .config* -x aty128fb.c -x aty128.h ../linux/Documentation/Configure.help linux-stable/Documentation/Configure.help
--- ../linux/Documentation/Configure.help Tue Jan 4 13:12:10 2000
+++ linux-stable/Documentation/Configure.help Thu Jan 6 14:31:08 2000
@@ -1813,6 +1813,16 @@
CONFIG_FB_ATY
This driver supports graphics boards with the ATI Mach64 chips.

+ATI Rage128 display support (EXPERIMENTAL)
+CONFIG_FB_ATY128
+ This driver supports graphics boards with the ATI Rage128 chip.
+ Say Y if you have such a graphics board.
+
+ The driver is also available as a module ( = code which can be
+ inserted and removed from the running kernel whenever you want). The
+ module will be called aty128fb.o. If you want to compile it as a
+ module, say M here and read Documentation/modules.txt.
+
PowerMac "control" frame buffer device support
CONFIG_FB_CONTROL
This driver supports a frame buffer for the graphics adapter in the
diff -uNr -x .config* -x aty128fb.c -x aty128.h ../linux/Documentation/fb/aty128fb.txt linux-stable/Documentation/fb/aty128fb.txt
--- ../linux/Documentation/fb/aty128fb.txt Wed Dec 31 19:00:00 1969
+++ linux-stable/Documentation/fb/aty128fb.txt Thu Jan 6 14:31:30 2000
@@ -0,0 +1,72 @@
+[This file is cloned from VesaFB/matroxfb]
+
+What is aty128fb?
+=================
+
+This is a driver for a graphic framebuffer for ATI Rage128 based devices
+on Intel and PPC boxes.
+
+Advantages:
+
+ * It provides a nice large console (128 cols + 48 lines with 1024x768)
+ without using tiny, unreadable fonts.
+ * You can run XF68_FBDev on top of /dev/fb0
+ * Most important: boot logo :-)
+
+Disadvantages:
+
+ * graphic mode is slower than text mode... but you should not notice
+ if you use same resolution as you used in textmode.
+ * still experimental.
+
+
+How to use it?
+==============
+
+Switching modes is done using the video=aty128fb:<resolution>... modedb
+boot parameter or using `fbset' program.
+
+See Documentation/fb/modedb.txt for more information on modedb
+resolutions.
+
+You should compile in both vgacon (to boot if you remove your Rage128 from
+box) and aty128fb (for graphics mode). You should not compile-in vesafb
+unless you have primary display on non-Rage128 VBE2.0 device (see
+Documentation/vesafb.txt for details).
+
+
+X11
+===
+
+XF68_FBDev should generally work fine, but it is non-accelerated. As of
+this document, 8 and 32bpp works fine. There have been palette issues
+when switching from X to console and back to X. You will have to restart
+X to fix this.
+
+
+Configuration
+=============
+
+You can pass kernel command line options to vesafb with
+`video=aty128fb:option1,option2:value2,option3' (multiple options should
+be separated by comma, values are separated from options by `:').
+Accepted options:
+
+noaccel - do not use acceleration engine. It is default.
+accel - use acceleration engine. Not finished.
+vmode:x - chooses PowerMacintosh video mode <x>. Depreciated.
+cmode:x - chooses PowerMacintosh colour mode <x>. Depreciated.
+<XxX@X> - selects startup videomode. See modedb.txt for detailed
+ explanation. Default is 640x480x8bpp.
+
+
+Limitations
+===========
+
+There are known and unknown bugs, features and misfeatures.
+Currently there are following known bugs:
+ + This driver is still experimental and is not finished. Too many
+ bugs/eratta to list here.
+
+--
+Brad Douglas <brad@neruo.com>
diff -uNr -x .config* -x aty128fb.c -x aty128.h ../linux/MAINTAINERS linux-stable/MAINTAINERS
--- ../linux/MAINTAINERS Tue Jan 4 13:12:10 2000
+++ linux-stable/MAINTAINERS Thu Jan 6 14:35:16 2000
@@ -694,6 +694,14 @@
L: linux-ppp@vger.rutgers.edu
S: Maintained

+RAGE128 FRAMEBUFFER DISPLAY DRIVER
+P: Brad Douglas
+M: brad@neruo.com
+P: Anthony Tong
+M: atong@uiuc.edu
+L: linux-fbdev@vuser.vc.union.edu
+S: Maintained
+
REAL TIME CLOCK DRIVER
P: Paul Gortmaker
M: p_gortmaker@yahoo.com
diff -uNr -x .config* -x aty128fb.c -x aty128.h ../linux/drivers/video/Config.in linux-stable/drivers/video/Config.in
--- ../linux/drivers/video/Config.in Tue Jan 4 13:12:22 2000
+++ linux-stable/drivers/video/Config.in Thu Jan 6 14:36:46 2000
@@ -90,6 +90,7 @@
bool ' Multihead support' CONFIG_FB_MATROX_MULTIHEAD
fi
bool 'ATI Mach64 display support' CONFIG_FB_ATY
+ tristate 'ATI Rage 128 display support (EXPERIMENTAL)' CONFIG_FB_ATY128
fi
fi
if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
diff -uNr -x .config* -x aty128fb.c -x aty128.h ../linux/drivers/video/Makefile linux-stable/drivers/video/Makefile
--- ../linux/drivers/video/Makefile Wed Aug 25 20:29:49 1999
+++ linux-stable/drivers/video/Makefile Thu Jan 6 14:37:59 2000
@@ -104,6 +104,14 @@
L_OBJS += atyfb.o
endif

+ifeq ($(CONFIG_FB_ATY128),y)
+L_OBJS += aty128fb.o
+else
+ ifeq ($(CONFIG_FB_ATY128),m)
+ M_OBJS += aty128fb.o
+ endif
+endif
+
ifeq ($(CONFIG_FB_IGA),y)
L_OBJS += igafb.o
endif
diff -uNr -x .config* -x aty128fb.c -x aty128.h ../linux/drivers/video/fbmem.c linux-stable/drivers/video/fbmem.c
--- ../linux/drivers/video/fbmem.c Tue Jan 4 13:12:22 2000
+++ linux-stable/drivers/video/fbmem.c Thu Jan 6 16:02:02 2000
@@ -68,6 +68,8 @@
extern void offb_setup(char *options, int *ints);
extern void atyfb_init(void);
extern void atyfb_setup(char *options, int *ints);
+extern void aty128fb_init(void);
+extern void aty128fb_setup(char *options, int *ints);
extern void igafb_init(void);
extern void igafb_setup(char *options, int *ints);
extern void imsttfb_init(void);
@@ -142,6 +144,9 @@
#endif
#ifdef CONFIG_FB_ATY
{ "atyfb", atyfb_init, atyfb_setup },
+#endif
+#ifdef CONFIG_FB_ATY128
+ { "aty128fb", aty128fb_init, aty128fb_setup },
#endif
#ifdef CONFIG_FB_IGA
{ "igafb", igafb_init, igafb_setup },
diff -uNr -x .config* -x aty128fb.c -x aty128.h ../linux/drivers/video/offb.c linux-stable/drivers/video/offb.c
--- ../linux/drivers/video/offb.c Wed Aug 25 20:29:49 1999
+++ linux-stable/drivers/video/offb.c Thu Jan 6 15:57:53 2000
@@ -293,6 +293,9 @@
#ifdef CONFIG_FB_ATY
extern void atyfb_of_init(struct device_node *dp);
#endif /* CONFIG_FB_ATY */
+#ifdef CONFIG_FB_ATY128
+extern void aty128fb_of_init(struct device_node *dp);
+#endif /* CONFIG_FB_ATY128 */
#ifdef CONFIG_FB_S3TRIO
extern void s3triofb_init_of(struct device_node *dp);
#endif /* CONFIG_FB_S3TRIO */
@@ -409,6 +412,12 @@

__initfunc(static int offb_init_driver(struct device_node *dp))
{
+#ifdef CONFIG_FB_ATY128
+ if (!strncmp(dp->name, "ATY,Rage128", 11)) {
+ aty128fb_of_init(dp);
+ return 1;
+ }
+#endif /* CONFIG_FB_ATY */
#ifdef CONFIG_FB_ATY
if (!strncmp(dp->name, "ATY", 3)) {
atyfb_of_init(dp);
diff -uNr -x .config* -x aty128fb.c -x aty128.h ../linux/include/linux/fb.h linux-stable/include/linux/fb.h
--- ../linux/include/linux/fb.h Wed Jan 5 18:58:38 2000
+++ linux-stable/include/linux/fb.h Thu Jan 6 15:46:16 2000
@@ -74,6 +74,7 @@
#define FB_ACCEL_SUN_CGTHREE 24 /* Sun cgthree */
#define FB_ACCEL_SUN_TCX 25 /* Sun tcx */
#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
+#define FB_ACCEL_ATI_RAGE128 32 /* ATI Rage128 family */

struct fb_fix_screeninfo {
char id[16]; /* identification string eg "TT Builtin" */

--r5Pyd7+fXNt84Ff3
Content-Type: TEXT/PLAIN; CHARSET=us-ascii
Content-ID: <Pine.GSO.4.05.10001071002504.18599@joxer.acsu.buffalo.edu>
Content-Description:
Content-Disposition: ATTACHMENT; FILENAME="aty128fb-driver.diff"

--- linux-unstable/drivers/video/aty128fb.c Thu Jan 6 14:13:31 2000
+++ linux-stable/drivers/video/aty128fb.c Thu Jan 6 15:45:19 2000
@@ -85,12 +85,14 @@
0, FB_VMODE_NONINTERLACED
};

+#if LINUX_VERSION_CODE >= 0x020300
/* default modedb mode */
static struct fb_videomode defaultmode __initdata = {
/* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */
NULL, 60, 640, 480, 39722, 48, 16, 33, 10, 96, 2,
0, FB_VMODE_NONINTERLACED
};
+#endif

struct aty128_chip_info {
const char *name;
@@ -1659,8 +1661,10 @@
var = default_var;

#endif /* CONFIG_PMAC */
+#if LINUX_VERSION_CODE >=0x020300
if (!fb_find_mode(&var, &info->fb_info, mode_option, NULL, 0,
&defaultmode, 8))
+#endif
var = default_var;
#endif /* MODULE */

@@ -1752,7 +1756,6 @@
return;
}

-
/* register a card ++ajoshi */
static int __init
aty128_pci_register(struct pci_dev *pdev,
@@ -1760,9 +1763,10 @@
{
struct fb_info_aty128 *info = NULL;
unsigned long fb_addr, reg_addr;
- struct resource *rp;
u16 tmp;

+#if LINUX_VERSION_CODE >= 0x020300
+ struct resource *rp;

rp = &pdev->resource[0];
fb_addr = rp->start;
@@ -1782,6 +1786,12 @@
}

request_mem_region (rp->start, rp->end - rp->start + 1, "aty128fb");
+#else
+ fb_addr = pdev->base_address[0] & PCI_BASE_ADDRESS_MEM_MASK;
+ reg_addr = pdev->base_address[2] & PCI_BASE_ADDRESS_MEM_MASK;
+ if (!reg_addr)
+ return -1;
+#endif

info = kmalloc(sizeof(struct fb_info_aty128), GFP_ATOMIC);
if(!info) {
@@ -1830,12 +1840,16 @@
err_out:
kfree (info);
unmap_out:
+
+#if LINUX_VERSION_CODE >= 0x020300
release_mem_region (pdev->resource[0].start,
pdev->resource[0].end -
pdev->resource[0].start + 1);
release_mem_region (pdev->resource[2].start,
pdev->resource[2].end -
pdev->resource[2].start + 1);
+#endif
+
return -1;
}
#endif /* ! CONFIG_FB_OF */
@@ -2407,12 +2421,16 @@
iounmap (tmp->BIOS_SEG);
iounmap (tmp->regbase);
iounmap (tmp->frame_buffer);
+
+#if LINUX_VERSION_CODE >= 0x020300
release_mem_region (tmp->pdev->resource[0].start,
tmp->pdev->resource[0].end -
tmp->pdev->resource[0].start + 1);
release_mem_region (tmp->pdev->resource[2].start,
tmp->pdev->resource[2].end -
tmp->pdev->resource[2].start + 1);
+#endif
+
kfree (tmp);
}
}

--r5Pyd7+fXNt84Ff3--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/