Skip to content

Commit 37ef439

Browse files
author
Linus Torvalds
committed
Merge branch 'drm-forlinus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
2 parents bf785ee + 9c7d462 commit 37ef439

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2794
-1812
lines changed

drivers/char/drm/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
44

55
drm-objs := drm_auth.o drm_bufs.o drm_context.o drm_dma.o drm_drawable.o \
6-
drm_drv.o drm_fops.o drm_init.o drm_ioctl.o drm_irq.o \
6+
drm_drv.o drm_fops.o drm_ioctl.o drm_irq.o \
77
drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \
88
drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \
99
drm_sysfs.o
@@ -18,7 +18,7 @@ radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o
1818
ffb-objs := ffb_drv.o ffb_context.o
1919
sis-objs := sis_drv.o sis_ds.o sis_mm.o
2020
savage-objs := savage_drv.o savage_bci.o savage_state.o
21-
via-objs := via_irq.o via_drv.o via_ds.o via_map.o via_mm.o via_dma.o via_verifier.o via_video.o
21+
via-objs := via_irq.o via_drv.o via_ds.o via_map.o via_mm.o via_dma.o via_verifier.o via_video.o via_dmablit.o
2222

2323
ifeq ($(CONFIG_COMPAT),y)
2424
drm-objs += drm_ioc32.o

drivers/char/drm/ati_pcigart.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# define ATI_MAX_PCIGART_PAGES 8192 /**< 32 MB aperture, 4K pages */
5353
# define ATI_PCIGART_PAGE_SIZE 4096 /**< PCI GART page size */
5454

55-
static unsigned long drm_ati_alloc_pcigart_table(void)
55+
static void *drm_ati_alloc_pcigart_table(void)
5656
{
5757
unsigned long address;
5858
struct page *page;
@@ -72,27 +72,26 @@ static unsigned long drm_ati_alloc_pcigart_table(void)
7272
}
7373

7474
DRM_DEBUG("%s: returning 0x%08lx\n", __FUNCTION__, address);
75-
return address;
75+
return (void *)address;
7676
}
7777

78-
static void drm_ati_free_pcigart_table(unsigned long address)
78+
static void drm_ati_free_pcigart_table(void *address)
7979
{
8080
struct page *page;
8181
int i;
8282
DRM_DEBUG("%s\n", __FUNCTION__);
8383

84-
page = virt_to_page(address);
84+
page = virt_to_page((unsigned long)address);
8585

8686
for (i = 0; i < ATI_PCIGART_TABLE_PAGES; i++, page++) {
8787
__put_page(page);
8888
ClearPageReserved(page);
8989
}
9090

91-
free_pages(address, ATI_PCIGART_TABLE_ORDER);
91+
free_pages((unsigned long)address, ATI_PCIGART_TABLE_ORDER);
9292
}
9393

