mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 07:00:11 +01:00
Merge trunk into bsd-1-0-1-branch.
This commit is contained in:
parent
46f2275dab
commit
c279539328
49 changed files with 1065 additions and 858 deletions
106
libdrm/xf86drm.c
106
libdrm/xf86drm.c
|
|
@ -1,7 +1,8 @@
|
|||
/* xf86drm.c -- User-level interface to DRM device
|
||||
* Created: Tue Jan 5 08:16:21 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
|
|
@ -23,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Kevin E. Martin <martin@valinux.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.10 2000/02/23 04:47:23 martin Exp $
|
||||
*
|
||||
|
|
@ -71,10 +73,23 @@ extern int xf86RemoveSIGIOHandler(int fd);
|
|||
#define MAP_FAILED ((void *)-1)
|
||||
#endif
|
||||
|
||||
#include <sys/sysmacros.h> /* for makedev() */
|
||||
#include "xf86drm.h"
|
||||
#include "drm.h"
|
||||
|
||||
#define DRM_FIXED_DEVICE_MAJOR 145
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/sysmacros.h> /* for makedev() */
|
||||
#endif
|
||||
|
||||
#ifndef makedev
|
||||
/* This definition needs to be changed on
|
||||
some systems if dev_t is a structure.
|
||||
If there is a header file we can get it
|
||||
from, there would be best. */
|
||||
#define makedev(x,y) ((dev_t)(((x) << 8) | (y)))
|
||||
#endif
|
||||
|
||||
static void *drmHashTable = NULL; /* Context switch callbacks */
|
||||
|
||||
typedef struct drmHashEntry {
|
||||
|
|
@ -95,9 +110,16 @@ void drmFree(void *pt)
|
|||
if (pt) _DRM_FREE(pt);
|
||||
}
|
||||
|
||||
/* drmStrdup can't use strdup(3), since it doesn't call _DRM_MALLOC... */
|
||||
static char *drmStrdup(const char *s)
|
||||
{
|
||||
return s ? strdup(s) : NULL;
|
||||
char *retval = NULL;
|
||||
|
||||
if (s) {
|
||||
retval = _DRM_MALLOC(strlen(s)+1);
|
||||
strcpy(retval, s);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -134,7 +156,7 @@ static drmHashEntry *drmGetEntry(int fd)
|
|||
return entry;
|
||||
}
|
||||
|
||||
/* drm_open is used to open the /dev/drm device */
|
||||
/* drm_open is used to open the /dev/dri device */
|
||||
|
||||
static int drm_open(const char *file)
|
||||
{
|
||||
|
|
@ -144,14 +166,6 @@ static int drm_open(const char *file)
|
|||
return -errno;
|
||||
}
|
||||
|
||||
/* drmAvailable looks for /proc/dri, and returns 1 if it is present. */
|
||||
|
||||
int drmAvailable(void)
|
||||
{
|
||||
if (!access("/proc/dri/0", R_OK)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int drmOpenDevice(const char *path, long dev,
|
||||
mode_t mode, uid_t user, gid_t group)
|
||||
{
|
||||
|
|
@ -161,7 +175,16 @@ static int drmOpenDevice(const char *path, long dev,
|
|||
struct stat st;
|
||||
#endif
|
||||
|
||||
if (!stat(path, &st) && st.st_rdev == dev) return drm_open(path);
|
||||
/* Fiddle mode to remove execute bits */
|
||||
mode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
|
||||
|
||||
if (!stat(path, &st) && st.st_rdev == dev) {
|
||||
if (!geteuid()) {
|
||||
chown(path, user, group);
|
||||
chmod(path, mode);
|
||||
}
|
||||
return drm_open(path);
|
||||
}
|
||||
|
||||
if (geteuid()) return DRM_ERR_NOT_ROOT;
|
||||
remove(path);
|
||||
|
|
@ -174,6 +197,38 @@ static int drmOpenDevice(const char *path, long dev,
|
|||
return drm_open(path);
|
||||
}
|
||||
|
||||
/* drmAvailable looks for /proc/dri, and returns 1 if it is present. On
|
||||
OSs that do not have a Linux-like /proc, this information will not be
|
||||
available, and we'll have to create a device and check if the driver is
|
||||
loaded that way. */
|
||||
|
||||
int drmAvailable(void)
|
||||
{
|
||||
char dev_name[64];
|
||||
drmVersionPtr version;
|
||||
int retval = 0;
|
||||
int fd;
|
||||
|
||||
if (!access("/proc/dri/0", R_OK)) return 1;
|
||||
|
||||
sprintf(dev_name, "/dev/dri-temp-%d", getpid());
|
||||
|
||||
remove(dev_name);
|
||||
if ((fd = drmOpenDevice(dev_name, makedev(DRM_FIXED_DEVICE_MAJOR, 0),
|
||||
S_IRUSR, geteuid(), getegid())) >= 0) {
|
||||
/* Read version to make sure this is
|
||||
actually a DRI device. */
|
||||
if ((version = drmGetVersion(fd))) {
|
||||
retval = 1;
|
||||
drmFreeVersion(version);
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
remove(dev_name);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int drmOpenByBusid(const char *busid)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -268,7 +323,24 @@ static int drmOpenByName(const char *name)
|
|||
}
|
||||
}
|
||||
}
|
||||
} else remove(dev_name);
|
||||
} else {
|
||||
drmVersionPtr version;
|
||||
/* /proc/dri not available, possibly
|
||||
because we aren't on a Linux system.
|
||||
So, try to create the next device and
|
||||
see if it's active. */
|
||||
dev = makedev(DRM_FIXED_DEVICE_MAJOR, i);
|
||||
if ((fd = drmOpenDevice(dev_name, dev, mode, user, group))) {
|
||||
if ((version = drmGetVersion(fd))) {
|
||||
if (!strcmp(version->name, name)) {
|
||||
drmFreeVersion(version);
|
||||
return fd;
|
||||
}
|
||||
drmFreeVersion(version);
|
||||
}
|
||||
}
|
||||
remove(dev_name);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -303,7 +375,7 @@ static void drmFreeKernelVersion(drm_version_t *v)
|
|||
drmFree(v);
|
||||
}
|
||||
|
||||
static void drmCopyVersion(drmVersionPtr d, drm_version_t *s)
|
||||
static void drmCopyVersion(drmVersionPtr d, const drm_version_t *s)
|
||||
{
|
||||
d->version_major = s->version_major;
|
||||
d->version_minor = s->version_minor;
|
||||
|
|
@ -317,7 +389,7 @@ static void drmCopyVersion(drmVersionPtr d, drm_version_t *s)
|
|||
}
|
||||
|
||||
/* drmVersion obtains the version information via an ioctl. Similar
|
||||
* information is available via /proc/drm. */
|
||||
* information is available via /proc/dri. */
|
||||
|
||||
drmVersionPtr drmGetVersion(int fd)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
|
||||
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
|
|
@ -23,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.6 2000/02/23 04:47:27 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -528,6 +530,7 @@ typedef struct drm_device {
|
|||
/* Misc. support (init.c) */
|
||||
extern int drm_flags;
|
||||
extern void drm_parse_options(char *s);
|
||||
extern int drm_cpu_valid(void);
|
||||
|
||||
|
||||
/* Device support (fops.c) */
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,11 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Keith Whitwell <keithw@precisioninsight.com>
|
||||
*
|
||||
* $XFree86$
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
* Keith Whitwell <keithw@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -37,6 +36,11 @@
|
|||
|
||||
#include <linux/interrupt.h> /* For task queue support */
|
||||
|
||||
/* in case we don't have a 2.3.99-pre6 kernel or later: */
|
||||
#ifndef VM_DONTCOPY
|
||||
#define VM_DONTCOPY 0
|
||||
#endif
|
||||
|
||||
#define I810_BUF_FREE 2
|
||||
#define I810_BUF_CLIENT 1
|
||||
#define I810_BUF_HARDWARE 0
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:56:22 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c,v 1.1 2000/02/11 17:26:05 dawes Exp $
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -41,9 +40,9 @@ EXPORT_SYMBOL(i810_cleanup);
|
|||
#define I810_NAME "i810"
|
||||
#define I810_DESC "Intel I810"
|
||||
#define I810_DATE "19991213"
|
||||
#define I810_MAJOR 0
|
||||
#define I810_MAJOR 1
|
||||
#define I810_MINOR 0
|
||||
#define I810_PATCHLEVEL 1
|
||||
#define I810_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t i810_device;
|
||||
drm_ctx_t i810_res_ctx;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h,v 1.1 2000/02/11 17:26:05 dawes Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I810_DRV_H_
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:56:22 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c,v 1.1 2000/02/11 17:26:07 dawes Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -39,9 +39,9 @@ EXPORT_SYMBOL(mga_cleanup);
|
|||
#define MGA_NAME "mga"
|
||||
#define MGA_DESC "Matrox g200/g400"
|
||||
#define MGA_DATE "19991213"
|
||||
#define MGA_MAJOR 0
|
||||
#define MGA_MAJOR 1
|
||||
#define MGA_MINOR 0
|
||||
#define MGA_PATCHLEVEL 1
|
||||
#define MGA_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t mga_device;
|
||||
drm_ctx_t mga_res_ctx;
|
||||
|
|
@ -385,9 +385,9 @@ int mga_init(void)
|
|||
DRM_DEBUG("doing agp init\n");
|
||||
dev->agp = drm_agp_init();
|
||||
if(dev->agp == NULL) {
|
||||
DRM_DEBUG("The mga drm module requires the agpgart module"
|
||||
" to function correctly\nPlease load the agpgart"
|
||||
" module before you load the mga module\n");
|
||||
DRM_INFO("The mga drm module requires the agpgart module"
|
||||
" to function correctly\nPlease load the agpgart"
|
||||
" module before you load the mga module\n");
|
||||
drm_proc_cleanup();
|
||||
misc_deregister(&mga_misc);
|
||||
mga_takedown(dev);
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ EXPORT_SYMBOL(r128_cleanup);
|
|||
|
||||
#define R128_NAME "r128"
|
||||
#define R128_DESC "r128"
|
||||
#define R128_DATE "20000422"
|
||||
#define R128_MAJOR 0
|
||||
#define R128_DATE "20000607"
|
||||
#define R128_MAJOR 1
|
||||
#define R128_MINOR 0
|
||||
#define R128_PATCHLEVEL 5
|
||||
#define R128_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t r128_device;
|
||||
drm_ctx_t r128_res_ctx;
|
||||
|
|
@ -108,7 +108,7 @@ static drm_ioctl_desc_t r128_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_R128_RESET)] = { r128_eng_reset, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_FLUSH)] = { r128_eng_flush, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_PACKET)] = { r128_submit_pkt, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_CCEIDL)] = { r128_cce_idle, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_IDLE)] = { r128_cce_idle, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_VERTEX)] = { r128_vertex_buf, 1, 0 },
|
||||
};
|
||||
#define R128_IOCTL_COUNT DRM_ARRAY_SIZE(r128_ioctls)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* tdfx.c -- tdfx driver -*- linux-c -*-
|
||||
* Created: Thu Oct 7 10:38:32 1999 by faith@precisioninsight.com
|
||||
* Revised: Tue Oct 12 08:51:35 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c,v 1.3 2000/02/23 04:47:31 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Daryll Strauss <daryll@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -37,9 +39,9 @@ EXPORT_SYMBOL(tdfx_cleanup);
|
|||
#define TDFX_NAME "tdfx"
|
||||
#define TDFX_DESC "tdfx"
|
||||
#define TDFX_DATE "19991009"
|
||||
#define TDFX_MAJOR 0
|
||||
#define TDFX_MAJOR 1
|
||||
#define TDFX_MINOR 0
|
||||
#define TDFX_PATCHLEVEL 1
|
||||
#define TDFX_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t tdfx_device;
|
||||
drm_ctx_t tdfx_res_ctx;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# Makefile -- For the Direct Rendering Manager module (drm)
|
||||
# Created: Mon Jan 4 09:26:53 1999 by faith@precisioninsight.com
|
||||
#
|
||||
# Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
# 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
|
||||
|
|
@ -23,8 +24,22 @@
|
|||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.6 2000/02/23 04:47:25 martin Exp $
|
||||
#
|
||||
# ***** NOTE NOTE NOTE NOTE NOTE *****
|
||||
# To override the automatic Linux source tree determination, pass the
|
||||
# pathname for the kernel that you want to compile on the command line,
|
||||
# like this:
|
||||
# make TREE=/usr/my-kernel-tree/include
|
||||
#
|
||||
#
|
||||
# ***** NOTE NOTE NOTE NOTE NOTE *****
|
||||
# Because some distributions patch 2.2.x kernels to make kill_fasync have
|
||||
# three parameters, this script tries to determine, via the examination of
|
||||
# header files, if your kernel has been patched. If this detection is
|
||||
# incorrect, you can override the value on the command line, like this:
|
||||
# make PARAMS=2
|
||||
# or
|
||||
# make PARAMS=3
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
|
|
@ -96,11 +111,6 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
# To override this determination, pass the path on the make command line:
|
||||
# make TREE=/usr/my-kernel-tree/include
|
||||
# or hardcode a value for TREE here:
|
||||
# TREE:=/usr/include
|
||||
|
||||
ifeq ($(TREE),0)
|
||||
all:; @echo Error: Could not locate kernel tree in $A $B $C
|
||||
else
|
||||
|
|
@ -110,6 +120,8 @@ MODVERSIONS := $(shell gcc -E -I $(TREE) picker.c 2>/dev/null \
|
|||
| grep -s 'MODVERSIONS = ' | cut -d' ' -f3)
|
||||
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
|
||||
| grep -s 'AGP = ' | cut -d' ' -f3)
|
||||
PARAMS := $(shell if fgrep kill_fasync $(TREE)/linux/fs.h \
|
||||
| fgrep -q band; then echo 3; else echo 2; fi)
|
||||
ifeq ($(AGP),0)
|
||||
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
|
||||
| grep -s 'AGP_MODULE = ' | cut -d' ' -f3)
|
||||
|
|
@ -127,8 +139,9 @@ I810OBJS= i810_drv.o i810_dma.o i810_bufs.o i810_context.o
|
|||
I810HEADERS= i810_drv.h $(DRMHEADERS)
|
||||
endif
|
||||
|
||||
all::;@echo KERNEL HEADERS IN $(TREE): SMP=${SMP} MODVERSIONS=${MODVERSIONS} \
|
||||
AGP=${AGP}
|
||||
all::;@echo === KERNEL HEADERS IN $(TREE)
|
||||
all::;@echo === SMP=${SMP} MODVERSIONS=${MODVERSIONS} AGP=${AGP}
|
||||
all::;@echo === kill_fasync has $(PARAMS) parameters
|
||||
all:: $(LIBS) $(MODS) $(PROGS)
|
||||
endif
|
||||
|
||||
|
|
@ -141,7 +154,9 @@ endif
|
|||
ifeq ($(MODVERSIONS),1)
|
||||
MODCFLAGS += -DMODVERSIONS -include $(TREE)/linux/modversions.h
|
||||
endif
|
||||
|
||||
ifeq ($(PARAMS),3)
|
||||
MODCFLAGS += -DKILLFASYNCHASTHREEPARAMETERS
|
||||
endif
|
||||
|
||||
# **** End of configuration
|
||||
|
||||
|
|
@ -178,7 +193,7 @@ ChangeLog:
|
|||
|
||||
# .o files are used for modules
|
||||
%.o: %.c
|
||||
$(CC) $(MODCFLAGS) -c $< -o $@
|
||||
$(CC) $(MODCFLAGS) -I$(TREE) -c $< -o $@
|
||||
|
||||
%.po: %.c
|
||||
$(CC) $(PRGCFLAGS) -DDRM_USE_MALLOC -c $< -o $@
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 09:56:45 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,9 +24,7 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c,v 1.1 2000/02/11 17:26:02 dawes Exp $
|
||||
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* auth.c -- IOCTLs for authentication -*- linux-c -*-
|
||||
* Created: Tue Feb 2 08:37:54 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 11:31:48 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c,v 1.2 2000/02/23 04:47:25 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -44,7 +45,6 @@ static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic)
|
|||
|
||||
down(&dev->struct_sem);
|
||||
for (pt = dev->magiclist[hash].head; pt; pt = pt->next) {
|
||||
if (pt->priv->authenticated) continue;
|
||||
if (pt->magic == magic) {
|
||||
retval = pt->priv;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* bufs.c -- IOCTLs to manage buffers -*- linux-c -*-
|
||||
* Created: Tue Feb 2 08:37:54 1999 by faith@precisioninsight.com
|
||||
* Revised: Mon Feb 14 00:14:11 2000 by kevin@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* Copyright 1999, 2000 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
|
||||
|
|
@ -24,11 +24,13 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c,v 1.5 2000/02/23 04:47:25 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#define __NO_VERSION__
|
||||
#include <linux/config.h>
|
||||
#include "drmP.h"
|
||||
#include "linux/un.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* context.c -- IOCTLs for contexts and DMA queues -*- linux-c -*-
|
||||
* Created: Tue Feb 2 08:37:54 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 11:32:09 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/context.c,v 1.2 2000/02/23 04:47:26 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* ctxbitmap.c -- Context bitmap management -*- linux-c -*-
|
||||
* Created: Thu Jan 6 03:56:42 2000 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* Copyright 2000 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
|
||||
|
|
@ -23,9 +24,7 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author: Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/ctxbitmap.c,v 1.1 2000/02/11 17:26:02 dawes Exp $
|
||||
* Author: Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* dma.c -- DMA IOCTL and function support -*- linux-c -*-
|
||||
* Created: Fri Mar 19 14:30:16 1999 by faith@precisioninsight.com
|
||||
* Revised: Sun Feb 13 23:19:45 2000 by kevin@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* Copyright 1999, 2000 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/dma.c,v 1.5 2000/02/23 04:47:26 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinuxa.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* drawable.c -- IOCTLs for drawables -*- linux-c -*-
|
||||
* Created: Tue Feb 2 08:37:54 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 09:27:03 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drawable.c,v 1.2 2000/02/23 04:47:26 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* drm.h -- Header for Direct Rendering Manager -*- linux-c -*-
|
||||
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
|
|
@ -23,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.5 2000/02/23 04:47:26 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
* Acknowledgements:
|
||||
* Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
|
||||
|
|
@ -356,7 +358,7 @@ typedef struct drm_agp_info {
|
|||
#define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t)
|
||||
#define DRM_IOCTL_R128_RESET DRM_IO( 0x41)
|
||||
#define DRM_IOCTL_R128_FLUSH DRM_IO( 0x42)
|
||||
#define DRM_IOCTL_R128_CCEIDL DRM_IO( 0x43)
|
||||
#define DRM_IOCTL_R128_IDLE DRM_IO( 0x43)
|
||||
#define DRM_IOCTL_R128_PACKET DRM_IOW( 0x44, drm_r128_packet_t)
|
||||
#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x45, drm_r128_vertex_t)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
|
||||
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
|
|
@ -23,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.6 2000/02/23 04:47:27 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -528,6 +530,7 @@ typedef struct drm_device {
|
|||
/* Misc. support (init.c) */
|
||||
extern int drm_flags;
|
||||
extern void drm_parse_options(char *s);
|
||||
extern int drm_cpu_valid(void);
|
||||
|
||||
|
||||
/* Device support (fops.c) */
|
||||
|
|
|
|||
17
linux/fops.c
17
linux/fops.c
|
|
@ -1,8 +1,8 @@
|
|||
/* fops.c -- File operations for DRM -*- linux-c -*-
|
||||
* Created: Mon Jan 4 08:58:31 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Dec 3 10:26:26 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.6 2000/02/23 04:47:27 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Daryll Strauss <daryll@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -40,6 +42,7 @@ int drm_open_helper(struct inode *inode, struct file *filp, drm_device_t *dev)
|
|||
drm_file_t *priv;
|
||||
|
||||
if (filp->f_flags & O_EXCL) return -EBUSY; /* No exclusive opens */
|
||||
if (!drm_cpu_valid()) return -EINVAL;
|
||||
|
||||
DRM_DEBUG("pid = %d, minor = %d\n", current->pid, minor);
|
||||
|
||||
|
|
@ -211,11 +214,15 @@ int drm_write_string(drm_device_t *dev, const char *s)
|
|||
send -= count;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < 0x02020e || \
|
||||
( LINUX_VERSION_CODE > 0x020300 && LINUX_VERSION_CODE < 0x020315 )
|
||||
#if LINUX_VERSION_CODE < 0x020315 && !defined(KILLFASYNCHASTHREEPARAMETERS)
|
||||
/* The extra parameter to kill_fasync was added in 2.3.21, and is
|
||||
_not_ present in _stock_ 2.2.14 and 2.2.15. However, some
|
||||
distributions patch 2.2.x kernels to add this parameter. The
|
||||
Makefile.linux attempts to detect this addition and defines
|
||||
KILLFASYNCHASTHREEPARAMETERS if three parameters are found. */
|
||||
if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO);
|
||||
#else
|
||||
/* Parameter added in 2.2.14 and 2.3.21 */
|
||||
/* Parameter added in 2.3.21 */
|
||||
if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO, POLL_IN);
|
||||
#endif
|
||||
DRM_DEBUG("waking\n");
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* gamma_dma.c -- DMA support for GMX 2000 -*- linux-c -*-
|
||||
* Created: Fri Mar 19 14:30:16 1999 by faith@precisioninsight.com
|
||||
* Revised: Thu Sep 16 12:55:37 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c,v 1.2 2000/02/23 04:47:28 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -87,13 +88,31 @@ static inline void gamma_dma_dispatch(drm_device_t *dev, unsigned long address,
|
|||
GAMMA_WRITE(GAMMA_DMACOUNT, length / 4);
|
||||
}
|
||||
|
||||
static inline void gamma_dma_quiescent(drm_device_t *dev)
|
||||
static inline void gamma_dma_quiescent_single(drm_device_t *dev)
|
||||
{
|
||||
while (GAMMA_READ(GAMMA_DMACOUNT))
|
||||
;
|
||||
while (GAMMA_READ(GAMMA_INFIFOSPACE) < 3)
|
||||
;
|
||||
|
||||
GAMMA_WRITE(GAMMA_FILTERMODE, 1 << 10);
|
||||
GAMMA_WRITE(GAMMA_SYNC, 0);
|
||||
|
||||
do {
|
||||
while (!GAMMA_READ(GAMMA_OUTFIFOWORDS))
|
||||
;
|
||||
} while (GAMMA_READ(GAMMA_OUTPUTFIFO) != GAMMA_SYNC_TAG);
|
||||
}
|
||||
|
||||
static inline void gamma_dma_quiescent_dual(drm_device_t *dev)
|
||||
{
|
||||
while (GAMMA_READ(GAMMA_DMACOUNT))
|
||||
;
|
||||
while (GAMMA_READ(GAMMA_INFIFOSPACE) < 3)
|
||||
;
|
||||
|
||||
GAMMA_WRITE(GAMMA_BROADCASTMASK, 3);
|
||||
|
||||
GAMMA_WRITE(GAMMA_FILTERMODE, 1 << 10);
|
||||
GAMMA_WRITE(GAMMA_SYNC, 0);
|
||||
|
||||
|
|
@ -103,7 +122,6 @@ static inline void gamma_dma_quiescent(drm_device_t *dev)
|
|||
;
|
||||
} while (GAMMA_READ(GAMMA_OUTPUTFIFO) != GAMMA_SYNC_TAG);
|
||||
|
||||
|
||||
/* Read from second MX */
|
||||
do {
|
||||
while (!GAMMA_READ(GAMMA_OUTFIFOWORDS + 0x10000))
|
||||
|
|
@ -788,8 +806,13 @@ int gamma_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
if (!ret) {
|
||||
if (lock.flags & _DRM_LOCK_READY)
|
||||
gamma_dma_ready(dev);
|
||||
if (lock.flags & _DRM_LOCK_QUIESCENT)
|
||||
gamma_dma_quiescent(dev);
|
||||
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
||||
if (gamma_found() == 1) {
|
||||
gamma_dma_quiescent_single(dev);
|
||||
} else {
|
||||
gamma_dma_quiescent_dual(dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* gamma.c -- 3dlabs GMX 2000 driver -*- linux-c -*-
|
||||
* Created: Mon Jan 4 08:58:31 1999 by faith@precisioninsight.com
|
||||
* Revised: Tue Oct 12 08:51:36 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,22 +24,31 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c,v 1.4 2000/02/23 04:47:28 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#define EXPORT_SYMTAB
|
||||
#include "drmP.h"
|
||||
#include "gamma_drv.h"
|
||||
#include <linux/pci.h>
|
||||
EXPORT_SYMBOL(gamma_init);
|
||||
EXPORT_SYMBOL(gamma_cleanup);
|
||||
|
||||
#ifndef PCI_DEVICE_ID_3DLABS_GAMMA
|
||||
#define PCI_DEVICE_ID_3DLABS_GAMMA 0x0008
|
||||
#endif
|
||||
#ifndef PCI_DEVICE_ID_3DLABS_MX
|
||||
#define PCI_DEVICE_ID_3DLABS_MX 0x0006
|
||||
#endif
|
||||
|
||||
#define GAMMA_NAME "gamma"
|
||||
#define GAMMA_DESC "3dlabs GMX 2000"
|
||||
#define GAMMA_DATE "19990830"
|
||||
#define GAMMA_MAJOR 0
|
||||
#define GAMMA_DATE "20000606"
|
||||
#define GAMMA_MAJOR 1
|
||||
#define GAMMA_MINOR 0
|
||||
#define GAMMA_PATCHLEVEL 5
|
||||
#define GAMMA_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t gamma_device;
|
||||
|
||||
|
|
@ -98,10 +107,13 @@ static drm_ioctl_desc_t gamma_ioctls[] = {
|
|||
int init_module(void);
|
||||
void cleanup_module(void);
|
||||
static char *gamma = NULL;
|
||||
static int devices = 0;
|
||||
|
||||
MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
|
||||
MODULE_DESCRIPTION("3dlabs GMX 2000");
|
||||
MODULE_PARM(gamma, "s");
|
||||
MODULE_PARM(devices, "i");
|
||||
MODULE_PARM_DESC(devices, "devices=x, where x is the number of MX chips on your card\n");
|
||||
|
||||
/* init_module is called when insmod is used to load the module */
|
||||
|
||||
|
|
@ -121,7 +133,7 @@ void cleanup_module(void)
|
|||
#ifndef MODULE
|
||||
/* gamma_setup is called by the kernel to parse command-line options passed
|
||||
* via the boot-loader (e.g., LILO). It calls the insmod option routine,
|
||||
* drm_parse_drm.
|
||||
* drm_parse_options.
|
||||
*
|
||||
* This is not currently supported, since it requires changes to
|
||||
* linux/init/main.c. */
|
||||
|
|
@ -271,10 +283,12 @@ static int gamma_takedown(drm_device_t *dev)
|
|||
- PAGE_SHIFT,
|
||||
DRM_MEM_SAREA);
|
||||
break;
|
||||
#ifdef DRM_AGP
|
||||
case _DRM_AGP:
|
||||
/* Do nothing here, because this is all
|
||||
handled in the AGP/GART driver. */
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
|
||||
}
|
||||
|
|
@ -314,6 +328,34 @@ static int gamma_takedown(drm_device_t *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int gamma_found(void)
|
||||
{
|
||||
return devices;
|
||||
}
|
||||
|
||||
int gamma_find_devices(void)
|
||||
{
|
||||
struct pci_dev *d = NULL, *one = NULL, *two = NULL;
|
||||
|
||||
d = pci_find_device(PCI_VENDOR_ID_3DLABS,PCI_DEVICE_ID_3DLABS_GAMMA,d);
|
||||
if (!d) return 0;
|
||||
|
||||
one = pci_find_device(PCI_VENDOR_ID_3DLABS,PCI_DEVICE_ID_3DLABS_MX,d);
|
||||
if (!one) return 0;
|
||||
|
||||
/* Make sure it's on the same card, if not - no MX's found */
|
||||
if (PCI_SLOT(d->devfn) != PCI_SLOT(one->devfn)) return 0;
|
||||
|
||||
two = pci_find_device(PCI_VENDOR_ID_3DLABS,PCI_DEVICE_ID_3DLABS_MX,one);
|
||||
if (!two) return 1;
|
||||
|
||||
/* Make sure it's on the same card, if not - only 1 MX found */
|
||||
if (PCI_SLOT(d->devfn) != PCI_SLOT(two->devfn)) return 1;
|
||||
|
||||
/* Two MX's found - we don't currently support more than 2 */
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* gamma_init is called via init_module at module load time, or via
|
||||
* linux/init/main.c (this is not currently supported). */
|
||||
|
||||
|
|
@ -331,6 +373,8 @@ int gamma_init(void)
|
|||
#ifdef MODULE
|
||||
drm_parse_options(gamma);
|
||||
#endif
|
||||
devices = gamma_find_devices();
|
||||
if (devices == 0) return -1;
|
||||
|
||||
if ((retcode = misc_register(&gamma_misc))) {
|
||||
DRM_ERROR("Cannot register \"%s\"\n", GAMMA_NAME);
|
||||
|
|
@ -342,13 +386,14 @@ int gamma_init(void)
|
|||
drm_mem_init();
|
||||
drm_proc_init(dev);
|
||||
|
||||
DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
|
||||
DRM_INFO("Initialized %s %d.%d.%d %s on minor %d with %d MX devices\n",
|
||||
GAMMA_NAME,
|
||||
GAMMA_MAJOR,
|
||||
GAMMA_MINOR,
|
||||
GAMMA_PATCHLEVEL,
|
||||
GAMMA_DATE,
|
||||
gamma_misc.minor);
|
||||
gamma_misc.minor,
|
||||
devices);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* gamma_drv.h -- Private header for 3dlabs GMX 2000 driver -*- linux-c -*-
|
||||
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 09:24:27 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,8 +24,6 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h,v 1.2 2000/02/23 04:47:28 martin Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GAMMA_DRV_H_
|
||||
|
|
@ -53,5 +51,7 @@ extern int gamma_irq_install(drm_device_t *dev, int irq);
|
|||
extern int gamma_irq_uninstall(drm_device_t *dev);
|
||||
extern int gamma_control(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg);
|
||||
extern int gamma_find_devices(void);
|
||||
extern int gamma_found(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Thu Jan 6 01:47:26 2000 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_bufs.c,v 1.1 2000/02/11 17:26:04 dawes Exp $
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 09:51:35 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,9 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
*
|
||||
* $XFree86$
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,11 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Keith Whitwell <keithw@precisioninsight.com>
|
||||
*
|
||||
* $XFree86$
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
* Keith Whitwell <keithw@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -37,6 +36,11 @@
|
|||
|
||||
#include <linux/interrupt.h> /* For task queue support */
|
||||
|
||||
/* in case we don't have a 2.3.99-pre6 kernel or later: */
|
||||
#ifndef VM_DONTCOPY
|
||||
#define VM_DONTCOPY 0
|
||||
#endif
|
||||
|
||||
#define I810_BUF_FREE 2
|
||||
#define I810_BUF_CLIENT 1
|
||||
#define I810_BUF_HARDWARE 0
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:56:22 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c,v 1.1 2000/02/11 17:26:05 dawes Exp $
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -41,9 +40,9 @@ EXPORT_SYMBOL(i810_cleanup);
|
|||
#define I810_NAME "i810"
|
||||
#define I810_DESC "Intel I810"
|
||||
#define I810_DATE "19991213"
|
||||
#define I810_MAJOR 0
|
||||
#define I810_MAJOR 1
|
||||
#define I810_MINOR 0
|
||||
#define I810_PATCHLEVEL 1
|
||||
#define I810_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t i810_device;
|
||||
drm_ctx_t i810_res_ctx;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h,v 1.1 2000/02/11 17:26:05 dawes Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I810_DRV_H_
|
||||
|
|
|
|||
14
linux/init.c
14
linux/init.c
|
|
@ -1,8 +1,8 @@
|
|||
/* init.c -- Setup/Cleanup for DRM -*- linux-c -*-
|
||||
* Created: Mon Jan 4 08:58:31 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 09:27:02 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c,v 1.2 2000/02/23 04:47:29 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -34,7 +35,7 @@
|
|||
int drm_flags = 0;
|
||||
|
||||
/* drm_parse_option parses a single option. See description for
|
||||
drm_parse_drm for details. */
|
||||
drm_parse_options for details. */
|
||||
|
||||
static void drm_parse_option(char *s)
|
||||
{
|
||||
|
|
@ -96,3 +97,10 @@ void drm_parse_options(char *s)
|
|||
}
|
||||
}
|
||||
|
||||
int drm_cpu_valid(void)
|
||||
{
|
||||
#if defined(__i386__)
|
||||
if (boot_cpu_data.x86 == 3) return 0; /* No cmpxchg on a 386 */
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* ioctl.c -- IOCTL processing for DRM -*- linux-c -*-
|
||||
* Created: Fri Jan 8 09:01:26 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 09:27:02 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/ioctl.c,v 1.2 2000/02/23 04:47:29 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* lists.c -- Buffer list handling routines -*- linux-c -*-
|
||||
* Created: Mon Apr 19 20:54:22 1999 by faith@precisioninsight.com
|
||||
* Revised: Sun Feb 13 23:37:52 2000 by kevin@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c,v 1.6 2000/02/23 04:56:42 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* lock.c -- IOCTLs for locking -*- linux-c -*-
|
||||
* Created: Tue Feb 2 08:37:54 1999 by faith@precisioninsight.com
|
||||
* Revised: Sun Feb 13 23:38:25 2000 by kevin@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lock.c,v 1.5 2000/02/23 04:47:29 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* memory.c -- Memory management wrappers for DRM -*- linux-c -*-
|
||||
* Created: Thu Feb 4 14:00:34 1999 by faith@precisioninsight.com
|
||||
* Revised: Sun Feb 13 23:39:37 2000 by kevin@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c,v 1.5 2000/02/23 04:47:30 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Thu Jan 6 01:47:26 2000 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_bufs.c,v 1.1 2000/02/11 17:26:06 dawes Exp $
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 09:51:35 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,9 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_context.c,v 1.1 2000/02/11 17:26:06 dawes Exp $
|
||||
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,11 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Keith Whitwell <keithw@precisioninsight.com>
|
||||
*
|
||||
* $XFree86$
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
* Keith Whitwell <keithw@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Tue Jan 25 01:50:01 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Keith Whitwell <keithw@precisioninsight.com>
|
||||
* Authors: Jeff Hartmann <jhartmann@valinux.com>
|
||||
* Keith Whitwell <keithw@valinux.com>
|
||||
*
|
||||
* $XFree86$
|
||||
*/
|
||||
|
||||
#ifndef _MGA_DRM_H_
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:56:22 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c,v 1.1 2000/02/11 17:26:07 dawes Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -39,9 +39,9 @@ EXPORT_SYMBOL(mga_cleanup);
|
|||
#define MGA_NAME "mga"
|
||||
#define MGA_DESC "Matrox g200/g400"
|
||||
#define MGA_DATE "19991213"
|
||||
#define MGA_MAJOR 0
|
||||
#define MGA_MAJOR 1
|
||||
#define MGA_MINOR 0
|
||||
#define MGA_PATCHLEVEL 1
|
||||
#define MGA_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t mga_device;
|
||||
drm_ctx_t mga_res_ctx;
|
||||
|
|
@ -385,9 +385,9 @@ int mga_init(void)
|
|||
DRM_DEBUG("doing agp init\n");
|
||||
dev->agp = drm_agp_init();
|
||||
if(dev->agp == NULL) {
|
||||
DRM_DEBUG("The mga drm module requires the agpgart module"
|
||||
" to function correctly\nPlease load the agpgart"
|
||||
" module before you load the mga module\n");
|
||||
DRM_INFO("The mga drm module requires the agpgart module"
|
||||
" to function correctly\nPlease load the agpgart"
|
||||
" module before you load the mga module\n");
|
||||
drm_proc_cleanup();
|
||||
misc_deregister(&mga_misc);
|
||||
mga_takedown(dev);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,10 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Rickard E. (Rik) Faith <faith@precisioninsight.com>
|
||||
* Jeff Hartmann <jhartmann@precisioninsight.com>
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
* $XFree86$
|
||||
*/
|
||||
|
||||
#ifndef _MGA_DRV_H_
|
||||
|
|
|
|||
1034
linux/mga_state.c
1034
linux/mga_state.c
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,8 @@
|
|||
/* proc.c -- /proc support for DRM -*- linux-c -*-
|
||||
* Created: Mon Jan 11 09:48:47 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
|
|
@ -23,8 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c,v 1.6 2000/02/23 04:47:30 martin Exp $
|
||||
*
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*/
|
||||
|
||||
#define __NO_VERSION__
|
||||
|
|
|
|||
|
|
@ -88,6 +88,20 @@ static void r128_flush_write_combine(void)
|
|||
"pop %%eax" : /* no outputs */ : /* no inputs */ );
|
||||
}
|
||||
|
||||
static void r128_status(drm_device_t *dev)
|
||||
{
|
||||
drm_r128_private_t *dev_priv = dev->dev_private;
|
||||
|
||||
printk("GUI_STAT = 0x%08x\n",
|
||||
(unsigned int)R128_READ(R128_GUI_STAT));
|
||||
printk("PM4_STAT = 0x%08x\n",
|
||||
(unsigned int)R128_READ(R128_PM4_STAT));
|
||||
printk("PM4_BUFFER_DL_WPTR = 0x%08x\n",
|
||||
(unsigned int)R128_READ(R128_PM4_BUFFER_DL_WPTR));
|
||||
printk("PM4_BUFFER_DL_RPTR = 0x%08x\n",
|
||||
(unsigned int)R128_READ(R128_PM4_BUFFER_DL_RPTR));
|
||||
}
|
||||
|
||||
static int r128_do_cleanup_cce(drm_device_t *dev)
|
||||
{
|
||||
if (dev->dev_private) {
|
||||
|
|
@ -828,6 +842,7 @@ static drm_buf_t *r128_freelist_get(drm_device_t *dev)
|
|||
udelay(1);
|
||||
}
|
||||
|
||||
r128_status(dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ EXPORT_SYMBOL(r128_cleanup);
|
|||
|
||||
#define R128_NAME "r128"
|
||||
#define R128_DESC "r128"
|
||||
#define R128_DATE "20000422"
|
||||
#define R128_MAJOR 0
|
||||
#define R128_DATE "20000607"
|
||||
#define R128_MAJOR 1
|
||||
#define R128_MINOR 0
|
||||
#define R128_PATCHLEVEL 5
|
||||
#define R128_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t r128_device;
|
||||
drm_ctx_t r128_res_ctx;
|
||||
|
|
@ -108,7 +108,7 @@ static drm_ioctl_desc_t r128_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_R128_RESET)] = { r128_eng_reset, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_FLUSH)] = { r128_eng_flush, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_PACKET)] = { r128_submit_pkt, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_CCEIDL)] = { r128_cce_idle, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_IDLE)] = { r128_cce_idle, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_R128_VERTEX)] = { r128_vertex_buf, 1, 0 },
|
||||
};
|
||||
#define R128_IOCTL_COUNT DRM_ARRAY_SIZE(r128_ioctls)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* tdfx_context.c -- IOCTLs for tdfx contexts -*- linux-c -*-
|
||||
* Created: Thu Oct 7 10:50:22 1999 by faith@precisioninsight.com
|
||||
* Revised: Sat Oct 9 23:39:56 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_context.c,v 1.2 2000/02/23 04:47:30 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Daryll Strauss <daryll@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* tdfx.c -- tdfx driver -*- linux-c -*-
|
||||
* Created: Thu Oct 7 10:38:32 1999 by faith@precisioninsight.com
|
||||
* Revised: Tue Oct 12 08:51:35 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c,v 1.3 2000/02/23 04:47:31 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Daryll Strauss <daryll@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -37,9 +39,9 @@ EXPORT_SYMBOL(tdfx_cleanup);
|
|||
#define TDFX_NAME "tdfx"
|
||||
#define TDFX_DESC "tdfx"
|
||||
#define TDFX_DATE "19991009"
|
||||
#define TDFX_MAJOR 0
|
||||
#define TDFX_MAJOR 1
|
||||
#define TDFX_MINOR 0
|
||||
#define TDFX_PATCHLEVEL 1
|
||||
#define TDFX_PATCHLEVEL 0
|
||||
|
||||
static drm_device_t tdfx_device;
|
||||
drm_ctx_t tdfx_res_ctx;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* tdfx_drv.h -- Private header for tdfx driver -*- linux-c -*-
|
||||
* Created: Thu Oct 7 10:40:04 1999 by faith@precisioninsight.com
|
||||
* Revised: Sat Oct 9 23:38:19 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.h,v 1.2 2000/02/23 04:47:31 martin Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* vm.c -- Memory mapping for DRM -*- linux-c -*-
|
||||
* Created: Mon Jan 4 08:58:31 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
|
|
@ -23,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c,v 1.5 2000/02/23 04:47:31 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* drm.h -- Header for Direct Rendering Manager -*- linux-c -*-
|
||||
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
|
|
@ -23,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.5 2000/02/23 04:47:26 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
* Acknowledgements:
|
||||
* Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
|
||||
|
|
@ -356,7 +358,7 @@ typedef struct drm_agp_info {
|
|||
#define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t)
|
||||
#define DRM_IOCTL_R128_RESET DRM_IO( 0x41)
|
||||
#define DRM_IOCTL_R128_FLUSH DRM_IO( 0x42)
|
||||
#define DRM_IOCTL_R128_CCEIDL DRM_IO( 0x43)
|
||||
#define DRM_IOCTL_R128_IDLE DRM_IO( 0x43)
|
||||
#define DRM_IOCTL_R128_PACKET DRM_IOW( 0x44, drm_r128_packet_t)
|
||||
#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x45, drm_r128_vertex_t)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/* drm.h -- Header for Direct Rendering Manager -*- linux-c -*-
|
||||
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
|
||||
*
|
||||
* Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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
|
||||
|
|
@ -23,7 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.5 2000/02/23 04:47:26 martin Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
* Acknowledgements:
|
||||
* Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
|
||||
|
|
@ -356,7 +358,7 @@ typedef struct drm_agp_info {
|
|||
#define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t)
|
||||
#define DRM_IOCTL_R128_RESET DRM_IO( 0x41)
|
||||
#define DRM_IOCTL_R128_FLUSH DRM_IO( 0x42)
|
||||
#define DRM_IOCTL_R128_CCEIDL DRM_IO( 0x43)
|
||||
#define DRM_IOCTL_R128_IDLE DRM_IO( 0x43)
|
||||
#define DRM_IOCTL_R128_PACKET DRM_IOW( 0x44, drm_r128_packet_t)
|
||||
#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x45, drm_r128_vertex_t)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* drmstat.c -- DRM device status and testing program
|
||||
* Created: Tue Jan 5 08:19:24 1999 by faith@precisioninsight.com
|
||||
* Revised: Sun Feb 13 23:35:00 2000 by kevin@precisioninsight.com
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmstat.c,v 1.6 2000/02/23 04:47:27 martin Exp $
|
||||
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue