Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
488ff207
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
488ff207
编写于
10月 17, 2011
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: no need to pass parameters into set_scale/dither
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
63221755
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
28 deletion
+26
-28
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
+5
-12
drivers/gpu/drm/nouveau/nouveau_crtc.h
drivers/gpu/drm/nouveau/nouveau_crtc.h
+2
-2
drivers/gpu/drm/nouveau/nv50_crtc.c
drivers/gpu/drm/nouveau/nv50_crtc.c
+10
-6
drivers/gpu/drm/nouveau/nvd0_display.c
drivers/gpu/drm/nouveau/nvd0_display.c
+9
-8
未找到文件。
drivers/gpu/drm/nouveau/nouveau_connector.c
浏览文件 @
488ff207
...
@@ -471,7 +471,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
...
@@ -471,7 +471,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
if
(
!
ret
)
if
(
!
ret
)
return
-
EINVAL
;
return
-
EINVAL
;
}
else
{
}
else
{
ret
=
nv_crtc
->
set_scale
(
nv_crtc
,
value
,
true
);
ret
=
nv_crtc
->
set_scale
(
nv_crtc
,
true
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
}
}
...
@@ -486,9 +486,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
...
@@ -486,9 +486,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
if
(
!
nv_crtc
||
!
nv_crtc
->
set_scale
)
if
(
!
nv_crtc
||
!
nv_crtc
->
set_scale
)
return
0
;
return
0
;
return
nv_crtc
->
set_scale
(
nv_crtc
,
return
nv_crtc
->
set_scale
(
nv_crtc
,
true
);
nv_connector
->
scaling_mode
,
true
);
}
}
return
0
;
return
0
;
...
@@ -500,9 +498,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
...
@@ -500,9 +498,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
if
(
!
nv_crtc
||
!
nv_crtc
->
set_scale
)
if
(
!
nv_crtc
||
!
nv_crtc
->
set_scale
)
return
0
;
return
0
;
return
nv_crtc
->
set_scale
(
nv_crtc
,
return
nv_crtc
->
set_scale
(
nv_crtc
,
true
);
nv_connector
->
scaling_mode
,
true
);
}
}
return
0
;
return
0
;
...
@@ -514,9 +510,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
...
@@ -514,9 +510,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
if
(
!
nv_crtc
||
!
nv_crtc
->
set_scale
)
if
(
!
nv_crtc
||
!
nv_crtc
->
set_scale
)
return
0
;
return
0
;
return
nv_crtc
->
set_scale
(
nv_crtc
,
return
nv_crtc
->
set_scale
(
nv_crtc
,
true
);
nv_connector
->
scaling_mode
,
true
);
}
}
return
0
;
return
0
;
...
@@ -532,8 +526,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
...
@@ -532,8 +526,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
if
(
!
nv_crtc
||
!
nv_crtc
->
set_dither
)
if
(
!
nv_crtc
||
!
nv_crtc
->
set_dither
)
return
0
;
return
0
;
return
nv_crtc
->
set_dither
(
nv_crtc
,
nv_connector
->
use_dithering
,
return
nv_crtc
->
set_dither
(
nv_crtc
,
true
);
true
);
}
}
if
(
nv_encoder
&&
nv_encoder
->
dcb
->
type
==
OUTPUT_TV
)
if
(
nv_encoder
&&
nv_encoder
->
dcb
->
type
==
OUTPUT_TV
)
...
...
drivers/gpu/drm/nouveau/nouveau_crtc.h
浏览文件 @
488ff207
...
@@ -67,8 +67,8 @@ struct nouveau_crtc {
...
@@ -67,8 +67,8 @@ struct nouveau_crtc {
int
depth
;
int
depth
;
}
lut
;
}
lut
;
int
(
*
set_dither
)(
struct
nouveau_crtc
*
crtc
,
bool
on
,
bool
update
);
int
(
*
set_dither
)(
struct
nouveau_crtc
*
crtc
,
bool
update
);
int
(
*
set_scale
)(
struct
nouveau_crtc
*
crtc
,
int
mode
,
bool
update
);
int
(
*
set_scale
)(
struct
nouveau_crtc
*
crtc
,
bool
update
);
};
};
static
inline
struct
nouveau_crtc
*
nouveau_crtc
(
struct
drm_crtc
*
crtc
)
static
inline
struct
nouveau_crtc
*
nouveau_crtc
(
struct
drm_crtc
*
crtc
)
...
...
drivers/gpu/drm/nouveau/nv50_crtc.c
浏览文件 @
488ff207
...
@@ -132,10 +132,12 @@ nv50_crtc_blank(struct nouveau_crtc *nv_crtc, bool blanked)
...
@@ -132,10 +132,12 @@ nv50_crtc_blank(struct nouveau_crtc *nv_crtc, bool blanked)
}
}
static
int
static
int
nv50_crtc_set_dither
(
struct
nouveau_crtc
*
nv_crtc
,
bool
on
,
bool
update
)
nv50_crtc_set_dither
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
{
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
struct
nouveau_channel
*
evo
=
nv50_display
(
dev
)
->
master
;
struct
nouveau_channel
*
evo
=
nv50_display
(
dev
)
->
master
;
struct
nouveau_connector
*
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
);
int
ret
;
int
ret
;
NV_DEBUG_KMS
(
dev
,
"
\n
"
);
NV_DEBUG_KMS
(
dev
,
"
\n
"
);
...
@@ -147,7 +149,7 @@ nv50_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update)
...
@@ -147,7 +149,7 @@ nv50_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update)
}
}
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
DITHER_CTRL
),
1
);
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
DITHER_CTRL
),
1
);
if
(
on
)
if
(
nv_connector
->
use_dithering
)
OUT_RING
(
evo
,
NV50_EVO_CRTC_DITHER_CTRL_ON
);
OUT_RING
(
evo
,
NV50_EVO_CRTC_DITHER_CTRL_ON
);
else
else
OUT_RING
(
evo
,
NV50_EVO_CRTC_DITHER_CTRL_OFF
);
OUT_RING
(
evo
,
NV50_EVO_CRTC_DITHER_CTRL_OFF
);
...
@@ -180,15 +182,15 @@ nouveau_crtc_connector_get(struct nouveau_crtc *nv_crtc)
...
@@ -180,15 +182,15 @@ nouveau_crtc_connector_get(struct nouveau_crtc *nv_crtc)
}
}
static
int
static
int
nv50_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
int
scaling_mode
,
bool
update
)
nv50_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
{
struct
nouveau_connector
*
nv_connector
;
struct
nouveau_connector
*
nv_connector
;
struct
drm_crtc
*
crtc
=
&
nv_crtc
->
base
;
struct
drm_crtc
*
crtc
=
&
nv_crtc
->
base
;
struct
drm_device
*
dev
=
crtc
->
dev
;
struct
drm_device
*
dev
=
crtc
->
dev
;
struct
nouveau_channel
*
evo
=
nv50_display
(
dev
)
->
master
;
struct
nouveau_channel
*
evo
=
nv50_display
(
dev
)
->
master
;
struct
drm_display_mode
*
mode
=
&
crtc
->
mode
;
struct
drm_display_mode
*
mode
=
&
crtc
->
mode
;
int
scaling_mode
,
ret
;
u32
ctrl
=
0
,
oX
,
oY
;
u32
ctrl
=
0
,
oX
,
oY
;
int
ret
;
NV_DEBUG_KMS
(
dev
,
"
\n
"
);
NV_DEBUG_KMS
(
dev
,
"
\n
"
);
...
@@ -196,6 +198,8 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, int scaling_mode, bool update)
...
@@ -196,6 +198,8 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, int scaling_mode, bool update)
if
(
!
nv_connector
||
!
nv_connector
->
native_mode
)
{
if
(
!
nv_connector
||
!
nv_connector
->
native_mode
)
{
NV_ERROR
(
dev
,
"no native mode, forcing panel scaling
\n
"
);
NV_ERROR
(
dev
,
"no native mode, forcing panel scaling
\n
"
);
scaling_mode
=
DRM_MODE_SCALE_NONE
;
scaling_mode
=
DRM_MODE_SCALE_NONE
;
}
else
{
scaling_mode
=
nv_connector
->
scaling_mode
;
}
}
/* start off at the resolution we programmed the crtc for, this
/* start off at the resolution we programmed the crtc for, this
...
@@ -663,8 +667,8 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
...
@@ -663,8 +667,8 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
BEGIN_RING
(
evo
,
0
,
NV50_EVO_CRTC
(
nv_crtc
->
index
,
SCALE_CENTER_OFFSET
),
1
);
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
));
OUT_RING
(
evo
,
NV50_EVO_CRTC_SCALE_CENTER_OFFSET_VAL
(
0
,
0
));
nv_crtc
->
set_dither
(
nv_crtc
,
nv_connector
->
use_dithering
,
false
);
nv_crtc
->
set_dither
(
nv_crtc
,
false
);
nv_crtc
->
set_scale
(
nv_crtc
,
nv_connector
->
scaling_mode
,
false
);
nv_crtc
->
set_scale
(
nv_crtc
,
false
);
return
nv50_crtc_do_mode_set_base
(
crtc
,
old_fb
,
x
,
y
,
false
);
return
nv50_crtc_do_mode_set_base
(
crtc
,
old_fb
,
x
,
y
,
false
);
}
}
...
...
drivers/gpu/drm/nouveau/nvd0_display.c
浏览文件 @
488ff207
...
@@ -107,13 +107,14 @@ nvd0_display_crtc_get(struct drm_encoder *encoder)
...
@@ -107,13 +107,14 @@ nvd0_display_crtc_get(struct drm_encoder *encoder)
* CRTC
* CRTC
*****************************************************************************/
*****************************************************************************/
static
int
static
int
nvd0_crtc_set_dither
(
struct
nouveau_crtc
*
nv_crtc
,
bool
on
,
bool
update
)
nvd0_crtc_set_dither
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
{
struct
nouveau_connector
*
nv_connector
;
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
u32
*
push
,
mode
;
u32
*
push
,
mode
=
0
;
mode
=
0x00000000
;
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
)
;
if
(
on
)
{
if
(
nv_connector
->
use_dithering
)
{
/* 0x11: 6bpc dynamic 2x2
/* 0x11: 6bpc dynamic 2x2
* 0x13: 8bpc dynamic 2x2
* 0x13: 8bpc dynamic 2x2
* 0x19: 6bpc static 2x2
* 0x19: 6bpc static 2x2
...
@@ -139,7 +140,7 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update)
...
@@ -139,7 +140,7 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool on, bool update)
}
}
static
int
static
int
nvd0_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
int
type
,
bool
update
)
nvd0_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
{
struct
drm_display_mode
*
mode
=
&
nv_crtc
->
base
.
mode
;
struct
drm_display_mode
*
mode
=
&
nv_crtc
->
base
.
mode
;
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
...
@@ -155,7 +156,7 @@ nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, int type, bool update)
...
@@ -155,7 +156,7 @@ nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, int type, bool update)
u32
xratio
=
(
native
->
hdisplay
<<
19
)
/
mode
->
hdisplay
;
u32
xratio
=
(
native
->
hdisplay
<<
19
)
/
mode
->
hdisplay
;
u32
yratio
=
(
native
->
vdisplay
<<
19
)
/
mode
->
vdisplay
;
u32
yratio
=
(
native
->
vdisplay
<<
19
)
/
mode
->
vdisplay
;
switch
(
typ
e
)
{
switch
(
nv_connector
->
scaling_mod
e
)
{
case
DRM_MODE_SCALE_ASPECT
:
case
DRM_MODE_SCALE_ASPECT
:
if
(
xratio
>
yratio
)
{
if
(
xratio
>
yratio
)
{
outX
=
(
mode
->
hdisplay
*
yratio
)
>>
19
;
outX
=
(
mode
->
hdisplay
*
yratio
)
>>
19
;
...
@@ -378,8 +379,8 @@ nvd0_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
...
@@ -378,8 +379,8 @@ nvd0_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
}
}
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
);
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
);
nvd0_crtc_set_dither
(
nv_crtc
,
nv_connector
->
use_dithering
,
false
);
nvd0_crtc_set_dither
(
nv_crtc
,
false
);
nvd0_crtc_set_scale
(
nv_crtc
,
nv_connector
->
scaling_mode
,
false
);
nvd0_crtc_set_scale
(
nv_crtc
,
false
);
nvd0_crtc_set_image
(
nv_crtc
,
crtc
->
fb
,
x
,
y
,
false
);
nvd0_crtc_set_image
(
nv_crtc
,
crtc
->
fb
,
x
,
y
,
false
);
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录