mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-07 15:49:02 +02:00
Merge changes from the latest version of the Linux drivers.
This commit is contained in:
parent
dff195687c
commit
3fb48522f1
29 changed files with 847 additions and 721 deletions
15
bsd/drm.h
15
bsd/drm.h
|
|
@ -1,8 +1,8 @@
|
|||
/* drm.h -- Header for Direct Rendering Manager -*- c -*-
|
||||
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 13:08:18 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,10 +23,13 @@
|
|||
* 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.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.46 1999/08/20 20:00:53 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.1 1999/09/25 14:37:58 dawes Exp $
|
||||
*
|
||||
*
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
* Acknowledgements:
|
||||
* Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DRM_H_
|
||||
|
|
@ -66,7 +69,7 @@ typedef struct drm_clip_rect {
|
|||
unsigned short y2;
|
||||
} drm_clip_rect_t;
|
||||
|
||||
/* Seperate include files for the i810/mga specific structures */
|
||||
/* Seperate include files for the i810/mga/r128 specific structures */
|
||||
#include "mga_drm.h"
|
||||
#include "i810_drm.h"
|
||||
#include "r128_drm.h"
|
||||
|
|
|
|||
|
|
@ -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$
|
||||
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* auth.c -- IOCTLs for authentication -*- 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,8 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c,v 1.4 1999/08/30 13:05:00 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c,v 1.1 1999/09/25 14:37:57 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* bufs.c -- IOCTLs to manage buffers -*- c -*-
|
||||
* Created: Tue Feb 2 08:37:54 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 22:48:10 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,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c,v 1.8 1999/08/30 13:05:00 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c,v 1.1 1999/09/25 14:37:57 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* context.c -- IOCTLs for contexts and DMA queues -*- 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,8 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/context.c,v 1.5 1999/08/30 13:05:00 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/context.c,v 1.1 1999/09/25 14:37:58 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* Created: Thu Jan 6 03:56:42 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,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$
|
||||
* Author: Jeff Hartmann <jhartmann@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* dma.c -- DMA IOCTL and function support -*- c -*-
|
||||
* Created: Fri Mar 19 14:30:16 1999 by faith@precisioninsight.com
|
||||
* Revised: Thu Sep 16 12:55:39 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,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/dma.c,v 1.7 1999/09/16 16:56:18 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/dma.c,v 1.1 1999/09/25 14:37:58 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinuxa.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -62,15 +62,24 @@ void drm_dma_takedown(drm_device_t *dev)
|
|||
dma->bufs[i].page_order,
|
||||
DRM_MEM_DMA);
|
||||
}
|
||||
drm_free(dma->bufs[i].buflist,
|
||||
dma->buf_count
|
||||
* sizeof(*dma->bufs[0].buflist),
|
||||
DRM_MEM_BUFS);
|
||||
drm_free(dma->bufs[i].seglist,
|
||||
dma->buf_count
|
||||
dma->bufs[i].seg_count
|
||||
* sizeof(*dma->bufs[0].seglist),
|
||||
DRM_MEM_SEGS);
|
||||
drm_freelist_destroy(&dma->bufs[i].freelist);
|
||||
}
|
||||
if(dma->bufs[i].buf_count) {
|
||||
for(j = 0; j < dma->bufs[i].buf_count; j++) {
|
||||
if(dma->bufs[i].buflist[j].dev_private) {
|
||||
drm_free(dma->bufs[i].buflist[j].dev_private,
|
||||
dma->bufs[i].buflist[j].dev_priv_size,
|
||||
DRM_MEM_BUFS);
|
||||
}
|
||||
}
|
||||
drm_free(dma->bufs[i].buflist,
|
||||
dma->bufs[i].buf_count *
|
||||
sizeof(*dma->bufs[0].buflist),
|
||||
DRM_MEM_BUFS);
|
||||
drm_freelist_destroy(&dma->bufs[i].freelist);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* drawable.c -- IOCTLs for drawables -*- 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,8 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drawable.c,v 1.3 1999/08/30 13:05:00 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drawable.c,v 1.1 1999/09/25 14:37:58 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* fops.c -- File operations for DRM -*- c -*-
|
||||
* Created: Mon Jan 4 08:58:31 1999 by faith@precisioninsight.com
|
||||
* Revised: Tue Oct 12 08:48:59 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,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.3 1999/08/20 15:36:45 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.1 1999/09/25 14:37:59 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Daryll Strauss <daryll@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* init.c -- Setup/Cleanup for DRM -*- 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,8 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c,v 1.3 1999/08/20 15:07:01 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c,v 1.1 1999/09/25 14:38:01 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -98,4 +98,3 @@ void drm_parse_options(char *s)
|
|||
drm_parse_option(h); /* parse */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* ioctl.c -- IOCTL processing for DRM -*- 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,8 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/ioctl.c,v 1.3 1999/08/30 13:05:00 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/ioctl.c,v 1.1 1999/09/25 14:38:01 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* lists.c -- Buffer list handling routines -*- c -*-
|
||||
* Created: Mon Apr 19 20:54:22 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 09:27:01 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,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c,v 1.3 1999/08/20 15:07:02 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c,v 1.1 1999/09/25 14:38:01 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* lock.c -- IOCTLs for locking -*- c -*-
|
||||
* Created: Tue Feb 2 08:37:54 1999 by faith@precisioninsight.com
|
||||
* Revised: Tue Oct 12 08:51:06 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,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lock.c,v 1.5 1999/08/30 13:05:00 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lock.c,v 1.1 1999/09/25 14:38:01 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* memory.c -- Memory management wrappers for DRM -*- c -*-
|
||||
* Created: Thu Feb 4 14:00:34 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 13:04:33 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,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c,v 1.4 1999/08/20 20:00:53 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c,v 1.1 1999/09/25 14:38:02 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -55,21 +55,21 @@ static struct simplelock drm_mem_lock;
|
|||
static unsigned long drm_ram_available = 0;
|
||||
static unsigned long drm_ram_used = 0;
|
||||
static drm_mem_stats_t drm_mem_stats[] = {
|
||||
[DRM_MEM_DMA] = { "dmabufs" },
|
||||
[DRM_MEM_SAREA] = { "sareas" },
|
||||
[DRM_MEM_DRIVER] = { "driver" },
|
||||
[DRM_MEM_MAGIC] = { "magic" },
|
||||
[DRM_MEM_IOCTLS] = { "ioctltab" },
|
||||
[DRM_MEM_MAPS] = { "maplist" },
|
||||
[DRM_MEM_VMAS] = { "vmalist" },
|
||||
[DRM_MEM_BUFS] = { "buflist" },
|
||||
[DRM_MEM_SEGS] = { "seglist" },
|
||||
[DRM_MEM_PAGES] = { "pagelist" },
|
||||
[DRM_MEM_FILES] = { "files" },
|
||||
[DRM_MEM_QUEUES] = { "queues" },
|
||||
[DRM_MEM_CMDS] = { "commands" },
|
||||
[DRM_MEM_MAPPINGS] = { "mappings" },
|
||||
[DRM_MEM_BUFLISTS] = { "buflists" },
|
||||
[DRM_MEM_DMA] = { "dmabufs" },
|
||||
[DRM_MEM_SAREA] = { "sareas" },
|
||||
[DRM_MEM_DRIVER] = { "driver" },
|
||||
[DRM_MEM_MAGIC] = { "magic" },
|
||||
[DRM_MEM_IOCTLS] = { "ioctltab" },
|
||||
[DRM_MEM_MAPS] = { "maplist" },
|
||||
[DRM_MEM_VMAS] = { "vmalist" },
|
||||
[DRM_MEM_BUFS] = { "buflist" },
|
||||
[DRM_MEM_SEGS] = { "seglist" },
|
||||
[DRM_MEM_PAGES] = { "pagelist" },
|
||||
[DRM_MEM_FILES] = { "files" },
|
||||
[DRM_MEM_QUEUES] = { "queues" },
|
||||
[DRM_MEM_CMDS] = { "commands" },
|
||||
[DRM_MEM_MAPPINGS] = { "mappings" },
|
||||
[DRM_MEM_BUFLISTS] = { "buflists" },
|
||||
[DRM_MEM_AGPLISTS] = { "agplist" },
|
||||
[DRM_MEM_TOTALAGP] = { "totalagp" },
|
||||
[DRM_MEM_BOUNDAGP] = { "boundagp" },
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* vm.c -- Memory mapping for DRM -*- c -*-
|
||||
* Created: Mon Jan 4 08:58:31 1999 by faith@precisioninsight.com
|
||||
* Revised: Fri Aug 20 22:48:11 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,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c,v 1.7 1999/08/21 02:48:34 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c,v 1.1 1999/09/25 14:38:02 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* gamma_dma.c -- DMA support for GMX 2000 -*- 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,8 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c,v 1.9 1999/09/16 16:56:18 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c,v 1.1 1999/09/25 14:38:00 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -92,13 +92,31 @@ static __inline void gamma_dma_dispatch(drm_device_t *dev,
|
|||
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);
|
||||
|
||||
|
|
@ -107,7 +125,6 @@ static __inline void gamma_dma_quiescent(drm_device_t *dev)
|
|||
while (!GAMMA_READ(GAMMA_OUTFIFOWORDS))
|
||||
;
|
||||
} while (GAMMA_READ(GAMMA_OUTPUTFIFO) != GAMMA_SYNC_TAG);
|
||||
|
||||
|
||||
/* Read from second MX */
|
||||
do {
|
||||
|
|
@ -784,8 +801,13 @@ int gamma_lock(dev_t kdev, u_long cmd, caddr_t data, int flags, struct proc *p)
|
|||
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 -*- 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,8 +24,8 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c,v 1.17 1999/08/30 13:05:00 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c,v 1.1 1999/09/25 14:38:00 dawes Exp $
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -36,6 +36,16 @@
|
|||
|
||||
MODULE_DEPEND(gamma, drm, 1, 1, 1);
|
||||
|
||||
#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
|
||||
#ifndef PCI_VENDOR_ID_3DLABS
|
||||
#define PCI_VENDOR_ID_3DLABS 0x3d3d
|
||||
#endif
|
||||
|
||||
static int gamma_init(device_t nbdev);
|
||||
static void gamma_cleanup(device_t nbdev);
|
||||
|
||||
|
|
@ -47,6 +57,10 @@ static int gamma_probe(device_t dev)
|
|||
case 0x00083d3d:
|
||||
s = "3D Labs Gamma graphics accelerator";
|
||||
break;
|
||||
|
||||
case 0x00063d3d:
|
||||
s = "3D Labs MX graphics accelerator";
|
||||
break;
|
||||
}
|
||||
|
||||
if (s) {
|
||||
|
|
@ -92,10 +106,10 @@ DRIVER_MODULE(if_gamma, pci, gamma_driver, gamma_devclass, 0, 0);
|
|||
|
||||
#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
|
||||
|
||||
#define CDEV_MAJOR 200
|
||||
|
||||
|
|
@ -150,6 +164,8 @@ static drm_ioctl_desc_t gamma_ioctls[] = {
|
|||
};
|
||||
#define GAMMA_IOCTL_COUNT DRM_ARRAY_SIZE(gamma_ioctls)
|
||||
|
||||
static int devices = 0;
|
||||
|
||||
static int gamma_setup(drm_device_t *dev)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -286,7 +302,9 @@ gamma_takedown(drm_device_t *dev)
|
|||
DRM_MEM_SAREA);
|
||||
break;
|
||||
case _DRM_AGP:
|
||||
break; /* XXX */
|
||||
/* Do nothing here, because this is all
|
||||
handled in the AGP/GART driver. */
|
||||
break;
|
||||
}
|
||||
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
|
||||
}
|
||||
|
|
@ -328,6 +346,38 @@ gamma_takedown(drm_device_t *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int gamma_found(void)
|
||||
{
|
||||
return devices;
|
||||
}
|
||||
|
||||
static int
|
||||
gamma_find_devices(device_t dev)
|
||||
{
|
||||
device_t *children, child;
|
||||
int nchildren, i;
|
||||
int count = 0;
|
||||
|
||||
if (device_get_children(device_get_parent(dev), &children, &nchildren))
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < nchildren; i++) {
|
||||
child = children[i];
|
||||
|
||||
if (pci_get_slot(dev) == pci_get_slot(child) &&
|
||||
pci_get_vendor(child) == PCI_VENDOR_ID_3DLABS &&
|
||||
pci_get_device(child) == PCI_DEVICE_ID_3DLABS_MX) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
free(children, M_TEMP);
|
||||
|
||||
/* we don't currently support more than two */
|
||||
if (count > 2) count = 2;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/* gamma_init is called via gamma_attach at module load time */
|
||||
|
||||
static int
|
||||
|
|
@ -344,6 +394,8 @@ gamma_init(device_t nbdev)
|
|||
#if 0 /* XXX use getenv I guess */
|
||||
drm_parse_options(gamma);
|
||||
#endif
|
||||
devices = gamma_find_devices(nbdev);
|
||||
if (devices == 0) return -1;
|
||||
|
||||
#if 0
|
||||
if ((retcode = misc_register(&gamma_misc))) {
|
||||
|
|
@ -363,13 +415,14 @@ gamma_init(device_t nbdev)
|
|||
drm_mem_init();
|
||||
drm_sysctl_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,
|
||||
device_get_unit(nbdev));
|
||||
device_get_unit(nbdev),
|
||||
devices);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* gamma_drv.h -- Private header for 3dlabs GMX 2000 driver -*- 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,9 +24,6 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h,v 1.4 1999/08/30 13:05:00 faith Exp $
|
||||
* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h,v 1.1 1999/09/25 14:38:00 dawes Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GAMMA_DRV_H_
|
||||
|
|
@ -46,5 +43,6 @@ extern d_ioctl_t gamma_control;
|
|||
extern int gamma_dma_schedule(drm_device_t *dev, int locked);
|
||||
extern int gamma_irq_install(drm_device_t *dev, int irq);
|
||||
extern int gamma_irq_uninstall(drm_device_t *dev);
|
||||
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,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$
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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$
|
||||
* 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: 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$
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -41,9 +41,9 @@ MODULE_DEPEND(mga, agp, 1, 1, 1);
|
|||
#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
|
||||
|
||||
drm_ctx_t mga_res_ctx;
|
||||
|
||||
|
|
@ -404,9 +404,9 @@ mga_init(device_t nbdev)
|
|||
DRM_DEBUG("doing agp init\n");
|
||||
dev->agp = drm_agp_init();
|
||||
if(dev->agp == NULL) {
|
||||
DRM_DEBUG("The mga drm module requires the agp module"
|
||||
" to function correctly\nPlease load the agp"
|
||||
" module before you load the mga module\n");
|
||||
DRM_INFO("The mga drm module requires the agp module"
|
||||
" to function correctly\nPlease load the agp"
|
||||
" module before you load the mga module\n");
|
||||
drm_sysctl_cleanup(dev);
|
||||
mga_takedown(dev);
|
||||
return ENOMEM;
|
||||
|
|
|
|||
|
|
@ -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_
|
||||
|
|
|
|||
1167
bsd/mga/mga_state.c
1167
bsd/mga/mga_state.c
File diff suppressed because it is too large
Load diff
|
|
@ -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_
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* r128_drm.h -- Public header for the r128 driver
|
||||
/* r128_drm.h -- Public header for the r128 driver -*- linux-c -*-
|
||||
* Created: Wed Apr 5 19:24:19 2000 by kevin@precisioninsight.com
|
||||
*
|
||||
* Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* tdfx_context.c -- IOCTLs for tdfx contexts -*- 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,8 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI$
|
||||
* $XFree86$
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Daryll Strauss <daryll@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -36,9 +37,7 @@ extern drm_ctx_t tdfx_res_ctx;
|
|||
|
||||
static int tdfx_alloc_queue(drm_device_t *dev)
|
||||
{
|
||||
static int context = 0;
|
||||
|
||||
return ++context; /* Should this reuse contexts in the future? */
|
||||
return drm_ctxbitmap_next(dev);
|
||||
}
|
||||
|
||||
int tdfx_context_switch(drm_device_t *dev, int old, int new)
|
||||
|
|
@ -135,6 +134,12 @@ tdfx_addctx(dev_t kdev, u_long cmd, caddr_t data, int flags, struct proc *p)
|
|||
ctx.handle = tdfx_alloc_queue(dev);
|
||||
}
|
||||
DRM_DEBUG("%d\n", ctx.handle);
|
||||
if (ctx.handle == -1) {
|
||||
DRM_DEBUG("Not enough free contexts.\n");
|
||||
/* Should this return -EBUSY instead? */
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
*(drm_ctx_t *) data = ctx;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -189,13 +194,11 @@ tdfx_newctx(dev_t kdev, u_long cmd, caddr_t data, int flags, struct proc *p)
|
|||
int
|
||||
tdfx_rmctx(dev_t kdev, u_long cmd, caddr_t data, int flags, struct proc *p)
|
||||
{
|
||||
drm_device_t *dev = kdev->si_drv1;
|
||||
drm_ctx_t ctx;
|
||||
|
||||
ctx = *(drm_ctx_t *) data;
|
||||
DRM_DEBUG("%d\n", ctx.handle);
|
||||
/* This is currently a noop because we
|
||||
don't reuse context values. Perhaps we
|
||||
should? */
|
||||
drm_ctxbitmap_free(dev, ctx.handle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* tdfx.c -- tdfx driver -*- 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,8 +24,9 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI$
|
||||
* $XFree86$
|
||||
* Authors:
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Daryll Strauss <daryll@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -35,13 +36,16 @@
|
|||
#include <pci/pcivar.h>
|
||||
|
||||
MODULE_DEPEND(tdfx, drm, 1, 1, 1);
|
||||
#ifdef DRM_AGP
|
||||
MODULE_DEPEND(tdfx, agp, 1, 1, 1);
|
||||
#endif
|
||||
|
||||
#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 int tdfx_init(device_t nbdev);
|
||||
static void tdfx_cleanup(device_t nbdev);
|
||||
|
|
@ -153,6 +157,16 @@ static drm_ioctl_desc_t tdfx_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { tdfx_lock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { tdfx_unlock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
|
||||
#ifdef DRM_AGP
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = {drm_agp_acquire, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = {drm_agp_release, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = {drm_agp_enable, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = {drm_agp_info, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = {drm_agp_alloc, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = {drm_agp_free, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = {drm_agp_unbind, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = {drm_agp_bind, 1, 1},
|
||||
#endif
|
||||
};
|
||||
#define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls)
|
||||
|
||||
|
|
@ -259,6 +273,26 @@ tdfx_takedown(drm_device_t *dev)
|
|||
}
|
||||
dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
|
||||
}
|
||||
#ifdef DRM_AGP
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
drm_agp_mem_t *temp;
|
||||
drm_agp_mem_t *temp_next;
|
||||
|
||||
temp = dev->agp->memory;
|
||||
while(temp != NULL) {
|
||||
temp_next = temp->next;
|
||||
drm_free_agp(temp->handle, temp->pages);
|
||||
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
|
||||
temp = temp_next;
|
||||
}
|
||||
|
||||
if (dev->agp->acquired)
|
||||
agp_release(dev->agp->agpdev);
|
||||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Clear vma list (only built for debugging) */
|
||||
if (dev->vmalist) {
|
||||
|
|
@ -312,8 +346,6 @@ tdfx_takedown(drm_device_t *dev)
|
|||
}
|
||||
lockmgr(&dev->dev_lock, LK_RELEASE, 0, curproc);
|
||||
|
||||
device_unbusy(dev->device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -323,6 +355,7 @@ static int
|
|||
tdfx_init(device_t nbdev)
|
||||
{
|
||||
drm_device_t *dev = device_get_softc(nbdev);
|
||||
int retcode;
|
||||
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
|
|
@ -347,6 +380,16 @@ tdfx_init(device_t nbdev)
|
|||
drm_sysctl_init(dev);
|
||||
TAILQ_INIT(&dev->files);
|
||||
|
||||
#ifdef DRM_AGP
|
||||
dev->agp = drm_agp_init();
|
||||
#endif
|
||||
if((retcode = drm_ctxbitmap_init(dev))) {
|
||||
DRM_ERROR("Cannot allocate memory for context bitmap.\n");
|
||||
drm_sysctl_cleanup(dev);
|
||||
tdfx_takedown(dev);
|
||||
return retcode;
|
||||
}
|
||||
|
||||
DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
|
||||
TDFX_NAME,
|
||||
TDFX_MAJOR,
|
||||
|
|
@ -372,7 +415,7 @@ tdfx_cleanup(device_t nbdev)
|
|||
|
||||
DRM_INFO("Module unloaded\n");
|
||||
|
||||
device_busy(dev->device);
|
||||
drm_ctxbitmap_cleanup(dev);
|
||||
tdfx_takedown(dev);
|
||||
}
|
||||
|
||||
|
|
@ -447,6 +490,7 @@ tdfx_close(dev_t kdev, int flags, int fmt, struct proc *p)
|
|||
return EBUSY;
|
||||
}
|
||||
simple_unlock(&dev->count_lock);
|
||||
device_unbusy(dev->device);
|
||||
return tdfx_takedown(dev);
|
||||
}
|
||||
simple_unlock(&dev->count_lock);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/* tdfx_drv.h -- Private header for tdfx driver -*- 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,8 +24,6 @@
|
|||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* $PI$
|
||||
* $XFree86$
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue