Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0109fd37
Commit
0109fd37
authored
Jul 09, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge head 'drm-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6
parents
cc14cf46
850eb83a
Changes
25
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
146 additions
and
194 deletions
+146
-194
drivers/char/drm/ati_pcigart.c
drivers/char/drm/ati_pcigart.c
+1
-1
drivers/char/drm/drm.h
drivers/char/drm/drm.h
+2
-0
drivers/char/drm/drmP.h
drivers/char/drm/drmP.h
+7
-23
drivers/char/drm/drm_auth.c
drivers/char/drm/drm_auth.c
+2
-2
drivers/char/drm/drm_bufs.c
drivers/char/drm/drm_bufs.c
+6
-6
drivers/char/drm/drm_context.c
drivers/char/drm/drm_context.c
+2
-2
drivers/char/drm/drm_drv.c
drivers/char/drm/drm_drv.c
+6
-3
drivers/char/drm/drm_fops.c
drivers/char/drm/drm_fops.c
+5
-9
drivers/char/drm/drm_irq.c
drivers/char/drm/drm_irq.c
+1
-1
drivers/char/drm/drm_lock.c
drivers/char/drm/drm_lock.c
+9
-3
drivers/char/drm/drm_memory.c
drivers/char/drm/drm_memory.c
+0
-13
drivers/char/drm/drm_proc.c
drivers/char/drm/drm_proc.c
+1
-1
drivers/char/drm/drm_stub.c
drivers/char/drm/drm_stub.c
+45
-47
drivers/char/drm/drm_vm.c
drivers/char/drm/drm_vm.c
+6
-4
drivers/char/drm/i810_dma.c
drivers/char/drm/i810_dma.c
+12
-12
drivers/char/drm/i810_drv.h
drivers/char/drm/i810_drv.h
+0
-1
drivers/char/drm/i830_dma.c
drivers/char/drm/i830_dma.c
+10
-10
drivers/char/drm/i830_drv.c
drivers/char/drm/i830_drv.c
+1
-1
drivers/char/drm/i830_drv.h
drivers/char/drm/i830_drv.h
+0
-2
drivers/char/drm/i830_irq.c
drivers/char/drm/i830_irq.c
+2
-3
drivers/char/drm/i915_dma.c
drivers/char/drm/i915_dma.c
+24
-36
drivers/char/drm/i915_drv.c
drivers/char/drm/i915_drv.c
+1
-1
drivers/char/drm/i915_drv.h
drivers/char/drm/i915_drv.h
+0
-10
drivers/char/drm/i915_irq.c
drivers/char/drm/i915_irq.c
+2
-2
drivers/char/drm/r128_state.c
drivers/char/drm/r128_state.c
+1
-1
No files found.
drivers/char/drm/ati_pcigart.c
View file @
0109fd37
...
...
@@ -52,7 +52,7 @@
# define ATI_MAX_PCIGART_PAGES 8192
/**< 32 MB aperture, 4K pages */
# define ATI_PCIGART_PAGE_SIZE 4096
/**< PCI GART page size */
unsigned
long
drm_ati_alloc_pcigart_table
(
void
)
static
unsigned
long
drm_ati_alloc_pcigart_table
(
void
)
{
unsigned
long
address
;
struct
page
*
page
;
...
...
drivers/char/drm/drm.h
View file @
0109fd37
...
...
@@ -38,7 +38,9 @@
#define _DRM_H_
#if defined(__linux__)
#if defined(__KERNEL__)
#include <linux/config.h>
#endif
#include <asm/ioctl.h>
/* For _IO* macros */
#define DRM_IOCTL_NR(n) _IOC_NR(n)
#define DRM_IOC_VOID _IOC_NONE
...
...
drivers/char/drm/drmP.h
View file @
0109fd37
...
...
@@ -774,8 +774,6 @@ extern int drm_cpu_valid( void );
/* Driver support (drm_drv.h) */
extern
int
drm_init
(
struct
drm_driver
*
driver
);
extern
void
drm_exit
(
struct
drm_driver
*
driver
);
extern
int
drm_version
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
int
drm_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
long
drm_compat_ioctl
(
struct
file
*
filp
,
...
...
@@ -785,28 +783,19 @@ extern int drm_takedown(drm_device_t * dev);
/* Device support (drm_fops.h) */
extern
int
drm_open
(
struct
inode
*
inode
,
struct
file
*
filp
);
extern
int
drm_stub_open
(
struct
inode
*
inode
,
struct
file
*
filp
);
extern
int
drm_open_helper
(
struct
inode
*
inode
,
struct
file
*
filp
,
drm_device_t
*
dev
);
extern
int
drm_flush
(
struct
file
*
filp
);
extern
int
drm_fasync
(
int
fd
,
struct
file
*
filp
,
int
on
);
extern
int
drm_release
(
struct
inode
*
inode
,
struct
file
*
filp
);
/* Mapping support (drm_vm.h) */
extern
void
drm_vm_open
(
struct
vm_area_struct
*
vma
);
extern
void
drm_vm_close
(
struct
vm_area_struct
*
vma
);
extern
void
drm_vm_shm_close
(
struct
vm_area_struct
*
vma
);
extern
int
drm_mmap_dma
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
);
extern
int
drm_mmap
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
);
extern
unsigned
int
drm_poll
(
struct
file
*
filp
,
struct
poll_table_struct
*
wait
);
extern
ssize_t
drm_read
(
struct
file
*
filp
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
off
);
/* Memory management support (drm_memory.h) */
#include "drm_memory.h"
extern
void
drm_mem_init
(
void
);
extern
int
drm_mem_info
(
char
*
buf
,
char
**
start
,
off_t
offset
,
int
request
,
int
*
eof
,
void
*
data
);
extern
void
*
drm_calloc
(
size_t
nmemb
,
size_t
size
,
int
area
);
extern
void
*
drm_realloc
(
void
*
oldpt
,
size_t
oldsize
,
size_t
size
,
int
area
);
extern
unsigned
long
drm_alloc_pages
(
int
order
,
int
area
);
...
...
@@ -854,9 +843,6 @@ extern int drm_newctx( struct inode *inode, struct file *filp,
extern
int
drm_rmctx
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
int
drm_context_switch
(
drm_device_t
*
dev
,
int
old
,
int
new
);
extern
int
drm_context_switch_complete
(
drm_device_t
*
dev
,
int
new
);
extern
int
drm_ctxbitmap_init
(
drm_device_t
*
dev
);
extern
void
drm_ctxbitmap_cleanup
(
drm_device_t
*
dev
);
extern
void
drm_ctxbitmap_free
(
drm_device_t
*
dev
,
int
ctx_handle
);
...
...
@@ -874,9 +860,6 @@ extern int drm_rmdraw(struct inode *inode, struct file *filp,
/* Authentication IOCTL support (drm_auth.h) */
extern
int
drm_add_magic
(
drm_device_t
*
dev
,
drm_file_t
*
priv
,
drm_magic_t
magic
);
extern
int
drm_remove_magic
(
drm_device_t
*
dev
,
drm_magic_t
magic
);
extern
int
drm_getmagic
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
int
drm_authmagic
(
struct
inode
*
inode
,
struct
file
*
filp
,
...
...
@@ -893,13 +876,9 @@ extern int drm_unlock(struct inode *inode, struct file *filp,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
int
drm_lock_take
(
__volatile__
unsigned
int
*
lock
,
unsigned
int
context
);
extern
int
drm_lock_transfer
(
drm_device_t
*
dev
,
__volatile__
unsigned
int
*
lock
,
unsigned
int
context
);
extern
int
drm_lock_free
(
drm_device_t
*
dev
,
__volatile__
unsigned
int
*
lock
,
unsigned
int
context
);
extern
int
drm_notifier
(
void
*
priv
);
/* Buffer management support (drm_bufs.h) */
extern
int
drm_order
(
unsigned
long
size
);
...
...
@@ -927,7 +906,6 @@ extern void drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp);
/* IRQ support (drm_irq.h) */
extern
int
drm_control
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
int
drm_irq_install
(
drm_device_t
*
dev
);
extern
int
drm_irq_uninstall
(
drm_device_t
*
dev
);
extern
irqreturn_t
drm_irq_handler
(
DRM_IRQ_ARGS
);
extern
void
drm_driver_irq_preinstall
(
drm_device_t
*
dev
);
...
...
@@ -967,7 +945,6 @@ extern int drm_agp_unbind_memory(DRM_AGP_MEM *handle);
extern
int
drm_get_dev
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
,
struct
drm_driver
*
driver
);
extern
int
drm_put_dev
(
drm_device_t
*
dev
);
extern
int
drm_get_head
(
drm_device_t
*
dev
,
drm_head_t
*
head
);
extern
int
drm_put_head
(
drm_head_t
*
head
);
extern
unsigned
int
drm_debug
;
extern
unsigned
int
drm_cards_limit
;
...
...
@@ -1064,9 +1041,16 @@ static __inline__ void drm_free(void *pt, size_t size, int area)
{
kfree
(
pt
);
}
/** Wrapper around kcalloc() */
static
__inline__
void
*
drm_calloc
(
size_t
nmemb
,
size_t
size
,
int
area
)
{
return
kcalloc
(
nmemb
,
size
,
GFP_KERNEL
);
}
#else
extern
void
*
drm_alloc
(
size_t
size
,
int
area
);
extern
void
drm_free
(
void
*
pt
,
size_t
size
,
int
area
);
extern
void
*
drm_calloc
(
size_t
nmemb
,
size_t
size
,
int
area
);
#endif
/*@}*/
...
...
drivers/char/drm/drm_auth.c
View file @
0109fd37
...
...
@@ -87,7 +87,7 @@ static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic)
* associated the magic number hash key in drm_device::magiclist, while holding
* the drm_device::struct_sem lock.
*/
int
drm_add_magic
(
drm_device_t
*
dev
,
drm_file_t
*
priv
,
drm_magic_t
magic
)
static
int
drm_add_magic
(
drm_device_t
*
dev
,
drm_file_t
*
priv
,
drm_magic_t
magic
)
{
int
hash
;
drm_magic_entry_t
*
entry
;
...
...
@@ -124,7 +124,7 @@ int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic)
* Searches and unlinks the entry in drm_device::magiclist with the magic
* number hash key, while holding the drm_device::struct_sem lock.
*/
int
drm_remove_magic
(
drm_device_t
*
dev
,
drm_magic_t
magic
)
static
int
drm_remove_magic
(
drm_device_t
*
dev
,
drm_magic_t
magic
)
{
drm_magic_entry_t
*
prev
=
NULL
;
drm_magic_entry_t
*
pt
;
...
...
drivers/char/drm/drm_bufs.c
View file @
0109fd37
...
...
@@ -356,7 +356,7 @@ static void drm_cleanup_buf_error(drm_device_t *dev, drm_buf_entry_t *entry)
* reallocates the buffer list of the same size order to accommodate the new
* buffers.
*/
int
drm_addbufs_agp
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
drm_addbufs_agp
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
...
...
@@ -521,7 +521,7 @@ int drm_addbufs_agp( struct inode *inode, struct file *filp,
}
#endif
/* __OS_HAS_AGP */
int
drm_addbufs_pci
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
drm_addbufs_pci
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
...
...
@@ -751,7 +751,7 @@ int drm_addbufs_pci( struct inode *inode, struct file *filp,
}
int
drm_addbufs_sg
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
drm_addbufs_sg
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
...
...
drivers/char/drm/drm_context.c
View file @
0109fd37
...
...
@@ -84,7 +84,7 @@ void drm_ctxbitmap_free( drm_device_t *dev, int ctx_handle )
* drm_device::context_sareas to accommodate the new entry while holding the
* drm_device::struct_sem lock.
*/
int
drm_ctxbitmap_next
(
drm_device_t
*
dev
)
static
int
drm_ctxbitmap_next
(
drm_device_t
*
dev
)
{
int
bit
;
...
...
@@ -326,7 +326,7 @@ int drm_context_switch( drm_device_t *dev, int old, int new )
* hardware lock is held, clears the drm_device::context_flag and wakes up
* drm_device::context_wait.
*/
int
drm_context_switch_complete
(
drm_device_t
*
dev
,
int
new
)
static
int
drm_context_switch_complete
(
drm_device_t
*
dev
,
int
new
)
{
dev
->
last_context
=
new
;
/* PRE/POST: This is the _only_ writer. */
dev
->
last_switch
=
jiffies
;
...
...
drivers/char/drm/drm_drv.c
View file @
0109fd37
...
...
@@ -51,8 +51,11 @@
#include "drmP.h"
#include "drm_core.h"
static
int
drm_version
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
);
/** Ioctl table */
drm_ioctl_desc_t
drm_ioctls
[]
=
{
static
drm_ioctl_desc_t
drm_ioctls
[]
=
{
[
DRM_IOCTL_NR
(
DRM_IOCTL_VERSION
)]
=
{
drm_version
,
0
,
0
},
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_UNIQUE
)]
=
{
drm_getunique
,
0
,
0
},
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_MAGIC
)]
=
{
drm_getmagic
,
0
,
0
},
...
...
@@ -447,7 +450,7 @@ module_exit( drm_core_exit );
*
* Fills in the version information in \p arg.
*/
int
drm_version
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
drm_version
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
...
...
drivers/char/drm/drm_fops.c
View file @
0109fd37
...
...
@@ -37,6 +37,8 @@
#include "drmP.h"
#include <linux/poll.h>
static
int
drm_open_helper
(
struct
inode
*
inode
,
struct
file
*
filp
,
drm_device_t
*
dev
);
static
int
drm_setup
(
drm_device_t
*
dev
)
{
int
i
;
...
...
@@ -251,7 +253,7 @@ int drm_release( struct inode *inode, struct file *filp )
}
}
if
(
drm_core_check_feature
(
dev
,
DRIVER_HAVE_DMA
))
if
(
drm_core_check_feature
(
dev
,
DRIVER_HAVE_DMA
)
&&
!
dev
->
driver
->
release
)
{
dev
->
driver
->
reclaim_buffers
(
dev
,
filp
);
}
...
...
@@ -259,7 +261,7 @@ int drm_release( struct inode *inode, struct file *filp )
drm_fasync
(
-
1
,
filp
,
0
);
down
(
&
dev
->
ctxlist_sem
);
if
(
!
list_empty
(
&
dev
->
ctxlist
->
head
)
)
{
if
(
dev
->
ctxlist
&&
(
!
list_empty
(
&
dev
->
ctxlist
->
head
))
)
{
drm_ctx_list_t
*
pos
,
*
n
;
list_for_each_entry_safe
(
pos
,
n
,
&
dev
->
ctxlist
->
head
,
head
)
{
...
...
@@ -341,7 +343,7 @@ EXPORT_SYMBOL(drm_release);
* Creates and initializes a drm_file structure for the file private data in \p
* filp and add it into the double linked list in \p dev.
*/
int
drm_open_helper
(
struct
inode
*
inode
,
struct
file
*
filp
,
drm_device_t
*
dev
)
static
int
drm_open_helper
(
struct
inode
*
inode
,
struct
file
*
filp
,
drm_device_t
*
dev
)
{
int
minor
=
iminor
(
inode
);
drm_file_t
*
priv
;
...
...
@@ -443,9 +445,3 @@ unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait)
}
EXPORT_SYMBOL
(
drm_poll
);
/** No-op. */
ssize_t
drm_read
(
struct
file
*
filp
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
off
)
{
return
0
;
}
drivers/char/drm/drm_irq.c
View file @
0109fd37
...
...
@@ -89,7 +89,7 @@ int drm_irq_by_busid(struct inode *inode, struct file *filp,
* \c drm_driver_irq_preinstall() and \c drm_driver_irq_postinstall() functions
* before and after the installation.
*/
int
drm_irq_install
(
drm_device_t
*
dev
)
static
int
drm_irq_install
(
drm_device_t
*
dev
)
{
int
ret
;
unsigned
long
sh_flags
=
0
;
...
...
drivers/char/drm/drm_lock.c
View file @
0109fd37
...
...
@@ -35,6 +35,11 @@
#include "drmP.h"
static
int
drm_lock_transfer
(
drm_device_t
*
dev
,
__volatile__
unsigned
int
*
lock
,
unsigned
int
context
);
static
int
drm_notifier
(
void
*
priv
);
/**
* Lock ioctl.
*
...
...
@@ -225,8 +230,9 @@ int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context)
* Resets the lock file pointer.
* Marks the lock as held by the given context, via the \p cmpxchg instruction.
*/
int
drm_lock_transfer
(
drm_device_t
*
dev
,
__volatile__
unsigned
int
*
lock
,
unsigned
int
context
)
static
int
drm_lock_transfer
(
drm_device_t
*
dev
,
__volatile__
unsigned
int
*
lock
,
unsigned
int
context
)
{
unsigned
int
old
,
new
,
prev
;
...
...
@@ -282,7 +288,7 @@ int drm_lock_free(drm_device_t *dev,
* \return one if the signal should be delivered normally, or zero if the
* signal should be blocked.
*/
int
drm_notifier
(
void
*
priv
)
static
int
drm_notifier
(
void
*
priv
)
{
drm_sigdata_t
*
s
=
(
drm_sigdata_t
*
)
priv
;
unsigned
int
old
,
new
,
prev
;
...
...
drivers/char/drm/drm_memory.c
View file @
0109fd37
...
...
@@ -65,19 +65,6 @@ int drm_mem_info(char *buf, char **start, off_t offset,
return
0
;
}
/** Wrapper around kmalloc() */
void
*
drm_calloc
(
size_t
nmemb
,
size_t
size
,
int
area
)
{
void
*
addr
;
addr
=
kmalloc
(
size
*
nmemb
,
GFP_KERNEL
);
if
(
addr
!=
NULL
)
memset
((
void
*
)
addr
,
0
,
size
*
nmemb
);
return
addr
;
}
EXPORT_SYMBOL
(
drm_calloc
);
/** Wrapper around kmalloc() and kfree() */
void
*
drm_realloc
(
void
*
oldpt
,
size_t
oldsize
,
size_t
size
,
int
area
)
{
...
...
drivers/char/drm/drm_proc.c
View file @
0109fd37
...
...
@@ -57,7 +57,7 @@ static int drm_vma_info(char *buf, char **start, off_t offset,
/**
* Proc file list.
*/
struct
drm_proc_list
{
st
atic
st
ruct
drm_proc_list
{
const
char
*
name
;
/**< file name */
int
(
*
f
)(
char
*
,
char
**
,
off_t
,
int
,
int
*
,
void
*
);
/**< proc callback*/
}
drm_proc_list
[]
=
{
...
...
drivers/char/drm/drm_stub.c
View file @
0109fd37
...
...
@@ -157,52 +157,6 @@ int drm_stub_open(struct inode *inode, struct file *filp)
return
err
;
}
/**
* Register.
*
* \param pdev - PCI device structure
* \param ent entry from the PCI ID table with device type flags
* \return zero on success or a negative number on failure.
*
* Attempt to gets inter module "drm" information. If we are first
* then register the character device and inter module information.
* Try and register, if we fail to register, backout previous work.
*/
int
drm_get_dev
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
,
struct
drm_driver
*
driver
)
{
drm_device_t
*
dev
;
int
ret
;
DRM_DEBUG
(
"
\n
"
);
dev
=
drm_calloc
(
1
,
sizeof
(
*
dev
),
DRM_MEM_STUB
);
if
(
!
dev
)
return
-
ENOMEM
;
pci_enable_device
(
pdev
);
if
((
ret
=
drm_fill_in_dev
(
dev
,
pdev
,
ent
,
driver
)))
{
printk
(
KERN_ERR
"DRM: Fill_in_dev failed.
\n
"
);
goto
err_g1
;
}
if
((
ret
=
drm_get_head
(
dev
,
&
dev
->
primary
)))
goto
err_g1
;
/* postinit is a required function to display the signon banner */
/* drivers add secondary heads here if needed */
if
((
ret
=
dev
->
driver
->
postinit
(
dev
,
ent
->
driver_data
)))
goto
err_g1
;
return
0
;
err_g1:
drm_free
(
dev
,
sizeof
(
*
dev
),
DRM_MEM_STUB
);
return
ret
;
}
EXPORT_SYMBOL
(
drm_get_dev
);
/**
* Get a secondary minor number.
*
...
...
@@ -214,7 +168,7 @@ EXPORT_SYMBOL(drm_get_dev);
* create the proc init entry via proc_init(). This routines assigns
* minor numbers to secondary heads of multi-headed cards
*/
int
drm_get_head
(
drm_device_t
*
dev
,
drm_head_t
*
head
)
static
int
drm_get_head
(
drm_device_t
*
dev
,
drm_head_t
*
head
)
{
drm_head_t
**
heads
=
drm_heads
;
int
ret
;
...
...
@@ -262,6 +216,50 @@ int drm_get_head(drm_device_t *dev, drm_head_t *head)
return
ret
;
}
/**
* Register.
*
* \param pdev - PCI device structure
* \param ent entry from the PCI ID table with device type flags
* \return zero on success or a negative number on failure.
*
* Attempt to gets inter module "drm" information. If we are first
* then register the character device and inter module information.
* Try and register, if we fail to register, backout previous work.
*/
int
drm_get_dev
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
,
struct
drm_driver
*
driver
)
{
drm_device_t
*
dev
;
int
ret
;
DRM_DEBUG
(
"
\n
"
);
dev
=
drm_calloc
(
1
,
sizeof
(
*
dev
),
DRM_MEM_STUB
);
if
(
!
dev
)
return
-
ENOMEM
;
pci_enable_device
(
pdev
);
if
((
ret
=
drm_fill_in_dev
(
dev
,
pdev
,
ent
,
driver
)))
{
printk
(
KERN_ERR
"DRM: Fill_in_dev failed.
\n
"
);
goto
err_g1
;
}
if
((
ret
=
drm_get_head
(
dev
,
&
dev
->
primary
)))
goto
err_g1
;
/* postinit is a required function to display the signon banner */
/* drivers add secondary heads here if needed */
if
((
ret
=
dev
->
driver
->
postinit
(
dev
,
ent
->
driver_data
)))
goto
err_g1
;
return
0
;
err_g1:
drm_free
(
dev
,
sizeof
(
*
dev
),
DRM_MEM_STUB
);
return
ret
;
}
EXPORT_SYMBOL
(
drm_get_dev
);
/**
* Put a device minor number.
...
...
drivers/char/drm/drm_vm.c
View file @
0109fd37
...
...
@@ -38,6 +38,8 @@
#include <linux/efi.h>
#endif
static
void
drm_vm_open
(
struct
vm_area_struct
*
vma
);
static
void
drm_vm_close
(
struct
vm_area_struct
*
vma
);
/**
* \c nopage method for AGP virtual memory.
...
...
@@ -163,7 +165,7 @@ static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma,
* Deletes map information if we are the last
* person to close a mapping and it's not in the global maplist.
*/
void
drm_vm_shm_close
(
struct
vm_area_struct
*
vma
)
static
void
drm_vm_shm_close
(
struct
vm_area_struct
*
vma
)
{
drm_file_t
*
priv
=
vma
->
vm_file
->
private_data
;
drm_device_t
*
dev
=
priv
->
head
->
dev
;
...
...
@@ -399,7 +401,7 @@ static struct vm_operations_struct drm_vm_sg_ops = {
* Create a new drm_vma_entry structure as the \p vma private data entry and
* add it to drm_device::vmalist.
*/
void
drm_vm_open
(
struct
vm_area_struct
*
vma
)
static
void
drm_vm_open
(
struct
vm_area_struct
*
vma
)
{
drm_file_t
*
priv
=
vma
->
vm_file
->
private_data
;
drm_device_t
*
dev
=
priv
->
head
->
dev
;
...
...
@@ -428,7 +430,7 @@ void drm_vm_open(struct vm_area_struct *vma)
* Search the \p vma private data entry in drm_device::vmalist, unlink it, and
* free it.
*/
void
drm_vm_close
(
struct
vm_area_struct
*
vma
)
static
void
drm_vm_close
(
struct
vm_area_struct
*
vma
)
{
drm_file_t
*
priv
=
vma
->
vm_file
->
private_data
;
drm_device_t
*
dev
=
priv
->
head
->
dev
;
...
...
@@ -463,7 +465,7 @@ void drm_vm_close(struct vm_area_struct *vma)
* Sets the virtual memory area operations structure to vm_dma_ops, the file
* pointer, and calls vm_open().
*/
int
drm_mmap_dma
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
)
static
int
drm_mmap_dma
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
drm_device_t
*
dev
;
...
...
drivers/char/drm/i810_dma.c
View file @
0109fd37
...
...
@@ -90,16 +90,7 @@ static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf)
return
0
;
}
static
struct
file_operations
i810_buffer_fops
=
{
.
open
=
drm_open
,
.
flush
=
drm_flush
,
.
release
=
drm_release
,
.
ioctl
=
drm_ioctl
,
.
mmap
=
i810_mmap_buffers
,
.
fasync
=
drm_fasync
,
};
int
i810_mmap_buffers
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
)
static
int
i810_mmap_buffers
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
drm_device_t
*
dev
;
...
...
@@ -126,6 +117,15 @@ int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
return
0
;
}
static
struct
file_operations
i810_buffer_fops
=
{
.
open
=
drm_open
,
.
flush
=
drm_flush
,
.
release
=
drm_release
,
.
ioctl
=
drm_ioctl
,
.
mmap
=
i810_mmap_buffers
,
.
fasync
=
drm_fasync
,
};
static
int
i810_map_buffer
(
drm_buf_t
*
buf
,
struct
file
*
filp
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
...
...
@@ -1003,7 +1003,7 @@ void i810_reclaim_buffers(drm_device_t *dev, struct file *filp)
}
}
int
i810_flush_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
i810_flush_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
...
...
drivers/char/drm/i810_drv.h
View file @
0109fd37
...
...
@@ -115,7 +115,6 @@ typedef struct drm_i810_private {
/* i810_dma.c */
extern
void
i810_reclaim_buffers
(
drm_device_t
*
dev
,
struct
file
*
filp
);
extern
int
i810_mmap_buffers
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
);
extern
int
i810_driver_dma_quiescent
(
drm_device_t
*
dev
);
extern
void
i810_driver_release
(
drm_device_t
*
dev
,
struct
file
*
filp
);
...
...
drivers/char/drm/i830_dma.c
View file @
0109fd37
...
...
@@ -92,16 +92,7 @@ static int i830_freelist_put(drm_device_t *dev, drm_buf_t *buf)
return
0
;
}
static
struct
file_operations
i830_buffer_fops
=
{
.
open
=
drm_open
,
.
flush
=
drm_flush
,
.
release
=
drm_release
,
.
ioctl
=
drm_ioctl
,
.
mmap
=
i830_mmap_buffers
,
.
fasync
=
drm_fasync
,
};
int
i830_mmap_buffers
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
)
static
int
i830_mmap_buffers
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
drm_device_t
*
dev
;
...
...
@@ -128,6 +119,15 @@ int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
return
0
;
}
static
struct
file_operations
i830_buffer_fops
=
{
.
open
=
drm_open
,
.
flush
=
drm_flush
,
.
release
=
drm_release
,
.
ioctl
=
drm_ioctl
,
.
mmap
=
i830_mmap_buffers
,
.
fasync
=
drm_fasync
,
};
static
int
i830_map_buffer
(
drm_buf_t
*
buf
,
struct
file
*
filp
)
{
drm_file_t
*
priv
=
filp
->
private_data
;
...
...
drivers/char/drm/i830_drv.c
View file @
0109fd37
...
...
@@ -40,7 +40,7 @@
#include "drm_pciids.h"
int
postinit
(
struct
drm_device
*
dev
,
unsigned
long
flags
)
static
int
postinit
(
struct
drm_device
*
dev
,
unsigned
long
flags
)
{
dev
->
counters
+=
4
;
dev
->
types
[
6
]
=
_DRM_STAT_IRQ
;
...
...
drivers/char/drm/i830_drv.h
View file @
0109fd37
...
...
@@ -123,8 +123,6 @@ typedef struct drm_i830_private {
/* i830_dma.c */
extern
void
i830_reclaim_buffers
(
drm_device_t
*
dev
,
struct
file
*
filp
);
extern
int
i830_mmap_buffers
(
struct
file
*
filp
,
struct
vm_area_struct
*
vma
);
/* i830_irq.c */
extern
int
i830_irq_emit
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
);
...
...
drivers/char/drm/i830_irq.c
View file @
0109fd37
...
...
@@ -54,8 +54,7 @@ irqreturn_t i830_driver_irq_handler( DRM_IRQ_ARGS )
return
IRQ_HANDLED
;
}
int
i830_emit_irq
(
drm_device_t
*
dev
)
static
int
i830_emit_irq
(
drm_device_t
*
dev
)
{
drm_i830_private_t
*
dev_priv
=
dev
->
dev_private
;
RING_LOCALS
;
...
...
@@ -73,7 +72,7 @@ int i830_emit_irq(drm_device_t *dev)
}
int
i830_wait_irq
(
drm_device_t
*
dev
,
int
irq_nr
)
static
int
i830_wait_irq
(
drm_device_t
*
dev
,
int
irq_nr
)
{
drm_i830_private_t
*
dev_priv
=
(
drm_i830_private_t
*
)
dev
->
dev_private
;
...
...
drivers/char/drm/i915_dma.c
View file @
0109fd37
...
...
@@ -32,23 +32,6 @@
#include "i915_drm.h"
#include "i915_drv.h"
drm_ioctl_desc_t
i915_ioctls
[]
=
{
[
DRM_IOCTL_NR
(
DRM_I915_INIT
)]
=
{
i915_dma_init
,
1
,
1
},
[
DRM_IOCTL_NR
(
DRM_I915_FLUSH
)]
=
{
i915_flush_ioctl
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_FLIP
)]
=
{
i915_flip_bufs
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_BATCHBUFFER
)]
=
{
i915_batchbuffer
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_IRQ_EMIT
)]
=
{
i915_irq_emit
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_IRQ_WAIT
)]
=
{
i915_irq_wait
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_GETPARAM
)]
=
{
i915_getparam
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_SETPARAM
)]
=
{
i915_setparam
,
1
,
1
},
[
DRM_IOCTL_NR
(
DRM_I915_ALLOC
)]
=
{
i915_mem_alloc
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_FREE
)]
=
{
i915_mem_free
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_INIT_HEAP
)]
=
{
i915_mem_init_heap
,
1
,
1
},
[
DRM_IOCTL_NR
(
DRM_I915_CMDBUFFER
)]
=
{
i915_cmdbuffer
,
1
,
0
}
};
int
i915_max_ioctl
=
DRM_ARRAY_SIZE
(
i915_ioctls
);
/* Really want an OS-independent resettable timer. Would like to have
* this loop run for (eg) 3 sec, but have the timer reset every time
* the head pointer changes, so that EBUSY only happens if the ring
...
...
@@ -95,7 +78,7 @@ void i915_kernel_lost_context(drm_device_t * dev)
dev_priv
->
sarea_priv
->
perf_boxes
|=
I915_BOX_RING_EMPTY
;
}
int
i915_dma_cleanup
(
drm_device_t
*
dev
)
static
int
i915_dma_cleanup
(
drm_device_t
*
dev
)
{
/* Make sure interrupts are disabled here because the uninstall ioctl
* may not have been called from userspace and after dev_private
...
...
@@ -247,7 +230,7 @@ static int i915_resume(drm_device_t * dev)
return
0
;
}
int
i915_dma_init
(
DRM_IOCTL_ARGS
)
static
int
i915_dma_init
(
DRM_IOCTL_ARGS
)
{
DRM_DEVICE
;
drm_i915_private_t
*
dev_priv
;
...
...
@@ -558,7 +541,7 @@ static int i915_quiescent(drm_device_t * dev)
return
i915_wait_ring
(
dev
,
dev_priv
->
ring
.
Size
-
8
,
__FUNCTION__
);
}
int
i915_flush_ioctl
(
DRM_IOCTL_ARGS
)
static
int
i915_flush_ioctl
(
DRM_IOCTL_ARGS
)
{
DRM_DEVICE
;
...
...
@@ -567,7 +550,7 @@ int i915_flush_ioctl(DRM_IOCTL_ARGS)
return
i915_quiescent
(
dev
);
}
int
i915_batchbuffer
(
DRM_IOCTL_ARGS
)
static
int
i915_batchbuffer
(
DRM_IOCTL_ARGS
)
{
DRM_DEVICE
;
drm_i915_private_t
*
dev_priv
=
(
drm_i915_private_t
*
)
dev
->
dev_private
;
...
...
@@ -601,7 +584,7 @@ int i915_batchbuffer(DRM_IOCTL_ARGS)
return
ret
;
}
int
i915_cmdbuffer
(
DRM_IOCTL_ARGS
)
static
int
i915_cmdbuffer
(
DRM_IOCTL_ARGS
)
{
DRM_DEVICE
;
drm_i915_private_t
*
dev_priv
=
(
drm_i915_private_t
*
)
dev
->
dev_private
;
...
...
@@ -637,18 +620,7 @@ int i915_cmdbuffer(DRM_IOCTL_ARGS)
return
0
;
}
int
i915_do_cleanup_pageflip
(
drm_device_t
*
dev
)
{
drm_i915_private_t
*
dev_priv
=
dev
->
dev_private
;
DRM_DEBUG
(
"%s
\n
"
,
__FUNCTION__
);
if
(
dev_priv
->
current_page
!=
0
)
i915_dispatch_flip
(
dev
);
return
0
;
}
int
i915_flip_bufs
(
DRM_IOCTL_ARGS
)
static
int
i915_flip_bufs
(
DRM_IOCTL_ARGS
)
{
DRM_DEVICE
;
...
...
@@ -659,7 +631,7 @@ int i915_flip_bufs(DRM_IOCTL_ARGS)
return
i915_dispatch_flip
(
dev
);
}
int
i915_getparam
(
DRM_IOCTL_ARGS
)
static
int
i915_getparam
(
DRM_IOCTL_ARGS
)
{
DRM_DEVICE
;
drm_i915_private_t
*
dev_priv
=
dev
->
dev_private
;
...
...
@@ -694,7 +666,7 @@ int i915_getparam(DRM_IOCTL_ARGS)
return
0
;
}
int
i915_setparam
(
DRM_IOCTL_ARGS
)
static
int
i915_setparam
(
DRM_IOCTL_ARGS
)
{
DRM_DEVICE
;
drm_i915_private_t
*
dev_priv
=
dev
->
dev_private
;
...
...
@@ -743,3 +715,19 @@ void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp)
}
}
drm_ioctl_desc_t
i915_ioctls
[]
=
{
[
DRM_IOCTL_NR
(
DRM_I915_INIT
)]
=
{
i915_dma_init
,
1
,
1
},
[
DRM_IOCTL_NR
(
DRM_I915_FLUSH
)]
=
{
i915_flush_ioctl
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_FLIP
)]
=
{
i915_flip_bufs
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_BATCHBUFFER
)]
=
{
i915_batchbuffer
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_IRQ_EMIT
)]
=
{
i915_irq_emit
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_IRQ_WAIT
)]
=
{
i915_irq_wait
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_GETPARAM
)]
=
{
i915_getparam
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_SETPARAM
)]
=
{
i915_setparam
,
1
,
1
},
[
DRM_IOCTL_NR
(
DRM_I915_ALLOC
)]
=
{
i915_mem_alloc
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_FREE
)]
=
{
i915_mem_free
,
1
,
0
},
[
DRM_IOCTL_NR
(
DRM_I915_INIT_HEAP
)]
=
{
i915_mem_init_heap
,
1
,
1
},
[
DRM_IOCTL_NR
(
DRM_I915_CMDBUFFER
)]
=
{
i915_cmdbuffer
,
1
,
0
}
};
int
i915_max_ioctl
=
DRM_ARRAY_SIZE
(
i915_ioctls
);
drivers/char/drm/i915_drv.c
View file @
0109fd37
...
...
@@ -34,7 +34,7 @@
#include "drm_pciids.h"
int
postinit
(
struct
drm_device
*
dev
,
unsigned
long
flags
)
static
int
postinit
(
struct
drm_device
*
dev
,
unsigned
long
flags
)
{
dev
->
counters
+=
4
;
dev
->
types
[
6
]
=
_DRM_STAT_IRQ
;
...
...
drivers/char/drm/i915_drv.h
View file @
0109fd37
...
...
@@ -99,14 +99,6 @@ typedef struct drm_i915_private {
}
drm_i915_private_t
;
/* i915_dma.c */
extern
int
i915_dma_init
(
DRM_IOCTL_ARGS
);
extern
int
i915_dma_cleanup
(
drm_device_t
*
dev
);
extern
int
i915_flush_ioctl
(
DRM_IOCTL_ARGS
);
extern
int
i915_batchbuffer
(
DRM_IOCTL_ARGS
);
extern
int
i915_flip_bufs
(
DRM_IOCTL_ARGS
);
extern
int
i915_getparam
(
DRM_IOCTL_ARGS
);
extern
int
i915_setparam
(
DRM_IOCTL_ARGS
);
extern
int
i915_cmdbuffer
(
DRM_IOCTL_ARGS
);
extern
void
i915_kernel_lost_context
(
drm_device_t
*
dev
);
extern
void
i915_driver_pretakedown
(
drm_device_t
*
dev
);
extern
void
i915_driver_prerelease
(
drm_device_t
*
dev
,
DRMFILE
filp
);
...
...
@@ -114,8 +106,6 @@ extern void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp);
/* i915_irq.c */
extern
int
i915_irq_emit
(
DRM_IOCTL_ARGS
);
extern
int
i915_irq_wait
(
DRM_IOCTL_ARGS
);
extern
int
i915_wait_irq
(
drm_device_t
*
dev
,
int
irq_nr
);
extern
int
i915_emit_irq
(
drm_device_t
*
dev
);
extern
irqreturn_t
i915_driver_irq_handler
(
DRM_IRQ_ARGS
);
extern
void
i915_driver_irq_preinstall
(
drm_device_t
*
dev
);
...
...
drivers/char/drm/i915_irq.c
View file @
0109fd37
...
...
@@ -56,7 +56,7 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
return
IRQ_HANDLED
;
}
int
i915_emit_irq
(
drm_device_t
*
dev
)
static
int
i915_emit_irq
(
drm_device_t
*
dev
)
{
drm_i915_private_t
*
dev_priv
=
dev
->
dev_private
;
u32
ret
;
...
...
@@ -76,7 +76,7 @@ int i915_emit_irq(drm_device_t * dev)
return
ret
;
}
int
i915_wait_irq
(
drm_device_t
*
dev
,
int
irq_nr
)
static
int
i915_wait_irq
(
drm_device_t
*
dev
,
int
irq_nr
)
{
drm_i915_private_t
*
dev_priv
=
(
drm_i915_private_t
*
)
dev
->
dev_private
;
int
ret
=
0
;
...
...
drivers/char/drm/r128_state.c
View file @
0109fd37
...
...
@@ -1307,7 +1307,7 @@ static int r128_do_init_pageflip( drm_device_t *dev )
return
0
;
}
int
r128_do_cleanup_pageflip
(
drm_device_t
*
dev
)
static
int
r128_do_cleanup_pageflip
(
drm_device_t
*
dev
)
{
drm_r128_private_t
*
dev_priv
=
dev
->
dev_private
;
DRM_DEBUG
(
"
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment