Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
a2bc283f
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看板
提交
a2bc283f
编写于
2月 11, 2013
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nv50-/disp: initial work towards supporting external encoders
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
5a885f0b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
197 addition
and
0 deletion
+197
-0
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/dport.h
drivers/gpu/drm/nouveau/core/engine/disp/dport.h
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+6
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
+11
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv84.c
drivers/gpu/drm/nouveau/core/engine/disp/nv84.c
+6
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
+6
-0
drivers/gpu/drm/nouveau/core/engine/disp/nva0.c
drivers/gpu/drm/nouveau/core/engine/disp/nva0.c
+3
-0
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
+6
-0
drivers/gpu/drm/nouveau/core/engine/disp/piornv50.c
drivers/gpu/drm/nouveau/core/engine/disp/piornv50.c
+140
-0
drivers/gpu/drm/nouveau/core/include/core/class.h
drivers/gpu/drm/nouveau/core/include/core/class.h
+17
-0
未找到文件。
drivers/gpu/drm/nouveau/Makefile
浏览文件 @
a2bc283f
...
...
@@ -165,6 +165,7 @@ nouveau-y += core/engine/disp/hdanvd0.o
nouveau-y
+=
core/engine/disp/hdminv84.o
nouveau-y
+=
core/engine/disp/hdminva3.o
nouveau-y
+=
core/engine/disp/hdminvd0.o
nouveau-y
+=
core/engine/disp/piornv50.o
nouveau-y
+=
core/engine/disp/sornv50.o
nouveau-y
+=
core/engine/disp/sornv94.o
nouveau-y
+=
core/engine/disp/sornvd0.o
...
...
drivers/gpu/drm/nouveau/core/engine/disp/dport.h
浏览文件 @
a2bc283f
...
...
@@ -70,6 +70,7 @@ struct nouveau_dp_func {
extern
const
struct
nouveau_dp_func
nv94_sor_dp_func
;
extern
const
struct
nouveau_dp_func
nvd0_sor_dp_func
;
extern
const
struct
nouveau_dp_func
nv50_pior_dp_func
;
int
nouveau_dp_train
(
struct
nouveau_disp
*
,
const
struct
nouveau_dp_func
*
,
struct
dcb_output
*
,
int
,
u32
);
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
浏览文件 @
a2bc283f
...
...
@@ -678,6 +678,9 @@ nv50_disp_base_omthds[] = {
{
SOR_MTHD
(
NV50_DISP_SOR_LVDS_SCRIPT
)
,
nv50_sor_mthd
},
{
DAC_MTHD
(
NV50_DISP_DAC_PWR
)
,
nv50_dac_mthd
},
{
DAC_MTHD
(
NV50_DISP_DAC_LOAD
)
,
nv50_dac_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_PWR
)
,
nv50_pior_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_TMDS_PWR
)
,
nv50_pior_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_DP_PWR
)
,
nv50_pior_mthd
},
{},
};
...
...
@@ -1227,9 +1230,12 @@ nv50_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
head
.
nr
=
2
;
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
2
;
priv
->
pior
.
nr
=
3
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
priv
->
pior
.
power
=
nv50_pior_power
;
priv
->
pior
.
dp
=
&
nv50_pior_dp_func
;
return
0
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
浏览文件 @
a2bc283f
...
...
@@ -35,6 +35,12 @@ struct nv50_disp_priv {
u32
lvdsconf
;
const
struct
nouveau_dp_func
*
dp
;
}
sor
;
struct
{
int
nr
;
int
(
*
power
)(
struct
nv50_disp_priv
*
,
int
ext
,
u32
data
);
u8
type
[
3
];
const
struct
nouveau_dp_func
*
dp
;
}
pior
;
};
#define DAC_MTHD(n) (n), (n) + 0x03
...
...
@@ -73,6 +79,11 @@ int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
int
nvd0_sor_dp_drvctl
(
struct
nv50_disp_priv
*
,
int
,
int
,
int
,
u16
,
u16
,
u32
,
struct
dcb_output
*
);
#define PIOR_MTHD(n) (n), (n) + 0x03
int
nv50_pior_mthd
(
struct
nouveau_object
*
,
u32
,
void
*
,
u32
);
int
nv50_pior_power
(
struct
nv50_disp_priv
*
,
int
,
u32
);
struct
nv50_disp_base
{
struct
nouveau_parent
base
;
struct
nouveau_ramht
*
ramht
;
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv84.c
浏览文件 @
a2bc283f
...
...
@@ -46,6 +46,9 @@ nv84_disp_base_omthds[] = {
{
SOR_MTHD
(
NV50_DISP_SOR_LVDS_SCRIPT
)
,
nv50_sor_mthd
},
{
DAC_MTHD
(
NV50_DISP_DAC_PWR
)
,
nv50_dac_mthd
},
{
DAC_MTHD
(
NV50_DISP_DAC_LOAD
)
,
nv50_dac_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_PWR
)
,
nv50_pior_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_TMDS_PWR
)
,
nv50_pior_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_DP_PWR
)
,
nv50_pior_mthd
},
{},
};
...
...
@@ -77,10 +80,13 @@ nv84_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
head
.
nr
=
2
;
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
2
;
priv
->
pior
.
nr
=
3
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
priv
->
sor
.
hdmi
=
nv84_hdmi_ctrl
;
priv
->
pior
.
power
=
nv50_pior_power
;
priv
->
pior
.
dp
=
&
nv50_pior_dp_func
;
return
0
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
浏览文件 @
a2bc283f
...
...
@@ -46,6 +46,9 @@ nv94_disp_base_omthds[] = {
{
SOR_MTHD
(
NV50_DISP_SOR_LVDS_SCRIPT
)
,
nv50_sor_mthd
},
{
DAC_MTHD
(
NV50_DISP_DAC_PWR
)
,
nv50_dac_mthd
},
{
DAC_MTHD
(
NV50_DISP_DAC_LOAD
)
,
nv50_dac_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_PWR
)
,
nv50_pior_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_TMDS_PWR
)
,
nv50_pior_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_DP_PWR
)
,
nv50_pior_mthd
},
{},
};
...
...
@@ -77,11 +80,14 @@ nv94_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
head
.
nr
=
2
;
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
4
;
priv
->
pior
.
nr
=
3
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
priv
->
sor
.
hdmi
=
nv84_hdmi_ctrl
;
priv
->
sor
.
dp
=
&
nv94_sor_dp_func
;
priv
->
pior
.
power
=
nv50_pior_power
;
priv
->
pior
.
dp
=
&
nv50_pior_dp_func
;
return
0
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nva0.c
浏览文件 @
a2bc283f
...
...
@@ -67,10 +67,13 @@ nva0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
head
.
nr
=
2
;
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
2
;
priv
->
pior
.
nr
=
3
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
priv
->
sor
.
hdmi
=
nv84_hdmi_ctrl
;
priv
->
pior
.
power
=
nv50_pior_power
;
priv
->
pior
.
dp
=
&
nv50_pior_dp_func
;
return
0
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
浏览文件 @
a2bc283f
...
...
@@ -47,6 +47,9 @@ nva3_disp_base_omthds[] = {
{
SOR_MTHD
(
NV50_DISP_SOR_LVDS_SCRIPT
)
,
nv50_sor_mthd
},
{
DAC_MTHD
(
NV50_DISP_DAC_PWR
)
,
nv50_dac_mthd
},
{
DAC_MTHD
(
NV50_DISP_DAC_LOAD
)
,
nv50_dac_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_PWR
)
,
nv50_pior_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_TMDS_PWR
)
,
nv50_pior_mthd
},
{
PIOR_MTHD
(
NV50_DISP_PIOR_DP_PWR
)
,
nv50_pior_mthd
},
{},
};
...
...
@@ -78,12 +81,15 @@ nva3_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
head
.
nr
=
2
;
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
4
;
priv
->
pior
.
nr
=
3
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
priv
->
sor
.
hda_eld
=
nva3_hda_eld
;
priv
->
sor
.
hdmi
=
nva3_hdmi_ctrl
;
priv
->
sor
.
dp
=
&
nv94_sor_dp_func
;
priv
->
pior
.
power
=
nv50_pior_power
;
priv
->
pior
.
dp
=
&
nv50_pior_dp_func
;
return
0
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/disp/piornv50.c
0 → 100644
浏览文件 @
a2bc283f
/*
* 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 <subdev/bios.h>
#include <subdev/bios/dcb.h>
#include <subdev/timer.h>
#include <subdev/i2c.h>
#include "nv50.h"
/******************************************************************************
* DisplayPort
*****************************************************************************/
static
struct
nouveau_i2c_port
*
nv50_pior_dp_find
(
struct
nouveau_disp
*
disp
,
struct
dcb_output
*
outp
)
{
struct
nouveau_i2c
*
i2c
=
nouveau_i2c
(
disp
);
return
i2c
->
find_type
(
i2c
,
NV_I2C_TYPE_EXTAUX
(
outp
->
extdev
));
}
static
int
nv50_pior_dp_pattern
(
struct
nouveau_disp
*
disp
,
struct
dcb_output
*
outp
,
int
head
,
int
pattern
)
{
struct
nouveau_i2c_port
*
port
;
int
ret
=
-
EINVAL
;
port
=
nv50_pior_dp_find
(
disp
,
outp
);
if
(
port
)
{
if
(
port
->
func
->
pattern
)
ret
=
port
->
func
->
pattern
(
port
,
pattern
);
else
ret
=
0
;
}
return
ret
;
}
static
int
nv50_pior_dp_lnk_ctl
(
struct
nouveau_disp
*
disp
,
struct
dcb_output
*
outp
,
int
head
,
int
lane_nr
,
int
link_bw
,
bool
enh
)
{
struct
nouveau_i2c_port
*
port
;
int
ret
=
-
EINVAL
;
port
=
nv50_pior_dp_find
(
disp
,
outp
);
if
(
port
&&
port
->
func
->
lnk_ctl
)
ret
=
port
->
func
->
lnk_ctl
(
port
,
lane_nr
,
link_bw
,
enh
);
return
ret
;
}
static
int
nv50_pior_dp_drv_ctl
(
struct
nouveau_disp
*
disp
,
struct
dcb_output
*
outp
,
int
head
,
int
lane
,
int
vsw
,
int
pre
)
{
struct
nouveau_i2c_port
*
port
;
int
ret
=
-
EINVAL
;
port
=
nv50_pior_dp_find
(
disp
,
outp
);
if
(
port
)
{
if
(
port
->
func
->
drv_ctl
)
ret
=
port
->
func
->
drv_ctl
(
port
,
lane
,
vsw
,
pre
);
else
ret
=
0
;
}
return
ret
;
}
const
struct
nouveau_dp_func
nv50_pior_dp_func
=
{
.
pattern
=
nv50_pior_dp_pattern
,
.
lnk_ctl
=
nv50_pior_dp_lnk_ctl
,
.
drv_ctl
=
nv50_pior_dp_drv_ctl
,
};
/******************************************************************************
* General PIOR handling
*****************************************************************************/
int
nv50_pior_power
(
struct
nv50_disp_priv
*
priv
,
int
or
,
u32
data
)
{
const
u32
stat
=
data
&
NV50_DISP_PIOR_PWR_STATE
;
const
u32
soff
=
(
or
*
0x800
);
nv_wait
(
priv
,
0x61e004
+
soff
,
0x80000000
,
0x00000000
);
nv_mask
(
priv
,
0x61e004
+
soff
,
0x80000101
,
0x80000000
|
stat
);
nv_wait
(
priv
,
0x61e004
+
soff
,
0x80000000
,
0x00000000
);
return
0
;
}
int
nv50_pior_mthd
(
struct
nouveau_object
*
object
,
u32
mthd
,
void
*
args
,
u32
size
)
{
struct
nv50_disp_priv
*
priv
=
(
void
*
)
object
->
engine
;
const
u8
type
=
(
mthd
&
NV50_DISP_PIOR_MTHD_TYPE
)
>>
12
;
const
u8
or
=
(
mthd
&
NV50_DISP_PIOR_MTHD_OR
);
u32
*
data
=
args
;
int
ret
;
if
(
size
<
sizeof
(
u32
))
return
-
EINVAL
;
mthd
&=
~
NV50_DISP_PIOR_MTHD_TYPE
;
mthd
&=
~
NV50_DISP_PIOR_MTHD_OR
;
switch
(
mthd
)
{
case
NV50_DISP_PIOR_PWR
:
ret
=
priv
->
pior
.
power
(
priv
,
or
,
data
[
0
]);
priv
->
pior
.
type
[
or
]
=
type
;
break
;
default:
return
-
EINVAL
;
}
return
ret
;
}
drivers/gpu/drm/nouveau/core/include/core/class.h
浏览文件 @
a2bc283f
...
...
@@ -219,6 +219,23 @@ struct nv04_display_class {
#define NV50_DISP_DAC_LOAD 0x0002000c
#define NV50_DISP_DAC_LOAD_VALUE 0x00000007
#define NV50_DISP_PIOR_MTHD 0x00030000
#define NV50_DISP_PIOR_MTHD_TYPE 0x0000f000
#define NV50_DISP_PIOR_MTHD_OR 0x00000003
#define NV50_DISP_PIOR_PWR 0x00030000
#define NV50_DISP_PIOR_PWR_STATE 0x00000001
#define NV50_DISP_PIOR_PWR_STATE_ON 0x00000001
#define NV50_DISP_PIOR_PWR_STATE_OFF 0x00000000
#define NV50_DISP_PIOR_TMDS_PWR 0x00032000
#define NV50_DISP_PIOR_TMDS_PWR_STATE 0x00000001
#define NV50_DISP_PIOR_TMDS_PWR_STATE_ON 0x00000001
#define NV50_DISP_PIOR_TMDS_PWR_STATE_OFF 0x00000000
#define NV50_DISP_PIOR_DP_PWR 0x00036000
#define NV50_DISP_PIOR_DP_PWR_STATE 0x00000001
#define NV50_DISP_PIOR_DP_PWR_STATE_ON 0x00000001
#define NV50_DISP_PIOR_DP_PWR_STATE_OFF 0x00000000
struct
nv50_display_class
{
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录