Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
456b0579
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看板
提交
456b0579
编写于
5月 30, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: use connector events for HPD instead of GPIO watching
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
7a014a87
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
34 addition
and
44 deletion
+34
-44
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
+29
-38
drivers/gpu/drm/nouveau/nouveau_connector.h
drivers/gpu/drm/nouveau/nouveau_connector.h
+3
-4
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+2
-2
未找到文件。
drivers/gpu/drm/nouveau/nouveau_connector.c
浏览文件 @
456b0579
...
...
@@ -44,6 +44,7 @@
#include <subdev/i2c.h>
#include <subdev/gpio.h>
#include <engine/disp.h>
MODULE_PARM_DESC
(
tv_disable
,
"Disable TV-out detection"
);
static
int
nouveau_tv_disable
=
0
;
...
...
@@ -100,7 +101,7 @@ static void
nouveau_connector_destroy
(
struct
drm_connector
*
connector
)
{
struct
nouveau_connector
*
nv_connector
=
nouveau_connector
(
connector
);
nouveau_event_ref
(
NULL
,
&
nv_connector
->
hpd
_func
);
nouveau_event_ref
(
NULL
,
&
nv_connector
->
hpd
);
kfree
(
nv_connector
->
edid
);
drm_sysfs_connector_remove
(
connector
);
drm_connector_cleanup
(
connector
);
...
...
@@ -915,30 +916,34 @@ static void
nouveau_connector_hotplug_work
(
struct
work_struct
*
work
)
{
struct
nouveau_connector
*
nv_connector
=
container_of
(
work
,
struct
nouveau_connector
,
hpd_
work
);
container_of
(
work
,
typeof
(
*
nv_connector
),
work
);
struct
drm_connector
*
connector
=
&
nv_connector
->
base
;
struct
drm_device
*
dev
=
connector
->
dev
;
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
drm
->
device
);
bool
plugged
=
gpio
->
get
(
gpio
,
0
,
nv_connector
->
hpd
.
func
,
0xff
);
struct
nouveau_drm
*
drm
=
nouveau_drm
(
connector
->
dev
);
const
char
*
name
=
connector
->
name
;
NV_DEBUG
(
drm
,
"%splugged %s
\n
"
,
plugged
?
""
:
"un"
,
connector
->
name
);
if
(
nv_connector
->
status
&
NVKM_HPD_IRQ
)
{
}
else
{
bool
plugged
=
(
nv_connector
->
status
!=
NVKM_HPD_UNPLUG
);
NV_DEBUG
(
drm
,
"%splugged %s
\n
"
,
plugged
?
""
:
"un"
,
name
);
if
(
plugged
)
drm_helper_connector_dpms
(
connector
,
DRM_MODE_DPMS_ON
);
else
drm_helper_connector_dpms
(
connector
,
DRM_MODE_DPMS_OFF
);
drm_helper_hpd_irq_event
(
connector
->
dev
);
}
drm_helper_hpd_irq_event
(
dev
);
nouveau_event_get
(
nv_connector
->
hpd
);
}
static
int
nouveau_connector_hotplug
(
void
*
data
,
u32
type
,
int
index
)
{
struct
nouveau_connector
*
nv_connector
=
data
;
schedule_work
(
&
nv_connector
->
hpd_work
);
return
NVKM_EVENT_KEEP
;
nv_connector
->
status
=
type
;
schedule_work
(
&
nv_connector
->
work
);
return
NVKM_EVENT_DROP
;
}
static
int
...
...
@@ -974,9 +979,9 @@ nouveau_connector_create(struct drm_device *dev, int index)
{
const
struct
drm_connector_funcs
*
funcs
=
&
nouveau_connector_funcs
;
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
drm
->
device
);
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
struct
nouveau_connector
*
nv_connector
=
NULL
;
struct
nouveau_disp
*
pdisp
=
nouveau_disp
(
drm
->
device
);
struct
drm_connector
*
connector
;
int
type
,
ret
=
0
;
bool
dummy
;
...
...
@@ -992,34 +997,15 @@ nouveau_connector_create(struct drm_device *dev, int index)
return
ERR_PTR
(
-
ENOMEM
);
connector
=
&
nv_connector
->
base
;
INIT_WORK
(
&
nv_connector
->
hpd_work
,
nouveau_connector_hotplug_work
);
nv_connector
->
index
=
index
;
/* attempt to parse vbios connector type and hotplug gpio */
nv_connector
->
dcb
=
olddcb_conn
(
dev
,
index
);
if
(
nv_connector
->
dcb
)
{
static
const
u8
hpd
[
16
]
=
{
0xff
,
0x07
,
0x08
,
0xff
,
0xff
,
0x51
,
0x52
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0x5e
,
0x5f
,
0x60
,
};
u32
entry
=
ROM16
(
nv_connector
->
dcb
[
0
]);
if
(
olddcb_conntab
(
dev
)[
3
]
>=
4
)
entry
|=
(
u32
)
ROM16
(
nv_connector
->
dcb
[
2
])
<<
16
;
ret
=
gpio
->
find
(
gpio
,
0
,
hpd
[
ffs
((
entry
&
0x07033000
)
>>
12
)],
DCB_GPIO_UNUSED
,
&
nv_connector
->
hpd
);
if
(
ret
)
nv_connector
->
hpd
.
func
=
DCB_GPIO_UNUSED
;
if
(
nv_connector
->
hpd
.
func
!=
DCB_GPIO_UNUSED
)
{
nouveau_event_new
(
gpio
->
events
,
NVKM_GPIO_TOGGLED
,
nv_connector
->
hpd
.
line
,
nouveau_connector_hotplug
,
nv_connector
,
&
nv_connector
->
hpd_func
);
}
nv_connector
->
type
=
nv_connector
->
dcb
[
0
];
if
(
drm_conntype_from_dcb
(
nv_connector
->
type
)
==
DRM_MODE_CONNECTOR_Unknown
)
{
...
...
@@ -1041,7 +1027,6 @@ nouveau_connector_create(struct drm_device *dev, int index)
}
}
else
{
nv_connector
->
type
=
DCB_CONNECTOR_NONE
;
nv_connector
->
hpd
.
func
=
DCB_GPIO_UNUSED
;
}
/* no vbios data, or an unknown dcb connector type - attempt to
...
...
@@ -1167,10 +1152,16 @@ nouveau_connector_create(struct drm_device *dev, int index)
break
;
}
ret
=
nouveau_event_new
(
pdisp
->
hpd
,
NVKM_HPD
,
index
,
nouveau_connector_hotplug
,
nv_connector
,
&
nv_connector
->
hpd
);
if
(
ret
)
connector
->
polled
=
DRM_CONNECTOR_POLL_CONNECT
;
if
(
nv_connector
->
hpd
.
func
!=
DCB_GPIO_UNUSED
)
else
connector
->
polled
=
DRM_CONNECTOR_POLL_HPD
;
INIT_WORK
(
&
nv_connector
->
work
,
nouveau_connector_hotplug_work
);
drm_sysfs_connector_add
(
connector
);
return
connector
;
}
drivers/gpu/drm/nouveau/nouveau_connector.h
浏览文件 @
456b0579
...
...
@@ -33,7 +33,6 @@
#include <core/event.h>
#include <subdev/bios.h>
#include <subdev/bios/gpio.h>
struct
nouveau_i2c_port
;
...
...
@@ -67,9 +66,9 @@ struct nouveau_connector {
u8
index
;
u8
*
dcb
;
struct
dcb_gpio_func
hpd
;
struct
work_struct
hpd_work
;
struct
nouveau_eventh
*
hpd_func
;
struct
nouveau_eventh
*
hpd
;
u32
status
;
struct
work_struct
work
;
int
dithering_mode
;
int
dithering_depth
;
...
...
drivers/gpu/drm/nouveau/nouveau_display.c
浏览文件 @
456b0579
...
...
@@ -393,7 +393,7 @@ nouveau_display_init(struct drm_device *dev)
/* enable hotplug interrupts */
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
struct
nouveau_connector
*
conn
=
nouveau_connector
(
connector
);
if
(
conn
->
hpd
_func
)
nouveau_event_get
(
conn
->
hpd_func
);
if
(
conn
->
hpd
)
nouveau_event_get
(
conn
->
hpd
);
}
return
ret
;
...
...
@@ -408,7 +408,7 @@ nouveau_display_fini(struct drm_device *dev)
/* disable hotplug interrupts */
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
struct
nouveau_connector
*
conn
=
nouveau_connector
(
connector
);
if
(
conn
->
hpd
_func
)
nouveau_event_put
(
conn
->
hpd_func
);
if
(
conn
->
hpd
)
nouveau_event_put
(
conn
->
hpd
);
}
drm_kms_helper_poll_disable
(
dev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录