Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933141AbXBEUQ3 (ORCPT ); Mon, 5 Feb 2007 15:16:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933160AbXBEUQ3 (ORCPT ); Mon, 5 Feb 2007 15:16:29 -0500 Received: from smtp1.kolej.mff.cuni.cz ([195.113.24.4]:50328 "EHLO smtp1.kolej.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933141AbXBEUQZ (ORCPT ); Mon, 5 Feb 2007 15:16:25 -0500 X-Greylist: delayed 1359 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 Feb 2007 15:16:24 EST X-Envelope-From: zajio1am@artax.karlin.mff.cuni.cz Date: Mon, 5 Feb 2007 20:51:30 +0100 From: Ondrej Zajicek To: James Simmons Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-fbdev-devel@lists.sourceforge.net Subject: [PATCH] fbdev driver for S3 Trio/Virge Message-ID: <20070205195130.GB5206@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: Debian GNU/Linux 3.1 (Sarge) User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 63858 Lines: 2087 This patch adds driver for S3 Trio / S3 Virge. Driver is tested with most versions of S3 Trio and S3 Virge, on i386. It is tested both as compiled-in and module. It is against linux-2.6.20 . This is version 2. Version 1 is in -mm tree. Changes from version 1: * proper Virge VX support * suspend/resume support * S3 fasttext support * several minor bugs corrected Signed-off-by: Ondrej Zajicek --- diff -uprN -X linux-2.6.20/Documentation/dontdiff linux-2.6.20/Documentation/fb/s3fb.txt linux-2.6.20-s3fb/Documentation/fb/s3fb.txt --- linux-2.6.20/Documentation/fb/s3fb.txt 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.20-s3fb/Documentation/fb/s3fb.txt 2007-02-05 14:26:14.000000000 +0100 @@ -0,0 +1,78 @@ + + s3fb - fbdev driver for S3 Trio/Virge chips + =========================================== + + +Supported Hardware +================== + + S3 Trio32 + S3 Trio64 (and variants V+, UV+, V2/DX, V2/GX) + S3 Virge (and variants VX, DX, GX and GX2+) + S3 Plato/PX (completely untested) + S3 Aurora64V+ (completely untested) + + - only PCI bus supported + - only BIOS initialized VGA devices supported + - probably not working on big endian + +I tested s3fb on Trio64 (plain, V+ and V2/DX) and Virge (plain, VX, DX), +all on i386. + + +Supported Features +================== + + * 4 bpp pseudocolor modes (with 18bit palette, two variants) + * 8 bpp pseudocolor mode (with 18bit palette) + * 16 bpp truecolor modes (RGB 555 and RGB 565) + * 24 bpp truecolor mode (RGB 888) on (only on Virge VX) + * 32 bpp truecolor mode (RGB 888) on (not on Virge VX) + * text mode (activated by bpp = 0) + * interlaced mode variant (not available in text mode) + * doublescan mode variant (not available in text mode) + * panning in both directions + * suspend/resume support + * DPMS support + +Text mode is supported even in higher resolutions, but there is limitation +to lower pixclocks (maximum between 50-60 MHz, depending on specific hardware). +This limitation is not enforced by driver. Text mode supports 8bit wide fonts +only (hardware limitation) and 16bit tall fonts (driver limitation). + +There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with +packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode +with interleaved planes (1 byte interleave), MSB first. Both modes support +8bit wide fonts only (driver limitation). + +Suspend/resume works on systems that initialize video card during resume and +if device is active (for example used by fbcon). + + +Missing Features +================ +(alias TODO list) + + * secondary (not initialized by BIOS) device support + * big endian support + * Zorro bus support + * MMIO support + * 24 bpp mode support on more cards + * support for fontwidths != 8 in 4 bpp modes + * support for fontheight != 16 in text mode + * composite and external sync (is anyone able to test this?) + * hardware cursor + * video overlay support + * vsync synchronization + * feature connector support + * acceleration support (8514-like 2D, Virge 3D, busmaster transfers) + * better values for some magic registers (performance issues) + + +Known bugs +========== + + * cursor disable in text mode doesn't work + +-- +Ondrej Zajicek diff -uprN -X linux-2.6.20/Documentation/dontdiff linux-2.6.20/drivers/video/Kconfig linux-2.6.20-s3fb/drivers/video/Kconfig --- linux-2.6.20/drivers/video/Kconfig 2007-02-04 19:44:54.000000000 +0100 +++ linux-2.6.20-s3fb/drivers/video/Kconfig 2007-02-05 19:05:50.000000000 +0100 @@ -85,6 +85,14 @@ config FB_CFB_IMAGEBLIT blitting. This is used by drivers that don't provide their own (accelerated) version. +config FB_SVGALIB + tristate + depends on FB + default n + ---help--- + Common utility functions useful to fbdev drivers of VGA-based + cards. + config FB_MACMODES tristate depends on FB @@ -1147,6 +1155,17 @@ config FB_S3TRIO help If you have a S3 Trio say Y. Say N for S3 Virge. +config FB_S3 + tristate "S3 Trio/Virge support" + depends on FB && PCI + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + select FB_TILEBLITTING + select FB_SVGALIB + ---help--- + Driver for graphics boards with S3 Trio / S3 Virge chip. + config FB_SAVAGE tristate "S3 Savage support" depends on FB && PCI && EXPERIMENTAL diff -uprN -X linux-2.6.20/Documentation/dontdiff linux-2.6.20/drivers/video/Makefile linux-2.6.20-s3fb/drivers/video/Makefile --- linux-2.6.20/drivers/video/Makefile 2007-02-04 19:44:54.000000000 +0100 +++ linux-2.6.20-s3fb/drivers/video/Makefile 2007-02-05 14:26:14.000000000 +0100 @@ -17,6 +17,7 @@ obj-$(CONFIG_SYSFS) += backlight/ obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o obj-$(CONFIG_FB_CFB_IMAGEBLIT) += cfbimgblt.o +obj-$(CONFIG_FB_SVGALIB) += svgalib.o obj-$(CONFIG_FB_MACMODES) += macmodes.o obj-$(CONFIG_FB_DDC) += fb_ddc.o @@ -54,6 +55,7 @@ obj-$(CONFIG_FB_S3TRIO) += S3t obj-$(CONFIG_FB_FM2) += fm2fb.o obj-$(CONFIG_FB_CYBLA) += cyblafb.o obj-$(CONFIG_FB_TRIDENT) += tridentfb.o +obj-$(CONFIG_FB_S3) += s3fb.o vgastate.o obj-$(CONFIG_FB_STI) += stifb.o obj-$(CONFIG_FB_FFB) += ffb.o sbuslib.o obj-$(CONFIG_FB_CG6) += cg6.o sbuslib.o diff -uprN -X linux-2.6.20/Documentation/dontdiff linux-2.6.20/drivers/video/s3fb.c linux-2.6.20-s3fb/drivers/video/s3fb.c --- linux-2.6.20/drivers/video/s3fb.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.20-s3fb/drivers/video/s3fb.c 2007-02-05 19:08:08.000000000 +0100 @@ -0,0 +1,1153 @@ +/* + * linux/drivers/video/s3fb.c -- Frame buffer device driver for S3 Trio/Virge + * + * Copyright (c) 2006 Ondrej Zajicek + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * Code is based on David Boucher's viafb (http://davesdomain.org.uk/viafb/) + * which is based on the code of neofb. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* Why should fb driver call console functions? because acquire_console_sem() */ +#include