Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
92854622
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
92854622
编写于
11月 11, 2011
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nvd0/disp: scaler updates, overscan compensation etc
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
2d1d898b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
67 addition
and
33 deletion
+67
-33
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+3
-3
drivers/gpu/drm/nouveau/nvd0_display.c
drivers/gpu/drm/nouveau/nvd0_display.c
+64
-30
未找到文件。
drivers/gpu/drm/nouveau/nouveau_display.c
浏览文件 @
92854622
...
...
@@ -161,9 +161,9 @@ struct drm_prop_enum_list {
};
static
struct
drm_prop_enum_list
underscan
[]
=
{
{
2
,
UNDERSCAN_AUTO
,
"auto"
},
{
2
,
UNDERSCAN_OFF
,
"off"
},
{
2
,
UNDERSCAN_ON
,
"on"
},
{
6
,
UNDERSCAN_AUTO
,
"auto"
},
{
6
,
UNDERSCAN_OFF
,
"off"
},
{
6
,
UNDERSCAN_ON
,
"on"
},
{}
};
...
...
drivers/gpu/drm/nouveau/nvd0_display.c
浏览文件 @
92854622
...
...
@@ -160,49 +160,83 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
static
int
nvd0_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
struct
drm_display_mode
*
mode
=
&
nv_crtc
->
base
.
mode
;
struct
drm_display_mode
*
omode
,
*
u
mode
=
&
nv_crtc
->
base
.
mode
;
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
struct
nouveau_connector
*
nv_connector
;
u32
*
push
,
outX
,
outY
;
outX
=
mode
->
hdisplay
;
outY
=
mode
->
vdisplay
;
int
mode
=
DRM_MODE_SCALE_NONE
;
u32
oX
,
oY
,
*
push
;
/* start off at the resolution we programmed the crtc for, this
* effectively handles NONE/FULL scaling
*/
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
);
if
(
nv_connector
&&
nv_connector
->
native_mode
)
{
struct
drm_display_mode
*
native
=
nv_connector
->
native_mode
;
u32
xratio
=
(
native
->
hdisplay
<<
19
)
/
mode
->
hdisplay
;
u32
yratio
=
(
native
->
vdisplay
<<
19
)
/
mode
->
vdisplay
;
if
(
nv_connector
&&
nv_connector
->
native_mode
)
mode
=
nv_connector
->
scaling_mode
;
if
(
mode
!=
DRM_MODE_SCALE_NONE
)
omode
=
nv_connector
->
native_mode
;
else
omode
=
umode
;
oX
=
omode
->
hdisplay
;
oY
=
omode
->
vdisplay
;
if
(
omode
->
flags
&
DRM_MODE_FLAG_DBLSCAN
)
oY
*=
2
;
/* add overscan compensation if necessary, will keep the aspect
* ratio the same as the backend mode unless overridden by the
* user setting both hborder and vborder properties.
*/
if
(
nv_connector
&&
(
nv_connector
->
underscan
==
UNDERSCAN_ON
||
(
nv_connector
->
underscan
==
UNDERSCAN_AUTO
&&
nv_connector
->
edid
&&
drm_detect_hdmi_monitor
(
nv_connector
->
edid
))))
{
u32
bX
=
nv_connector
->
underscan_hborder
;
u32
bY
=
nv_connector
->
underscan_vborder
;
u32
aspect
=
(
oY
<<
19
)
/
oX
;
if
(
bX
)
{
oX
-=
(
bX
*
2
);
if
(
bY
)
oY
-=
(
bY
*
2
);
else
oY
=
((
oX
*
aspect
)
+
(
aspect
/
2
))
>>
19
;
}
else
{
oX
-=
(
oX
>>
4
)
+
32
;
if
(
bY
)
oY
-=
(
bY
*
2
);
else
oY
=
((
oX
*
aspect
)
+
(
aspect
/
2
))
>>
19
;
}
}
switch
(
nv_connector
->
scaling_mode
)
{
/* handle CENTER/ASPECT scaling, taking into account the areas
* removed already for overscan compensation
*/
switch
(
mode
)
{
case
DRM_MODE_SCALE_CENTER
:
oX
=
min
((
u32
)
umode
->
hdisplay
,
oX
);
oY
=
min
((
u32
)
umode
->
vdisplay
,
oY
);
/* fall-through */
case
DRM_MODE_SCALE_ASPECT
:
if
(
xratio
>
yratio
)
{
outX
=
(
mode
->
hdisplay
*
yratio
)
>>
19
;
outY
=
(
mode
->
vdisplay
*
yratio
)
>>
19
;
if
(
oY
<
oX
)
{
u32
aspect
=
(
umode
->
hdisplay
<<
19
)
/
umode
->
vdisplay
;
oX
=
((
oY
*
aspect
)
+
(
aspect
/
2
)
)
>>
19
;
}
else
{
outX
=
(
mode
->
hdisplay
*
xratio
)
>>
19
;
outY
=
(
mode
->
vdisplay
*
xratio
)
>>
19
;
u32
aspect
=
(
umode
->
vdisplay
<<
19
)
/
umode
->
hdisplay
;
oY
=
((
oX
*
aspect
)
+
(
aspect
/
2
)
)
>>
19
;
}
break
;
case
DRM_MODE_SCALE_FULLSCREEN
:
outX
=
native
->
hdisplay
;
outY
=
native
->
vdisplay
;
break
;
default:
break
;
}
}
push
=
evo_wait
(
dev
,
0
,
16
);
if
(
push
)
{
evo_mthd
(
push
,
0x04c0
+
(
nv_crtc
->
index
*
0x300
),
3
);
evo_data
(
push
,
(
o
utY
<<
16
)
|
out
X
);
evo_data
(
push
,
(
o
utY
<<
16
)
|
out
X
);
evo_data
(
push
,
(
o
utY
<<
16
)
|
out
X
);
evo_data
(
push
,
(
o
Y
<<
16
)
|
o
X
);
evo_data
(
push
,
(
o
Y
<<
16
)
|
o
X
);
evo_data
(
push
,
(
o
Y
<<
16
)
|
o
X
);
evo_mthd
(
push
,
0x0494
+
(
nv_crtc
->
index
*
0x300
),
1
);
evo_data
(
push
,
0x00000000
);
evo_mthd
(
push
,
0x04b8
+
(
nv_crtc
->
index
*
0x300
),
1
);
evo_data
(
push
,
(
mode
->
vdisplay
<<
16
)
|
mode
->
hdisplay
);
evo_data
(
push
,
(
umode
->
vdisplay
<<
16
)
|
u
mode
->
hdisplay
);
if
(
update
)
{
evo_mthd
(
push
,
0x0080
,
1
);
evo_data
(
push
,
0x00000000
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录