94-
int drm_ati_pcigart_cleanup(drm_device_t * dev,
95-
drm_ati_pcigart_info * gart_info)
94+
int drm_ati_pcigart_cleanup(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
9695
{
9796
drm_sg_mem_t *entry = dev->sg;
9897
unsigned long pages;
@@ -136,10 +135,10 @@ int drm_ati_pcigart_cleanup(drm_device_t * dev,
136135

137136
EXPORT_SYMBOL(drm_ati_pcigart_cleanup);
138137

139-
int drm_ati_pcigart_init(drm_device_t * dev, drm_ati_pcigart_info * gart_info)
138+
int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
140139
{
141140
drm_sg_mem_t *entry = dev->sg;
142-
unsigned long address = 0;
141+
void *address = NULL;
143142
unsigned long pages;
144143
u32 *pci_gart, page_base, bus_address = 0;
145144
int i, j, ret = 0;
@@ -163,7 +162,7 @@ int drm_ati_pcigart_init(drm_device_t * dev, drm_ati_pcigart_info * gart_info)
163162
goto done;
164163
}
165164

166-
bus_address = pci_map_single(dev->pdev, (void *)address,
165+
bus_address = pci_map_single(dev->pdev, address,
167166
ATI_PCIGART_TABLE_PAGES *
168167
PAGE_SIZE, PCI_DMA_TODEVICE);
169168
if (bus_address == 0) {
@@ -176,7 +175,7 @@ int drm_ati_pcigart_init(drm_device_t * dev, drm_ati_pcigart_info * gart_info)
176175
address = gart_info->addr;
177176
bus_address = gart_info->bus_addr;
178177
DRM_DEBUG("PCI: Gart Table: VRAM %08X mapped at %08lX\n",
179-
bus_address, address);
178+
bus_address, (unsigned long)address);
180179
}
181180

182181
pci_gart = (u32 *) address;
@@ -195,7 +194,7 @@ int drm_ati_pcigart_init(drm_device_t * dev, drm_ati_pcigart_info * gart_info)
195194
if (entry->busaddr[i] == 0) {
196195
DRM_ERROR("unable to map PCIGART pages!\n");
197196
drm_ati_pcigart_cleanup(dev, gart_info);
198-
address = 0;
197+
address = NULL;
199198
bus_address = 0;
200199
goto done;
201200
}

drivers/char/drm/drm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */
9191
#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */
9292

93-
#define _DRM_LOCK_HELD 0x80000000 /**< Hardware lock is held */
94-
#define _DRM_LOCK_CONT 0x40000000 /**< Hardware lock is contended */
93+
#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */
94+
#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */
9595
#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD)
9696
#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
9797
#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))

drivers/char/drm/drmP.h

Lines changed: 72 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,6 @@
144144
/** \name Backward compatibility section */
145145
/*@{*/
146146

147-
#ifndef MODULE_LICENSE
148-
#define MODULE_LICENSE(x)
149-
#endif
150-
151-
#ifndef preempt_disable
152-
#define preempt_disable()
153-
#define preempt_enable()
154-
#endif
155-
156-
#ifndef pte_offset_map
157-
#define pte_offset_map pte_offset
158-
#define pte_unmap(pte)
159-
#endif
160-
161147
#define DRM_RPR_ARG(vma) vma,
162148

163149
#define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT)
@@ -286,10 +272,13 @@ typedef int drm_ioctl_t(struct inode *inode, struct file *filp,
286272
typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
287273
unsigned long arg);
288274

275+
#define DRM_AUTH 0x1
276+
#define DRM_MASTER 0x2
277+
#define DRM_ROOT_ONLY 0x4
278+
289279
typedef struct drm_ioctl_desc {
290280
drm_ioctl_t *func;
291-
int auth_needed;
292-
int root_only;
281+
int flags;
293282
} drm_ioctl_desc_t;
294283

295284
typedef struct drm_devstate {
@@ -384,6 +373,7 @@ typedef struct drm_buf_entry {
384373
/** File private data */
385374
typedef struct drm_file {
386375
int authenticated;
376+
int master;
387377
int minor;
388378
pid_t pid;
389379
uid_t uid;
@@ -532,8 +522,9 @@ typedef struct drm_vbl_sig {
532522
typedef struct ati_pcigart_info {
533523
int gart_table_location;
534524
int is_pcie;
535-
unsigned long addr;
525+
void *addr;
536526
dma_addr_t bus_addr;
527+
drm_local_map_t mapping;
537528
} drm_ati_pcigart_info;
538529

539530
/**
@@ -544,25 +535,24 @@ typedef struct ati_pcigart_info {
544535
struct drm_device;
545536

546537
struct drm_driver {
547-
int (*preinit) (struct drm_device *, unsigned long flags);
548-
void (*prerelease) (struct drm_device *, struct file * filp);
549-
void (*pretakedown) (struct drm_device *);
550-
int (*postcleanup) (struct drm_device *);
551-
int (*presetup) (struct drm_device *);
552-
int (*postsetup) (struct drm_device *);
538+
int (*load) (struct drm_device *, unsigned long flags);
539+
int (*firstopen) (struct drm_device *);
540+
int (*open) (struct drm_device *, drm_file_t *);
541+
void (*preclose) (struct drm_device *, struct file * filp);
542+
void (*postclose) (struct drm_device *, drm_file_t *);
543+
void (*lastclose) (struct drm_device *);
544+
int (*unload) (struct drm_device *);
553545
int (*dma_ioctl) (DRM_IOCTL_ARGS);
554-
int (*open_helper) (struct drm_device *, drm_file_t *);
555-
void (*free_filp_priv) (struct drm_device *, drm_file_t *);
556-
void (*release) (struct drm_device *, struct file * filp);
557546
void (*dma_ready) (struct drm_device *);
558547
int (*dma_quiescent) (struct drm_device *);
559548
int (*context_ctor) (struct drm_device * dev, int context);
560549
int (*context_dtor) (struct drm_device * dev, int context);
561550
int (*kernel_context_switch) (struct drm_device * dev, int old,
562551
int new);
563552
void (*kernel_context_switch_unlock) (struct drm_device * dev,
564-
drm_lock_t * lock);
553+
drm_lock_t *lock);
565554
int (*vblank_wait) (struct drm_device * dev, unsigned int *sequence);
555+
int (*dri_library_name) (struct drm_device *dev, char *buf);
566556

567557
/**
568558
* Called by \c drm_device_is_agp. Typically used to determine if a
@@ -579,16 +569,24 @@ struct drm_driver {
579569

580570
/* these have to be filled in */
581571

582-
int (*postinit) (struct drm_device *, unsigned long flags);
583-
irqreturn_t(*irq_handler) (DRM_IRQ_ARGS);
572+
irqreturn_t(*irq_handler) (DRM_IRQ_ARGS);
584573
void (*irq_preinstall) (struct drm_device * dev);
585574
void (*irq_postinstall) (struct drm_device * dev);
586575
void (*irq_uninstall) (struct drm_device * dev);
587576
void (*reclaim_buffers) (struct drm_device * dev, struct file * filp);
577+
void (*reclaim_buffers_locked) (struct drm_device *dev,
578+
struct file *filp);
588579
unsigned long (*get_map_ofs) (drm_map_t * map);
589580
unsigned long (*get_reg_ofs) (struct drm_device * dev);
590581
void (*set_version) (struct drm_device * dev, drm_set_version_t * sv);
591-
int (*version) (drm_version_t * version);
582+
583+
int major;
584+
int minor;
585+
int patchlevel;
586+
char *name;
587+
char *desc;
588+
char *date;
589+
592590
u32 driver_features;
593591
int dev_priv_size;
594592
drm_ioctl_desc_t *ioctls;
@@ -752,32 +750,55 @@ static inline int drm_core_has_MTRR(struct drm_device *dev)
752750
{
753751
return drm_core_check_feature(dev, DRIVER_USE_MTRR);
754752
}
753+
754+
#define DRM_MTRR_WC MTRR_TYPE_WRCOMB
755+
756+
static inline int drm_mtrr_add(unsigned long offset, unsigned long size,
757+
unsigned int flags)
758+
{
759+
return mtrr_add(offset, size, flags, 1);
760+
}
761+
762+
static inline int drm_mtrr_del(int handle, unsigned long offset,
763+
unsigned long size, unsigned int flags)
764+
{
765+
return mtrr_del(handle, offset, size);
766+
}
767+
755768
#else
756769
#define drm_core_has_MTRR(dev) (0)
770+
771+
#define DRM_MTRR_WC 0
772+
773+
static inline int drm_mtrr_add(unsigned long offset, unsigned long size,
774+
unsigned int flags)
775+
{
776+
return 0;
777+
}
778+
779+
static inline int drm_mtrr_del(int handle, unsigned long offset,
780+
unsigned long size, unsigned int flags)
781+
{
782+
return 0;
783+
}
757784
#endif
758785

759786
/******************************************************************/
760787
/** \name Internal function definitions */
761788
/*@{*/
762789

763-
/* Misc. support (drm_init.h) */
764-
extern int drm_flags;
765-
extern void drm_parse_options(char *s);
766-
extern int drm_cpu_valid(void);
767-
768790
/* Driver support (drm_drv.h) */
769791
extern int drm_init(struct drm_driver *driver);
770792
extern void drm_exit(struct drm_driver *driver);
771793
extern int drm_ioctl(struct inode *inode, struct file *filp,
772794
unsigned int cmd, unsigned long arg);
773795
extern long drm_compat_ioctl(struct file *filp,
774796
unsigned int cmd, unsigned long arg);
775-
extern int drm_takedown(drm_device_t * dev);
797+
extern int drm_lastclose(drm_device_t *dev);
776798

777799
/* Device support (drm_fops.h) */
778800
extern int drm_open(struct inode *inode, struct file *filp);
779801
extern int drm_stub_open(struct inode *inode, struct file *filp);
780-
extern int drm_flush(struct file *filp);
781802
extern int drm_fasync(int fd, struct file *filp, int on);
782803
extern int drm_release(struct inode *inode, struct file *filp);
783804

@@ -819,6 +840,8 @@ extern int drm_getstats(struct inode *inode, struct file *filp,
819840
unsigned int cmd, unsigned long arg);
820841
extern int drm_setversion(struct inode *inode, struct file *filp,
821842
unsigned int cmd, unsigned long arg);
843+
extern int drm_noop(struct inode *inode, struct file *filp,
844+
unsigned int cmd, unsigned long arg);
822845

823846
/* Context IOCTL support (drm_context.h) */
824847
extern int drm_resctx(struct inode *inode, struct file *filp,
@@ -857,10 +880,6 @@ extern int drm_getmagic(struct inode *inode, struct file *filp,
857880
extern int drm_authmagic(struct inode *inode, struct file *filp,
858881
unsigned int cmd, unsigned long arg);
859882

860-
/* Placeholder for ioctls past */
861-
extern int drm_noop(struct inode *inode, struct file *filp,
862-
unsigned int cmd, unsigned long arg);
863-
864883
/* Locking IOCTL support (drm_lock.h) */
865884
extern int drm_lock(struct inode *inode, struct file *filp,
866885
unsigned int cmd, unsigned long arg);
@@ -873,6 +892,7 @@ extern int drm_lock_free(drm_device_t * dev,
873892
/* Buffer management support (drm_bufs.h) */
874893
extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request);
875894
extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request);
895+
extern int drm_addbufs_fb(drm_device_t *dev, drm_buf_desc_t *request);
876896
extern int drm_addmap(drm_device_t * dev, unsigned int offset,
877897
unsigned int size, drm_map_type_t type,
878898
drm_map_flags_t flags, drm_local_map_t ** map_ptr);
@@ -908,8 +928,8 @@ extern void drm_core_reclaim_buffers(drm_device_t * dev, struct file *filp);
908928
/* IRQ support (drm_irq.h) */
909929
extern int drm_control(struct inode *inode, struct file *filp,
910930
unsigned int cmd, unsigned long arg);
911-
extern int drm_irq_uninstall(drm_device_t * dev);
912931
extern irqreturn_t drm_irq_handler(DRM_IRQ_ARGS);
932+
extern int drm_irq_uninstall(drm_device_t * dev);
913933
extern void drm_driver_irq_preinstall(drm_device_t * dev);
914934
extern void drm_driver_irq_postinstall(drm_device_t * dev);
915935
extern void drm_driver_irq_uninstall(drm_device_t * dev);
@@ -933,13 +953,17 @@ extern int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
933953
extern int drm_agp_info(drm_device_t * dev, drm_agp_info_t * info);
934954
extern int drm_agp_info_ioctl(struct inode *inode, struct file *filp,
935955
unsigned int cmd, unsigned long arg);
936-
extern int drm_agp_alloc(struct inode *inode, struct file *filp,
956+
extern int drm_agp_alloc(drm_device_t *dev, drm_agp_buffer_t *request);
957+
extern int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp,
937958
unsigned int cmd, unsigned long arg);
938-
extern int drm_agp_free(struct inode *inode, struct file *filp,
959+
extern int drm_agp_free(drm_device_t *dev, drm_agp_buffer_t *request);
960+
extern int drm_agp_free_ioctl(struct inode *inode, struct file *filp,
939961
unsigned int cmd, unsigned long arg);
940-
extern int drm_agp_unbind(struct inode *inode, struct file *filp,
962+
extern int drm_agp_unbind(drm_device_t *dev, drm_agp_binding_t *request);
963+
extern int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp,
941964
unsigned int cmd, unsigned long arg);
942-
extern int drm_agp_bind(struct inode *inode, struct file *filp,
965+
extern int drm_agp_bind(drm_device_t *dev, drm_agp_binding_t *request);
966+
extern int drm_agp_bind_ioctl(struct inode *inode, struct file *filp,
943967
unsigned int cmd, unsigned long arg);
944968
extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge,
945969
size_t pages, u32 type);
@@ -991,10 +1015,8 @@ extern struct drm_sysfs_class *drm_sysfs_create(struct module *owner,
9911015
char *name);
9921016
extern void drm_sysfs_destroy(struct drm_sysfs_class *cs);
9931017
extern struct class_device *drm_sysfs_device_add(struct drm_sysfs_class *cs,
994-
dev_t dev,
995-
struct device *device,
996-
const char *fmt, ...);
997-
extern void drm_sysfs_device_remove(dev_t dev);
1018+
drm_head_t *head);
1019+
extern void drm_sysfs_device_remove(struct class_device *class_dev);
9981020

9991021
/* Inline replacements for DRM_IOREMAP macros */
10001022
static __inline__ void drm_core_ioremap(struct drm_map *map,

0 commit comments

Comments
 (0)