From 55bea952b326b88f2fa6502321f605f96ee9be66 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 26 Aug 2005 00:16:01 +0000 Subject: [1] Fix BSD DRM for the nonroot changes. [2] Don't attempt to acquire the DMA lock in a non-DMA driver, as it will be uninitialized. Submitted by: [1] jkim (minor changes by me) --- bsd-core/drmP.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 7e16fe66..d5907355 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -229,7 +229,8 @@ enum { int flags, DRM_STRUCTPROC *p, DRMFILE filp #define PAGE_ALIGN(addr) round_page(addr) -#define DRM_SUSER(p) suser(p) +/* DRM_SUSER returns true if the user is superuser */ +#define DRM_SUSER(p) (suser(p) == 0) #define DRM_AGP_FIND_DEVICE() agp_find_device() #define DRM_MTRR_WC MDF_WRITECOMBINE #define jiffies ticks @@ -249,7 +250,8 @@ enum { #define CDEV_MAJOR 34 #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) -#define DRM_SUSER(p) suser(p->p_ucred, &p->p_acflag) +/* DRM_SUSER returns true if the user is superuser */ +#define DRM_SUSER(p) (suser(p->p_ucred, &p->p_acflag) == 0) #define DRM_AGP_FIND_DEVICE() agp_find_device(0) #define DRM_MTRR_WC MTRR_TYPE_WC #define jiffies hardclock_ticks @@ -524,6 +526,7 @@ typedef TAILQ_HEAD(drm_file_list, drm_file) drm_file_list_t; struct drm_file { TAILQ_ENTRY(drm_file) link; int authenticated; + int master; int minor; pid_t pid; uid_t uid; @@ -585,6 +588,7 @@ typedef struct drm_agp_head { typedef struct drm_sg_mem { unsigned long handle; + void *virtual; int pages; dma_addr_t *busaddr; drm_dma_handle_t *dmah; /* Handle to PCI memory for ATI PCIGART table */ -- cgit v1.2.3