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
9698b4db
Commit
9698b4db
authored
Jul 12, 2007
by
Dave Airlie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm: de-typedef sman
Signed-off-by:
Dave Airlie
<
airlied@linux.ie
>
parent
55910517
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
49 deletions
+51
-49
drivers/char/drm/drm_sman.c
drivers/char/drm/drm_sman.c
+24
-23
drivers/char/drm/drm_sman.h
drivers/char/drm/drm_sman.h
+22
-22
drivers/char/drm/sis_drv.h
drivers/char/drm/sis_drv.h
+2
-1
drivers/char/drm/sis_mm.c
drivers/char/drm/sis_mm.c
+1
-1
drivers/char/drm/via_drv.h
drivers/char/drm/via_drv.h
+1
-1
drivers/char/drm/via_mm.c
drivers/char/drm/via_mm.c
+1
-1
No files found.
drivers/char/drm/drm_sman.c
View file @
9698b4db
...
...
@@ -44,7 +44,7 @@ typedef struct drm_owner_item {
struct
list_head
mem_blocks
;
}
drm_owner_item_t
;
void
drm_sman_takedown
(
drm_sman_t
*
sman
)
void
drm_sman_takedown
(
struct
drm_sman
*
sman
)
{
drm_ht_remove
(
&
sman
->
user_hash_tab
);
drm_ht_remove
(
&
sman
->
owner_hash_tab
);
...
...
@@ -56,12 +56,12 @@ void drm_sman_takedown(drm_sman_t * sman)
EXPORT_SYMBOL
(
drm_sman_takedown
);
int
drm_sman_init
(
drm_sman_t
*
sman
,
unsigned
int
num_managers
,
drm_sman_init
(
struct
drm_sman
*
sman
,
unsigned
int
num_managers
,
unsigned
int
user_order
,
unsigned
int
owner_order
)
{
int
ret
=
0
;
sman
->
mm
=
(
drm_sman_mm_t
*
)
drm_calloc
(
num_managers
,
sizeof
(
*
sman
->
mm
),
sman
->
mm
=
(
struct
drm_sman_mm
*
)
drm_calloc
(
num_managers
,
sizeof
(
*
sman
->
mm
),
DRM_MEM_MM
);
if
(
!
sman
->
mm
)
{
ret
=
-
ENOMEM
;
...
...
@@ -120,10 +120,10 @@ static unsigned long drm_sman_mm_offset(void *private, void *ref)
}
int
drm_sman_set_range
(
drm_sman_t
*
sman
,
unsigned
int
manager
,
drm_sman_set_range
(
struct
drm_sman
*
sman
,
unsigned
int
manager
,
unsigned
long
start
,
unsigned
long
size
)
{
drm_sman_mm_t
*
sman_mm
;
struct
drm_sman_mm
*
sman_mm
;
struct
drm_mm
*
mm
;
int
ret
;
...
...
@@ -153,8 +153,8 @@ drm_sman_set_range(drm_sman_t * sman, unsigned int manager,
EXPORT_SYMBOL
(
drm_sman_set_range
);
int
drm_sman_set_manager
(
drm_sman_t
*
sman
,
unsigned
int
manager
,
drm_sman_mm_t
*
allocator
)
drm_sman_set_manager
(
struct
drm_sman
*
sman
,
unsigned
int
manager
,
struct
drm_sman_mm
*
allocator
)
{
BUG_ON
(
manager
>=
sman
->
num_managers
);
sman
->
mm
[
manager
]
=
*
allocator
;
...
...
@@ -163,7 +163,7 @@ drm_sman_set_manager(drm_sman_t * sman, unsigned int manager,
}
EXPORT_SYMBOL
(
drm_sman_set_manager
);
static
drm_owner_item_t
*
drm_sman_get_owner_item
(
drm_sman_t
*
sman
,
static
drm_owner_item_t
*
drm_sman_get_owner_item
(
struct
drm_sman
*
sman
,
unsigned
long
owner
)
{
int
ret
;
...
...
@@ -194,14 +194,14 @@ static drm_owner_item_t *drm_sman_get_owner_item(drm_sman_t * sman,
return
NULL
;
}
drm_memblock_item_t
*
drm_sman_alloc
(
drm_sman_t
*
sman
,
unsigned
int
manager
,
struct
drm_memblock_item
*
drm_sman_alloc
(
struct
drm_sman
*
sman
,
unsigned
int
manager
,
unsigned
long
size
,
unsigned
alignment
,
unsigned
long
owner
)
{
void
*
tmp
;
drm_sman_mm_t
*
sman_mm
;
struct
drm_sman_mm
*
sman_mm
;
drm_owner_item_t
*
owner_item
;
drm_memblock_item_t
*
memblock
;
struct
drm_memblock_item
*
memblock
;
BUG_ON
(
manager
>=
sman
->
num_managers
);
...
...
@@ -246,9 +246,9 @@ drm_memblock_item_t *drm_sman_alloc(drm_sman_t *sman, unsigned int manager,
EXPORT_SYMBOL
(
drm_sman_alloc
);
static
void
drm_sman_free
(
drm_memblock_item_t
*
item
)
static
void
drm_sman_free
(
struct
drm_memblock_item
*
item
)
{
drm_sman_t
*
sman
=
item
->
sman
;
struct
drm_sman
*
sman
=
item
->
sman
;
list_del
(
&
item
->
owner_list
);
drm_ht_remove_item
(
&
sman
->
user_hash_tab
,
&
item
->
user_hash
);
...
...
@@ -256,22 +256,23 @@ static void drm_sman_free(drm_memblock_item_t *item)
drm_free
(
item
,
sizeof
(
*
item
),
DRM_MEM_MM
);
}
int
drm_sman_free_key
(
drm_sman_t
*
sman
,
unsigned
int
key
)
int
drm_sman_free_key
(
struct
drm_sman
*
sman
,
unsigned
int
key
)
{
drm_hash_item_t
*
hash_item
;
drm_memblock_item_t
*
memblock_item
;
struct
drm_memblock_item
*
memblock_item
;
if
(
drm_ht_find_item
(
&
sman
->
user_hash_tab
,
key
,
&
hash_item
))
return
-
EINVAL
;
memblock_item
=
drm_hash_entry
(
hash_item
,
drm_memblock_item_t
,
user_hash
);
memblock_item
=
drm_hash_entry
(
hash_item
,
struct
drm_memblock_item
,
user_hash
);
drm_sman_free
(
memblock_item
);
return
0
;
}
EXPORT_SYMBOL
(
drm_sman_free_key
);
static
void
drm_sman_remove_owner
(
drm_sman_t
*
sman
,
static
void
drm_sman_remove_owner
(
struct
drm_sman
*
sman
,
drm_owner_item_t
*
owner_item
)
{
list_del
(
&
owner_item
->
sman_list
);
...
...
@@ -279,7 +280,7 @@ static void drm_sman_remove_owner(drm_sman_t *sman,
drm_free
(
owner_item
,
sizeof
(
*
owner_item
),
DRM_MEM_MM
);
}
int
drm_sman_owner_clean
(
drm_sman_t
*
sman
,
unsigned
long
owner
)
int
drm_sman_owner_clean
(
struct
drm_sman
*
sman
,
unsigned
long
owner
)
{
drm_hash_item_t
*
hash_item
;
...
...
@@ -300,10 +301,10 @@ int drm_sman_owner_clean(drm_sman_t *sman, unsigned long owner)
EXPORT_SYMBOL
(
drm_sman_owner_clean
);
static
void
drm_sman_do_owner_cleanup
(
drm_sman_t
*
sman
,
static
void
drm_sman_do_owner_cleanup
(
struct
drm_sman
*
sman
,
drm_owner_item_t
*
owner_item
)
{
drm_memblock_item_t
*
entry
,
*
next
;
struct
drm_memblock_item
*
entry
,
*
next
;
list_for_each_entry_safe
(
entry
,
next
,
&
owner_item
->
mem_blocks
,
owner_list
)
{
...
...
@@ -312,7 +313,7 @@ static void drm_sman_do_owner_cleanup(drm_sman_t *sman,
drm_sman_remove_owner
(
sman
,
owner_item
);
}
void
drm_sman_owner_cleanup
(
drm_sman_t
*
sman
,
unsigned
long
owner
)
void
drm_sman_owner_cleanup
(
struct
drm_sman
*
sman
,
unsigned
long
owner
)
{
drm_hash_item_t
*
hash_item
;
...
...
@@ -329,11 +330,11 @@ void drm_sman_owner_cleanup(drm_sman_t *sman, unsigned long owner)
EXPORT_SYMBOL
(
drm_sman_owner_cleanup
);
void
drm_sman_cleanup
(
drm_sman_t
*
sman
)
void
drm_sman_cleanup
(
struct
drm_sman
*
sman
)
{
drm_owner_item_t
*
entry
,
*
next
;
unsigned
int
i
;
drm_sman_mm_t
*
sman_mm
;
struct
drm_sman_mm
*
sman_mm
;
list_for_each_entry_safe
(
entry
,
next
,
&
sman
->
owner_items
,
sman_list
)
{
drm_sman_do_owner_cleanup
(
sman
,
entry
);
...
...
drivers/char/drm/drm_sman.h
View file @
9698b4db
...
...
@@ -50,7 +50,7 @@
* for memory management.
*/
typedef
struct
drm_sman_mm
{
struct
drm_sman_mm
{
/* private info. If allocated, needs to be destroyed by the destroy
function */
void
*
private
;
...
...
@@ -74,30 +74,30 @@ typedef struct drm_sman_mm {
"alloc" function */
unsigned
long
(
*
offset
)
(
void
*
private
,
void
*
ref
);
}
drm_sman_mm_t
;
};
typedef
struct
drm_memblock_item
{
struct
drm_memblock_item
{
struct
list_head
owner_list
;
drm_hash_item_t
user_hash
;
void
*
mm_info
;
drm_sman_mm_t
*
mm
;
struct
drm_sman_mm
*
mm
;
struct
drm_sman
*
sman
;
}
drm_memblock_item_t
;
};
typedef
struct
drm_sman
{
drm_sman_mm_t
*
mm
;
struct
drm_sman
{
struct
drm_sman_mm
*
mm
;
int
num_managers
;
drm_open_hash_t
owner_hash_tab
;
drm_open_hash_t
user_hash_tab
;
struct
list_head
owner_items
;
}
drm_sman_t
;
};
/*
* Take down a memory manager. This function should only be called after a
* successful init and after a call to drm_sman_cleanup.
*/
extern
void
drm_sman_takedown
(
drm_sman_t
*
sman
);
extern
void
drm_sman_takedown
(
struct
drm_sman
*
sman
);
/*
* Allocate structures for a manager.
...
...
@@ -112,7 +112,7 @@ extern void drm_sman_takedown(drm_sman_t * sman);
*
*/
extern
int
drm_sman_init
(
drm_sman_t
*
sman
,
unsigned
int
num_managers
,
extern
int
drm_sman_init
(
struct
drm_sman
*
sman
,
unsigned
int
num_managers
,
unsigned
int
user_order
,
unsigned
int
owner_order
);
/*
...
...
@@ -120,7 +120,7 @@ extern int drm_sman_init(drm_sman_t * sman, unsigned int num_managers,
* manager unless a customized allogator is used.
*/
extern
int
drm_sman_set_range
(
drm_sman_t
*
sman
,
unsigned
int
manager
,
extern
int
drm_sman_set_range
(
struct
drm_sman
*
sman
,
unsigned
int
manager
,
unsigned
long
start
,
unsigned
long
size
);
/*
...
...
@@ -129,14 +129,14 @@ extern int drm_sman_set_range(drm_sman_t * sman, unsigned int manager,
* so it can be destroyed after this call.
*/
extern
int
drm_sman_set_manager
(
drm_sman_t
*
sman
,
unsigned
int
mananger
,
drm_sman_mm_t
*
allocator
);
extern
int
drm_sman_set_manager
(
struct
drm_sman
*
sman
,
unsigned
int
mananger
,
struct
drm_sman_mm
*
allocator
);
/*
* Allocate a memory block. Aligment is not implemented yet.
*/
extern
drm_memblock_item_t
*
drm_sman_alloc
(
drm_sman_t
*
sman
,
extern
struct
drm_memblock_item
*
drm_sman_alloc
(
struct
drm_sman
*
sman
,
unsigned
int
manager
,
unsigned
long
size
,
unsigned
alignment
,
...
...
@@ -145,7 +145,7 @@ extern drm_memblock_item_t *drm_sman_alloc(drm_sman_t * sman,
* Free a memory block identified by its user hash key.
*/
extern
int
drm_sman_free_key
(
drm_sman_t
*
sman
,
unsigned
int
key
);
extern
int
drm_sman_free_key
(
struct
drm_sman
*
sman
,
unsigned
int
key
);
/*
* returns 1 iff there are no stale memory blocks associated with this owner.
...
...
@@ -154,7 +154,7 @@ extern int drm_sman_free_key(drm_sman_t * sman, unsigned int key);
* resources associated with owner.
*/
extern
int
drm_sman_owner_clean
(
drm_sman_t
*
sman
,
unsigned
long
owner
);
extern
int
drm_sman_owner_clean
(
struct
drm_sman
*
sman
,
unsigned
long
owner
);
/*
* Frees all stale memory blocks associated with this owner. Note that this
...
...
@@ -164,13 +164,13 @@ extern int drm_sman_owner_clean(drm_sman_t * sman, unsigned long owner);
* is not going to be referenced anymore.
*/
extern
void
drm_sman_owner_cleanup
(
drm_sman_t
*
sman
,
unsigned
long
owner
);
extern
void
drm_sman_owner_cleanup
(
struct
drm_sman
*
sman
,
unsigned
long
owner
);
/*
* Frees all stale memory blocks associated with the memory manager.
* See idling above.
*/
extern
void
drm_sman_cleanup
(
drm_sman_t
*
sman
);
extern
void
drm_sman_cleanup
(
struct
drm_sman
*
sman
);
#endif
drivers/char/drm/sis_drv.h
View file @
9698b4db
...
...
@@ -46,6 +46,7 @@ enum sis_family {
#include "drm_sman.h"
#define SIS_BASE (dev_priv->mmio)
#define SIS_READ(reg) DRM_READ32(SIS_BASE, reg);
#define SIS_WRITE(reg, val) DRM_WRITE32(SIS_BASE, reg, val);
...
...
@@ -53,7 +54,7 @@ enum sis_family {
typedef
struct
drm_sis_private
{
drm_local_map_t
*
mmio
;
unsigned
int
idle_fault
;
drm_sman_t
sman
;
struct
drm_sman
sman
;
unsigned
int
chipset
;
int
vram_initialized
;
int
agp_initialized
;
...
...
drivers/char/drm/sis_mm.c
View file @
9698b4db
...
...
@@ -130,7 +130,7 @@ static int sis_drm_alloc(struct drm_device *dev, struct drm_file * priv,
drm_sis_mem_t
__user
*
argp
=
(
drm_sis_mem_t
__user
*
)
data
;
drm_sis_mem_t
mem
;
int
retval
=
0
;
drm_memblock_item_t
*
item
;
struct
drm_memblock_item
*
item
;
DRM_COPY_FROM_USER_IOCTL
(
mem
,
argp
,
sizeof
(
mem
));
...
...
drivers/char/drm/via_drv.h
View file @
9698b4db
...
...
@@ -87,7 +87,7 @@ typedef struct drm_via_private {
uint32_t
irq_pending_mask
;
int
*
irq_map
;
unsigned
int
idle_fault
;
drm_sman_t
sman
;
struct
drm_sman
sman
;
int
vram_initialized
;
int
agp_initialized
;
unsigned
long
vram_offset
;
...
...
drivers/char/drm/via_mm.c
View file @
9698b4db
...
...
@@ -127,7 +127,7 @@ int via_mem_alloc(DRM_IOCTL_ARGS)
drm_via_mem_t
mem
;
int
retval
=
0
;
drm_memblock_item_t
*
item
;
struct
drm_memblock_item
*
item
;
drm_via_private_t
*
dev_priv
=
(
drm_via_private_t
*
)
dev
->
dev_private
;
unsigned
long
tmpSize
;
...
...
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