José Fonseca wrote:

After receiving so far 6 personal mails of people interesting in
developing the S3 Savage DRI driver I've decided to write a section in
the DRI Developers FAQ regarding its development:
http://dri.sourceforge.net/doc/faq/hardware.html#SAVAGE .

It's a shame that of those who very few actually replied back. The
Savage obviously raises a lot of interest and if they got together the
driver would be a reality in no time. If they instead rely on me to do
the initial work they'll have to wait quite while - not that I gave up,
but my priorities are [in order] my PhD, TG work, Mach64, and only the
new drivers Savage/Trident/nVidia.

Also before I do any further work in new drivers I want to pull out a
more general Mesa/3D DRI driver framework that could be shared by those
new drivers, to avoid so much copying'n'pasting which yelds such a waste
of time when writing a new driver, and maitaining them afterwords.

Regards,

José Fonseca


Hello,

I am also interested in getting DRI to work on Savage cards. As a first task, I downloaded the savage branch and made the code compilable. I mailed these changes directly to Jose. He committed them and encouraged me to do further conversation about the Savage driver publically on this list. So, here I am ;-).
As a second task, I bootstrapped a kernel module from the tdfx driver by simply replacing every (hopefully ;-) occurence of 'tdfx' with 'savage'. The two files are attached. I also added the pci id for the card in my laptop (VT8751) in the file "savage_drv.c". This is the only entry right now because I can only test on this hardware. But if some people join, the id list could be extended easily. Other questions are the vendor and author strings and stuff like that. I added my name as author but I am not happy with that. Because I don't want to blame someone for the errors and mistakes I made and on the other side I don't want to claim that I have put any brain in this so far.


Nevertheless, as of yet we have a ddx driver in the branch wich compiles (at least on my system) and a bootstrapped kernel module (with working insmod). But I haven't put any knowledge of DRI into these things. Thus, there is a lot of work to do. As I consider myself to be a newbie I would like to ask the gurus how to proceed from this point?

Regards,
Andreas Karrenbauer
/* savage.h -- 3dfx DRM template customization -*- linux-c -*-
 * Created: Wed Feb 14 12:32:32 2001 by [EMAIL PROTECTED]
 *
 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors:
 *    Gareth Hughes <[EMAIL PROTECTED]>
 */

#ifndef __SAVAGE_H__
#define __SAVAGE_H__

/* This remains constant for all DRM template files.
 */
#define DRM(x) savage_##x

/* General customization:
 */
#define __HAVE_MTRR             1
#define __HAVE_CTX_BITMAP       1

#endif
/* savage_drv.c -- savage driver -*- linux-c -*-
 * Created: Thu Oct  7 10:38:32 1999 by [EMAIL PROTECTED]
 *
 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 *
 * Authors of the original tdfx driver:
 *    Rickard E. (Rik) Faith <[EMAIL PROTECTED]>
 *    Daryll Strauss <[EMAIL PROTECTED]>
 *    Gareth Hughes <[EMAIL PROTECTED]>
 * Modified for Savage by:
 *    Andreas Karrenbauer <[EMAIL PROTECTED]>
 */

#include <linux/config.h>
#include "savage.h"
#include "drmP.h"

#define DRIVER_AUTHOR           "bootstraped by Andreas Karrenbauer"

#define DRIVER_NAME             "savage"
#define DRIVER_DESC             "alpha savage dr"
#define DRIVER_DATE             "20030226"

#define DRIVER_MAJOR            1
#define DRIVER_MINOR            0
#define DRIVER_PATCHLEVEL       0

#ifndef PCI_VENDOR_ID_SAVAGE
#define PCI_VENDOR_ID_SAVAGE 0x5333 
#endif
#ifndef PCI_DEVICE_ID_SAVAGE_VT8751
#define PCI_DEVICE_ID_SAVAGE_VT8751 0x8d03
#endif

static drm_pci_list_t DRM(idlist)[] = {
        { PCI_VENDOR_ID_SAVAGE, PCI_DEVICE_ID_SAVAGE_VT8751 },
        { 0, 0 }
};

#define DRIVER_CARD_LIST DRM(idlist)


#include "drm_auth.h"
#include "drm_bufs.h"
#include "drm_context.h"
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"

