Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
1608a0fb
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1608a0fb
编写于
11月 04, 2016
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/fbcon: refcount the drm_framebuffer
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
595b61cc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
38 deletion
+34
-38
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+25
-28
drivers/gpu/drm/nouveau/nouveau_display.h
drivers/gpu/drm/nouveau/nouveau_display.h
+3
-2
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
+6
-7
drivers/gpu/drm/nouveau/nouveau_fbcon.h
drivers/gpu/drm/nouveau/nouveau_fbcon.h
+0
-1
未找到文件。
drivers/gpu/drm/nouveau/nouveau_display.c
浏览文件 @
1608a0fb
...
...
@@ -245,28 +245,32 @@ static const struct drm_framebuffer_funcs nouveau_framebuffer_funcs = {
};
int
nouveau_framebuffer_
init
(
struct
drm_device
*
dev
,
struct
nouveau_framebuffer
*
nv_fb
,
const
struct
drm_mode_fb_cmd2
*
mode_cmd
,
struct
nouveau_bo
*
nvbo
)
nouveau_framebuffer_
new
(
struct
drm_device
*
dev
,
const
struct
drm_mode_fb_cmd2
*
mode_cmd
,
struct
nouveau_bo
*
nvbo
,
struct
nouveau_framebuffer
**
pfb
)
{
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
struct
drm_framebuffer
*
fb
=
&
nv_fb
->
base
;
struct
nouveau_framebuffer
*
fb
;
int
ret
;
drm_helper_mode_fill_fb_struct
(
fb
,
mode_cmd
);
nv_fb
->
nvbo
=
nvbo
;
if
(
!
(
fb
=
kzalloc
(
sizeof
(
*
fb
),
GFP_KERNEL
)))
return
-
ENOMEM
;
ret
=
drm_framebuffer_init
(
dev
,
fb
,
&
nouveau_framebuffer_funcs
);
if
(
ret
)
return
ret
;
drm_helper_mode_fill_fb_struct
(
&
fb
->
base
,
mode_cmd
);
fb
->
nvbo
=
nvbo
;
if
(
disp
->
fb_ctor
)
{
ret
=
disp
->
fb_ctor
(
fb
);
if
(
ret
)
disp
->
fb_dtor
(
fb
);
ret
=
drm_framebuffer_init
(
dev
,
&
fb
->
base
,
&
nouveau_framebuffer_funcs
);
if
(
ret
==
0
)
{
if
(
!
disp
->
fb_ctor
||
!
(
ret
=
disp
->
fb_ctor
(
&
fb
->
base
)))
{
*
pfb
=
fb
;
return
0
;
}
disp
->
fb_dtor
(
&
fb
->
base
);
drm_framebuffer_cleanup
(
&
fb
->
base
);
}
kfree
(
fb
);
return
ret
;
}
...
...
@@ -275,27 +279,20 @@ nouveau_user_framebuffer_create(struct drm_device *dev,
struct
drm_file
*
file_priv
,
const
struct
drm_mode_fb_cmd2
*
mode_cmd
)
{
struct
nouveau_framebuffer
*
nouveau_fb
;
struct
nouveau_framebuffer
*
fb
;
struct
nouveau_bo
*
nvbo
;
struct
drm_gem_object
*
gem
;
int
ret
=
-
ENOMEM
;
int
ret
;
gem
=
drm_gem_object_lookup
(
file_priv
,
mode_cmd
->
handles
[
0
]);
if
(
!
gem
)
return
ERR_PTR
(
-
ENOENT
);
nvbo
=
nouveau_gem_object
(
gem
);
nouveau_fb
=
kzalloc
(
sizeof
(
struct
nouveau_framebuffer
),
GFP_KERNEL
);
if
(
!
nouveau_fb
)
goto
err_unref
;
ret
=
nouveau_framebuffer_init
(
dev
,
nouveau_fb
,
mode_cmd
,
nouveau_gem_object
(
gem
));
if
(
ret
)
goto
err
;
return
&
nouveau_fb
->
base
;
ret
=
nouveau_framebuffer_new
(
dev
,
mode_cmd
,
nvbo
,
&
fb
);
if
(
ret
==
0
)
return
&
fb
->
base
;
err:
kfree
(
nouveau_fb
);
err_unref:
drm_gem_object_unreference_unlocked
(
gem
);
return
ERR_PTR
(
ret
);
}
...
...
drivers/gpu/drm/nouveau/nouveau_display.h
浏览文件 @
1608a0fb
...
...
@@ -22,8 +22,9 @@ nouveau_framebuffer(struct drm_framebuffer *fb)
return
container_of
(
fb
,
struct
nouveau_framebuffer
,
base
);
}
int
nouveau_framebuffer_init
(
struct
drm_device
*
,
struct
nouveau_framebuffer
*
,
const
struct
drm_mode_fb_cmd2
*
,
struct
nouveau_bo
*
);
int
nouveau_framebuffer_new
(
struct
drm_device
*
,
const
struct
drm_mode_fb_cmd2
*
,
struct
nouveau_bo
*
,
struct
nouveau_framebuffer
**
);
struct
nouveau_page_flip_state
{
struct
list_head
head
;
...
...
drivers/gpu/drm/nouveau/nouveau_fbcon.c
浏览文件 @
1608a0fb
...
...
@@ -359,8 +359,9 @@ nouveau_fbcon_create(struct drm_fb_helper *helper,
goto
out
;
}
nouveau_framebuffer_init
(
dev
,
&
fbcon
->
fb
,
&
mode_cmd
,
nvbo
);
fb
=
&
fbcon
->
fb
;
ret
=
nouveau_framebuffer_new
(
dev
,
&
mode_cmd
,
nvbo
,
&
fb
);
if
(
ret
)
goto
out_unref
;
ret
=
nouveau_bo_pin
(
nvbo
,
TTM_PL_FLAG_VRAM
,
false
);
if
(
ret
)
{
...
...
@@ -454,17 +455,15 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *fbcon)
drm_fb_helper_unregister_fbi
(
&
fbcon
->
helper
);
drm_fb_helper_release_fbi
(
&
fbcon
->
helper
);
drm_fb_helper_fini
(
&
fbcon
->
helper
);
if
(
nouveau_fb
->
nvbo
)
{
nouveau_bo_vma_del
(
nouveau_fb
->
nvbo
,
&
nouveau_fb
->
vma
);
nouveau_bo_unmap
(
nouveau_fb
->
nvbo
);
nouveau_bo_unpin
(
nouveau_fb
->
nvbo
);
drm_gem_object_unreference_unlocked
(
&
nouveau_fb
->
nvbo
->
gem
);
nouveau_fb
->
nvbo
=
NULL
;
drm_framebuffer_unreference
(
&
nouveau_fb
->
base
);
}
drm_fb_helper_fini
(
&
fbcon
->
helper
);
drm_framebuffer_unregister_private
(
&
nouveau_fb
->
base
);
drm_framebuffer_cleanup
(
&
nouveau_fb
->
base
);
return
0
;
}
...
...
drivers/gpu/drm/nouveau/nouveau_fbcon.h
浏览文件 @
1608a0fb
...
...
@@ -33,7 +33,6 @@
struct
nouveau_fbdev
{
struct
drm_fb_helper
helper
;
struct
nouveau_framebuffer
fb
;
unsigned
int
saved_flags
;
struct
nvif_object
surf2d
;
struct
nvif_object
clip
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录