mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-07 05:18:16 +02:00
fix up linux compilation fix r128 driver - now works on FreeBSD
This commit is contained in:
parent
a3fc50047e
commit
0242f24caa
12 changed files with 20 additions and 22 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# $FreeBSD$
|
||||
|
||||
SUBDIR = tdfx mga # radeon gamma r128 radeon i810 sis
|
||||
SUBDIR = tdfx mga r128 # radeon gamma radeon i810 sis
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#endif
|
||||
|
||||
#define __REALLY_HAVE_MTRR 0
|
||||
#define __REALLY_HAVE_SG 0
|
||||
|
||||
#if __REALLY_HAVE_AGP
|
||||
#include <pci/agpvar.h>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# $FreeBSD$
|
||||
|
||||
SUBDIR = tdfx mga # radeon gamma r128 radeon i810 sis
|
||||
SUBDIR = tdfx mga r128 # radeon gamma radeon i810 sis
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# $FreeBSD$
|
||||
|
||||
SUBDIR = tdfx mga # radeon gamma r128 radeon i810 sis
|
||||
SUBDIR = tdfx mga r128 # radeon gamma radeon i810 sis
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#endif
|
||||
|
||||
#define __REALLY_HAVE_MTRR 0
|
||||
#define __REALLY_HAVE_SG 0
|
||||
|
||||
#if __REALLY_HAVE_AGP
|
||||
#include <pci/agpvar.h>
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@ int DRM(addbufs_pci)( DRM_OS_IOCTL )
|
|||
}
|
||||
#endif /* __HAVE_PCI_DMA */
|
||||
|
||||
#ifdef __HAVE_SG
|
||||
#if __REALLY_HAVE_SG
|
||||
int DRM(addbufs_sg)( DRM_OS_IOCTL )
|
||||
{
|
||||
DRM_OS_DEVICE;
|
||||
|
|
@ -848,7 +848,7 @@ int DRM(addbufs_sg)( DRM_OS_IOCTL )
|
|||
atomic_dec( &dev->buf_alloc );
|
||||
return 0;
|
||||
}
|
||||
#endif /* __HAVE_SG */
|
||||
#endif /* __REALLY_HAVE_SG */
|
||||
|
||||
int DRM(addbufs)( DRM_OS_IOCTL )
|
||||
{
|
||||
|
|
@ -866,7 +866,7 @@ int DRM(addbufs)( DRM_OS_IOCTL )
|
|||
#endif
|
||||
else
|
||||
#endif
|
||||
#if __HAVE_SG
|
||||
#if __REALLY_HAVE_SG
|
||||
if ( request.flags & _DRM_SG_BUFFER )
|
||||
#ifdef __linux__
|
||||
return DRM(addbufs_sg)( inode, filp, cmd, data );
|
||||
|
|
|
|||
|
|
@ -81,9 +81,6 @@
|
|||
#ifndef __HAVE_COUNTERS
|
||||
#define __HAVE_COUNTERS 0
|
||||
#endif
|
||||
#ifndef __HAVE_SG
|
||||
#define __HAVE_SG 0
|
||||
#endif
|
||||
|
||||
#ifndef DRIVER_PREINIT
|
||||
#define DRIVER_PREINIT()
|
||||
|
|
@ -208,7 +205,7 @@ static drm_ioctl_desc_t DRM(ioctls)[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = { DRM(agp_unbind), 1, 1 },
|
||||
#endif
|
||||
|
||||
#if __HAVE_SG
|
||||
#if __REALLY_HAVE_SG
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_SG_ALLOC)] = { DRM(sg_alloc), 1, 1 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_SG_FREE)] = { DRM(sg_free), 1, 1 },
|
||||
#endif
|
||||
|
|
@ -561,10 +558,10 @@ static int DRM(takedown)( drm_device_t *dev )
|
|||
*/
|
||||
break;
|
||||
case _DRM_SCATTER_GATHER:
|
||||
/* Handle it, but do nothing, if HAVE_SG
|
||||
/* Handle it, but do nothing, if REALLY_HAVE_SG
|
||||
* isn't defined.
|
||||
*/
|
||||
#if __HAVE_SG
|
||||
#if __REALLY_HAVE_SG
|
||||
if(dev->sg) {
|
||||
DRM(sg_cleanup)(dev->sg);
|
||||
dev->sg = NULL;
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@ do { \
|
|||
|
||||
#define __REALLY_HAVE_AGP (__HAVE_AGP && (defined(CONFIG_AGP) || \
|
||||
defined(CONFIG_AGP_MODULE)))
|
||||
#define __REALLY_HAVE_SG (__HAVE_SG)
|
||||
#define __REALLY_HAVE_MTRR (__HAVE_MTRR && defined(CONFIG_MTRR))
|
||||
|
||||
#define DRM_OS_LOCK up(&dev->struct_sem)
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@ int DRM(addbufs_pci)( DRM_OS_IOCTL )
|
|||
}
|
||||
#endif /* __HAVE_PCI_DMA */
|
||||
|
||||
#ifdef __HAVE_SG
|
||||
#if __REALLY_HAVE_SG
|
||||
int DRM(addbufs_sg)( DRM_OS_IOCTL )
|
||||
{
|
||||
DRM_OS_DEVICE;
|
||||
|
|
@ -848,7 +848,7 @@ int DRM(addbufs_sg)( DRM_OS_IOCTL )
|
|||
atomic_dec( &dev->buf_alloc );
|
||||
return 0;
|
||||
}
|
||||
#endif /* __HAVE_SG */
|
||||
#endif /* __REALLY_HAVE_SG */
|
||||
|
||||
int DRM(addbufs)( DRM_OS_IOCTL )
|
||||
{
|
||||
|
|
@ -866,7 +866,7 @@ int DRM(addbufs)( DRM_OS_IOCTL )
|
|||
#endif
|
||||
else
|
||||
#endif
|
||||
#if __HAVE_SG
|
||||
#if __REALLY_HAVE_SG
|
||||
if ( request.flags & _DRM_SG_BUFFER )
|
||||
#ifdef __linux__
|
||||
return DRM(addbufs_sg)( inode, filp, cmd, data );
|
||||
|
|
|
|||
|
|
@ -81,9 +81,6 @@
|
|||
#ifndef __HAVE_COUNTERS
|
||||
#define __HAVE_COUNTERS 0
|
||||
#endif
|
||||
#ifndef __HAVE_SG
|
||||
#define __HAVE_SG 0
|
||||
#endif
|
||||
|
||||
#ifndef DRIVER_PREINIT
|
||||
#define DRIVER_PREINIT()
|
||||
|
|
@ -208,7 +205,7 @@ static drm_ioctl_desc_t DRM(ioctls)[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = { DRM(agp_unbind), 1, 1 },
|
||||
#endif
|
||||
|
||||
#if __HAVE_SG
|
||||
#if __REALLY_HAVE_SG
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_SG_ALLOC)] = { DRM(sg_alloc), 1, 1 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_SG_FREE)] = { DRM(sg_free), 1, 1 },
|
||||
#endif
|
||||
|
|
@ -561,10 +558,10 @@ static int DRM(takedown)( drm_device_t *dev )
|
|||
*/
|
||||
break;
|
||||
case _DRM_SCATTER_GATHER:
|
||||
/* Handle it, but do nothing, if HAVE_SG
|
||||
/* Handle it, but do nothing, if REALLY_HAVE_SG
|
||||
* isn't defined.
|
||||
*/
|
||||
#if __HAVE_SG
|
||||
#if __REALLY_HAVE_SG
|
||||
if(dev->sg) {
|
||||
DRM(sg_cleanup)(dev->sg);
|
||||
dev->sg = NULL;
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@ do { \
|
|||
|
||||
#define __REALLY_HAVE_AGP (__HAVE_AGP && (defined(CONFIG_AGP) || \
|
||||
defined(CONFIG_AGP_MODULE)))
|
||||
#define __REALLY_HAVE_SG (__HAVE_SG)
|
||||
#define __REALLY_HAVE_MTRR (__HAVE_MTRR && defined(CONFIG_MTRR))
|
||||
|
||||
#define DRM_OS_LOCK up(&dev->struct_sem)
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ static void r128_cce_init_ring_buffer( drm_device_t *dev )
|
|||
SET_RING_HEAD( &dev_priv->ring, 0 );
|
||||
|
||||
#if __REALLY_HAVE_SG
|
||||
#define DRM_OS_VTOPHYS(x) vtophys(x)
|
||||
/* #define DRM_OS_VTOPHYS(x) vtophys(x) */
|
||||
#define DRM_OS_VTOPHYS(x) virt_to_bus(x)
|
||||
|
||||
if ( !dev_priv->is_pci ) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue