Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
e781dc8f
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e781dc8f
编写于
8月 20, 2015
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/device: tidy ctor/dtor interfaces
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
76ecea5b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
41 deletion
+40
-41
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
+4
-6
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/nouveau/nouveau_drm.c
+11
-11
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+25
-24
未找到文件。
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
浏览文件 @
e781dc8f
...
...
@@ -210,12 +210,10 @@ enum nv_bus_type {
NVKM_BUS_PLATFORM
,
};
#define nvkm_device_create(p,t,n,s,c,d,u) \
nvkm_device_create_((void *)(p), (t), (n), (s), (c), (d), \
sizeof(**u), (void **)u)
int
nvkm_device_create_
(
void
*
,
enum
nv_bus_type
type
,
u64
name
,
const
char
*
sname
,
const
char
*
cfg
,
const
char
*
dbg
,
int
,
void
**
);
int
nvkm_device_new
(
void
*
,
enum
nv_bus_type
type
,
u64
name
,
const
char
*
sname
,
const
char
*
cfg
,
const
char
*
dbg
,
struct
nvkm_device
**
);
void
nvkm_device_del
(
struct
nvkm_device
**
);
/* device logging */
#define nvdev_printk_(d,l,p,f,a...) do { \
...
...
drivers/gpu/drm/nouveau/nouveau_drm.c
浏览文件 @
e781dc8f
...
...
@@ -325,9 +325,9 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
remove_conflicting_framebuffers
(
aper
,
"nouveaufb"
,
boot
);
kfree
(
aper
);
ret
=
nvkm_device_
create
(
pdev
,
NVKM_BUS_PCI
,
nouveau_pci_name
(
pdev
),
pci_name
(
pdev
)
,
nouveau_config
,
nouveau_debug
,
&
device
);
ret
=
nvkm_device_
new
(
pdev
,
NVKM_BUS_PCI
,
nouveau_pci_name
(
pdev
)
,
pci_name
(
pdev
),
nouveau_config
,
nouveau_debug
,
&
device
);
if
(
ret
)
return
ret
;
...
...
@@ -335,7 +335,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
ret
=
drm_get_pci_dev
(
pdev
,
pent
,
&
driver_pci
);
if
(
ret
)
{
nvkm_
object_ref
(
NULL
,
(
struct
nvkm_object
**
)
&
device
);
nvkm_
device_del
(
&
device
);
return
ret
;
}
...
...
@@ -537,7 +537,7 @@ nouveau_drm_device_remove(struct drm_device *dev)
device
=
client
->
device
;
drm_put_dev
(
dev
);
nvkm_
object_ref
(
NULL
,
(
struct
nvkm_object
**
)
&
device
);
nvkm_
device_del
(
&
device
);
}
static
void
...
...
@@ -1062,12 +1062,12 @@ nouveau_platform_device_create(struct platform_device *pdev,
struct
drm_device
*
drm
;
int
err
;
err
=
nvkm_device_
create
(
pdev
,
NVKM_BUS_PLATFORM
,
nouveau_platform_name
(
pdev
),
dev_name
(
&
pdev
->
dev
),
nouveau_config
,
nouveau_debug
,
pdevice
);
err
=
nvkm_device_
new
(
pdev
,
NVKM_BUS_PLATFORM
,
nouveau_platform_name
(
pdev
),
dev_name
(
&
pdev
->
dev
),
nouveau_config
,
nouveau_debug
,
pdevice
);
if
(
err
)
return
ERR_PTR
(
err
)
;
goto
err_free
;
drm
=
drm_dev_alloc
(
&
driver_platform
,
&
pdev
->
dev
);
if
(
!
drm
)
{
...
...
@@ -1085,7 +1085,7 @@ nouveau_platform_device_create(struct platform_device *pdev,
return
drm
;
err_free:
nvkm_
object_ref
(
NULL
,
(
struct
nvkm_object
**
)
pdevice
);
nvkm_
device_del
(
pdevice
);
return
ERR_PTR
(
err
);
}
...
...
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
浏览文件 @
e781dc8f
...
...
@@ -666,23 +666,6 @@ nvkm_device_init(struct nvkm_object *object)
return
ret
;
}
static
void
nvkm_device_dtor
(
struct
nvkm_object
*
object
)
{
struct
nvkm_device
*
device
=
(
void
*
)
object
;
nvkm_event_fini
(
&
device
->
event
);
mutex_lock
(
&
nv_devices_mutex
);
list_del
(
&
device
->
head
);
mutex_unlock
(
&
nv_devices_mutex
);
if
(
device
->
pri
)
iounmap
(
device
->
pri
);
nvkm_engine_destroy
(
&
device
->
engine
);
}
resource_size_t
nv_device_resource_start
(
struct
nvkm_device
*
device
,
unsigned
int
bar
)
{
...
...
@@ -728,16 +711,34 @@ static struct nvkm_oclass
nvkm_device_oclass
=
{
.
handle
=
NV_ENGINE
(
DEVICE
,
0x00
),
.
ofuncs
=
&
(
struct
nvkm_ofuncs
)
{
.
dtor
=
nvkm_device_dtor
,
.
init
=
nvkm_device_init
,
.
fini
=
nvkm_device_fini
,
},
};
void
nvkm_device_del
(
struct
nvkm_device
**
pdevice
)
{
struct
nvkm_device
*
device
=
*
pdevice
;
if
(
device
)
{
nvkm_event_fini
(
&
device
->
event
);
mutex_lock
(
&
nv_devices_mutex
);
list_del
(
&
device
->
head
);
mutex_unlock
(
&
nv_devices_mutex
);
if
(
device
->
pri
)
iounmap
(
device
->
pri
);
nvkm_engine_destroy
(
&
device
->
engine
);
*
pdevice
=
NULL
;
}
}
int
nvkm_device_
create_
(
void
*
dev
,
enum
nv_bus_type
type
,
u64
name
,
const
char
*
sname
,
const
char
*
cfg
,
const
char
*
dbg
,
int
length
,
void
**
pobject
)
nvkm_device_
new
(
void
*
dev
,
enum
nv_bus_type
type
,
u64
name
,
const
char
*
sname
,
const
char
*
cfg
,
const
char
*
dbg
,
struct
nvkm_device
**
pdevice
)
{
struct
nvkm_device
*
device
;
int
ret
=
-
EEXIST
;
...
...
@@ -748,9 +749,9 @@ nvkm_device_create_(void *dev, enum nv_bus_type type, u64 name,
goto
done
;
}
ret
=
nvkm_engine_create
_
(
NULL
,
NULL
,
&
nvkm_device_oclass
,
true
,
"DEVICE"
,
"device"
,
length
,
pobject
);
device
=
*
pobject
;
ret
=
nvkm_engine_create
(
NULL
,
NULL
,
&
nvkm_device_oclass
,
true
,
"DEVICE"
,
"device"
,
&
device
);
*
pdevice
=
device
;
if
(
ret
)
goto
done
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录