Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
616a5f57
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看板
提交
616a5f57
编写于
10月 20, 2011
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nv50/disp: rewrite crtc timing calculation, with proper names and fixes
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
a03a8623
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
56 addition
and
71 deletion
+56
-71
drivers/gpu/drm/nouveau/nv50_crtc.c
drivers/gpu/drm/nouveau/nv50_crtc.c
+56
-71
未找到文件。
drivers/gpu/drm/nouveau/nv50_crtc.c
浏览文件 @
616a5f57
...
...
@@ -588,89 +588,74 @@ nv50_crtc_do_mode_set_base(struct drm_crtc *crtc,
}
static
int
nv50_crtc_mode_set
(
struct
drm_crtc
*
crtc
,
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_
mode
,
int
x
,
int
y
,
nv50_crtc_mode_set
(
struct
drm_crtc
*
crtc
,
struct
drm_display_mode
*
u
mode
,
struct
drm_display_mode
*
mode
,
int
x
,
int
y
,
struct
drm_framebuffer
*
old_fb
)
{
struct
drm_device
*
dev
=
crtc
->
dev
;
struct
nouveau_channel
*
evo
=
nv50_display
(
dev
)
->
master
;
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nouveau_connector
*
nv_connector
=
NULL
;
uint32_t
hsync_dur
,
vsync_dur
,
hsync_start_to_end
,
vsync_start_to_end
;
uint32_t
hunk1
,
vunk1
,
vunk2a
,
vunk2b
;
u32
head
=
nv_crtc
->
index
*
0x400
;
u32
ilace
=
(
mode
->
flags
&
DRM_MODE_FLAG_INTERLACE
)
?
2
:
1
;
u32
vscan
=
(
mode
->
flags
&
DRM_MODE_FLAG_DBLSCAN
)
?
2
:
1
;
u32
hactive
,
hsynce
,
hbackp
,
hfrontp
,
hblanke
,
hblanks
;
u32
vactive
,
vsynce
,
vbackp
,
vfrontp
,
vblanke
,
vblanks
;
u32
vblan2e
=
0
,
vblan2s
=
1
;
int
ret
;
/* Find the connector attached to this CRTC */
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
);
NV_DEBUG_KMS
(
dev
,
"index %d
\n
"
,
nv_crtc
->
index
);
/* hw timing description looks like this:
*
* <sync> <back porch> <---------display---------> <front porch>
* ______
* |____________|---------------------------|____________|
*
* ^ synce ^ blanke ^ blanks ^ active
*
* interlaced modes also have 2 additional values pointing at the end
* and start of the next field's blanking period.
*/
hsync_dur
=
adjusted_mode
->
hsync_end
-
adjusted_mode
->
hsync_start
;
vsync_dur
=
adjusted_mode
->
vsync_end
-
adjusted_mode
->
vsync_start
;
hsync_start_to_end
=
adjusted_mode
->
htotal
-
adjusted_mode
->
hsync_start
;
vsync_start_to_end
=
adjusted_mode
->
vtotal
-
adjusted_mode
->
vsync_start
;
/* I can't give this a proper name, anyone else can? */
hunk1
=
adjusted_mode
->
htotal
-
adjusted_mode
->
hsync_start
+
adjusted_mode
->
hdisplay
;
vunk1
=
adjusted_mode
->
vtotal
-
adjusted_mode
->
vsync_start
+
adjusted_mode
->
vdisplay
;
/* Another strange value, this time only for interlaced adjusted_modes. */
vunk2a
=
2
*
adjusted_mode
->
vtotal
-
adjusted_mode
->
vsync_start
+
adjusted_mode
->
vdisplay
;
vunk2b
=
adjusted_mode
->
vtotal
-
adjusted_mode
->
vsync_start
+
adjusted_mode
->
vtotal
;
if
(
adjusted_mode
->
flags
&
DRM_MODE_FLAG_INTERLACE
)
{
vsync_dur
/=
2
;
vsync_start_to_end
/=
2
;
vunk1
/=
2
;
vunk2a
/=
2
;
vunk2b
/=
2
;
/* magic */
if
(
adjusted_mode
->
flags
&
DRM_MODE_FLAG_DBLSCAN
)
{
vsync_start_to_end
-=
1
;
vunk1
-=
1
;
vunk2a
-=
1
;
vunk2b
-=
1
;
}
hactive
=
mode
->
htotal
;
hsynce
=
mode
->
hsync_end
-
mode
->
hsync_start
-
1
;
hbackp
=
mode
->
htotal
-
mode
->
hsync_end
;
hblanke
=
hsynce
+
hbackp
;
hfrontp
=
mode
->
hsync_start
-
mode
->
hdisplay
;
hblanks
=
mode
->
htotal
-
hfrontp
-
1
;
vactive
=
mode
->
vtotal
*
vscan
/
ilace
;
vsynce
=
((
mode
->
vsync_end
-
mode
->
vsync_start
)
*
vscan
/
ilace
)
-
1
;
vbackp
=
(
mode
->
vtotal
-
mode
->
vsync_end
)
*
vscan
/
ilace
;
vblanke
=
vsynce
+
vbackp
;
vfrontp
=
(
mode
->
vsync_start
-
mode
->
vdisplay
)
*
vscan
/
ilace
;
vblanks
=
vactive
-
vfrontp
-
1
;
if
(
mode
->
flags
&
DRM_MODE_FLAG_INTERLACE
)
{
vblan2e
=
vactive
+
vsynce
+
vbackp
;
vblan2s
=
vblan2e
+
(
mode
->
vdisplay
*
vscan
/
ilace
);
vactive
=
(
vactive
*
2
)
+
1
;
}
ret
=
RING_SPACE
(
evo
,
19
);
if
(
ret
)
return
ret
;
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
CLOCK
),
2
);
OUT_RING
(
evo
,
adjusted_mode
->
clock
|
0x800000
);
OUT_RING
(
evo
,
(
adjusted_mode
->
flags
&
DRM_MODE_FLAG_INTERLACE
)
?
2
:
0
);
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
DISPLAY_START
),
5
);
OUT_RING
(
evo
,
0
);
OUT_RING
(
evo
,
(
adjusted_mode
->
vtotal
<<
16
)
|
adjusted_mode
->
htotal
);
OUT_RING
(
evo
,
(
vsync_dur
-
1
)
<<
16
|
(
hsync_dur
-
1
));
OUT_RING
(
evo
,
(
vsync_start_to_end
-
1
)
<<
16
|
(
hsync_start_to_end
-
1
));
OUT_RING
(
evo
,
(
vunk1
-
1
)
<<
16
|
(
hunk1
-
1
));
if
(
adjusted_mode
->
flags
&
DRM_MODE_FLAG_INTERLACE
)
{
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
UNK0824
),
1
);
OUT_RING
(
evo
,
(
vunk2b
-
1
)
<<
16
|
(
vunk2a
-
1
));
}
else
{
OUT_RING
(
evo
,
0
);
OUT_RING
(
evo
,
0
);
ret
=
RING_SPACE
(
evo
,
18
);
if
(
ret
==
0
)
{
BEGIN_RING
(
evo
,
0
,
0x0804
+
head
,
2
);
OUT_RING
(
evo
,
0x00800000
|
mode
->
clock
);
OUT_RING
(
evo
,
(
ilace
==
2
)
?
2
:
0
);
BEGIN_RING
(
evo
,
0
,
0x0810
+
head
,
6
);
OUT_RING
(
evo
,
0x00000000
);
/* border colour */
OUT_RING
(
evo
,
(
vactive
<<
16
)
|
hactive
);
OUT_RING
(
evo
,
(
vsynce
<<
16
)
|
hsynce
);
OUT_RING
(
evo
,
(
vblanke
<<
16
)
|
hblanke
);
OUT_RING
(
evo
,
(
vblanks
<<
16
)
|
hblanks
);
OUT_RING
(
evo
,
(
vblan2e
<<
16
)
|
vblan2s
);
BEGIN_RING
(
evo
,
0
,
0x082c
+
head
,
1
);
OUT_RING
(
evo
,
0x00000000
);
BEGIN_RING
(
evo
,
0
,
0x0900
+
head
,
1
);
OUT_RING
(
evo
,
0x00000311
);
/* makes sync channel work */
BEGIN_RING
(
evo
,
0
,
0x08c8
+
head
,
1
);
OUT_RING
(
evo
,
(
umode
->
vdisplay
<<
16
)
|
umode
->
hdisplay
);
BEGIN_RING
(
evo
,
0
,
0x08d4
+
head
,
1
);
OUT_RING
(
evo
,
0x00000000
);
/* screen position */
}
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
UNK082C
),
1
);
OUT_RING
(
evo
,
0
);
/* required to make display sync channel not hate life */
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
UNK900
),
1
);
OUT_RING
(
evo
,
0x00000311
);
/* This is the actual resolution of the mode. */
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
REAL_RES
),
1
);
OUT_RING
(
evo
,
(
mode
->
vdisplay
<<
16
)
|
mode
->
hdisplay
);
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
SCALE_CENTER_OFFSET
),
1
);
OUT_RING
(
evo
,
NV50_EVO_CRTC_SCALE_CENTER_OFFSET_VAL
(
0
,
0
));
nv_crtc
->
set_dither
(
nv_crtc
,
false
);
nv_crtc
->
set_scale
(
nv_crtc
,
false
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录