Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
9698b4db
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9698b4db
编写于
7月 12, 2007
作者:
D
Dave Airlie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm: de-typedef sman
Signed-off-by:
N
Dave Airlie
<
airlied@linux.ie
>
上级
55910517
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
51 addition
and
49 deletion
+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
未找到文件。
drivers/char/drm/drm_sman.c
浏览文件 @
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
浏览文件 @
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,23 +129,23 @@ 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
,
unsigned
int
manager
,
unsigned
long
size
,
unsigned
alignment
,
unsigned
long
owner
);
extern
struct
drm_memblock_item
*
drm_sman_alloc
(
struct
drm_sman
*
sman
,
unsigned
int
manager
,
unsigned
long
size
,
unsigned
alignment
,
unsigned
long
owner
);
/*
* 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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录