Most of the first cut of the DMA code. It's got most of the dispatch

architecture in place (Lacks actual DMA submission (The easy part,
    really...)) so it's not done yet, but I promised people that done or
    not, I'd do a check-in of this...
This commit is contained in:
Frank C. Earl 2002-05-01 00:25:30 +00:00
parent 43fb03f135
commit 9f0e6cad0e
7 changed files with 771 additions and 331 deletions

View file

@ -18,7 +18,7 @@
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL4
* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

View file

@ -18,7 +18,7 @@
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL4
* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

View file

@ -37,7 +37,7 @@
/* General customization:
*/
#define __HAVE_AGP 1
#define __MUST_HAVE_AGP 1
#define __MUST_HAVE_AGP 0
#define __HAVE_MTRR 1
#define __HAVE_CTX_BITMAP 1
#define __HAVE_SG 1
@ -46,6 +46,9 @@
/* DMA customization:
*/
#define __HAVE_DMA 1
#define __HAVE_DMA_IRQ 1
#define __HAVE_DMA_IRQ_BH 1
#define __HAVE_SHARED_IRQ 1
/* Buffer customization:
*/

File diff suppressed because it is too large Load diff

View file

@ -2,6 +2,7 @@
* Created: Thu Nov 30 20:04:32 2000 by gareth@valinux.com
*
* Copyright 2000 Gareth Hughes
* Copyright 2002 Frank C. Earl
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@ -24,6 +25,7 @@
*
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Frank C. Earl <fearl@airmail.net>
*/
#ifndef __MACH64_DRM_H__
@ -148,6 +150,7 @@ typedef struct drm_mach64_init {
} func;
unsigned int sarea_priv_offset;
int is_pci;
unsigned int fb_bpp;
unsigned int front_offset, front_pitch;

View file

@ -2,6 +2,7 @@
* Created: Fri Nov 24 22:07:58 2000 by gareth@valinux.com
*
* Copyright 2000 Gareth Hughes
* Copyright 2002 Frank C. Earl
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@ -24,13 +25,26 @@
*
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Frank C. Earl <fearl@airmail.net>
*/
#ifndef __MACH64_DRV_H__
#define __MACH64_DRV_H__
typedef struct drm_mach64_private {
#include <linux/list.h>
/* Doesn't need much- the interrupt handler will manage "aging", etc. */
typedef struct drm_mach64_freelist
{
struct list_head list; /* Linux LIST structure... */
struct drm_buf *buf; /* DMA buffer */
} drm_mach64_freelist_t;
typedef struct drm_mach64_private
{
drm_mach64_sarea_t *sarea_priv;
int is_pci;
unsigned int fb_bpp;
unsigned int front_offset, front_pitch;
@ -43,7 +57,21 @@ typedef struct drm_mach64_private {
u32 back_offset_pitch;
u32 depth_offset_pitch;
int usec_timeout;
u32 usec_timeout; /* Number of microseconds to wait for a timeout on the idle functions */
atomic_t dma_timeout; /* Number of interrupt dispatches since last DMA dispatch... */
atomic_t do_gui; /* Flag for the bottom half to know what to do... */
atomic_t do_blit; /* Flag for the bottom half to know what to do... */
struct pci_pool *pool;
dma_addr_t table_handle;
u32 table_addr;
u32 *table;
void *cpu_addr_table;
struct list_head free_list; /* Free-list head */
struct list_head empty_list; /* Free-list placeholder list */
struct list_head pending; /* Pending submission placeholder */
struct list_head dma_queue; /* Submission queue head */
drm_map_t *sarea;
drm_map_t *fb;
@ -51,10 +79,6 @@ typedef struct drm_mach64_private {
drm_map_t *buffers;
} drm_mach64_private_t;
typedef struct drm_mach64_buf_priv {
int age;
} drm_mach64_buf_priv_t;
/* mach64_drv.c */
extern int mach64_version( struct inode *inode, struct file *filp,
@ -398,6 +422,9 @@ do { \
* DMA macros
*/
#define MACH64_DMA_TIMEOUT 10 /* 10 vertical retraces should be enough */
#define MACH64_DMA_SIZE 8 /* 1 MB should be enough to make things happy */
#define DMA_FRAME_BUF_OFFSET 0
#define DMA_SYS_MEM_ADDR 1
#define DMA_COMMAND 2

View file

@ -1,4 +1,4 @@
/* mach64_dma.c -- DMA support for mach64 (Rage Pro) driver -*- linux-c -*-
/* mach64_state.c -- State support for mach64 (Rage Pro) driver -*- linux-c -*-
* Created: Sun Dec 03 19:20:26 2000 by gareth@valinux.com
*
* Copyright 2000 Gareth Hughes
@ -168,7 +168,7 @@ static void mach64_dma_dispatch_clear( drm_device_t *dev,
if ( flags & MACH64_DEPTH ) {
/* Setup for depth buffer clear
*/
DMAGETPTR( dev_priv, 12 );
DMAGETPTR( dev_priv, 14 );
DMAOUTREG( MACH64_Z_CNTL, 0 );
DMAOUTREG( MACH64_SCALE_3D_CNTL, 0 );
@ -228,7 +228,7 @@ static void mach64_dma_dispatch_swap( drm_device_t *dev )
break;
}
DMAGETPTR( dev_priv, 10 );
DMAGETPTR( dev_priv, 12 );
DMAOUTREG( MACH64_Z_CNTL, 0 );
DMAOUTREG( MACH64_SCALE_3D_CNTL, 0 );