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
nexedi
linux
Commits
db400b3c
Commit
db400b3c
authored
Sep 07, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'drm-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6
parents
0dd7f883
908f9c48
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
37 deletions
+46
-37
drivers/char/drm/drm_bufs.c
drivers/char/drm/drm_bufs.c
+33
-33
drivers/char/drm/drm_context.c
drivers/char/drm/drm_context.c
+1
-1
drivers/char/drm/drm_sysfs.c
drivers/char/drm/drm_sysfs.c
+1
-0
drivers/char/drm/mga_dma.c
drivers/char/drm/mga_dma.c
+11
-3
No files found.
drivers/char/drm/drm_bufs.c
View file @
db400b3c
...
@@ -48,8 +48,8 @@ unsigned long drm_get_resource_len(drm_device_t *dev, unsigned int resource)
...
@@ -48,8 +48,8 @@ unsigned long drm_get_resource_len(drm_device_t *dev, unsigned int resource)
}
}
EXPORT_SYMBOL
(
drm_get_resource_len
);
EXPORT_SYMBOL
(
drm_get_resource_len
);
static
drm_
local_map
_t
*
drm_find_matching_map
(
drm_device_t
*
dev
,
static
drm_
map_list
_t
*
drm_find_matching_map
(
drm_device_t
*
dev
,
drm_local_map_t
*
map
)
drm_local_map_t
*
map
)
{
{
struct
list_head
*
list
;
struct
list_head
*
list
;
...
@@ -57,7 +57,7 @@ static drm_local_map_t *drm_find_matching_map(drm_device_t *dev,
...
@@ -57,7 +57,7 @@ static drm_local_map_t *drm_find_matching_map(drm_device_t *dev,
drm_map_list_t
*
entry
=
list_entry
(
list
,
drm_map_list_t
,
head
);
drm_map_list_t
*
entry
=
list_entry
(
list
,
drm_map_list_t
,
head
);
if
(
entry
->
map
&&
map
->
type
==
entry
->
map
->
type
&&
if
(
entry
->
map
&&
map
->
type
==
entry
->
map
->
type
&&
entry
->
map
->
offset
==
map
->
offset
)
{
entry
->
map
->
offset
==
map
->
offset
)
{
return
entry
->
map
;
return
entry
;
}
}
}
}
...
@@ -114,14 +114,13 @@ static __inline__ unsigned int HandleID(unsigned long lhandle, drm_device_t *dev
...
@@ -114,14 +114,13 @@ static __inline__ unsigned int HandleID(unsigned long lhandle, drm_device_t *dev
* type. Adds the map to the map list drm_device::maplist. Adds MTRR's where
* type. Adds the map to the map list drm_device::maplist. Adds MTRR's where
* applicable and if supported by the kernel.
* applicable and if supported by the kernel.
*/
*/
int
drm_addmap
(
drm_device_t
*
dev
,
unsigned
int
offset
,
int
drm_addmap
_core
(
drm_device_t
*
dev
,
unsigned
int
offset
,
unsigned
int
size
,
drm_map_type_t
type
,
unsigned
int
size
,
drm_map_type_t
type
,
drm_map_flags_t
flags
,
drm_local_map_t
**
map_ptr
)
drm_map_flags_t
flags
,
drm_map_list_t
**
maplist
)
{
{
drm_map_t
*
map
;
drm_map_t
*
map
;
drm_map_list_t
*
list
;
drm_map_list_t
*
list
;
drm_dma_handle_t
*
dmah
;
drm_dma_handle_t
*
dmah
;
drm_local_map_t
*
found_map
;
map
=
drm_alloc
(
sizeof
(
*
map
),
DRM_MEM_MAPS
);
map
=
drm_alloc
(
sizeof
(
*
map
),
DRM_MEM_MAPS
);
if
(
!
map
)
if
(
!
map
)
...
@@ -166,17 +165,17 @@ int drm_addmap(drm_device_t * dev, unsigned int offset,
...
@@ -166,17 +165,17 @@ int drm_addmap(drm_device_t * dev, unsigned int offset,
* needing to be aware of it. Therefore, we just return success
* needing to be aware of it. Therefore, we just return success
* when the server tries to create a duplicate map.
* when the server tries to create a duplicate map.
*/
*/
found_map
=
drm_find_matching_map
(
dev
,
map
);
list
=
drm_find_matching_map
(
dev
,
map
);
if
(
found_map
!=
NULL
)
{
if
(
list
!=
NULL
)
{
if
(
found_
map
->
size
!=
map
->
size
)
{
if
(
list
->
map
->
size
!=
map
->
size
)
{
DRM_DEBUG
(
"Matching maps of type %d with "
DRM_DEBUG
(
"Matching maps of type %d with "
"mismatched sizes, (%ld vs %ld)
\n
"
,
"mismatched sizes, (%ld vs %ld)
\n
"
,
map
->
type
,
map
->
size
,
found_
map
->
size
);
map
->
type
,
map
->
size
,
list
->
map
->
size
);
found_
map
->
size
=
map
->
size
;
list
->
map
->
size
=
map
->
size
;
}
}
drm_free
(
map
,
sizeof
(
*
map
),
DRM_MEM_MAPS
);
drm_free
(
map
,
sizeof
(
*
map
),
DRM_MEM_MAPS
);
*
map
_ptr
=
found_map
;
*
map
list
=
list
;
return
0
;
return
0
;
}
}
...
@@ -264,9 +263,22 @@ int drm_addmap(drm_device_t * dev, unsigned int offset,
...
@@ -264,9 +263,22 @@ int drm_addmap(drm_device_t * dev, unsigned int offset,
:
map
->
offset
,
dev
);
:
map
->
offset
,
dev
);
up
(
&
dev
->
struct_sem
);
up
(
&
dev
->
struct_sem
);
*
map
_ptr
=
map
;
*
map
list
=
list
;
return
0
;
return
0
;
}
}
int
drm_addmap
(
drm_device_t
*
dev
,
unsigned
int
offset
,
unsigned
int
size
,
drm_map_type_t
type
,
drm_map_flags_t
flags
,
drm_local_map_t
**
map_ptr
)
{
drm_map_list_t
*
list
;
int
rc
;
rc
=
drm_addmap_core
(
dev
,
offset
,
size
,
type
,
flags
,
&
list
);
if
(
!
rc
)
*
map_ptr
=
list
->
map
;
return
rc
;
}
EXPORT_SYMBOL
(
drm_addmap
);
EXPORT_SYMBOL
(
drm_addmap
);
int
drm_addmap_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
int
drm_addmap_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
...
@@ -275,10 +287,9 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
...
@@ -275,10 +287,9 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
drm_file_t
*
priv
=
filp
->
private_data
;
drm_file_t
*
priv
=
filp
->
private_data
;
drm_device_t
*
dev
=
priv
->
head
->
dev
;
drm_device_t
*
dev
=
priv
->
head
->
dev
;
drm_map_t
map
;
drm_map_t
map
;
drm_map_
t
*
map_ptr
;
drm_map_
list_t
*
maplist
;
drm_map_t
__user
*
argp
=
(
void
__user
*
)
arg
;
drm_map_t
__user
*
argp
=
(
void
__user
*
)
arg
;
int
err
;
int
err
;
unsigned
long
handle
=
0
;
if
(
!
(
filp
->
f_mode
&
3
))
if
(
!
(
filp
->
f_mode
&
3
))
return
-
EACCES
;
/* Require read/write */
return
-
EACCES
;
/* Require read/write */
...
@@ -287,26 +298,15 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
...
@@ -287,26 +298,15 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
return
-
EFAULT
;
return
-
EFAULT
;
}
}
err
=
drm_addmap
(
dev
,
map
.
offset
,
map
.
size
,
map
.
type
,
map
.
flags
,
err
=
drm_addmap
_core
(
dev
,
map
.
offset
,
map
.
size
,
map
.
type
,
map
.
flags
,
&
map_ptr
);
&
maplist
);
if
(
err
)
{
if
(
err
)
return
err
;
return
err
;
}
{
drm_map_list_t
*
_entry
;
list_for_each_entry
(
_entry
,
&
dev
->
maplist
->
head
,
head
)
{
if
(
_entry
->
map
==
map_ptr
)
handle
=
_entry
->
user_token
;
}
if
(
!
handle
)
return
-
EFAULT
;
}
if
(
copy_to_user
(
argp
,
map
_ptr
,
sizeof
(
*
map_ptr
)))
if
(
copy_to_user
(
argp
,
map
list
->
map
,
sizeof
(
drm_map_t
)))
return
-
EFAULT
;
return
-
EFAULT
;
if
(
put_user
(
handle
,
&
argp
->
handle
))
if
(
put_user
(
maplist
->
user_token
,
&
argp
->
handle
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
}
}
...
@@ -1041,7 +1041,7 @@ static int drm_addbufs_sg(drm_device_t *dev, drm_buf_desc_t *request)
...
@@ -1041,7 +1041,7 @@ static int drm_addbufs_sg(drm_device_t *dev, drm_buf_desc_t *request)
return
0
;
return
0
;
}
}
int
drm_addbufs_fb
(
drm_device_t
*
dev
,
drm_buf_desc_t
*
request
)
static
int
drm_addbufs_fb
(
drm_device_t
*
dev
,
drm_buf_desc_t
*
request
)
{
{
drm_device_dma_t
*
dma
=
dev
->
dma
;
drm_device_dma_t
*
dma
=
dev
->
dma
;
drm_buf_entry_t
*
entry
;
drm_buf_entry_t
*
entry
;
...
...
drivers/char/drm/drm_context.c
View file @
db400b3c
...
@@ -308,7 +308,7 @@ int drm_setsareactx(struct inode *inode, struct file *filp,
...
@@ -308,7 +308,7 @@ int drm_setsareactx(struct inode *inode, struct file *filp,
*
*
* Attempt to set drm_device::context_flag.
* Attempt to set drm_device::context_flag.
*/
*/
int
drm_context_switch
(
drm_device_t
*
dev
,
int
old
,
int
new
)
static
int
drm_context_switch
(
drm_device_t
*
dev
,
int
old
,
int
new
)
{
{
if
(
test_and_set_bit
(
0
,
&
dev
->
context_flag
)
)
{
if
(
test_and_set_bit
(
0
,
&
dev
->
context_flag
)
)
{
DRM_ERROR
(
"Reentering -- FIXME
\n
"
);
DRM_ERROR
(
"Reentering -- FIXME
\n
"
);
...
...
drivers/char/drm/drm_sysfs.c
View file @
db400b3c
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <linux/err.h>
#include <linux/err.h>
#include "drm_core.h"
#include "drm_core.h"
#include "drmP.h"
struct
drm_sysfs_class
{
struct
drm_sysfs_class
{
struct
class_device_attribute
attr
;
struct
class_device_attribute
attr
;
...
...
drivers/char/drm/mga_dma.c
View file @
db400b3c
...
@@ -417,6 +417,7 @@ int mga_driver_preinit(drm_device_t *dev, unsigned long flags)
...
@@ -417,6 +417,7 @@ int mga_driver_preinit(drm_device_t *dev, unsigned long flags)
return
0
;
return
0
;
}
}
#if __OS_HAS_AGP
/**
/**
* Bootstrap the driver for AGP DMA.
* Bootstrap the driver for AGP DMA.
*
*
...
@@ -560,6 +561,13 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev,
...
@@ -560,6 +561,13 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev,
DRM_INFO
(
"Initialized card for AGP DMA.
\n
"
);
DRM_INFO
(
"Initialized card for AGP DMA.
\n
"
);
return
0
;
return
0
;
}
}
#else
static
int
mga_do_agp_dma_bootstrap
(
drm_device_t
*
dev
,
drm_mga_dma_bootstrap_t
*
dma_bs
)
{
return
-
EINVAL
;
}
#endif
/**
/**
* Bootstrap the driver for PCI DMA.
* Bootstrap the driver for PCI DMA.
...
@@ -697,7 +705,6 @@ static int mga_do_dma_bootstrap(drm_device_t * dev,
...
@@ -697,7 +705,6 @@ static int mga_do_dma_bootstrap(drm_device_t * dev,
* carve off portions of it for internal uses. The remaining memory
* carve off portions of it for internal uses. The remaining memory
* is returned to user-mode to be used for AGP textures.
* is returned to user-mode to be used for AGP textures.
*/
*/
if
(
is_agp
)
{
if
(
is_agp
)
{
err
=
mga_do_agp_dma_bootstrap
(
dev
,
dma_bs
);
err
=
mga_do_agp_dma_bootstrap
(
dev
,
dma_bs
);
}
}
...
@@ -932,6 +939,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
...
@@ -932,6 +939,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
drm_core_ioremapfree
(
dev
->
agp_buffer_map
,
dev
);
drm_core_ioremapfree
(
dev
->
agp_buffer_map
,
dev
);
if
(
dev_priv
->
used_new_dma_init
)
{
if
(
dev_priv
->
used_new_dma_init
)
{
#if __OS_HAS_AGP
if
(
dev_priv
->
agp_mem
!=
NULL
)
{
if
(
dev_priv
->
agp_mem
!=
NULL
)
{
dev_priv
->
agp_textures
=
NULL
;
dev_priv
->
agp_textures
=
NULL
;
drm_unbind_agp
(
dev_priv
->
agp_mem
);
drm_unbind_agp
(
dev_priv
->
agp_mem
);
...
@@ -944,7 +952,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
...
@@ -944,7 +952,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
if
((
dev
->
agp
!=
NULL
)
&&
dev
->
agp
->
acquired
)
{
if
((
dev
->
agp
!=
NULL
)
&&
dev
->
agp
->
acquired
)
{
err
=
drm_agp_release
(
dev
);
err
=
drm_agp_release
(
dev
);
}
}
#endif
dev_priv
->
used_new_dma_init
=
0
;
dev_priv
->
used_new_dma_init
=
0
;
}
}
...
@@ -965,7 +973,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
...
@@ -965,7 +973,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
}
}
}
}
return
0
;
return
err
;
}
}
int
mga_dma_init
(
DRM_IOCTL_ARGS
)
int
mga_dma_init
(
DRM_IOCTL_ARGS
)
...
...
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