Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
1c30cd09
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看板
提交
1c30cd09
编写于
11月 08, 2012
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nvd0/disp: move HDMI control to core
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
0a9e2b95
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
86 addition
and
29 deletion
+86
-29
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/hdminvd0.c
drivers/gpu/drm/nouveau/core/engine/disp/hdminvd0.c
+62
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
+3
-0
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nve0.c
drivers/gpu/drm/nouveau/core/engine/disp/nve0.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
+3
-0
drivers/gpu/drm/nouveau/core/include/core/class.h
drivers/gpu/drm/nouveau/core/include/core/class.h
+6
-0
drivers/gpu/drm/nouveau/nvd0_display.c
drivers/gpu/drm/nouveau/nvd0_display.c
+8
-29
未找到文件。
drivers/gpu/drm/nouveau/Makefile
浏览文件 @
1c30cd09
...
...
@@ -139,6 +139,7 @@ nouveau-y += core/engine/disp/nvd0.o
nouveau-y
+=
core/engine/disp/nve0.o
nouveau-y
+=
core/engine/disp/dacnv50.o
nouveau-y
+=
core/engine/disp/hdanvd0.o
nouveau-y
+=
core/engine/disp/hdminvd0.o
nouveau-y
+=
core/engine/disp/sornv50.o
nouveau-y
+=
core/engine/disp/sornvd0.o
nouveau-y
+=
core/engine/disp/vga.o
...
...
drivers/gpu/drm/nouveau/core/engine/disp/hdminvd0.c
0 → 100644
浏览文件 @
1c30cd09
/*
* Copyright 2012 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include <core/os.h>
#include <core/class.h>
#include "nv50.h"
int
nvd0_hdmi_ctrl
(
struct
nv50_disp_priv
*
priv
,
int
head
,
int
or
,
u32
data
)
{
const
u32
hoff
=
(
head
*
0x800
);
if
(
!
(
data
&
NV84_DISP_SOR_HDMI_PWR_STATE_ON
))
{
nv_mask
(
priv
,
0x616798
+
hoff
,
0x40000000
,
0x00000000
);
nv_mask
(
priv
,
0x6167a4
+
hoff
,
0x00000001
,
0x00000000
);
nv_mask
(
priv
,
0x616714
+
hoff
,
0x00000001
,
0x00000000
);
return
0
;
}
/* AVI InfoFrame */
nv_mask
(
priv
,
0x616714
+
hoff
,
0x00000001
,
0x00000000
);
nv_wr32
(
priv
,
0x61671c
+
hoff
,
0x000d0282
);
nv_wr32
(
priv
,
0x616720
+
hoff
,
0x0000006f
);
nv_wr32
(
priv
,
0x616724
+
hoff
,
0x00000000
);
nv_wr32
(
priv
,
0x616728
+
hoff
,
0x00000000
);
nv_wr32
(
priv
,
0x61672c
+
hoff
,
0x00000000
);
nv_mask
(
priv
,
0x616714
+
hoff
,
0x00000001
,
0x00000001
);
/* ??? InfoFrame? */
nv_mask
(
priv
,
0x6167a4
+
hoff
,
0x00000001
,
0x00000000
);
nv_wr32
(
priv
,
0x6167ac
+
hoff
,
0x00000010
);
nv_mask
(
priv
,
0x6167a4
+
hoff
,
0x00000001
,
0x00000001
);
/* HDMI_CTRL */
nv_mask
(
priv
,
0x616798
+
hoff
,
0x401f007f
,
data
);
/* NFI, audio doesn't work without it though.. */
nv_mask
(
priv
,
0x616548
+
hoff
,
0x00000070
,
0x00000000
);
return
0
;
}
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
浏览文件 @
1c30cd09
...
...
@@ -25,6 +25,7 @@ struct nv50_disp_priv {
int
nr
;
int
(
*
power
)(
struct
nv50_disp_priv
*
,
int
sor
,
u32
data
);
int
(
*
hda_eld
)(
struct
nv50_disp_priv
*
,
int
sor
,
u8
*
,
u32
);
int
(
*
hdmi
)(
struct
nv50_disp_priv
*
,
int
head
,
int
sor
,
u32
);
int
(
*
dp_train
)(
struct
nv50_disp_priv
*
,
int
sor
,
int
link
,
u16
type
,
u16
mask
,
u32
data
,
struct
dcb_output
*
);
...
...
@@ -52,6 +53,8 @@ int nv50_sor_power(struct nv50_disp_priv *, int, u32);
int
nvd0_hda_eld
(
struct
nv50_disp_priv
*
,
int
,
u8
*
,
u32
);
int
nvd0_hdmi_ctrl
(
struct
nv50_disp_priv
*
,
int
,
int
,
u32
);
int
nvd0_sor_dp_train
(
struct
nv50_disp_priv
*
,
int
,
int
,
u16
,
u16
,
u32
,
struct
dcb_output
*
);
int
nvd0_sor_dp_lnkctl
(
struct
nv50_disp_priv
*
,
int
,
int
,
int
,
u16
,
u16
,
u32
,
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
浏览文件 @
1c30cd09
...
...
@@ -43,6 +43,7 @@ struct nouveau_omthds
nva3_disp_base_omthds
[]
=
{
{
SOR_MTHD
(
NV50_DISP_SOR_PWR
)
,
nv50_sor_mthd
},
{
SOR_MTHD
(
NVA3_DISP_SOR_HDA_ELD
)
,
nv50_sor_mthd
},
{
SOR_MTHD
(
NV84_DISP_SOR_HDMI_PWR
)
,
nv50_sor_mthd
},
{
SOR_MTHD
(
NV94_DISP_SOR_DP_TRAIN
)
,
nv50_sor_mthd
},
{
SOR_MTHD
(
NV94_DISP_SOR_DP_LNKCTL
)
,
nv50_sor_mthd
},
{
SOR_MTHD
(
NV94_DISP_SOR_DP_DRVCTL
(
0
)),
nv50_sor_mthd
},
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
浏览文件 @
1c30cd09
...
...
@@ -900,6 +900,7 @@ nvd0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
priv
->
sor
.
hda_eld
=
nvd0_hda_eld
;
priv
->
sor
.
hdmi
=
nvd0_hdmi_ctrl
;
priv
->
sor
.
dp_train
=
nvd0_sor_dp_train
;
priv
->
sor
.
dp_lnkctl
=
nvd0_sor_dp_lnkctl
;
priv
->
sor
.
dp_drvctl
=
nvd0_sor_dp_drvctl
;
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nve0.c
浏览文件 @
1c30cd09
...
...
@@ -70,6 +70,7 @@ nve0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
priv
->
sor
.
hda_eld
=
nvd0_hda_eld
;
priv
->
sor
.
hdmi
=
nvd0_hdmi_ctrl
;
priv
->
sor
.
dp_train
=
nvd0_sor_dp_train
;
priv
->
sor
.
dp_lnkctl
=
nvd0_sor_dp_lnkctl
;
priv
->
sor
.
dp_drvctl
=
nvd0_sor_dp_drvctl
;
...
...
drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
浏览文件 @
1c30cd09
...
...
@@ -91,6 +91,9 @@ nv50_sor_mthd(struct nouveau_object *object, u32 mthd, void *args, u32 size)
case
NVA3_DISP_SOR_HDA_ELD
:
ret
=
priv
->
sor
.
hda_eld
(
priv
,
or
,
args
,
size
);
break
;
case
NV84_DISP_SOR_HDMI_PWR
:
ret
=
priv
->
sor
.
hdmi
(
priv
,
head
,
or
,
data
);
break
;
case
NV94_DISP_SOR_DP_TRAIN
:
ret
=
priv
->
sor
.
dp_train
(
priv
,
or
,
link
,
type
,
mask
,
data
,
&
outp
);
break
;
...
...
drivers/gpu/drm/nouveau/core/include/core/class.h
浏览文件 @
1c30cd09
...
...
@@ -182,6 +182,12 @@ struct nve0_channel_ind_class {
#define NV50_DISP_SOR_PWR_STATE_ON 0x00000001
#define NV50_DISP_SOR_PWR_STATE_OFF 0x00000000
#define NVA3_DISP_SOR_HDA_ELD 0x00010100
#define NV84_DISP_SOR_HDMI_PWR 0x00012000
#define NV84_DISP_SOR_HDMI_PWR_STATE 0x40000000
#define NV84_DISP_SOR_HDMI_PWR_STATE_OFF 0x00000000
#define NV84_DISP_SOR_HDMI_PWR_STATE_ON 0x40000000
#define NV84_DISP_SOR_HDMI_PWR_MAX_AC_PACKET 0x001f0000
#define NV84_DISP_SOR_HDMI_PWR_REKEY 0x0000007f
#define NV94_DISP_SOR_DP_TRAIN 0x00016000
#define NV94_DISP_SOR_DP_TRAIN_PATTERN 0x00000003
#define NV94_DISP_SOR_DP_TRAIN_PATTERN_DISABLED 0x00000000
...
...
drivers/gpu/drm/nouveau/nvd0_display.c
浏览文件 @
1c30cd09
...
...
@@ -1269,9 +1269,8 @@ nvd0_hdmi_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode)
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
encoder
->
crtc
);
struct
nouveau_connector
*
nv_connector
;
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
nouveau_device
*
device
=
nouveau_dev
(
dev
);
int
head
=
nv_crtc
->
index
*
0x800
;
struct
nvd0_disp
*
disp
=
nvd0_disp
(
encoder
->
dev
);
const
u32
moff
=
(
nv_crtc
->
index
<<
3
)
|
nv_encoder
->
or
;
u32
rekey
=
56
;
/* binary driver, and tegra constant */
u32
max_ac_packet
;
...
...
@@ -1284,26 +1283,9 @@ nvd0_hdmi_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode)
max_ac_packet
-=
18
;
/* constant from tegra */
max_ac_packet
/=
32
;
/* AVI InfoFrame */
nv_mask
(
device
,
0x616714
+
head
,
0x00000001
,
0x00000000
);
nv_wr32
(
device
,
0x61671c
+
head
,
0x000d0282
);
nv_wr32
(
device
,
0x616720
+
head
,
0x0000006f
);
nv_wr32
(
device
,
0x616724
+
head
,
0x00000000
);
nv_wr32
(
device
,
0x616728
+
head
,
0x00000000
);
nv_wr32
(
device
,
0x61672c
+
head
,
0x00000000
);
nv_mask
(
device
,
0x616714
+
head
,
0x00000001
,
0x00000001
);
/* ??? InfoFrame? */
nv_mask
(
device
,
0x6167a4
+
head
,
0x00000001
,
0x00000000
);
nv_wr32
(
device
,
0x6167ac
+
head
,
0x00000010
);
nv_mask
(
device
,
0x6167a4
+
head
,
0x00000001
,
0x00000001
);
/* HDMI_CTRL */
nv_mask
(
device
,
0x616798
+
head
,
0x401f007f
,
0x40000000
|
rekey
|
max_ac_packet
<<
16
);
/* NFI, audio doesn't work without it though.. */
nv_mask
(
device
,
0x616548
+
head
,
0x00000070
,
0x00000000
);
nv_call
(
disp
->
core
,
NV84_DISP_SOR_HDMI_PWR
+
moff
,
NV84_DISP_SOR_HDMI_PWR_STATE_ON
|
(
max_ac_packet
<<
16
)
|
rekey
);
nvd0_audio_mode_set
(
encoder
,
mode
);
}
...
...
@@ -1313,15 +1295,12 @@ nvd0_hdmi_disconnect(struct drm_encoder *encoder)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
nv_encoder
->
crtc
);
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
nouveau_device
*
device
=
nouveau_dev
(
dev
);
int
head
=
nv_crtc
->
index
*
0x800
;
struct
nvd0_disp
*
disp
=
nvd0_disp
(
encoder
->
dev
);
const
u32
moff
=
(
nv_crtc
->
index
<<
3
)
|
nv_encoder
->
or
;
nvd0_audio_disconnect
(
encoder
);
nv_mask
(
device
,
0x616798
+
head
,
0x40000000
,
0x00000000
);
nv_mask
(
device
,
0x6167a4
+
head
,
0x00000001
,
0x00000000
);
nv_mask
(
device
,
0x616714
+
head
,
0x00000001
,
0x00000000
);
nv_call
(
disp
->
core
,
NV84_DISP_SOR_HDMI_PWR
+
moff
,
0x00000000
);
}
/******************************************************************************
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录