Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
8777c5c1
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看板
提交
8777c5c1
编写于
6月 06, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/dp: probe dpcd to determine connectedness
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
efa366fd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
40 deletion
+26
-40
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
+19
-29
drivers/gpu/drm/nouveau/nouveau_dp.c
drivers/gpu/drm/nouveau/nouveau_dp.c
+6
-8
drivers/gpu/drm/nouveau/nouveau_encoder.h
drivers/gpu/drm/nouveau/nouveau_encoder.h
+1
-3
未找到文件。
drivers/gpu/drm/nouveau/nouveau_connector.c
浏览文件 @
8777c5c1
...
...
@@ -111,15 +111,15 @@ nouveau_connector_destroy(struct drm_connector *connector)
kfree
(
connector
);
}
static
struct
nouveau_i2c_port
*
nouveau_connector_ddc_detect
(
struct
drm_connector
*
connector
,
struct
nouveau_encoder
**
pnv_encoder
)
static
struct
nouveau_encoder
*
nouveau_connector_ddc_detect
(
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
nouveau_connector
*
nv_connector
=
nouveau_connector
(
connector
);
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
drm
->
device
);
struct
nouveau_i2c_port
*
port
=
NULL
;
struct
nouveau_encoder
*
nv_encoder
;
struct
drm_mode_object
*
obj
;
int
i
,
panel
=
-
ENODEV
;
/* eDP panels need powering on by us (if the VBIOS doesn't default it
...
...
@@ -134,13 +134,9 @@ nouveau_connector_ddc_detect(struct drm_connector *connector,
}
}
for
(
i
=
0
;
i
<
DRM_CONNECTOR_MAX_ENCODER
;
i
++
)
{
struct
nouveau_encoder
*
nv_encoder
;
struct
drm_mode_object
*
obj
;
int
id
;
id
=
connector
->
encoder_ids
[
i
];
if
(
!
id
)
for
(
i
=
0
;
nv_encoder
=
NULL
,
i
<
DRM_CONNECTOR_MAX_ENCODER
;
i
++
)
{
int
id
=
connector
->
encoder_ids
[
i
];
if
(
id
==
0
)
break
;
obj
=
drm_mode_object_find
(
dev
,
id
,
DRM_MODE_OBJECT_ENCODER
);
...
...
@@ -148,22 +144,24 @@ nouveau_connector_ddc_detect(struct drm_connector *connector,
continue
;
nv_encoder
=
nouveau_encoder
(
obj_to_encoder
(
obj
));
port
=
nv_encoder
->
i2c
;
if
(
port
&&
nv_probe_i2c
(
port
,
0x50
))
{
*
pnv_encoder
=
nv_encoder
;
break
;
if
(
nv_encoder
->
dcb
->
type
==
DCB_OUTPUT_DP
)
{
int
ret
=
nouveau_dp_detect
(
nv_encoder
);
if
(
ret
==
0
)
break
;
}
else
if
(
nv_encoder
->
i2c
)
{
if
(
nv_probe_i2c
(
nv_encoder
->
i2c
,
0x50
))
break
;
}
port
=
NULL
;
}
/* eDP panel not detected, restore panel power GPIO to previous
* state to avoid confusing the SOR for other output types.
*/
if
(
!
port
&&
panel
==
0
)
if
(
!
nv_encoder
&&
panel
==
0
)
gpio
->
set
(
gpio
,
0
,
DCB_GPIO_PANEL_POWER
,
0xff
,
panel
);
return
port
;
return
nv_encoder
;
}
static
struct
nouveau_encoder
*
...
...
@@ -262,8 +260,8 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
if
(
ret
<
0
&&
ret
!=
-
EACCES
)
return
conn_status
;
i2c
=
nouveau_connector_ddc_detect
(
connector
,
&
nv_encode
r
);
if
(
i2c
)
{
nv_encoder
=
nouveau_connector_ddc_detect
(
connecto
r
);
if
(
nv_encoder
&&
(
i2c
=
nv_encoder
->
i2c
)
!=
NULL
)
{
nv_connector
->
edid
=
drm_get_edid
(
connector
,
&
i2c
->
adapter
);
drm_mode_connector_update_edid_property
(
connector
,
nv_connector
->
edid
);
...
...
@@ -273,14 +271,6 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
goto
detect_analog
;
}
if
(
nv_encoder
->
dcb
->
type
==
DCB_OUTPUT_DP
&&
!
nouveau_dp_detect
(
to_drm_encoder
(
nv_encoder
)))
{
NV_ERROR
(
drm
,
"Detected %s, but failed init
\n
"
,
connector
->
name
);
conn_status
=
connector_status_disconnected
;
goto
out
;
}
/* Override encoder type for DVI-I based on whether EDID
* says the display is digital or analog, both use the
* same i2c channel so the value returned from ddc_detect
...
...
drivers/gpu/drm/nouveau/nouveau_dp.c
浏览文件 @
8777c5c1
...
...
@@ -55,11 +55,10 @@ nouveau_dp_probe_oui(struct drm_device *dev, struct nouveau_i2c_port *auxch,
}
bool
nouveau_dp_detect
(
struct
drm_encoder
*
encoder
)
int
nouveau_dp_detect
(
struct
nouveau_encoder
*
nv_
encoder
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
drm_device
*
dev
=
nv_encoder
->
base
.
base
.
dev
;
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_i2c_port
*
auxch
;
u8
*
dpcd
=
nv_encoder
->
dp
.
dpcd
;
...
...
@@ -67,11 +66,11 @@ nouveau_dp_detect(struct drm_encoder *encoder)
auxch
=
nv_encoder
->
i2c
;
if
(
!
auxch
)
return
false
;
return
-
ENODEV
;
ret
=
nv_rdaux
(
auxch
,
DP_DPCD_REV
,
dpcd
,
8
);
if
(
ret
)
return
false
;
return
ret
;
nv_encoder
->
dp
.
link_bw
=
27000
*
dpcd
[
1
];
nv_encoder
->
dp
.
link_nr
=
dpcd
[
2
]
&
DP_MAX_LANE_COUNT_MASK
;
...
...
@@ -91,6 +90,5 @@ nouveau_dp_detect(struct drm_encoder *encoder)
nv_encoder
->
dp
.
link_nr
,
nv_encoder
->
dp
.
link_bw
);
nouveau_dp_probe_oui
(
dev
,
auxch
,
dpcd
);
return
true
;
return
0
;
}
drivers/gpu/drm/nouveau/nouveau_encoder.h
浏览文件 @
8777c5c1
...
...
@@ -85,9 +85,7 @@ get_slave_funcs(struct drm_encoder *enc)
}
/* nouveau_dp.c */
bool
nouveau_dp_detect
(
struct
drm_encoder
*
);
void
nouveau_dp_dpms
(
struct
drm_encoder
*
,
int
mode
,
u32
datarate
,
struct
nouveau_object
*
);
int
nouveau_dp_detect
(
struct
nouveau_encoder
*
);
struct
nouveau_connector
*
nouveau_encoder_connector_get
(
struct
nouveau_encoder
*
encoder
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录