#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"
#include "drm_lock.h"
#include "drm_memory.h"
#include "drm_proc.h"
#include "drm_vm.h"
#include "drm_stub.h"
cvs server: Diffing .
Index: Makefile.kernel
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v
retrieving revision 1.25
diff -u -r1.25 Makefile.kernel
--- Makefile.kernel     27 Jan 2002 20:05:41 -0000      1.25
+++ Makefile.kernel     26 Feb 2003 22:22:51 -0000
@@ -3,10 +3,11 @@
 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.

 O_TARGET       := drm.o
-list-multi     := gamma.o tdfx.o r128.o mga.o i810.o i830.o ffb.o radeon.o
+list-multi     := gamma.o tdfx.o r128.o mga.o i810.o i830.o ffb.o radeon.o savage.o

 gamma-objs  := gamma_drv.o gamma_dma.o
 tdfx-objs   := tdfx_drv.o
+savage-objs := savage_drv.o
 r128-objs   := r128_drv.o r128_cce.o r128_state.o
 mga-objs    := mga_drv.o mga_dma.o mga_state.o mga_warp.o
 i810-objs   := i810_drv.o i810_dma.o
@@ -16,6 +17,7 @@

 obj-$(CONFIG_DRM_GAMMA) += gamma.o
 obj-$(CONFIG_DRM_TDFX) += tdfx.o
+obj-$(CONFIG_DRM_SAVAGE)+= savage.o
 obj-$(CONFIG_DRM_R128) += r128.o
 obj-$(CONFIG_DRM_RADEON)+= radeon.o
 obj-$(CONFIG_DRM_MGA)  += mga.o
@@ -30,6 +32,9 @@

 tdfx.o: $(tdfx-objs) $(lib)
        $(LD) -r -o $@ $(tdfx-objs) $(lib)
+
+savage.o: $(savage-objs) $(lib)
+       $(LD) -r -o $@ $(savage-objs) $(lib)

 mga.o: $(mga-objs) $(lib)
        $(LD) -r -o $@ $(mga-objs) $(lib)
Index: Makefile.linux
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v
retrieving revision 1.44
diff -u -r1.44 Makefile.linux
--- Makefile.linux      29 Oct 2002 13:49:26 -0000      1.44
+++ Makefile.linux      26 Feb 2003 22:22:52 -0000
@@ -38,7 +38,7 @@

 # **** End of SMP/MODVERSIONS detection

-MODS =         gamma.o tdfx.o r128.o radeon.o
+MODS =         gamma.o tdfx.o r128.o radeon.o savage.o
 LIBS =

 DRMTEMPLATES = drm_auth.h drm_bufs.h drm_context.h drm_dma.h drm_drawable.h \
@@ -52,6 +52,9 @@
 TDFXOBJS =     tdfx_drv.o
 TDFXHEADERS =  tdfx.h $(DRMHEADERS) $(DRMTEMPLATES)

+SAVAGEOBJS =   savage_drv.o
+SAVAGEHEADERS =        savage.h $(DRMHEADERS) $(DRMTEMPLATES)
+
 R128OBJS =     r128_drv.o r128_cce.o r128_state.o
 R128HEADERS =  r128.h r128_drv.h r128_drm.h $(DRMHEADERS) $(DRMTEMPLATES)

@@ -224,6 +227,11 @@
 tdfx.o: $(TDFXOBJS) $(LIBS)
        $(LD) -r $^ -o $@

+savage_drv.o: savage_drv.c
+       $(CC) $(MODCFLAGS) -DEXPORT_SYMTAB -I$(TREE) -c $< -o $@
+savage.o: $(SAVAGEOBJS) $(LIBS)
+       $(LD) -r $^ -o $@
+
 sis.o: $(SISOBJS) $(LIBS)
        $(LD) -r $^ -o $@

@@ -270,6 +278,7 @@

 $(GAMMAOBJS): $(GAMMAHEADERS)
 $(TDFXOBJS): $(TDFXHEADERS)
+$(SAVAGEOBJS): $(SAVAGEHEADERS)
 $(R128OBJS): $(R128HEADERS)
 $(RADEONOBJS): $(RADEONHEADERS)
 ifeq ($(AGP),1)

Reply via email to