summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJeff Hartmann <jhartmann@valinux.com>2001-02-15 19:35:11 +0000
committerJeff Hartmann <jhartmann@valinux.com>2001-02-15 19:35:11 +0000
commitef3b0ebd76c5913fc3d0776597d53fcb14e3efd4 (patch)
treec2a8c113b73784c55be5b6a32534e4079e1f164c /linux-core
parent68dc58a187f9e07a3877420a6c22926d78f0cb2c (diff)
Make I810 compile
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/i810_dma.c31
-rw-r--r--linux-core/i810_drm.h4
-rw-r--r--linux-core/i810_drv.c6
-rw-r--r--linux-core/i810_drv.h7
4 files changed, 25 insertions, 23 deletions
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index 8585fef1..8c50b320 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -48,9 +48,8 @@
#define I810_BUF_UNMAPPED 0
#define I810_BUF_MAPPED 1
-#define I810_REG(reg) 2
#define I810_BASE(reg) ((unsigned long) \
- dev->maplist[I810_REG(reg)]->handle)
+ dev_priv->mmio_map->handle)
#define I810_ADDR(reg) (I810_BASE(reg) + reg)
#define I810_DEREF(reg) *(__volatile__ int *)I810_ADDR(reg)
#define I810_READ(reg) I810_DEREF(reg)
@@ -407,23 +406,26 @@ static int i810_dma_initialize(drm_device_t *dev,
drm_i810_private_t *dev_priv,
drm_i810_init_t *init)
{
- drm_map_t *sarea_map;
+ struct list_head *list;
dev->dev_private = (void *) dev_priv;
memset(dev_priv, 0, sizeof(drm_i810_private_t));
- if (init->ring_map_idx >= dev->map_count ||
- init->buffer_map_idx >= dev->map_count) {
- i810_dma_cleanup(dev);
- DRM_ERROR("ring_map or buffer_map are invalid\n");
- return -EINVAL;
- }
+ list_for_each(list, &dev->maplist->head) {
+ drm_map_list_t *r_list = (drm_map_list_t *)list;
+ if( r_list->map &&
+ r_list->map->type == _DRM_SHM &&
+ r_list->map->flags & _DRM_CONTAINS_LOCK ) {
+ dev_priv->sarea_map = r_list->map;
+ break;
+ }
+ }
+
+ DRM_FIND_MAP( dev_priv->mmio_map, init->mmio_offset );
+ DRM_FIND_MAP( dev_priv->buffer_map, init->buffers_offset );
- dev_priv->ring_map_idx = init->ring_map_idx;
- dev_priv->buffer_map_idx = init->buffer_map_idx;
- sarea_map = dev->maplist[0];
dev_priv->sarea_priv = (drm_i810_sarea_t *)
- ((u8 *)sarea_map->handle +
+ ((u8 *)dev_priv->sarea_map->handle +
init->sarea_priv_offset);
atomic_set(&dev_priv->flush_done, 0);
@@ -876,6 +878,7 @@ static void i810_dma_dispatch_vertex(drm_device_t *dev,
static void i810_dma_service(int irq, void *device, struct pt_regs *regs)
{
drm_device_t *dev = (drm_device_t *)device;
+ drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
u16 temp;
atomic_inc(&dev->counts[_DRM_STAT_IRQ]);
@@ -901,6 +904,7 @@ static void i810_dma_task_queue(void *device)
int i810_irq_install(drm_device_t *dev, int irq)
{
+ drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
int retcode;
u16 temp;
@@ -963,6 +967,7 @@ int i810_irq_install(drm_device_t *dev, int irq)
int i810_irq_uninstall(drm_device_t *dev)
{
+ drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
int irq;
u16 temp;
diff --git a/linux-core/i810_drm.h b/linux-core/i810_drm.h
index c5f51c9a..cee189b7 100644
--- a/linux-core/i810_drm.h
+++ b/linux-core/i810_drm.h
@@ -98,8 +98,8 @@ typedef struct _drm_i810_init {
I810_INIT_DMA = 0x01,
I810_CLEANUP_DMA = 0x02
} func;
- int ring_map_idx;
- int buffer_map_idx;
+ unsigned int mmio_offset;
+ unsigned int buffers_offset;
int sarea_priv_offset;
unsigned int ring_start;
unsigned int ring_end;
diff --git a/linux-core/i810_drv.c b/linux-core/i810_drv.c
index 5b4d1c34..86ab394d 100644
--- a/linux-core/i810_drv.c
+++ b/linux-core/i810_drv.c
@@ -78,11 +78,7 @@
#define DRIVER_BUF_PRIV_T drm_i810_buf_priv_t
#define DRIVER_AGP_BUFFERS_MAP( dev ) \
-({ \
- drm_i810_private_t *dev_priv = (dev)->dev_private; \
- drm_map_t *map = (dev)->maplist[dev_priv->buffer_map_idx]; \
- map; \
-})
+ ((drm_i810_private_t *)((dev)->dev_private))->buffer_map
#include "drm_bufs.h"
diff --git a/linux-core/i810_drv.h b/linux-core/i810_drv.h
index e7824093..1f6e1468 100644
--- a/linux-core/i810_drv.h
+++ b/linux-core/i810_drv.h
@@ -54,11 +54,12 @@ typedef struct _drm_i810_ring_buffer{
} drm_i810_ring_buffer_t;
typedef struct drm_i810_private {
- int ring_map_idx;
- int buffer_map_idx;
+ drm_map_t *sarea_map;
+ drm_map_t *buffer_map;
+ drm_map_t *mmio_map;
- drm_i810_ring_buffer_t ring;
drm_i810_sarea_t *sarea_priv;
+ drm_i810_ring_buffer_t ring;
unsigned long hw_status_page;
unsigned long counter;