Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e0be428e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e0be428e
编写于
7月 12, 2007
作者:
D
Dave Airlie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm: detypedef the hashtab and more of sman
Signed-off-by:
N
Dave Airlie
<
airlied@linux.ie
>
上级
9698b4db
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
59 addition
and
59 deletion
+59
-59
drivers/char/drm/drmP.h
drivers/char/drm/drmP.h
+4
-4
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
+1
-1
drivers/char/drm/drm_hashtab.c
drivers/char/drm/drm_hashtab.c
+17
-17
drivers/char/drm/drm_hashtab.h
drivers/char/drm/drm_hashtab.h
+12
-12
drivers/char/drm/drm_sman.c
drivers/char/drm/drm_sman.c
+18
-18
drivers/char/drm/drm_sman.h
drivers/char/drm/drm_sman.h
+3
-3
drivers/char/drm/drm_vm.c
drivers/char/drm/drm_vm.c
+2
-2
未找到文件。
drivers/char/drm/drmP.h
浏览文件 @
e0be428e
...
...
@@ -276,7 +276,7 @@ typedef struct drm_ioctl_desc {
struct
drm_magic_entry
{
struct
list_head
head
;
drm_hash_item_t
hash_item
;
struct
drm_hash_item
hash_item
;
struct
drm_file
*
priv
;
struct
drm_magic_entry
*
next
;
};
...
...
@@ -481,7 +481,7 @@ struct drm_sigdata {
*/
struct
drm_map_list
{
struct
list_head
head
;
/**< list head */
drm_hash_item_t
hash
;
struct
drm_hash_item
hash
;
struct
drm_map
*
map
;
/**< mapping */
unsigned
int
user_token
;
};
...
...
@@ -660,7 +660,7 @@ struct drm_device {
/** \name Authentication */
/*@{ */
struct
list_head
filelist
;
drm_open_hash_t
magiclist
;
/**< magic hash table */
struct
drm_open_hash
magiclist
;
/**< magic hash table */
struct
list_head
magicfree
;
/*@} */
...
...
@@ -668,7 +668,7 @@ struct drm_device {
/*@{ */
struct
list_head
maplist
;
/**< Linked list of regions */
int
map_count
;
/**< Number of mappable regions */
drm_open_hash_t
map_hash
;
/**< User token hash table for maps */
struct
drm_open_hash
map_hash
;
/**< User token hash table for maps */
/** \name Context handle management */
/*@{ */
...
...
drivers/char/drm/drm_auth.c
浏览文件 @
e0be428e
...
...
@@ -49,7 +49,7 @@ static struct drm_file *drm_find_file(struct drm_device * dev, drm_magic_t magic
{
struct
drm_file
*
retval
=
NULL
;
struct
drm_magic_entry
*
pt
;
drm_hash_item_t
*
hash
;
struct
drm_hash_item
*
hash
;
mutex_lock
(
&
dev
->
struct_mutex
);
if
(
!
drm_ht_find_item
(
&
dev
->
magiclist
,
(
unsigned
long
)
magic
,
&
hash
))
{
...
...
@@ -105,7 +105,7 @@ static int drm_add_magic(struct drm_device * dev, struct drm_file * priv,
static
int
drm_remove_magic
(
struct
drm_device
*
dev
,
drm_magic_t
magic
)
{
struct
drm_magic_entry
*
pt
;
drm_hash_item_t
*
hash
;
struct
drm_hash_item
*
hash
;
DRM_DEBUG
(
"%d
\n
"
,
magic
);
...
...
drivers/char/drm/drm_bufs.c
浏览文件 @
e0be428e
...
...
@@ -64,7 +64,7 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
return
NULL
;
}
static
int
drm_map_handle
(
struct
drm_device
*
dev
,
drm_hash_item_t
*
hash
,
static
int
drm_map_handle
(
struct
drm_device
*
dev
,
struct
drm_hash_item
*
hash
,
unsigned
long
user_token
,
int
hashed_handle
)
{
int
use_hashed_handle
;
...
...
drivers/char/drm/drm_hashtab.c
浏览文件 @
e0be428e
...
...
@@ -36,7 +36,7 @@
#include "drm_hashtab.h"
#include <linux/hash.h>
int
drm_ht_create
(
drm_open_hash_t
*
ht
,
unsigned
int
order
)
int
drm_ht_create
(
struct
drm_open_hash
*
ht
,
unsigned
int
order
)
{
unsigned
int
i
;
...
...
@@ -63,9 +63,9 @@ int drm_ht_create(drm_open_hash_t *ht, unsigned int order)
return
0
;
}
void
drm_ht_verbose_list
(
drm_open_hash_t
*
ht
,
unsigned
long
key
)
void
drm_ht_verbose_list
(
struct
drm_open_hash
*
ht
,
unsigned
long
key
)
{
drm_hash_item_t
*
entry
;
struct
drm_hash_item
*
entry
;
struct
hlist_head
*
h_list
;
struct
hlist_node
*
list
;
unsigned
int
hashed_key
;
...
...
@@ -75,15 +75,15 @@ void drm_ht_verbose_list(drm_open_hash_t *ht, unsigned long key)
DRM_DEBUG
(
"Key is 0x%08lx, Hashed key is 0x%08x
\n
"
,
key
,
hashed_key
);
h_list
=
&
ht
->
table
[
hashed_key
];
hlist_for_each
(
list
,
h_list
)
{
entry
=
hlist_entry
(
list
,
drm_hash_item_t
,
head
);
entry
=
hlist_entry
(
list
,
struct
drm_hash_item
,
head
);
DRM_DEBUG
(
"count %d, key: 0x%08lx
\n
"
,
count
++
,
entry
->
key
);
}
}
static
struct
hlist_node
*
drm_ht_find_key
(
drm_open_hash_t
*
ht
,
static
struct
hlist_node
*
drm_ht_find_key
(
struct
drm_open_hash
*
ht
,
unsigned
long
key
)
{
drm_hash_item_t
*
entry
;
struct
drm_hash_item
*
entry
;
struct
hlist_head
*
h_list
;
struct
hlist_node
*
list
;
unsigned
int
hashed_key
;
...
...
@@ -91,7 +91,7 @@ static struct hlist_node *drm_ht_find_key(drm_open_hash_t *ht,
hashed_key
=
hash_long
(
key
,
ht
->
order
);
h_list
=
&
ht
->
table
[
hashed_key
];
hlist_for_each
(
list
,
h_list
)
{
entry
=
hlist_entry
(
list
,
drm_hash_item_t
,
head
);
entry
=
hlist_entry
(
list
,
struct
drm_hash_item
,
head
);
if
(
entry
->
key
==
key
)
return
list
;
if
(
entry
->
key
>
key
)
...
...
@@ -101,9 +101,9 @@ static struct hlist_node *drm_ht_find_key(drm_open_hash_t *ht,
}
int
drm_ht_insert_item
(
drm_open_hash_t
*
ht
,
drm_hash_item_t
*
item
)
int
drm_ht_insert_item
(
struct
drm_open_hash
*
ht
,
struct
drm_hash_item
*
item
)
{
drm_hash_item_t
*
entry
;
struct
drm_hash_item
*
entry
;
struct
hlist_head
*
h_list
;
struct
hlist_node
*
list
,
*
parent
;
unsigned
int
hashed_key
;
...
...
@@ -113,7 +113,7 @@ int drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item)
h_list
=
&
ht
->
table
[
hashed_key
];
parent
=
NULL
;
hlist_for_each
(
list
,
h_list
)
{
entry
=
hlist_entry
(
list
,
drm_hash_item_t
,
head
);
entry
=
hlist_entry
(
list
,
struct
drm_hash_item
,
head
);
if
(
entry
->
key
==
key
)
return
-
EINVAL
;
if
(
entry
->
key
>
key
)
...
...
@@ -132,7 +132,7 @@ int drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item)
* Just insert an item and return any "bits" bit key that hasn't been
* used before.
*/
int
drm_ht_just_insert_please
(
drm_open_hash_t
*
ht
,
drm_hash_item_t
*
item
,
int
drm_ht_just_insert_please
(
struct
drm_open_hash
*
ht
,
struct
drm_hash_item
*
item
,
unsigned
long
seed
,
int
bits
,
int
shift
,
unsigned
long
add
)
{
...
...
@@ -156,8 +156,8 @@ int drm_ht_just_insert_please(drm_open_hash_t *ht, drm_hash_item_t *item,
return
0
;
}
int
drm_ht_find_item
(
drm_open_hash_t
*
ht
,
unsigned
long
key
,
drm_hash_item_t
**
item
)
int
drm_ht_find_item
(
struct
drm_open_hash
*
ht
,
unsigned
long
key
,
struct
drm_hash_item
**
item
)
{
struct
hlist_node
*
list
;
...
...
@@ -165,11 +165,11 @@ int drm_ht_find_item(drm_open_hash_t *ht, unsigned long key,
if
(
!
list
)
return
-
EINVAL
;
*
item
=
hlist_entry
(
list
,
drm_hash_item_t
,
head
);
*
item
=
hlist_entry
(
list
,
struct
drm_hash_item
,
head
);
return
0
;
}
int
drm_ht_remove_key
(
drm_open_hash_t
*
ht
,
unsigned
long
key
)
int
drm_ht_remove_key
(
struct
drm_open_hash
*
ht
,
unsigned
long
key
)
{
struct
hlist_node
*
list
;
...
...
@@ -182,14 +182,14 @@ int drm_ht_remove_key(drm_open_hash_t *ht, unsigned long key)
return
-
EINVAL
;
}
int
drm_ht_remove_item
(
drm_open_hash_t
*
ht
,
drm_hash_item_t
*
item
)
int
drm_ht_remove_item
(
struct
drm_open_hash
*
ht
,
struct
drm_hash_item
*
item
)
{
hlist_del_init
(
&
item
->
head
);
ht
->
fill
--
;
return
0
;
}
void
drm_ht_remove
(
drm_open_hash_t
*
ht
)
void
drm_ht_remove
(
struct
drm_open_hash
*
ht
)
{
if
(
ht
->
table
)
{
if
(
ht
->
use_vmalloc
)
...
...
drivers/char/drm/drm_hashtab.h
浏览文件 @
e0be428e
...
...
@@ -37,31 +37,31 @@
#define drm_hash_entry(_ptr, _type, _member) container_of(_ptr, _type, _member)
typedef
struct
drm_hash_item
{
struct
drm_hash_item
{
struct
hlist_node
head
;
unsigned
long
key
;
}
drm_hash_item_t
;
};
typedef
struct
drm_open_hash
{
struct
drm_open_hash
{
unsigned
int
size
;
unsigned
int
order
;
unsigned
int
fill
;
struct
hlist_head
*
table
;
int
use_vmalloc
;
}
drm_open_hash_t
;
};
extern
int
drm_ht_create
(
drm_open_hash_t
*
ht
,
unsigned
int
order
);
extern
int
drm_ht_insert_item
(
drm_open_hash_t
*
ht
,
drm_hash_item_t
*
item
);
extern
int
drm_ht_just_insert_please
(
drm_open_hash_t
*
ht
,
drm_hash_item_t
*
item
,
extern
int
drm_ht_create
(
struct
drm_open_hash
*
ht
,
unsigned
int
order
);
extern
int
drm_ht_insert_item
(
struct
drm_open_hash
*
ht
,
struct
drm_hash_item
*
item
);
extern
int
drm_ht_just_insert_please
(
struct
drm_open_hash
*
ht
,
struct
drm_hash_item
*
item
,
unsigned
long
seed
,
int
bits
,
int
shift
,
unsigned
long
add
);
extern
int
drm_ht_find_item
(
drm_open_hash_t
*
ht
,
unsigned
long
key
,
drm_hash_item_t
**
item
);
extern
int
drm_ht_find_item
(
struct
drm_open_hash
*
ht
,
unsigned
long
key
,
struct
drm_hash_item
**
item
);
extern
void
drm_ht_verbose_list
(
drm_open_hash_t
*
ht
,
unsigned
long
key
);
extern
int
drm_ht_remove_key
(
drm_open_hash_t
*
ht
,
unsigned
long
key
);
extern
int
drm_ht_remove_item
(
drm_open_hash_t
*
ht
,
drm_hash_item_t
*
item
);
extern
void
drm_ht_remove
(
drm_open_hash_t
*
ht
);
extern
void
drm_ht_verbose_list
(
struct
drm_open_hash
*
ht
,
unsigned
long
key
);
extern
int
drm_ht_remove_key
(
struct
drm_open_hash
*
ht
,
unsigned
long
key
);
extern
int
drm_ht_remove_item
(
struct
drm_open_hash
*
ht
,
struct
drm_hash_item
*
item
);
extern
void
drm_ht_remove
(
struct
drm_open_hash
*
ht
);
#endif
...
...
drivers/char/drm/drm_sman.c
浏览文件 @
e0be428e
...
...
@@ -38,11 +38,11 @@
#include "drm_sman.h"
typedef
struct
drm_owner_item
{
drm_hash_item_t
owner_hash
;
struct
drm_owner_item
{
struct
drm_hash_item
owner_hash
;
struct
list_head
sman_list
;
struct
list_head
mem_blocks
;
}
drm_owner_item_t
;
};
void
drm_sman_takedown
(
struct
drm_sman
*
sman
)
{
...
...
@@ -163,16 +163,16 @@ drm_sman_set_manager(struct drm_sman * sman, unsigned int manager,
}
EXPORT_SYMBOL
(
drm_sman_set_manager
);
static
drm_owner_item_t
*
drm_sman_get_owner_item
(
struct
drm_sman
*
sman
,
static
struct
drm_owner_item
*
drm_sman_get_owner_item
(
struct
drm_sman
*
sman
,
unsigned
long
owner
)
{
int
ret
;
drm_hash_item_t
*
owner_hash_item
;
drm_owner_item_t
*
owner_item
;
struct
drm_hash_item
*
owner_hash_item
;
struct
drm_owner_item
*
owner_item
;
ret
=
drm_ht_find_item
(
&
sman
->
owner_hash_tab
,
owner
,
&
owner_hash_item
);
if
(
!
ret
)
{
return
drm_hash_entry
(
owner_hash_item
,
drm_owner_item_t
,
return
drm_hash_entry
(
owner_hash_item
,
struct
drm_owner_item
,
owner_hash
);
}
...
...
@@ -200,7 +200,7 @@ struct drm_memblock_item *drm_sman_alloc(struct drm_sman *sman, unsigned int man
{
void
*
tmp
;
struct
drm_sman_mm
*
sman_mm
;
drm_owner_item_t
*
owner_item
;
struct
drm_owner_item
*
owner_item
;
struct
drm_memblock_item
*
memblock
;
BUG_ON
(
manager
>=
sman
->
num_managers
);
...
...
@@ -258,7 +258,7 @@ static void drm_sman_free(struct drm_memblock_item *item)
int
drm_sman_free_key
(
struct
drm_sman
*
sman
,
unsigned
int
key
)
{
drm_hash_item_t
*
hash_item
;
struct
drm_hash_item
*
hash_item
;
struct
drm_memblock_item
*
memblock_item
;
if
(
drm_ht_find_item
(
&
sman
->
user_hash_tab
,
key
,
&
hash_item
))
...
...
@@ -273,7 +273,7 @@ int drm_sman_free_key(struct drm_sman *sman, unsigned int key)
EXPORT_SYMBOL
(
drm_sman_free_key
);
static
void
drm_sman_remove_owner
(
struct
drm_sman
*
sman
,
drm_owner_item_t
*
owner_item
)
struct
drm_owner_item
*
owner_item
)
{
list_del
(
&
owner_item
->
sman_list
);
drm_ht_remove_item
(
&
sman
->
owner_hash_tab
,
&
owner_item
->
owner_hash
);
...
...
@@ -283,14 +283,14 @@ static void drm_sman_remove_owner(struct drm_sman *sman,
int
drm_sman_owner_clean
(
struct
drm_sman
*
sman
,
unsigned
long
owner
)
{
drm_hash_item_t
*
hash_item
;
drm_owner_item_t
*
owner_item
;
struct
drm_hash_item
*
hash_item
;
struct
drm_owner_item
*
owner_item
;
if
(
drm_ht_find_item
(
&
sman
->
owner_hash_tab
,
owner
,
&
hash_item
))
{
return
-
1
;
}
owner_item
=
drm_hash_entry
(
hash_item
,
drm_owner_item_t
,
owner_hash
);
owner_item
=
drm_hash_entry
(
hash_item
,
struct
drm_owner_item
,
owner_hash
);
if
(
owner_item
->
mem_blocks
.
next
==
&
owner_item
->
mem_blocks
)
{
drm_sman_remove_owner
(
sman
,
owner_item
);
return
-
1
;
...
...
@@ -302,7 +302,7 @@ int drm_sman_owner_clean(struct drm_sman *sman, unsigned long owner)
EXPORT_SYMBOL
(
drm_sman_owner_clean
);
static
void
drm_sman_do_owner_cleanup
(
struct
drm_sman
*
sman
,
drm_owner_item_t
*
owner_item
)
struct
drm_owner_item
*
owner_item
)
{
struct
drm_memblock_item
*
entry
,
*
next
;
...
...
@@ -316,15 +316,15 @@ static void drm_sman_do_owner_cleanup(struct drm_sman *sman,
void
drm_sman_owner_cleanup
(
struct
drm_sman
*
sman
,
unsigned
long
owner
)
{
drm_hash_item_t
*
hash_item
;
drm_owner_item_t
*
owner_item
;
struct
drm_hash_item
*
hash_item
;
struct
drm_owner_item
*
owner_item
;
if
(
drm_ht_find_item
(
&
sman
->
owner_hash_tab
,
owner
,
&
hash_item
))
{
return
;
}
owner_item
=
drm_hash_entry
(
hash_item
,
drm_owner_item_t
,
owner_hash
);
owner_item
=
drm_hash_entry
(
hash_item
,
struct
drm_owner_item
,
owner_hash
);
drm_sman_do_owner_cleanup
(
sman
,
owner_item
);
}
...
...
@@ -332,7 +332,7 @@ EXPORT_SYMBOL(drm_sman_owner_cleanup);
void
drm_sman_cleanup
(
struct
drm_sman
*
sman
)
{
drm_owner_item_t
*
entry
,
*
next
;
struct
drm_owner_item
*
entry
,
*
next
;
unsigned
int
i
;
struct
drm_sman_mm
*
sman_mm
;
...
...
drivers/char/drm/drm_sman.h
浏览文件 @
e0be428e
...
...
@@ -78,7 +78,7 @@ struct drm_sman_mm {
struct
drm_memblock_item
{
struct
list_head
owner_list
;
drm_hash_item_t
user_hash
;
struct
drm_hash_item
user_hash
;
void
*
mm_info
;
struct
drm_sman_mm
*
mm
;
struct
drm_sman
*
sman
;
...
...
@@ -87,8 +87,8 @@ struct drm_memblock_item {
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
drm_open_hash
owner_hash_tab
;
struct
drm_open_hash
user_hash_tab
;
struct
list_head
owner_items
;
};
...
...
drivers/char/drm/drm_vm.c
浏览文件 @
e0be428e
...
...
@@ -83,7 +83,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma,
struct
drm_device
*
dev
=
priv
->
head
->
dev
;
struct
drm_map
*
map
=
NULL
;
struct
drm_map_list
*
r_list
;
drm_hash_item_t
*
hash
;
struct
drm_hash_item
*
hash
;
/*
* Find the right map
...
...
@@ -549,7 +549,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
struct
drm_device
*
dev
=
priv
->
head
->
dev
;
struct
drm_map
*
map
=
NULL
;
unsigned
long
offset
=
0
;
drm_hash_item_t
*
hash
;
struct
drm_hash_item
*
hash
;
DRM_DEBUG
(
"start = 0x%lx, end = 0x%lx, page offset = 0x%lx
\n
"
,
vma
->
vm_start
,
vma
->
vm_end
,
vma
->
vm_pgoff
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录