Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ab0af559
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看板
提交
ab0af559
编写于
8月 10, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nv50/kms: move framebuffer wrangling out of common code
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
7820e5ee
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
81 addition
and
47 deletion
+81
-47
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+12
-47
drivers/gpu/drm/nouveau/nouveau_display.h
drivers/gpu/drm/nouveau/nouveau_display.h
+4
-0
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/nouveau/nv50_display.c
+65
-0
未找到文件。
drivers/gpu/drm/nouveau/nouveau_display.c
浏览文件 @
ab0af559
...
...
@@ -200,6 +200,10 @@ static void
nouveau_user_framebuffer_destroy
(
struct
drm_framebuffer
*
drm_fb
)
{
struct
nouveau_framebuffer
*
fb
=
nouveau_framebuffer
(
drm_fb
);
struct
nouveau_display
*
disp
=
nouveau_display
(
drm_fb
->
dev
);
if
(
disp
->
fb_dtor
)
disp
->
fb_dtor
(
drm_fb
);
if
(
fb
->
nvbo
)
drm_gem_object_unreference_unlocked
(
&
fb
->
nvbo
->
gem
);
...
...
@@ -229,63 +233,24 @@ nouveau_framebuffer_init(struct drm_device *dev,
struct
drm_mode_fb_cmd2
*
mode_cmd
,
struct
nouveau_bo
*
nvbo
)
{
struct
nouveau_d
rm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_d
isplay
*
disp
=
nouveau_display
(
dev
);
struct
drm_framebuffer
*
fb
=
&
nv_fb
->
base
;
int
ret
;
drm_helper_mode_fill_fb_struct
(
fb
,
mode_cmd
);
nv_fb
->
nvbo
=
nvbo
;
if
(
nv_device
(
drm
->
device
)
->
card_type
>=
NV_50
)
{
u32
tile_flags
=
nouveau_bo_tile_layout
(
nvbo
);
if
(
tile_flags
==
0x7a00
||
tile_flags
==
0xfe00
)
nv_fb
->
r_dma
=
NvEvoFB32
;
else
if
(
tile_flags
==
0x7000
)
nv_fb
->
r_dma
=
NvEvoFB16
;
else
nv_fb
->
r_dma
=
NvEvoVRAM_LP
;
switch
(
fb
->
depth
)
{
case
8
:
nv_fb
->
r_format
=
0x1e00
;
break
;
case
15
:
nv_fb
->
r_format
=
0xe900
;
break
;
case
16
:
nv_fb
->
r_format
=
0xe800
;
break
;
case
24
:
case
32
:
nv_fb
->
r_format
=
0xcf00
;
break
;
case
30
:
nv_fb
->
r_format
=
0xd100
;
break
;
default:
NV_ERROR
(
drm
,
"unknown depth %d
\n
"
,
fb
->
depth
);
return
-
EINVAL
;
}
if
(
nvbo
->
tile_flags
&
NOUVEAU_GEM_TILE_NONCONTIG
)
{
NV_ERROR
(
drm
,
"framebuffer requires contiguous bo
\n
"
);
return
-
EINVAL
;
}
if
(
nv_device
(
drm
->
device
)
->
chipset
==
0x50
)
nv_fb
->
r_format
|=
(
tile_flags
<<
8
);
if
(
!
tile_flags
)
{
if
(
nv_device
(
drm
->
device
)
->
card_type
<
NV_D0
)
nv_fb
->
r_pitch
=
0x00100000
|
fb
->
pitches
[
0
];
else
nv_fb
->
r_pitch
=
0x01000000
|
fb
->
pitches
[
0
];
}
else
{
u32
mode
=
nvbo
->
tile_mode
;
if
(
nv_device
(
drm
->
device
)
->
card_type
>=
NV_C0
)
mode
>>=
4
;
nv_fb
->
r_pitch
=
((
fb
->
pitches
[
0
]
/
4
)
<<
4
)
|
mode
;
}
}
ret
=
drm_framebuffer_init
(
dev
,
fb
,
&
nouveau_framebuffer_funcs
);
if
(
ret
)
{
if
(
ret
)
return
ret
;
if
(
disp
->
fb_ctor
)
{
ret
=
disp
->
fb_ctor
(
fb
);
if
(
ret
)
disp
->
fb_dtor
(
fb
);
}
return
0
;
return
ret
;
}
static
struct
drm_framebuffer
*
...
...
drivers/gpu/drm/nouveau/nouveau_display.h
浏览文件 @
ab0af559
...
...
@@ -36,9 +36,13 @@ struct nouveau_display {
int
(
*
init
)(
struct
drm_device
*
);
void
(
*
fini
)(
struct
drm_device
*
);
int
(
*
fb_ctor
)(
struct
drm_framebuffer
*
);
void
(
*
fb_dtor
)(
struct
drm_framebuffer
*
);
struct
nouveau_object
*
core
;
struct
nouveau_eventh
**
vblank
;
struct
drm_property
*
dithering_mode
;
struct
drm_property
*
dithering_depth
;
struct
drm_property
*
underscan_property
;
...
...
drivers/gpu/drm/nouveau/nv50_display.c
浏览文件 @
ab0af559
...
...
@@ -2168,9 +2168,72 @@ nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe)
return
0
;
}
/******************************************************************************
* Framebuffer
*****************************************************************************/
static
void
nv50_fb_dtor
(
struct
drm_framebuffer
*
fb
)
{
}
static
int
nv50_fb_ctor
(
struct
drm_framebuffer
*
fb
)
{
struct
nouveau_framebuffer
*
nv_fb
=
nouveau_framebuffer
(
fb
);
struct
nouveau_drm
*
drm
=
nouveau_drm
(
fb
->
dev
);
struct
nouveau_bo
*
nvbo
=
nv_fb
->
nvbo
;
u32
tile_flags
;
tile_flags
=
nouveau_bo_tile_layout
(
nvbo
);
if
(
tile_flags
==
0x7a00
||
tile_flags
==
0xfe00
)
nv_fb
->
r_dma
=
NvEvoFB32
;
else
if
(
tile_flags
==
0x7000
)
nv_fb
->
r_dma
=
NvEvoFB16
;
else
nv_fb
->
r_dma
=
NvEvoVRAM_LP
;
if
(
nvbo
->
tile_flags
&
NOUVEAU_GEM_TILE_NONCONTIG
)
{
NV_ERROR
(
drm
,
"framebuffer requires contiguous bo
\n
"
);
return
-
EINVAL
;
}
switch
(
fb
->
depth
)
{
case
8
:
nv_fb
->
r_format
=
0x1e00
;
break
;
case
15
:
nv_fb
->
r_format
=
0xe900
;
break
;
case
16
:
nv_fb
->
r_format
=
0xe800
;
break
;
case
24
:
case
32
:
nv_fb
->
r_format
=
0xcf00
;
break
;
case
30
:
nv_fb
->
r_format
=
0xd100
;
break
;
default:
NV_ERROR
(
drm
,
"unknown depth %d
\n
"
,
fb
->
depth
);
return
-
EINVAL
;
}
if
(
nv_device
(
drm
->
device
)
->
chipset
==
0x50
)
nv_fb
->
r_format
|=
(
tile_flags
<<
8
);
if
(
!
tile_flags
)
{
if
(
nv_device
(
drm
->
device
)
->
card_type
<
NV_D0
)
nv_fb
->
r_pitch
=
0x00100000
|
fb
->
pitches
[
0
];
else
nv_fb
->
r_pitch
=
0x01000000
|
fb
->
pitches
[
0
];
}
else
{
u32
mode
=
nvbo
->
tile_mode
;
if
(
nv_device
(
drm
->
device
)
->
card_type
>=
NV_C0
)
mode
>>=
4
;
nv_fb
->
r_pitch
=
((
fb
->
pitches
[
0
]
/
4
)
<<
4
)
|
mode
;
}
return
0
;
}
/******************************************************************************
* Init
*****************************************************************************/
void
nv50_display_fini
(
struct
drm_device
*
dev
)
{
...
...
@@ -2233,6 +2296,8 @@ nv50_display_create(struct drm_device *dev)
nouveau_display
(
dev
)
->
dtor
=
nv50_display_destroy
;
nouveau_display
(
dev
)
->
init
=
nv50_display_init
;
nouveau_display
(
dev
)
->
fini
=
nv50_display_fini
;
nouveau_display
(
dev
)
->
fb_ctor
=
nv50_fb_ctor
;
nouveau_display
(
dev
)
->
fb_dtor
=
nv50_fb_dtor
;
disp
->
core
=
nouveau_display
(
dev
)
->
core
;
/* small shared memory area we use for notifiers and semaphores */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录