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
c652fecc
Commit
c652fecc
authored
Oct 28, 2004
by
Dave Airlie
Browse files
Options
Browse Files
Download
Plain Diff
Merge starflyer.(none):/home/airlied/bitkeeper/linux-2.5
into starflyer.(none):/home/airlied/bitkeeper/drm-2.6
parents
29f1caa9
e47234d3
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
90 deletions
+90
-90
drivers/char/drm/drmP.h
drivers/char/drm/drmP.h
+20
-2
drivers/char/drm/drm_irq.h
drivers/char/drm/drm_irq.h
+2
-2
drivers/char/drm/drm_memory.h
drivers/char/drm/drm_memory.h
+3
-17
drivers/char/drm/drm_memory_debug.h
drivers/char/drm/drm_memory_debug.h
+1
-1
drivers/char/drm/drm_os_linux.h
drivers/char/drm/drm_os_linux.h
+0
-5
drivers/char/drm/i915_mem.c
drivers/char/drm/i915_mem.c
+10
-10
drivers/char/drm/r128_state.c
drivers/char/drm/r128_state.c
+42
-42
drivers/char/drm/radeon_mem.c
drivers/char/drm/radeon_mem.c
+10
-10
drivers/char/drm/radeon_state.c
drivers/char/drm/radeon_state.c
+2
-1
No files found.
drivers/char/drm/drmP.h
View file @
c652fecc
...
...
@@ -34,6 +34,8 @@
#ifndef _DRM_P_H_
#define _DRM_P_H_
/* If you want the memory alloc debug functionality, change define below */
/* #define DEBUG_MEMORY */
#ifdef __KERNEL__
#ifdef __alpha__
...
...
@@ -765,11 +767,9 @@ extern ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count
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
(
alloc
)(
size_t
size
,
int
area
);
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
void
DRM
(
free
)(
void
*
pt
,
size_t
size
,
int
area
);
extern
unsigned
long
DRM
(
alloc_pages
)(
int
order
,
int
area
);
extern
void
DRM
(
free_pages
)(
unsigned
long
address
,
int
order
,
int
area
);
...
...
@@ -984,6 +984,24 @@ static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsig
static
__inline__
void
drm_core_dropmap
(
struct
drm_map
*
map
)
{
}
#ifndef DEBUG_MEMORY
/** Wrapper around kmalloc() */
static
__inline__
void
*
DRM
(
alloc
)(
size_t
size
,
int
area
)
{
return
kmalloc
(
size
,
GFP_KERNEL
);
}
/** Wrapper around kfree() */
static
__inline__
void
DRM
(
free
)(
void
*
pt
,
size_t
size
,
int
area
)
{
kfree
(
pt
);
}
#else
extern
void
*
DRM
(
alloc
)(
size_t
size
,
int
area
);
extern
void
DRM
(
free
)(
void
*
pt
,
size_t
size
,
int
area
);
#endif
/*@}*/
extern
unsigned
long
DRM
(
core_get_map_ofs
)(
drm_map_t
*
map
);
...
...
drivers/char/drm/drm_irq.h
View file @
c652fecc
...
...
@@ -300,7 +300,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
spin_unlock_irqrestore
(
&
dev
->
vbl_lock
,
irqflags
);
if
(
!
(
vbl_sig
=
DRM
_MALLOC
(
sizeof
(
drm_vbl_sig_t
)
)
)
)
{
if
(
!
(
vbl_sig
=
DRM
(
alloc
)(
sizeof
(
drm_vbl_sig_t
),
DRM_MEM_DRIVER
)
)
)
{
return
-
ENOMEM
;
}
...
...
@@ -356,7 +356,7 @@ void DRM(vbl_send_signals)( drm_device_t *dev )
list_del
(
list
);
DRM
_FREE
(
vbl_sig
,
sizeof
(
*
vbl_sig
)
);
DRM
(
free
)(
vbl_sig
,
sizeof
(
*
vbl_sig
),
DRM_MEM_DRIVER
);
dev
->
vbl_pending
--
;
}
...
...
drivers/char/drm/drm_memory.h
View file @
c652fecc
...
...
@@ -39,10 +39,8 @@
/**
* Cut down version of drm_memory_debug.h, which used to be called
* drm_memory.h. If you want the debug functionality, change 0 to 1
* below.
* drm_memory.h.
*/
#define DEBUG_MEMORY 0
#if __OS_HAS_AGP
...
...
@@ -197,7 +195,7 @@ static inline void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *d
}
#if DEBUG_MEMORY
#if
def
DEBUG_MEMORY
#include "drm_memory_debug.h"
#else
...
...
@@ -226,13 +224,7 @@ int DRM(mem_info)(char *buf, char **start, off_t offset,
}
/** Wrapper around kmalloc() */
void
*
DRM
(
alloc
)(
size_t
size
,
int
area
)
{
return
kmalloc
(
size
,
GFP_KERNEL
);
}
/** Wrapper around kmalloc() */
void
*
DRM
(
calloc
)(
size_t
size
,
size_t
nmemb
,
int
area
)
void
*
DRM
(
calloc
)(
size_t
nmemb
,
size_t
size
,
int
area
)
{
void
*
addr
;
...
...
@@ -256,12 +248,6 @@ void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size, int area)
return
pt
;
}
/** Wrapper around kfree() */
void
DRM
(
free
)(
void
*
pt
,
size_t
size
,
int
area
)
{
kfree
(
pt
);
}
/**
* Allocate pages.
*
...
...
drivers/char/drm/drm_memory_debug.h
View file @
c652fecc
...
...
@@ -167,7 +167,7 @@ void *DRM(alloc)(size_t size, int area)
return
pt
;
}
void
*
DRM
(
calloc
)(
size_t
size
,
size_t
nmemb
,
int
area
)
void
*
DRM
(
calloc
)(
size_t
nmemb
,
size_t
size
,
int
area
)
{
void
*
addr
;
...
...
drivers/char/drm/drm_os_linux.h
View file @
c652fecc
...
...
@@ -100,11 +100,6 @@ static __inline__ int mtrr_del (int reg, unsigned long base,
__put_user(val, uaddr)
/** 'malloc' without the overhead of DRM(alloc)() */
#define DRM_MALLOC(x) kmalloc(x, GFP_KERNEL)
/** 'free' without the overhead of DRM(free)() */
#define DRM_FREE(x,size) kfree(x)
#define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) _priv = _filp->private_data
/**
...
...
drivers/char/drm/i915_mem.c
View file @
c652fecc
...
...
@@ -75,7 +75,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
{
/* Maybe cut off the start of an existing block */
if
(
start
>
p
->
start
)
{
struct
mem_block
*
newblock
=
DRM
_MALLOC
(
sizeof
(
*
newblock
)
);
struct
mem_block
*
newblock
=
DRM
(
alloc
)(
sizeof
(
*
newblock
),
DRM_MEM_BUFLISTS
);
if
(
!
newblock
)
goto
out
;
newblock
->
start
=
start
;
...
...
@@ -91,7 +91,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
/* Maybe cut off the end of an existing block */
if
(
size
<
p
->
size
)
{
struct
mem_block
*
newblock
=
DRM
_MALLOC
(
sizeof
(
*
newblock
)
);
struct
mem_block
*
newblock
=
DRM
(
alloc
)(
sizeof
(
*
newblock
),
DRM_MEM_BUFLISTS
);
if
(
!
newblock
)
goto
out
;
newblock
->
start
=
start
+
size
;
...
...
@@ -148,7 +148,7 @@ static void free_block(struct mem_block *p)
p
->
size
+=
q
->
size
;
p
->
next
=
q
->
next
;
p
->
next
->
prev
=
p
;
DRM
_FREE
(
q
,
sizeof
(
*
q
)
);
DRM
(
free
)(
q
,
sizeof
(
*
q
),
DRM_MEM_BUFLISTS
);
}
if
(
p
->
prev
->
filp
==
NULL
)
{
...
...
@@ -156,7 +156,7 @@ static void free_block(struct mem_block *p)
q
->
size
+=
p
->
size
;
q
->
next
=
p
->
next
;
q
->
next
->
prev
=
q
;
DRM
_FREE
(
p
,
sizeof
(
*
q
)
);
DRM
(
free
)(
p
,
sizeof
(
*
q
),
DRM_MEM_BUFLISTS
);
}
}
...
...
@@ -164,14 +164,14 @@ static void free_block(struct mem_block *p)
*/
static
int
init_heap
(
struct
mem_block
**
heap
,
int
start
,
int
size
)
{
struct
mem_block
*
blocks
=
DRM
_MALLOC
(
sizeof
(
*
blocks
)
);
struct
mem_block
*
blocks
=
DRM
(
alloc
)(
sizeof
(
*
blocks
),
DRM_MEM_BUFLISTS
);
if
(
!
blocks
)
return
-
ENOMEM
;
*
heap
=
DRM
_MALLOC
(
sizeof
(
**
heap
)
);
*
heap
=
DRM
(
alloc
)(
sizeof
(
**
heap
),
DRM_MEM_BUFLISTS
);
if
(
!*
heap
)
{
DRM
_FREE
(
blocks
,
sizeof
(
*
blocks
)
);
DRM
(
free
)(
blocks
,
sizeof
(
*
blocks
),
DRM_MEM_BUFLISTS
);
return
-
ENOMEM
;
}
...
...
@@ -211,7 +211,7 @@ void i915_mem_release(drm_device_t * dev, DRMFILE filp, struct mem_block *heap)
p
->
size
+=
q
->
size
;
p
->
next
=
q
->
next
;
p
->
next
->
prev
=
p
;
DRM
_FREE
(
q
,
sizeof
(
*
q
)
);
DRM
(
free
)(
q
,
sizeof
(
*
q
),
DRM_MEM_BUFLISTS
);
}
}
}
...
...
@@ -228,10 +228,10 @@ void i915_mem_takedown(struct mem_block **heap)
for
(
p
=
(
*
heap
)
->
next
;
p
!=
*
heap
;)
{
struct
mem_block
*
q
=
p
;
p
=
p
->
next
;
DRM
_FREE
(
q
,
sizeof
(
*
q
)
);
DRM
(
free
)(
q
,
sizeof
(
*
q
),
DRM_MEM_BUFLISTS
);
}
DRM
_FREE
(
*
heap
,
sizeof
(
**
heap
)
);
DRM
(
free
)(
*
heap
,
sizeof
(
**
heap
),
DRM_MEM_BUFLISTS
);
*
heap
=
NULL
;
}
...
...
drivers/char/drm/r128_state.c
View file @
c652fecc
...
...
@@ -926,24 +926,24 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev,
}
buffer_size
=
depth
->
n
*
sizeof
(
u32
);
buffer
=
DRM
_MALLOC
(
buffer_size
);
buffer
=
DRM
(
alloc
)(
buffer_size
,
DRM_MEM_BUFS
);
if
(
buffer
==
NULL
)
return
DRM_ERR
(
ENOMEM
);
if
(
DRM_COPY_FROM_USER
(
buffer
,
depth
->
buffer
,
buffer_size
)
)
{
DRM
_FREE
(
buffer
,
buffer_size
);
DRM
(
free
)(
buffer
,
buffer_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
EFAULT
);
}
mask_size
=
depth
->
n
*
sizeof
(
u8
);
if
(
depth
->
mask
)
{
mask
=
DRM
_MALLOC
(
mask_size
);
mask
=
DRM
(
alloc
)(
mask_size
,
DRM_MEM_BUFS
);
if
(
mask
==
NULL
)
{
DRM
_FREE
(
buffer
,
buffer_size
);
DRM
(
free
)(
buffer
,
buffer_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
ENOMEM
);
}
if
(
DRM_COPY_FROM_USER
(
mask
,
depth
->
mask
,
mask_size
)
)
{
DRM
_FREE
(
buffer
,
buffer_size
);
DRM
_FREE
(
mask
,
mask_size
);
DRM
(
free
)(
buffer
,
buffer_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
mask
,
mask_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
EFAULT
);
}
...
...
@@ -970,7 +970,7 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev,
}
}
DRM
_FREE
(
mask
,
mask_size
);
DRM
(
free
)(
mask
,
mask_size
,
DRM_MEM_BUFS
);
}
else
{
for
(
i
=
0
;
i
<
count
;
i
++
,
x
++
)
{
BEGIN_RING
(
6
);
...
...
@@ -994,7 +994,7 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev,
}
}
DRM
_FREE
(
buffer
,
buffer_size
);
DRM
(
free
)(
buffer
,
buffer_size
,
DRM_MEM_BUFS
);
return
0
;
}
...
...
@@ -1016,54 +1016,54 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev,
xbuf_size
=
count
*
sizeof
(
*
x
);
ybuf_size
=
count
*
sizeof
(
*
y
);
x
=
DRM
_MALLOC
(
xbuf_size
);
x
=
DRM
(
alloc
)(
xbuf_size
,
DRM_MEM_BUFS
);
if
(
x
==
NULL
)
{
return
DRM_ERR
(
ENOMEM
);
}
y
=
DRM
_MALLOC
(
ybuf_size
);
y
=
DRM
(
alloc
)(
ybuf_size
,
DRM_MEM_BUFS
);
if
(
y
==
NULL
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
ENOMEM
);
}
if
(
DRM_COPY_FROM_USER
(
x
,
depth
->
x
,
xbuf_size
)
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
EFAULT
);
}
if
(
DRM_COPY_FROM_USER
(
y
,
depth
->
y
,
xbuf_size
)
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
EFAULT
);
}
buffer_size
=
depth
->
n
*
sizeof
(
u32
);
buffer
=
DRM
_MALLOC
(
buffer_size
);
buffer
=
DRM
(
alloc
)(
buffer_size
,
DRM_MEM_BUFS
);
if
(
buffer
==
NULL
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
ENOMEM
);
}
if
(
DRM_COPY_FROM_USER
(
buffer
,
depth
->
buffer
,
buffer_size
)
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
_FREE
(
buffer
,
buffer_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
buffer
,
buffer_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
EFAULT
);
}
if
(
depth
->
mask
)
{
mask_size
=
depth
->
n
*
sizeof
(
u8
);
mask
=
DRM
_MALLOC
(
mask_size
);
mask
=
DRM
(
alloc
)(
mask_size
,
DRM_MEM_BUFS
);
if
(
mask
==
NULL
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
_FREE
(
buffer
,
buffer_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
buffer
,
buffer_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
ENOMEM
);
}
if
(
DRM_COPY_FROM_USER
(
mask
,
depth
->
mask
,
mask_size
)
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
_FREE
(
buffer
,
buffer_size
);
DRM
_FREE
(
mask
,
mask_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
buffer
,
buffer_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
mask
,
mask_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
EFAULT
);
}
...
...
@@ -1090,7 +1090,7 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev,
}
}
DRM
_FREE
(
mask
,
mask_size
);
DRM
(
free
)(
mask
,
mask_size
,
DRM_MEM_BUFS
);
}
else
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
BEGIN_RING
(
6
);
...
...
@@ -1114,9 +1114,9 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev,
}
}
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
_FREE
(
buffer
,
buffer_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
buffer
,
buffer_size
,
DRM_MEM_BUFS
);
return
0
;
}
...
...
@@ -1184,23 +1184,23 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev,
xbuf_size
=
count
*
sizeof
(
*
x
);
ybuf_size
=
count
*
sizeof
(
*
y
);
x
=
DRM
_MALLOC
(
xbuf_size
);
x
=
DRM
(
alloc
)(
xbuf_size
,
DRM_MEM_BUFS
);
if
(
x
==
NULL
)
{
return
DRM_ERR
(
ENOMEM
);
}
y
=
DRM
_MALLOC
(
ybuf_size
);
y
=
DRM
(
alloc
)(
ybuf_size
,
DRM_MEM_BUFS
);
if
(
y
==
NULL
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
ENOMEM
);
}
if
(
DRM_COPY_FROM_USER
(
x
,
depth
->
x
,
xbuf_size
)
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
EFAULT
);
}
if
(
DRM_COPY_FROM_USER
(
y
,
depth
->
y
,
ybuf_size
)
)
{
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
return
DRM_ERR
(
EFAULT
);
}
...
...
@@ -1228,8 +1228,8 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev,
ADVANCE_RING
();
}
DRM
_FREE
(
x
,
xbuf_size
);
DRM
_FREE
(
y
,
ybuf_size
);
DRM
(
free
)(
x
,
xbuf_size
,
DRM_MEM_BUFS
);
DRM
(
free
)(
y
,
ybuf_size
,
DRM_MEM_BUFS
);
return
0
;
}
...
...
drivers/char/drm/radeon_mem.c
View file @
c652fecc
...
...
@@ -44,7 +44,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
{
/* Maybe cut off the start of an existing block */
if
(
start
>
p
->
start
)
{
struct
mem_block
*
newblock
=
DRM
_MALLOC
(
sizeof
(
*
newblock
)
);
struct
mem_block
*
newblock
=
DRM
(
alloc
)(
sizeof
(
*
newblock
),
DRM_MEM_BUFS
);
if
(
!
newblock
)
goto
out
;
newblock
->
start
=
start
;
...
...
@@ -60,7 +60,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
/* Maybe cut off the end of an existing block */
if
(
size
<
p
->
size
)
{
struct
mem_block
*
newblock
=
DRM
_MALLOC
(
sizeof
(
*
newblock
)
);
struct
mem_block
*
newblock
=
DRM
(
alloc
)(
sizeof
(
*
newblock
),
DRM_MEM_BUFS
);
if
(
!
newblock
)
goto
out
;
newblock
->
start
=
start
+
size
;
...
...
@@ -118,7 +118,7 @@ static void free_block( struct mem_block *p )
p
->
size
+=
q
->
size
;
p
->
next
=
q
->
next
;
p
->
next
->
prev
=
p
;
DRM
_FREE
(
q
,
sizeof
(
*
q
)
);
DRM
(
free
)(
q
,
sizeof
(
*
q
),
DRM_MEM_BUFS
);
}
if
(
p
->
prev
->
filp
==
0
)
{
...
...
@@ -126,7 +126,7 @@ static void free_block( struct mem_block *p )
q
->
size
+=
p
->
size
;
q
->
next
=
p
->
next
;
q
->
next
->
prev
=
q
;
DRM
_FREE
(
p
,
sizeof
(
*
q
)
);
DRM
(
free
)(
p
,
sizeof
(
*
q
),
DRM_MEM_BUFS
);
}
}
...
...
@@ -134,14 +134,14 @@ static void free_block( struct mem_block *p )
*/
static
int
init_heap
(
struct
mem_block
**
heap
,
int
start
,
int
size
)
{
struct
mem_block
*
blocks
=
DRM
_MALLOC
(
sizeof
(
*
blocks
)
);
struct
mem_block
*
blocks
=
DRM
(
alloc
)(
sizeof
(
*
blocks
),
DRM_MEM_BUFS
);
if
(
!
blocks
)
return
DRM_ERR
(
ENOMEM
);
*
heap
=
DRM
_MALLOC
(
sizeof
(
**
heap
)
);
*
heap
=
DRM
(
alloc
)(
sizeof
(
**
heap
),
DRM_MEM_BUFS
);
if
(
!*
heap
)
{
DRM
_FREE
(
blocks
,
sizeof
(
*
blocks
)
);
DRM
(
free
)(
blocks
,
sizeof
(
*
blocks
),
DRM_MEM_BUFS
);
return
DRM_ERR
(
ENOMEM
);
}
...
...
@@ -180,7 +180,7 @@ void radeon_mem_release( DRMFILE filp, struct mem_block *heap )
p
->
size
+=
q
->
size
;
p
->
next
=
q
->
next
;
p
->
next
->
prev
=
p
;
DRM
_FREE
(
q
,
sizeof
(
*
q
)
);
DRM
(
free
)(
q
,
sizeof
(
*
q
),
DRM_MEM_DRIVER
);
}
}
}
...
...
@@ -197,10 +197,10 @@ void radeon_mem_takedown( struct mem_block **heap )
for
(
p
=
(
*
heap
)
->
next
;
p
!=
*
heap
;
)
{
struct
mem_block
*
q
=
p
;
p
=
p
->
next
;
DRM
_FREE
(
q
,
sizeof
(
*
q
)
);
DRM
(
free
)(
q
,
sizeof
(
*
q
),
DRM_MEM_DRIVER
);
}
DRM
_FREE
(
*
heap
,
sizeof
(
**
heap
)
);
DRM
(
free
)(
*
heap
,
sizeof
(
**
heap
),
DRM_MEM_DRIVER
);
*
heap
=
NULL
;
}
...
...
drivers/char/drm/radeon_state.c
View file @
c652fecc
...
...
@@ -1440,7 +1440,8 @@ static int radeon_cp_dispatch_texture( DRMFILE filp,
}
if
(
!
buf
)
{
DRM_DEBUG
(
"radeon_cp_dispatch_texture: EAGAIN
\n
"
);
DRM_COPY_TO_USER
(
tex
->
image
,
image
,
sizeof
(
*
image
)
);
if
(
DRM_COPY_TO_USER
(
tex
->
image
,
image
,
sizeof
(
*
image
)
))
return
DRM_ERR
(
EFAULT
);
return
DRM_ERR
(
EAGAIN
);
}
...
...
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