mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-26 04:10:17 +01:00
next round of patches from Eric for Radeon support (needs testing now).
This commit is contained in:
parent
0242f24caa
commit
6ac03b936f
29 changed files with 522 additions and 310 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# $FreeBSD$
|
||||
|
||||
SUBDIR = tdfx mga r128 # radeon gamma radeon i810 sis
|
||||
SUBDIR = tdfx mga r128 radeon # gamma i810 sis
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include <pci/agpvar.h>
|
||||
#endif
|
||||
|
||||
#define DRM_WEIRD_MAPBUFS_BUG 1
|
||||
#define DRM_TIME_SLICE (hz/20) /* Time slice for GLXContexts */
|
||||
|
||||
#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
# $FreeBSD$
|
||||
|
||||
KMOD = radeon
|
||||
SRCS = radeon_bufs.c radeon_cp.c radeon_drv.c radeon_state.c
|
||||
SRCS += device_if.h bus_if.h pci_if.h
|
||||
CFLAGS += ${DEBUG_FLAGS} -I..
|
||||
KERN = /usr/src/sys
|
||||
KMODDEPS = drm
|
||||
NOMAN= YES
|
||||
SRCS = radeon_cp.c radeon_drv.c radeon_state.c
|
||||
SRCS += device_if.h bus_if.h pci_if.h opt_drm_linux.h
|
||||
CFLAGS += ${DEBUG_FLAGS} -I. -I..
|
||||
|
||||
@:
|
||||
ln -sf /sys @
|
||||
|
|
@ -13,4 +12,14 @@ KMODDEPS = drm
|
|||
machine:
|
||||
ln -sf /sys/i386/include machine
|
||||
|
||||
.if ${MACHINE_ARCH} == "i386"
|
||||
# This line enables linux ioctl handling by default
|
||||
# comment out if you don't want it
|
||||
RADEON_OPTS= "\#define DRM_LINUX" 1
|
||||
.endif
|
||||
|
||||
opt_drm_linux.h:
|
||||
touch opt_drm_linux.h
|
||||
echo $(RADEON_OPTS) >> opt_drm_linux.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
# $FreeBSD$
|
||||
|
||||
KMOD = sis
|
||||
SRCS = sis_drv.c sis_ds.c sis_mm.c
|
||||
SRCS += device_if.h bus_if.h pci_if.h
|
||||
CFLAGS += ${DEBUG_FLAGS} -I..
|
||||
KERN = /usr/src/sys
|
||||
KMODDEPS = drm
|
||||
KMOD= sis
|
||||
NOMAN= YES
|
||||
SRCS= sis_drv.c sis_ds.c sis_mm.c
|
||||
SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h
|
||||
CFLAGS+= ${DEBUG_FLAGS} -I. -I..
|
||||
|
||||
@:
|
||||
ln -sf /sys @
|
||||
|
|
@ -13,4 +12,14 @@ KMODDEPS = drm
|
|||
machine:
|
||||
ln -sf /sys/i386/include machine
|
||||
|
||||
.if ${MACHINE_ARCH} == "i386"
|
||||
# This line enables linux ioctl handling by default
|
||||
# comment out if you don't want it
|
||||
SIS_OPTS= "\#define DRM_LINUX" 1
|
||||
.endif
|
||||
|
||||
opt_drm_linux.h:
|
||||
touch opt_drm_linux.h
|
||||
echo $(SIS_OPTS) >> opt_drm_linux.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
KMOD= tdfx
|
||||
NOMAN= YES
|
||||
SRCS= tdfx_drv.c
|
||||
SRCS= tdfx_drv.c
|
||||
SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h
|
||||
CFLAGS+= ${DEBUG_FLAGS} -I. -I..
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# $FreeBSD$
|
||||
|
||||
SUBDIR = tdfx mga r128 # radeon gamma radeon i810 sis
|
||||
SUBDIR = tdfx mga r128 radeon # gamma i810 sis
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# $FreeBSD$
|
||||
|
||||
SUBDIR = tdfx mga r128 # radeon gamma radeon i810 sis
|
||||
SUBDIR = tdfx mga r128 radeon # gamma i810 sis
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include <pci/agpvar.h>
|
||||
#endif
|
||||
|
||||
#define DRM_WEIRD_MAPBUFS_BUG 1
|
||||
#define DRM_TIME_SLICE (hz/20) /* Time slice for GLXContexts */
|
||||
|
||||
#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
# $FreeBSD$
|
||||
|
||||
KMOD = i810
|
||||
SRCS = i810_dma.c i810_drv.c
|
||||
SRCS += device_if.h bus_if.h pci_if.h
|
||||
CFLAGS += ${DEBUG_FLAGS} -I..
|
||||
KERN = /usr/src/sys
|
||||
KMODDEPS = drm
|
||||
KMOD= i810
|
||||
NOMAN= YES
|
||||
SRCS= i810_drv.c i810_dma.c
|
||||
SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h
|
||||
CFLAGS+= ${DEBUG_FLAGS} -I. -I..
|
||||
|
||||
@:
|
||||
ln -sf /sys @
|
||||
|
|
@ -13,4 +12,14 @@ KMODDEPS = drm
|
|||
machine:
|
||||
ln -sf /sys/i386/include machine
|
||||
|
||||
.if ${MACHINE_ARCH} == "i386"
|
||||
# This line enables linux ioctl handling by default
|
||||
# comment out if you don't want it
|
||||
I810_OPTS= "\#define DRM_LINUX" 1
|
||||
.endif
|
||||
|
||||
opt_drm_linux.h:
|
||||
touch opt_drm_linux.h
|
||||
echo $(I810_OPTS) >> opt_drm_linux.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
# $FreeBSD$
|
||||
|
||||
KMOD = radeon
|
||||
SRCS = radeon_bufs.c radeon_cp.c radeon_drv.c radeon_state.c
|
||||
SRCS += device_if.h bus_if.h pci_if.h
|
||||
CFLAGS += ${DEBUG_FLAGS} -I..
|
||||
KERN = /usr/src/sys
|
||||
KMODDEPS = drm
|
||||
NOMAN= YES
|
||||
SRCS = radeon_cp.c radeon_drv.c radeon_state.c
|
||||
SRCS += device_if.h bus_if.h pci_if.h opt_drm_linux.h
|
||||
CFLAGS += ${DEBUG_FLAGS} -I. -I..
|
||||
|
||||
@:
|
||||
ln -sf /sys @
|
||||
|
|
@ -13,4 +12,14 @@ KMODDEPS = drm
|
|||
machine:
|
||||
ln -sf /sys/i386/include machine
|
||||
|
||||
.if ${MACHINE_ARCH} == "i386"
|
||||
# This line enables linux ioctl handling by default
|
||||
# comment out if you don't want it
|
||||
RADEON_OPTS= "\#define DRM_LINUX" 1
|
||||
.endif
|
||||
|
||||
opt_drm_linux.h:
|
||||
touch opt_drm_linux.h
|
||||
echo $(RADEON_OPTS) >> opt_drm_linux.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
# $FreeBSD$
|
||||
|
||||
KMOD = sis
|
||||
SRCS = sis_drv.c sis_ds.c sis_mm.c
|
||||
SRCS += device_if.h bus_if.h pci_if.h
|
||||
CFLAGS += ${DEBUG_FLAGS} -I..
|
||||
KERN = /usr/src/sys
|
||||
KMODDEPS = drm
|
||||
KMOD= sis
|
||||
NOMAN= YES
|
||||
SRCS= sis_drv.c sis_ds.c sis_mm.c
|
||||
SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h
|
||||
CFLAGS+= ${DEBUG_FLAGS} -I. -I..
|
||||
|
||||
@:
|
||||
ln -sf /sys @
|
||||
|
|
@ -13,4 +12,14 @@ KMODDEPS = drm
|
|||
machine:
|
||||
ln -sf /sys/i386/include machine
|
||||
|
||||
.if ${MACHINE_ARCH} == "i386"
|
||||
# This line enables linux ioctl handling by default
|
||||
# comment out if you don't want it
|
||||
SIS_OPTS= "\#define DRM_LINUX" 1
|
||||
.endif
|
||||
|
||||
opt_drm_linux.h:
|
||||
touch opt_drm_linux.h
|
||||
echo $(SIS_OPTS) >> opt_drm_linux.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
KMOD= tdfx
|
||||
NOMAN= YES
|
||||
SRCS= tdfx_drv.c
|
||||
SRCS= tdfx_drv.c
|
||||
SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h
|
||||
CFLAGS+= ${DEBUG_FLAGS} -I. -I..
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
#define __HAVE_DMA_HISTOGRAM 0
|
||||
#endif
|
||||
|
||||
#define DRM_DEBUG_CODE 1 /* Include debugging code (if > 1, then
|
||||
#define DRM_DEBUG_CODE 0 /* Include debugging code (if > 1, then
|
||||
also include looping detection. */
|
||||
|
||||
/* There's undoubtably more of this file to go into these OS dependent ones. */
|
||||
|
|
|
|||
|
|
@ -1075,7 +1075,7 @@ int DRM(mapbufs)( DRM_OS_IOCTL )
|
|||
#ifdef __FreeBSD__
|
||||
retcode = vm_mmap(&p->p_vmspace->vm_map,
|
||||
&virtual,
|
||||
round_page(dma->byte_count),
|
||||
round_page(map->size),
|
||||
PROT_READ|PROT_WRITE, VM_PROT_ALL,
|
||||
MAP_SHARED,
|
||||
SLIST_FIRST(&kdev->si_hlist),
|
||||
|
|
|
|||
|
|
@ -30,18 +30,21 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#define __NO_VERSION__
|
||||
#include "i810.h"
|
||||
#include "drmP.h"
|
||||
#include "i810_drv.h"
|
||||
#ifdef __linux__
|
||||
#define __NO_VERSION__
|
||||
#include <linux/interrupt.h> /* For task queue support */
|
||||
#endif
|
||||
|
||||
#include "i810.h"
|
||||
#include "drmP.h"
|
||||
#include "i810_drv.h"
|
||||
|
||||
/* in case we don't have a 2.3.99-pre6 kernel or later: */
|
||||
#ifdef __linux__
|
||||
#ifndef VM_DONTCOPY
|
||||
#define VM_DONTCOPY 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define I810_BUF_FREE 2
|
||||
#define I810_BUF_CLIENT 1
|
||||
|
|
@ -147,14 +150,12 @@ static struct file_operations i810_buffer_fops = {
|
|||
|
||||
int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_private_t *dev_priv;
|
||||
drm_buf_t *buf;
|
||||
drm_i810_buf_priv_t *buf_priv;
|
||||
|
||||
lock_kernel();
|
||||
dev = priv->dev;
|
||||
dev_priv = dev->dev_private;
|
||||
buf = dev_priv->mmap_buffer;
|
||||
buf_priv = buf->dev_private;
|
||||
|
|
@ -174,8 +175,7 @@ int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
|
|||
|
||||
static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_buf_priv_t *buf_priv = buf->dev_private;
|
||||
drm_i810_private_t *dev_priv = dev->dev_private;
|
||||
struct file_operations *old_fops;
|
||||
|
|
@ -414,11 +414,17 @@ static int i810_dma_initialize(drm_device_t *dev,
|
|||
drm_i810_private_t *dev_priv,
|
||||
drm_i810_init_t *init)
|
||||
{
|
||||
#ifdef __linux__
|
||||
struct list_head *list;
|
||||
#endif
|
||||
#if defined( __FreeBSD__ )
|
||||
drm_map_list_entry_t *listentry;
|
||||
#endif
|
||||
|
||||
dev->dev_private = (void *) dev_priv;
|
||||
memset(dev_priv, 0, sizeof(drm_i810_private_t));
|
||||
|
||||
#ifdef __linux__
|
||||
list_for_each(list, &dev->maplist->head) {
|
||||
drm_map_list_t *r_list = (drm_map_list_t *)list;
|
||||
if( r_list->map &&
|
||||
|
|
@ -428,7 +434,18 @@ static int i810_dma_initialize(drm_device_t *dev,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#if defined( __FreeBSD__ )
|
||||
TAILQ_FOREACH(listentry, dev->maplist, link) {
|
||||
drm_map_t *map = listentry->map;
|
||||
if (map->type == _DRM_SHM &&
|
||||
map->flags & _DRM_CONTAINS_LOCK) {
|
||||
dev_priv->sarea = map;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DRM_FIND_MAP( dev_priv->mmio_map, init->mmio_offset );
|
||||
DRM_FIND_MAP( dev_priv->buffer_map, init->buffers_offset );
|
||||
|
||||
|
|
@ -490,17 +507,14 @@ static int i810_dma_initialize(drm_device_t *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int i810_dma_init(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_dma_init( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_private_t *dev_priv;
|
||||
drm_i810_init_t init;
|
||||
int retcode = 0;
|
||||
|
||||
if (copy_from_user(&init, (drm_i810_init_t *)arg, sizeof(init)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( init, (drm_i810_init_t *) data, sizeof(init) );
|
||||
|
||||
switch(init.func) {
|
||||
case I810_INIT_DMA:
|
||||
|
|
@ -1056,16 +1070,14 @@ void i810_reclaim_buffers(drm_device_t *dev, pid_t pid)
|
|||
}
|
||||
}
|
||||
|
||||
int i810_flush_ioctl(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_flush_ioctl( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
|
||||
DRM_DEBUG("i810_flush_ioctl\n");
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_flush_ioctl called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
i810_flush_queue(dev);
|
||||
|
|
@ -1073,11 +1085,9 @@ int i810_flush_ioctl(struct inode *inode, struct file *filp,
|
|||
}
|
||||
|
||||
|
||||
int i810_dma_vertex(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_dma_vertex( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_device_dma_t *dma = dev->dma;
|
||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
||||
|
|
@ -1085,12 +1095,11 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
|
|||
dev_priv->sarea_priv;
|
||||
drm_i810_vertex_t vertex;
|
||||
|
||||
if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( vertex, (drm_i810_vertex_t *) data, sizeof(vertex) );
|
||||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_dma_vertex called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
|
||||
|
|
@ -1110,19 +1119,16 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
|
|||
|
||||
|
||||
|
||||
int i810_clear_bufs(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_clear_bufs( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_clear_t clear;
|
||||
|
||||
if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( clear, (drm_i810_clear_t *) data, sizeof(clear) );
|
||||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_clear_bufs called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
i810_dma_dispatch_clear( dev, clear.flags,
|
||||
|
|
@ -1131,28 +1137,24 @@ int i810_clear_bufs(struct inode *inode, struct file *filp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int i810_swap_bufs(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_swap_bufs( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
|
||||
DRM_DEBUG("i810_swap_bufs\n");
|
||||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_swap_buf called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
i810_dma_dispatch_swap( dev );
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
int i810_getage( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||
|
|
@ -1162,11 +1164,9 @@ int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
int i810_getbuf( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
int retcode = 0;
|
||||
drm_i810_dma_t d;
|
||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||
|
|
@ -1175,12 +1175,11 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
dev_priv->sarea_priv;
|
||||
|
||||
DRM_DEBUG("getbuf\n");
|
||||
if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( d, (drm_i810_dma_t *) data, sizeof(d) );
|
||||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_dma called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
d.granted = 0;
|
||||
|
|
@ -1188,20 +1187,17 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
retcode = i810_dma_get_buffer(dev, &d, filp);
|
||||
|
||||
DRM_DEBUG("i810_dma: %d returning %d, granted = %d\n",
|
||||
current->pid, retcode, d.granted);
|
||||
DRM_OS_CURRENTPID, retcode, d.granted);
|
||||
|
||||
if (copy_to_user((drm_dma_t *)arg, &d, sizeof(d)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNTOUSR( (drm_dma_t *) data, d, sizeof(d) );
|
||||
sarea_priv->last_dispatch = (int) hw_status[5];
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
||||
int i810_copybuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
int i810_copybuf( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_copy_t d;
|
||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
||||
|
|
@ -1213,27 +1209,25 @@ int i810_copybuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_dma called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
if (copy_from_user(&d, (drm_i810_copy_t *)arg, sizeof(d)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( d, (drm_i810_copy_t *) data, sizeof(d) );
|
||||
|
||||
if(d.idx > dma->buf_count) return -EINVAL;
|
||||
if(d.idx > dma->buf_count) DRM_OS_RETURN( EINVAL );
|
||||
buf = dma->buflist[ d.idx ];
|
||||
buf_priv = buf->dev_private;
|
||||
if (buf_priv->currently_mapped != I810_BUF_MAPPED) return -EPERM;
|
||||
|
||||
if (copy_from_user(buf_priv->virtual, d.address, d.used))
|
||||
return -EFAULT;
|
||||
if (DRM_OS_COPYFROMUSR(buf_priv->virtual, d.address, d.used))
|
||||
DRM_OS_RETURN( EFAULT );
|
||||
|
||||
sarea_priv->last_dispatch = (int) hw_status[5];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i810_docopy(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
int i810_docopy( DRM_OS_IOCTL )
|
||||
{
|
||||
if(VM_DONTCOPY == 0) return 1;
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,17 @@
|
|||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#include <sys/bus.h>
|
||||
#include <pci/pcivar.h>
|
||||
#include <opt_drm_linux.h>
|
||||
#endif
|
||||
|
||||
#include "i810.h"
|
||||
#include "drmP.h"
|
||||
#include "i810_drv.h"
|
||||
|
|
@ -45,6 +55,31 @@
|
|||
#define DRIVER_MINOR 1
|
||||
#define DRIVER_PATCHLEVEL 0
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
static int i810_probe(device_t dev)
|
||||
{
|
||||
const char *s = 0;
|
||||
|
||||
switch (pci_get_devid(dev)) {
|
||||
/* FIXME: Add i810 detection*/
|
||||
/*case 0x0525102b:
|
||||
s = "Matrox MGA G400 AGP graphics accelerator";
|
||||
break;
|
||||
|
||||
case 0x0521102b:
|
||||
s = "Matrox MGA G200 AGP graphics accelerator";
|
||||
break;*/
|
||||
}
|
||||
|
||||
if (s) {
|
||||
device_set_desc(dev, s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ENXIO;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DRIVER_IOCTLS \
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_I810_INIT)] = { i810_dma_init, 1, 1 }, \
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_I810_VERTEX)] = { i810_dma_vertex, 1, 0 }, \
|
||||
|
|
@ -77,6 +112,15 @@
|
|||
#include "drm_lock.h"
|
||||
#include "drm_lists.h"
|
||||
#include "drm_memory.h"
|
||||
#include "drm_proc.h"
|
||||
#include "drm_vm.h"
|
||||
#ifdef __linux__
|
||||
#include "drm_proc.h"
|
||||
#include "drm_stub.h"
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
#include "drm_sysctl.h"
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
DRIVER_MODULE(i810, pci, i810_driver, i810_devclass, 0, 0);
|
||||
#endif
|
||||
|
|
@ -109,6 +109,7 @@ static int mga_probe(device_t dev)
|
|||
#include "drm_ioctl.h"
|
||||
#include "drm_lock.h"
|
||||
#include "drm_memory.h"
|
||||
#include "drm_vm.h"
|
||||
#ifdef __linux__
|
||||
#include "drm_proc.h"
|
||||
#include "drm_stub.h"
|
||||
|
|
@ -116,7 +117,6 @@ static int mga_probe(device_t dev)
|
|||
#ifdef __FreeBSD__
|
||||
#include "drm_sysctl.h"
|
||||
#endif
|
||||
#include "drm_vm.h"
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
DRIVER_MODULE(mga, pci, mga_driver, mga_devclass, 0, 0);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ static int r128_probe(device_t dev)
|
|||
case 0x524c1002:
|
||||
s = "ATI Rage 128-RL";
|
||||
break;
|
||||
case 0x50461002:
|
||||
s = "ATI Rage 128 Pro PF";
|
||||
break;
|
||||
}
|
||||
|
||||
if (s) {
|
||||
|
|
|
|||
|
|
@ -27,11 +27,24 @@
|
|||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#include <sys/bus.h>
|
||||
#include <pci/pcivar.h>
|
||||
#include <opt_drm_linux.h>
|
||||
#endif
|
||||
|
||||
#include "radeon.h"
|
||||
#include "drmP.h"
|
||||
#include "radeon_drv.h"
|
||||
#if __REALLY_HAVE_SG
|
||||
#include "ati_pcigart.h"
|
||||
#endif
|
||||
|
||||
#define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc."
|
||||
|
||||
|
|
@ -43,6 +56,31 @@
|
|||
#define DRIVER_MINOR 1
|
||||
#define DRIVER_PATCHLEVEL 1
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
static int radeon_probe(device_t dev)
|
||||
{
|
||||
const char *s = 0;
|
||||
|
||||
switch (pci_get_devid(dev)) {
|
||||
/* FIXME: Add radeon detection*/
|
||||
/*case 0x0525102b:
|
||||
s = "Matrox MGA G400 AGP graphics accelerator";
|
||||
break;
|
||||
|
||||
case 0x0521102b:
|
||||
s = "Matrox MGA G200 AGP graphics accelerator";
|
||||
break; */
|
||||
}
|
||||
|
||||
if (s) {
|
||||
device_set_desc(dev, s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ENXIO;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DRIVER_IOCTLS \
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { radeon_cp_buffers, 1, 0 }, \
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_INIT)] = { radeon_cp_init, 1, 1 }, \
|
||||
|
|
@ -83,7 +121,18 @@
|
|||
#include "drm_ioctl.h"
|
||||
#include "drm_lock.h"
|
||||
#include "drm_memory.h"
|
||||
#include "drm_proc.h"
|
||||
#include "drm_vm.h"
|
||||
#ifdef __linux__
|
||||
#include "drm_proc.h"
|
||||
#include "drm_stub.h"
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
#include "drm_sysctl.h"
|
||||
#endif
|
||||
#if __REALLY_HAVE_SG
|
||||
#include "drm_scatter.h"
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
DRIVER_MODULE(radeon, pci, radeon_driver, radeon_devclass, 0, 0);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
#define __HAVE_DMA_HISTOGRAM 0
|
||||
#endif
|
||||
|
||||
#define DRM_DEBUG_CODE 1 /* Include debugging code (if > 1, then
|
||||
#define DRM_DEBUG_CODE 0 /* Include debugging code (if > 1, then
|
||||
also include looping detection. */
|
||||
|
||||
/* There's undoubtably more of this file to go into these OS dependent ones. */
|
||||
|
|
|
|||
|
|
@ -1075,7 +1075,7 @@ int DRM(mapbufs)( DRM_OS_IOCTL )
|
|||
#ifdef __FreeBSD__
|
||||
retcode = vm_mmap(&p->p_vmspace->vm_map,
|
||||
&virtual,
|
||||
round_page(dma->byte_count),
|
||||
round_page(map->size),
|
||||
PROT_READ|PROT_WRITE, VM_PROT_ALL,
|
||||
MAP_SHARED,
|
||||
SLIST_FIRST(&kdev->si_hlist),
|
||||
|
|
|
|||
126
linux/i810_dma.c
126
linux/i810_dma.c
|
|
@ -30,18 +30,21 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#define __NO_VERSION__
|
||||
#include "i810.h"
|
||||
#include "drmP.h"
|
||||
#include "i810_drv.h"
|
||||
#ifdef __linux__
|
||||
#define __NO_VERSION__
|
||||
#include <linux/interrupt.h> /* For task queue support */
|
||||
#endif
|
||||
|
||||
#include "i810.h"
|
||||
#include "drmP.h"
|
||||
#include "i810_drv.h"
|
||||
|
||||
/* in case we don't have a 2.3.99-pre6 kernel or later: */
|
||||
#ifdef __linux__
|
||||
#ifndef VM_DONTCOPY
|
||||
#define VM_DONTCOPY 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define I810_BUF_FREE 2
|
||||
#define I810_BUF_CLIENT 1
|
||||
|
|
@ -147,14 +150,12 @@ static struct file_operations i810_buffer_fops = {
|
|||
|
||||
int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_private_t *dev_priv;
|
||||
drm_buf_t *buf;
|
||||
drm_i810_buf_priv_t *buf_priv;
|
||||
|
||||
lock_kernel();
|
||||
dev = priv->dev;
|
||||
dev_priv = dev->dev_private;
|
||||
buf = dev_priv->mmap_buffer;
|
||||
buf_priv = buf->dev_private;
|
||||
|
|
@ -174,8 +175,7 @@ int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
|
|||
|
||||
static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_buf_priv_t *buf_priv = buf->dev_private;
|
||||
drm_i810_private_t *dev_priv = dev->dev_private;
|
||||
struct file_operations *old_fops;
|
||||
|
|
@ -414,11 +414,17 @@ static int i810_dma_initialize(drm_device_t *dev,
|
|||
drm_i810_private_t *dev_priv,
|
||||
drm_i810_init_t *init)
|
||||
{
|
||||
#ifdef __linux__
|
||||
struct list_head *list;
|
||||
#endif
|
||||
#if defined( __FreeBSD__ )
|
||||
drm_map_list_entry_t *listentry;
|
||||
#endif
|
||||
|
||||
dev->dev_private = (void *) dev_priv;
|
||||
memset(dev_priv, 0, sizeof(drm_i810_private_t));
|
||||
|
||||
#ifdef __linux__
|
||||
list_for_each(list, &dev->maplist->head) {
|
||||
drm_map_list_t *r_list = (drm_map_list_t *)list;
|
||||
if( r_list->map &&
|
||||
|
|
@ -428,7 +434,18 @@ static int i810_dma_initialize(drm_device_t *dev,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#if defined( __FreeBSD__ )
|
||||
TAILQ_FOREACH(listentry, dev->maplist, link) {
|
||||
drm_map_t *map = listentry->map;
|
||||
if (map->type == _DRM_SHM &&
|
||||
map->flags & _DRM_CONTAINS_LOCK) {
|
||||
dev_priv->sarea = map;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DRM_FIND_MAP( dev_priv->mmio_map, init->mmio_offset );
|
||||
DRM_FIND_MAP( dev_priv->buffer_map, init->buffers_offset );
|
||||
|
||||
|
|
@ -490,17 +507,14 @@ static int i810_dma_initialize(drm_device_t *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int i810_dma_init(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_dma_init( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_private_t *dev_priv;
|
||||
drm_i810_init_t init;
|
||||
int retcode = 0;
|
||||
|
||||
if (copy_from_user(&init, (drm_i810_init_t *)arg, sizeof(init)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( init, (drm_i810_init_t *) data, sizeof(init) );
|
||||
|
||||
switch(init.func) {
|
||||
case I810_INIT_DMA:
|
||||
|
|
@ -1056,16 +1070,14 @@ void i810_reclaim_buffers(drm_device_t *dev, pid_t pid)
|
|||
}
|
||||
}
|
||||
|
||||
int i810_flush_ioctl(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_flush_ioctl( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
|
||||
DRM_DEBUG("i810_flush_ioctl\n");
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_flush_ioctl called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
i810_flush_queue(dev);
|
||||
|
|
@ -1073,11 +1085,9 @@ int i810_flush_ioctl(struct inode *inode, struct file *filp,
|
|||
}
|
||||
|
||||
|
||||
int i810_dma_vertex(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_dma_vertex( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_device_dma_t *dma = dev->dma;
|
||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
||||
|
|
@ -1085,12 +1095,11 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
|
|||
dev_priv->sarea_priv;
|
||||
drm_i810_vertex_t vertex;
|
||||
|
||||
if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( vertex, (drm_i810_vertex_t *) data, sizeof(vertex) );
|
||||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_dma_vertex called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
|
||||
|
|
@ -1110,19 +1119,16 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
|
|||
|
||||
|
||||
|
||||
int i810_clear_bufs(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_clear_bufs( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_clear_t clear;
|
||||
|
||||
if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( clear, (drm_i810_clear_t *) data, sizeof(clear) );
|
||||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_clear_bufs called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
i810_dma_dispatch_clear( dev, clear.flags,
|
||||
|
|
@ -1131,28 +1137,24 @@ int i810_clear_bufs(struct inode *inode, struct file *filp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int i810_swap_bufs(struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
int i810_swap_bufs( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
|
||||
DRM_DEBUG("i810_swap_bufs\n");
|
||||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_swap_buf called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
i810_dma_dispatch_swap( dev );
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
int i810_getage( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||
|
|
@ -1162,11 +1164,9 @@ int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
int i810_getbuf( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
int retcode = 0;
|
||||
drm_i810_dma_t d;
|
||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||
|
|
@ -1175,12 +1175,11 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
dev_priv->sarea_priv;
|
||||
|
||||
DRM_DEBUG("getbuf\n");
|
||||
if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( d, (drm_i810_dma_t *) data, sizeof(d) );
|
||||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_dma called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
d.granted = 0;
|
||||
|
|
@ -1188,20 +1187,17 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
retcode = i810_dma_get_buffer(dev, &d, filp);
|
||||
|
||||
DRM_DEBUG("i810_dma: %d returning %d, granted = %d\n",
|
||||
current->pid, retcode, d.granted);
|
||||
DRM_OS_CURRENTPID, retcode, d.granted);
|
||||
|
||||
if (copy_to_user((drm_dma_t *)arg, &d, sizeof(d)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNTOUSR( (drm_dma_t *) data, d, sizeof(d) );
|
||||
sarea_priv->last_dispatch = (int) hw_status[5];
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
||||
int i810_copybuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
int i810_copybuf( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_i810_copy_t d;
|
||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
||||
|
|
@ -1213,27 +1209,25 @@ int i810_copybuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
|
||||
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
|
||||
DRM_ERROR("i810_dma called without lock held\n");
|
||||
return -EINVAL;
|
||||
DRM_OS_RETURN( EINVAL );
|
||||
}
|
||||
|
||||
if (copy_from_user(&d, (drm_i810_copy_t *)arg, sizeof(d)))
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( d, (drm_i810_copy_t *) data, sizeof(d) );
|
||||
|
||||
if(d.idx > dma->buf_count) return -EINVAL;
|
||||
if(d.idx > dma->buf_count) DRM_OS_RETURN( EINVAL );
|
||||
buf = dma->buflist[ d.idx ];
|
||||
buf_priv = buf->dev_private;
|
||||
if (buf_priv->currently_mapped != I810_BUF_MAPPED) return -EPERM;
|
||||
|
||||
if (copy_from_user(buf_priv->virtual, d.address, d.used))
|
||||
return -EFAULT;
|
||||
if (DRM_OS_COPYFROMUSR(buf_priv->virtual, d.address, d.used))
|
||||
DRM_OS_RETURN( EFAULT );
|
||||
|
||||
sarea_priv->last_dispatch = (int) hw_status[5];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i810_docopy(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
int i810_docopy( DRM_OS_IOCTL )
|
||||
{
|
||||
if(VM_DONTCOPY == 0) return 1;
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,17 @@
|
|||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#include <sys/bus.h>
|
||||
#include <pci/pcivar.h>
|
||||
#include <opt_drm_linux.h>
|
||||
#endif
|
||||
|
||||
#include "i810.h"
|
||||
#include "drmP.h"
|
||||
#include "i810_drv.h"
|
||||
|
|
@ -45,6 +55,31 @@
|
|||
#define DRIVER_MINOR 1
|
||||
#define DRIVER_PATCHLEVEL 0
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
static int i810_probe(device_t dev)
|
||||
{
|
||||
const char *s = 0;
|
||||
|
||||
switch (pci_get_devid(dev)) {
|
||||
/* FIXME: Add i810 detection*/
|
||||
/*case 0x0525102b:
|
||||
s = "Matrox MGA G400 AGP graphics accelerator";
|
||||
break;
|
||||
|
||||
case 0x0521102b:
|
||||
s = "Matrox MGA G200 AGP graphics accelerator";
|
||||
break;*/
|
||||
}
|
||||
|
||||
if (s) {
|
||||
device_set_desc(dev, s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ENXIO;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DRIVER_IOCTLS \
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_I810_INIT)] = { i810_dma_init, 1, 1 }, \
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_I810_VERTEX)] = { i810_dma_vertex, 1, 0 }, \
|
||||
|
|
@ -77,6 +112,15 @@
|
|||
#include "drm_lock.h"
|
||||
#include "drm_lists.h"
|
||||
#include "drm_memory.h"
|
||||
#include "drm_proc.h"
|
||||
#include "drm_vm.h"
|
||||
#ifdef __linux__
|
||||
#include "drm_proc.h"
|
||||
#include "drm_stub.h"
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
#include "drm_sysctl.h"
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
DRIVER_MODULE(i810, pci, i810_driver, i810_devclass, 0, 0);
|
||||
#endif
|
||||
|
|
@ -109,6 +109,7 @@ static int mga_probe(device_t dev)
|
|||
#include "drm_ioctl.h"
|
||||
#include "drm_lock.h"
|
||||
#include "drm_memory.h"
|
||||
#include "drm_vm.h"
|
||||
#ifdef __linux__
|
||||
#include "drm_proc.h"
|
||||
#include "drm_stub.h"
|
||||
|
|
@ -116,7 +117,6 @@ static int mga_probe(device_t dev)
|
|||
#ifdef __FreeBSD__
|
||||
#include "drm_sysctl.h"
|
||||
#endif
|
||||
#include "drm_vm.h"
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
DRIVER_MODULE(mga, pci, mga_driver, mga_devclass, 0, 0);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ static int r128_probe(device_t dev)
|
|||
case 0x524c1002:
|
||||
s = "ATI Rage 128-RL";
|
||||
break;
|
||||
case 0x50461002:
|
||||
s = "ATI Rage 128 Pro PF";
|
||||
break;
|
||||
}
|
||||
|
||||
if (s) {
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@
|
|||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
#define __NO_VERSION__
|
||||
#include "radeon.h"
|
||||
#include "drmP.h"
|
||||
#include "radeon_drv.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#define __NO_VERSION__
|
||||
#include <linux/interrupt.h> /* For task queue support */
|
||||
#include <linux/delay.h>
|
||||
#endif
|
||||
|
|
@ -397,7 +397,6 @@ static int radeon_do_wait_for_idle( drm_radeon_private_t *dev_priv )
|
|||
|
||||
ret = radeon_do_wait_for_fifo( dev_priv, 64 );
|
||||
if ( ret < 0 ) return ret;
|
||||
|
||||
for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
|
||||
if ( !(RADEON_READ( RADEON_RBBM_STATUS )
|
||||
& RADEON_RBBM_ACTIVE) ) {
|
||||
|
|
@ -620,9 +619,12 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev )
|
|||
*dev_priv->ring.head = cur_read_ptr;
|
||||
dev_priv->ring.tail = cur_read_ptr;
|
||||
|
||||
#if __REALLY_HAVE_SG
|
||||
if ( !dev_priv->is_pci ) {
|
||||
#endif
|
||||
RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR,
|
||||
dev_priv->ring_rptr->offset );
|
||||
#if __REALLY_HAVE_SG
|
||||
} else {
|
||||
drm_sg_mem_t *entry = dev->sg;
|
||||
unsigned long tmp_ofs, page_ofs;
|
||||
|
|
@ -637,6 +639,7 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev )
|
|||
virt_to_bus(entry->pagelist[page_ofs]->virtual),
|
||||
entry->handle + tmp_ofs );
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set ring buffer size */
|
||||
RADEON_WRITE( RADEON_CP_RB_CNTL, dev_priv->ring.size_l2qw );
|
||||
|
|
@ -658,7 +661,12 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev )
|
|||
static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
|
||||
{
|
||||
drm_radeon_private_t *dev_priv;
|
||||
#ifdef __linux__
|
||||
struct list_head *list;
|
||||
#endif
|
||||
#if defined( __FreeBSD__ )
|
||||
drm_map_list_entry_t *listentry;
|
||||
#endif
|
||||
u32 tmp;
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
|
||||
|
|
@ -779,6 +787,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
|
|||
RADEON_ROUND_MODE_TRUNC |
|
||||
RADEON_ROUND_PREC_8TH_PIX);
|
||||
|
||||
#ifdef __linux__
|
||||
list_for_each(list, &dev->maplist->head) {
|
||||
drm_map_list_t *r_list = (drm_map_list_t *)list;
|
||||
if( r_list->map &&
|
||||
|
|
@ -788,6 +797,17 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined( __FreeBSD__ )
|
||||
TAILQ_FOREACH(listentry, dev->maplist, link) {
|
||||
drm_map_t *map = listentry->map;
|
||||
if (map->type == _DRM_SHM &&
|
||||
map->flags & _DRM_CONTAINS_LOCK) {
|
||||
dev_priv->sarea = map;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
|
||||
DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
|
||||
|
|
@ -886,6 +906,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
|
|||
RADEON_WRITE( RADEON_LAST_CLEAR_REG,
|
||||
dev_priv->sarea_priv->last_clear );
|
||||
|
||||
#if __REALLY_HAVE_SG
|
||||
if ( dev_priv->is_pci ) {
|
||||
dev_priv->phys_pci_gart = DRM(ati_pcigart_init)( dev );
|
||||
if ( !dev_priv->phys_pci_gart ) {
|
||||
|
|
@ -923,12 +944,15 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
|
|||
RADEON_WRITE(0x0140, 0x29002901);
|
||||
#endif
|
||||
} else {
|
||||
#endif
|
||||
/* Turn off PCI GART
|
||||
*/
|
||||
tmp = RADEON_READ( RADEON_AIC_CNTL )
|
||||
& ~RADEON_PCIGART_TRANSLATE_EN;
|
||||
RADEON_WRITE( RADEON_AIC_CNTL, tmp );
|
||||
#if __REALLY_HAVE_SG
|
||||
}
|
||||
#endif
|
||||
|
||||
radeon_cp_load_microcode( dev_priv );
|
||||
radeon_cp_init_ring_buffer( dev );
|
||||
|
|
@ -962,15 +986,12 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_cp_init( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_init( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_init_t init;
|
||||
|
||||
if ( copy_from_user( &init, (drm_radeon_init_t *)arg, sizeof(init) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( init, (drm_radeon_init_t *) data, sizeof(init) );
|
||||
|
||||
switch ( init.func ) {
|
||||
case RADEON_INIT_CP:
|
||||
|
|
@ -982,11 +1003,9 @@ int radeon_cp_init( struct inode *inode, struct file *filp,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
int radeon_cp_start( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_start( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
|
||||
|
|
@ -1010,11 +1029,9 @@ int radeon_cp_start( struct inode *inode, struct file *filp,
|
|||
/* Stop the CP. The engine must have been idled before calling this
|
||||
* routine.
|
||||
*/
|
||||
int radeon_cp_stop( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_stop( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_radeon_cp_stop_t stop;
|
||||
int ret;
|
||||
|
|
@ -1022,8 +1039,7 @@ int radeon_cp_stop( struct inode *inode, struct file *filp,
|
|||
|
||||
LOCK_TEST_WITH_RETURN( dev );
|
||||
|
||||
if ( copy_from_user( &stop, (drm_radeon_init_t *)arg, sizeof(stop) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( stop, (drm_radeon_cp_stop_t *) data, sizeof(stop) );
|
||||
|
||||
/* Flush any pending CP commands. This ensures any outstanding
|
||||
* commands are exectuted by the engine before we turn it off.
|
||||
|
|
@ -1054,11 +1070,9 @@ int radeon_cp_stop( struct inode *inode, struct file *filp,
|
|||
|
||||
/* Just reset the CP ring. Called as part of an X Server engine reset.
|
||||
*/
|
||||
int radeon_cp_reset( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_reset( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
|
||||
|
|
@ -1077,11 +1091,9 @@ int radeon_cp_reset( struct inode *inode, struct file *filp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_cp_idle( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_idle( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
|
||||
|
|
@ -1090,11 +1102,9 @@ int radeon_cp_idle( struct inode *inode, struct file *filp,
|
|||
return radeon_do_cp_idle( dev_priv );
|
||||
}
|
||||
|
||||
int radeon_engine_reset( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_engine_reset( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
|
||||
LOCK_TEST_WITH_RETURN( dev );
|
||||
|
|
@ -1140,18 +1150,15 @@ int radeon_do_cleanup_pageflip( drm_device_t *dev )
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_fullscreen( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_fullscreen( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_fullscreen_t fs;
|
||||
|
||||
LOCK_TEST_WITH_RETURN( dev );
|
||||
|
||||
if ( copy_from_user( &fs, (drm_radeon_fullscreen_t *)arg,
|
||||
sizeof(fs) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( fs, (drm_radeon_fullscreen_t *) data,
|
||||
sizeof(fs) );
|
||||
|
||||
switch ( fs.func ) {
|
||||
case RADEON_INIT_FULLSCREEN:
|
||||
|
|
@ -1277,7 +1284,7 @@ drm_buf_t *radeon_freelist_get( drm_device_t *dev )
|
|||
start = 0;
|
||||
#endif
|
||||
}
|
||||
udelay( 1 );
|
||||
DRM_OS_DELAY( 1 );
|
||||
}
|
||||
|
||||
DRM_ERROR( "returning NULL!\n" );
|
||||
|
|
@ -1316,7 +1323,7 @@ int radeon_wait_ring( drm_radeon_private_t *dev_priv, int n )
|
|||
radeon_update_ring_snapshot( ring );
|
||||
if ( ring->space > n )
|
||||
return 0;
|
||||
udelay( 1 );
|
||||
DRM_OS_DELAY( 1 );
|
||||
}
|
||||
|
||||
/* FIXME: This return value is ignored in the BEGIN_RING macro! */
|
||||
|
|
@ -1327,7 +1334,7 @@ int radeon_wait_ring( drm_radeon_private_t *dev_priv, int n )
|
|||
return -EBUSY;
|
||||
}
|
||||
|
||||
static int radeon_cp_get_buffers( drm_device_t *dev, drm_dma_t *d )
|
||||
static int radeon_cp_get_buffers( drm_device_t *dev, drm_dma_t *d, int pid )
|
||||
{
|
||||
int i;
|
||||
drm_buf_t *buf;
|
||||
|
|
@ -1336,12 +1343,12 @@ static int radeon_cp_get_buffers( drm_device_t *dev, drm_dma_t *d )
|
|||
buf = radeon_freelist_get( dev );
|
||||
if ( !buf ) return -EAGAIN;
|
||||
|
||||
buf->pid = current->pid;
|
||||
buf->pid = pid;
|
||||
|
||||
if ( copy_to_user( &d->request_indices[i], &buf->idx,
|
||||
if (DRM_OS_COPYTOUSR( &d->request_indices[i], &buf->idx,
|
||||
sizeof(buf->idx) ) )
|
||||
return -EFAULT;
|
||||
if ( copy_to_user( &d->request_sizes[i], &buf->total,
|
||||
if (DRM_OS_COPYTOUSR( &d->request_sizes[i], &buf->total,
|
||||
sizeof(buf->total) ) )
|
||||
return -EFAULT;
|
||||
|
||||
|
|
@ -1350,25 +1357,22 @@ static int radeon_cp_get_buffers( drm_device_t *dev, drm_dma_t *d )
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_cp_buffers( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_buffers( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_device_dma_t *dma = dev->dma;
|
||||
int ret = 0;
|
||||
drm_dma_t d;
|
||||
|
||||
LOCK_TEST_WITH_RETURN( dev );
|
||||
|
||||
if ( copy_from_user( &d, (drm_dma_t *)arg, sizeof(d) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( d, (drm_dma_t *) data, sizeof(d) );
|
||||
|
||||
/* Please don't send us buffers.
|
||||
*/
|
||||
if ( d.send_count != 0 ) {
|
||||
DRM_ERROR( "Process %d trying to send %d buffers via drmDMA\n",
|
||||
current->pid, d.send_count );
|
||||
DRM_OS_CURRENTPID, d.send_count );
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -1376,18 +1380,17 @@ int radeon_cp_buffers( struct inode *inode, struct file *filp,
|
|||
*/
|
||||
if ( d.request_count < 0 || d.request_count > dma->buf_count ) {
|
||||
DRM_ERROR( "Process %d trying to get %d buffers (of %d max)\n",
|
||||
current->pid, d.request_count, dma->buf_count );
|
||||
DRM_OS_CURRENTPID, d.request_count, dma->buf_count );
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
d.granted_count = 0;
|
||||
|
||||
if ( d.request_count ) {
|
||||
ret = radeon_cp_get_buffers( dev, &d );
|
||||
ret = radeon_cp_get_buffers( dev, &d, DRM_OS_CURRENTPID );
|
||||
}
|
||||
|
||||
if ( copy_to_user( (drm_dma_t *)arg, &d, sizeof(d) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNTOUSR( (drm_dma_t *) data, d, sizeof(d) );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,11 +27,24 @@
|
|||
* Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#include <sys/bus.h>
|
||||
#include <pci/pcivar.h>
|
||||
#include <opt_drm_linux.h>
|
||||
#endif
|
||||
|
||||
#include "radeon.h"
|
||||
#include "drmP.h"
|
||||
#include "radeon_drv.h"
|
||||
#if __REALLY_HAVE_SG
|
||||
#include "ati_pcigart.h"
|
||||
#endif
|
||||
|
||||
#define DRIVER_AUTHOR "Gareth Hughes, VA Linux Systems Inc."
|
||||
|
||||
|
|
@ -43,6 +56,31 @@
|
|||
#define DRIVER_MINOR 1
|
||||
#define DRIVER_PATCHLEVEL 1
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
static int radeon_probe(device_t dev)
|
||||
{
|
||||
const char *s = 0;
|
||||
|
||||
switch (pci_get_devid(dev)) {
|
||||
/* FIXME: Add radeon detection*/
|
||||
/*case 0x0525102b:
|
||||
s = "Matrox MGA G400 AGP graphics accelerator";
|
||||
break;
|
||||
|
||||
case 0x0521102b:
|
||||
s = "Matrox MGA G200 AGP graphics accelerator";
|
||||
break; */
|
||||
}
|
||||
|
||||
if (s) {
|
||||
device_set_desc(dev, s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ENXIO;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DRIVER_IOCTLS \
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { radeon_cp_buffers, 1, 0 }, \
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_INIT)] = { radeon_cp_init, 1, 1 }, \
|
||||
|
|
@ -83,7 +121,18 @@
|
|||
#include "drm_ioctl.h"
|
||||
#include "drm_lock.h"
|
||||
#include "drm_memory.h"
|
||||
#include "drm_proc.h"
|
||||
#include "drm_vm.h"
|
||||
#ifdef __linux__
|
||||
#include "drm_proc.h"
|
||||
#include "drm_stub.h"
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
#include "drm_sysctl.h"
|
||||
#endif
|
||||
#if __REALLY_HAVE_SG
|
||||
#include "drm_scatter.h"
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
DRIVER_MODULE(radeon, pci, radeon_driver, radeon_devclass, 0, 0);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -623,10 +623,10 @@ extern int RADEON_READ_PLL( drm_device_t *dev, int addr );
|
|||
#define LOCK_TEST_WITH_RETURN( dev ) \
|
||||
do { \
|
||||
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \
|
||||
dev->lock.pid != current->pid ) { \
|
||||
dev->lock.pid != DRM_OS_CURRENTPID ) { \
|
||||
DRM_ERROR( "%s called without lock held\n", \
|
||||
__FUNCTION__ ); \
|
||||
return -EINVAL; \
|
||||
DRM_OS_RETURN( EINVAL ); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
|
@ -638,10 +638,10 @@ do { \
|
|||
radeon_update_ring_snapshot( ring ); \
|
||||
if ( ring->space >= ring->high_mark ) \
|
||||
goto __ring_space_done; \
|
||||
udelay( 1 ); \
|
||||
DRM_OS_DELAY( 1 ); \
|
||||
} \
|
||||
DRM_ERROR( "ring space check failed!\n" ); \
|
||||
return -EBUSY; \
|
||||
DRM_OS_RETURN( EBUSY ); \
|
||||
} \
|
||||
__ring_space_done: \
|
||||
} while (0)
|
||||
|
|
|
|||
|
|
@ -27,19 +27,21 @@
|
|||
* Kevin E. Martin <martin@valinux.com>
|
||||
*/
|
||||
|
||||
#ifdef __linux__
|
||||
#define __NO_VERSION__
|
||||
#include <linux/delay.h>
|
||||
#endif
|
||||
#include "radeon.h"
|
||||
#include "drmP.h"
|
||||
#include "radeon_drv.h"
|
||||
#include "drm.h"
|
||||
#include <linux/delay.h>
|
||||
|
||||
|
||||
/* ================================================================
|
||||
* CP hardware state programming functions
|
||||
*/
|
||||
|
||||
static inline void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv,
|
||||
static __inline__ void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv,
|
||||
drm_clip_rect_t *box )
|
||||
{
|
||||
RING_LOCALS;
|
||||
|
|
@ -58,7 +60,7 @@ static inline void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv,
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_context( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_context( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
|
||||
|
|
@ -87,7 +89,7 @@ static inline void radeon_emit_context( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_vertfmt( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_vertfmt( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
|
||||
|
|
@ -102,7 +104,7 @@ static inline void radeon_emit_vertfmt( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_line( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_line( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
|
||||
|
|
@ -121,7 +123,7 @@ static inline void radeon_emit_line( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_bumpmap( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_bumpmap( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
|
||||
|
|
@ -140,7 +142,7 @@ static inline void radeon_emit_bumpmap( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_masks( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_masks( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
|
||||
|
|
@ -157,7 +159,7 @@ static inline void radeon_emit_masks( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_viewport( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_viewport( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
|
||||
|
|
@ -177,7 +179,7 @@ static inline void radeon_emit_viewport( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_setup( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_setup( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
|
||||
|
|
@ -194,7 +196,7 @@ static inline void radeon_emit_setup( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_tcl( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_tcl( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
#ifdef TCL_ENABLE
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
|
|
@ -239,7 +241,7 @@ static inline void radeon_emit_tcl( drm_radeon_private_t *dev_priv )
|
|||
#endif
|
||||
}
|
||||
|
||||
static inline void radeon_emit_misc( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_misc( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
|
||||
|
|
@ -254,7 +256,7 @@ static inline void radeon_emit_misc( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_tex0( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_tex0( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_texture_regs_t *tex = &sarea_priv->tex_state[0];
|
||||
|
|
@ -277,7 +279,7 @@ static inline void radeon_emit_tex0( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_tex1( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_tex1( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_texture_regs_t *tex = &sarea_priv->tex_state[1];
|
||||
|
|
@ -300,7 +302,7 @@ static inline void radeon_emit_tex1( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_tex2( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_tex2( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_texture_regs_t *tex = &sarea_priv->tex_state[2];
|
||||
|
|
@ -323,7 +325,7 @@ static inline void radeon_emit_tex2( drm_radeon_private_t *dev_priv )
|
|||
ADVANCE_RING();
|
||||
}
|
||||
|
||||
static inline void radeon_emit_state( drm_radeon_private_t *dev_priv )
|
||||
static __inline__ void radeon_emit_state( drm_radeon_private_t *dev_priv )
|
||||
{
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
unsigned int dirty = sarea_priv->dirty;
|
||||
|
|
@ -964,7 +966,7 @@ static void radeon_cp_dispatch_indices( drm_device_t *dev,
|
|||
|
||||
static int radeon_cp_dispatch_texture( drm_device_t *dev,
|
||||
drm_radeon_texture_t *tex,
|
||||
drm_radeon_tex_image_t *image )
|
||||
drm_radeon_tex_image_t *image, int pid )
|
||||
{
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_buf_t *buf;
|
||||
|
|
@ -1054,7 +1056,7 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
|
|||
image->height -= height;
|
||||
image->data = (char *)image->data + size;
|
||||
|
||||
if ( copy_to_user( tex->image, image, sizeof(*image) ) ) {
|
||||
if ( DRM_OS_COPYTOUSR( tex->image, image, sizeof(*image) ) ) {
|
||||
DRM_ERROR( "EFAULT on tex->image\n" );
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1091,7 +1093,7 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
|
|||
/* Texture image width is larger than the minimum, so we
|
||||
* can upload it directly.
|
||||
*/
|
||||
if ( copy_from_user( buffer, data, dwords * sizeof(u32) ) ) {
|
||||
if ( DRM_OS_COPYFROMUSR( buffer, data, dwords * sizeof(u32) ) ) {
|
||||
DRM_ERROR( "EFAULT on data, %d dwords\n", dwords );
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1101,7 +1103,7 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
|
|||
* width.
|
||||
*/
|
||||
for ( i = 0 ; i < tex->height ; i++ ) {
|
||||
if ( copy_from_user( buffer, data, tex_width ) ) {
|
||||
if ( DRM_OS_COPYFROMUSR( buffer, data, tex_width ) ) {
|
||||
DRM_ERROR( "EFAULT on pad, %d bytes\n",
|
||||
tex_width );
|
||||
return -EFAULT;
|
||||
|
|
@ -1111,7 +1113,7 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
|
|||
}
|
||||
}
|
||||
|
||||
buf->pid = current->pid;
|
||||
buf->pid = pid;
|
||||
buf->used = (dwords + 8) * sizeof(u32);
|
||||
buf_priv->discard = 1;
|
||||
|
||||
|
|
@ -1156,11 +1158,9 @@ static void radeon_cp_dispatch_stipple( drm_device_t *dev, u32 *stipple )
|
|||
* IOCTL functions
|
||||
*/
|
||||
|
||||
int radeon_cp_clear( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_clear( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
drm_radeon_clear_t clear;
|
||||
|
|
@ -1169,16 +1169,15 @@ int radeon_cp_clear( struct inode *inode, struct file *filp,
|
|||
|
||||
LOCK_TEST_WITH_RETURN( dev );
|
||||
|
||||
if ( copy_from_user( &clear, (drm_radeon_clear_t *)arg,
|
||||
sizeof(clear) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( clear, (drm_radeon_clear_t *) data,
|
||||
sizeof(clear) );
|
||||
|
||||
RING_SPACE_TEST_WITH_RETURN( dev_priv );
|
||||
|
||||
if ( sarea_priv->nbox > RADEON_NR_SAREA_CLIPRECTS )
|
||||
sarea_priv->nbox = RADEON_NR_SAREA_CLIPRECTS;
|
||||
|
||||
if ( copy_from_user( &depth_boxes, clear.depth_boxes,
|
||||
if ( DRM_OS_COPYFROMUSR( &depth_boxes, clear.depth_boxes,
|
||||
sarea_priv->nbox * sizeof(depth_boxes[0]) ) )
|
||||
return -EFAULT;
|
||||
|
||||
|
|
@ -1187,11 +1186,9 @@ int radeon_cp_clear( struct inode *inode, struct file *filp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_cp_swap( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_swap( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
|
|
@ -1214,11 +1211,9 @@ int radeon_cp_swap( struct inode *inode, struct file *filp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_cp_vertex( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_vertex( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_device_dma_t *dma = dev->dma;
|
||||
drm_buf_t *buf;
|
||||
|
|
@ -1232,12 +1227,11 @@ int radeon_cp_vertex( struct inode *inode, struct file *filp,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ( copy_from_user( &vertex, (drm_radeon_vertex_t *)arg,
|
||||
sizeof(vertex) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( vertex, (drm_radeon_vertex_t *) data,
|
||||
sizeof(vertex) );
|
||||
|
||||
DRM_DEBUG( "%s: pid=%d index=%d count=%d discard=%d\n",
|
||||
__FUNCTION__, current->pid,
|
||||
__FUNCTION__, DRM_OS_CURRENTPID,
|
||||
vertex.idx, vertex.count, vertex.discard );
|
||||
|
||||
if ( vertex.idx < 0 || vertex.idx >= dma->buf_count ) {
|
||||
|
|
@ -1257,9 +1251,9 @@ int radeon_cp_vertex( struct inode *inode, struct file *filp,
|
|||
buf = dma->buflist[vertex.idx];
|
||||
buf_priv = buf->dev_private;
|
||||
|
||||
if ( buf->pid != current->pid ) {
|
||||
if ( buf->pid != DRM_OS_CURRENTPID ) {
|
||||
DRM_ERROR( "process %d using buffer owned by %d\n",
|
||||
current->pid, buf->pid );
|
||||
DRM_OS_CURRENTPID, buf->pid );
|
||||
return -EINVAL;
|
||||
}
|
||||
if ( buf->pending ) {
|
||||
|
|
@ -1276,11 +1270,9 @@ int radeon_cp_vertex( struct inode *inode, struct file *filp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_cp_indices( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_indices( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_device_dma_t *dma = dev->dma;
|
||||
drm_buf_t *buf;
|
||||
|
|
@ -1295,12 +1287,11 @@ int radeon_cp_indices( struct inode *inode, struct file *filp,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ( copy_from_user( &elts, (drm_radeon_indices_t *)arg,
|
||||
sizeof(elts) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( elts, (drm_radeon_indices_t *) data,
|
||||
sizeof(elts) );
|
||||
|
||||
DRM_DEBUG( "%s: pid=%d index=%d start=%d end=%d discard=%d\n",
|
||||
__FUNCTION__, current->pid,
|
||||
__FUNCTION__, DRM_OS_CURRENTPID,
|
||||
elts.idx, elts.start, elts.end, elts.discard );
|
||||
|
||||
if ( elts.idx < 0 || elts.idx >= dma->buf_count ) {
|
||||
|
|
@ -1320,9 +1311,9 @@ int radeon_cp_indices( struct inode *inode, struct file *filp,
|
|||
buf = dma->buflist[elts.idx];
|
||||
buf_priv = buf->dev_private;
|
||||
|
||||
if ( buf->pid != current->pid ) {
|
||||
if ( buf->pid != DRM_OS_CURRENTPID ) {
|
||||
DRM_ERROR( "process %d using buffer owned by %d\n",
|
||||
current->pid, buf->pid );
|
||||
DRM_OS_CURRENTPID, buf->pid );
|
||||
return -EINVAL;
|
||||
}
|
||||
if ( buf->pending ) {
|
||||
|
|
@ -1351,26 +1342,23 @@ int radeon_cp_indices( struct inode *inode, struct file *filp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_cp_texture( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_texture( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_radeon_texture_t tex;
|
||||
drm_radeon_tex_image_t image;
|
||||
|
||||
LOCK_TEST_WITH_RETURN( dev );
|
||||
|
||||
if ( copy_from_user( &tex, (drm_radeon_texture_t *)arg, sizeof(tex) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( tex, (drm_radeon_texture_t *) data, sizeof(tex) );
|
||||
|
||||
if ( tex.image == NULL ) {
|
||||
DRM_ERROR( "null texture image!\n" );
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ( copy_from_user( &image,
|
||||
if ( DRM_OS_COPYFROMUSR( &image,
|
||||
(drm_radeon_tex_image_t *)tex.image,
|
||||
sizeof(image) ) )
|
||||
return -EFAULT;
|
||||
|
|
@ -1378,25 +1366,22 @@ int radeon_cp_texture( struct inode *inode, struct file *filp,
|
|||
RING_SPACE_TEST_WITH_RETURN( dev_priv );
|
||||
VB_AGE_TEST_WITH_RETURN( dev_priv );
|
||||
|
||||
return radeon_cp_dispatch_texture( dev, &tex, &image );
|
||||
return radeon_cp_dispatch_texture( dev, &tex, &image, DRM_OS_CURRENTPID );
|
||||
}
|
||||
|
||||
int radeon_cp_stipple( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_stipple( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_radeon_stipple_t stipple;
|
||||
u32 mask[32];
|
||||
|
||||
LOCK_TEST_WITH_RETURN( dev );
|
||||
|
||||
if ( copy_from_user( &stipple, (drm_radeon_stipple_t *)arg,
|
||||
sizeof(stipple) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( stipple, (drm_radeon_stipple_t *) data,
|
||||
sizeof(stipple) );
|
||||
|
||||
if ( copy_from_user( &mask, stipple.mask, 32 * sizeof(u32) ) )
|
||||
if ( DRM_OS_COPYFROMUSR( &mask, stipple.mask, 32 * sizeof(u32) ) )
|
||||
return -EFAULT;
|
||||
|
||||
RING_SPACE_TEST_WITH_RETURN( dev_priv );
|
||||
|
|
@ -1406,11 +1391,9 @@ int radeon_cp_stipple( struct inode *inode, struct file *filp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int radeon_cp_indirect( struct inode *inode, struct file *filp,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
int radeon_cp_indirect( DRM_OS_IOCTL )
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
DRM_OS_DEVICE;
|
||||
drm_radeon_private_t *dev_priv = dev->dev_private;
|
||||
drm_device_dma_t *dma = dev->dma;
|
||||
drm_buf_t *buf;
|
||||
|
|
@ -1425,9 +1408,8 @@ int radeon_cp_indirect( struct inode *inode, struct file *filp,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ( copy_from_user( &indirect, (drm_radeon_indirect_t *)arg,
|
||||
sizeof(indirect) ) )
|
||||
return -EFAULT;
|
||||
DRM_OS_KRNFROMUSR( indirect, (drm_radeon_indirect_t *) data,
|
||||
sizeof(indirect) );
|
||||
|
||||
DRM_DEBUG( "indirect: idx=%d s=%d e=%d d=%d\n",
|
||||
indirect.idx, indirect.start,
|
||||
|
|
@ -1442,9 +1424,9 @@ int radeon_cp_indirect( struct inode *inode, struct file *filp,
|
|||
buf = dma->buflist[indirect.idx];
|
||||
buf_priv = buf->dev_private;
|
||||
|
||||
if ( buf->pid != current->pid ) {
|
||||
if ( buf->pid != DRM_OS_CURRENTPID ) {
|
||||
DRM_ERROR( "process %d using buffer owned by %d\n",
|
||||
current->pid, buf->pid );
|
||||
DRM_OS_CURRENTPID, buf->pid );
|
||||
return -EINVAL;
|
||||
}
|
||||
if ( buf->pending ) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue