Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
be9721a9
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看板
提交
be9721a9
编写于
12月 26, 2009
作者:
F
Francisco Jerez
提交者:
Ben Skeggs
1月 11, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nv04: Context switching fixes.
Signed-off-by:
N
Francisco Jerez
<
currojerez@riseup.net
>
上级
8c032ce7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
78 addition
and
74 deletion
+78
-74
drivers/gpu/drm/nouveau/nv04_graph.c
drivers/gpu/drm/nouveau/nv04_graph.c
+78
-74
未找到文件。
drivers/gpu/drm/nouveau/nv04_graph.c
浏览文件 @
be9721a9
...
...
@@ -28,6 +28,10 @@
#include "nouveau_drv.h"
static
uint32_t
nv04_graph_ctx_regs
[]
=
{
0x0040053c
,
0x00400544
,
0x00400540
,
0x00400548
,
NV04_PGRAPH_CTX_SWITCH1
,
NV04_PGRAPH_CTX_SWITCH2
,
NV04_PGRAPH_CTX_SWITCH3
,
...
...
@@ -102,69 +106,69 @@ static uint32_t nv04_graph_ctx_regs[] = {
NV04_PGRAPH_PATT_COLOR0
,
NV04_PGRAPH_PATT_COLOR1
,
NV04_PGRAPH_PATT_COLORRAM
+
0x00
,
NV04_PGRAPH_PATT_COLORRAM
+
0x01
,
NV04_PGRAPH_PATT_COLORRAM
+
0x02
,
NV04_PGRAPH_PATT_COLORRAM
+
0x03
,
NV04_PGRAPH_PATT_COLORRAM
+
0x04
,
NV04_PGRAPH_PATT_COLORRAM
+
0x05
,
NV04_PGRAPH_PATT_COLORRAM
+
0x06
,
NV04_PGRAPH_PATT_COLORRAM
+
0x07
,
NV04_PGRAPH_PATT_COLORRAM
+
0x08
,
NV04_PGRAPH_PATT_COLORRAM
+
0x09
,
NV04_PGRAPH_PATT_COLORRAM
+
0x0A
,
NV04_PGRAPH_PATT_COLORRAM
+
0x0B
,
NV04_PGRAPH_PATT_COLORRAM
+
0x0C
,
NV04_PGRAPH_PATT_COLORRAM
+
0x0D
,
NV04_PGRAPH_PATT_COLORRAM
+
0x0E
,
NV04_PGRAPH_PATT_COLORRAM
+
0x0F
,
NV04_PGRAPH_PATT_COLORRAM
+
0x0c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x10
,
NV04_PGRAPH_PATT_COLORRAM
+
0x11
,
NV04_PGRAPH_PATT_COLORRAM
+
0x12
,
NV04_PGRAPH_PATT_COLORRAM
+
0x13
,
NV04_PGRAPH_PATT_COLORRAM
+
0x14
,
NV04_PGRAPH_PATT_COLORRAM
+
0x15
,
NV04_PGRAPH_PATT_COLORRAM
+
0x16
,
NV04_PGRAPH_PATT_COLORRAM
+
0x17
,
NV04_PGRAPH_PATT_COLORRAM
+
0x18
,
NV04_PGRAPH_PATT_COLORRAM
+
0x19
,
NV04_PGRAPH_PATT_COLORRAM
+
0x1A
,
NV04_PGRAPH_PATT_COLORRAM
+
0x1B
,
NV04_PGRAPH_PATT_COLORRAM
+
0x1C
,
NV04_PGRAPH_PATT_COLORRAM
+
0x1D
,
NV04_PGRAPH_PATT_COLORRAM
+
0x1E
,
NV04_PGRAPH_PATT_COLORRAM
+
0x1F
,
NV04_PGRAPH_PATT_COLORRAM
+
0x1c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x20
,
NV04_PGRAPH_PATT_COLORRAM
+
0x21
,
NV04_PGRAPH_PATT_COLORRAM
+
0x22
,
NV04_PGRAPH_PATT_COLORRAM
+
0x23
,
NV04_PGRAPH_PATT_COLORRAM
+
0x24
,
NV04_PGRAPH_PATT_COLORRAM
+
0x25
,
NV04_PGRAPH_PATT_COLORRAM
+
0x26
,
NV04_PGRAPH_PATT_COLORRAM
+
0x27
,
NV04_PGRAPH_PATT_COLORRAM
+
0x28
,
NV04_PGRAPH_PATT_COLORRAM
+
0x29
,
NV04_PGRAPH_PATT_COLORRAM
+
0x2A
,
NV04_PGRAPH_PATT_COLORRAM
+
0x2B
,
NV04_PGRAPH_PATT_COLORRAM
+
0x2C
,
NV04_PGRAPH_PATT_COLORRAM
+
0x2D
,
NV04_PGRAPH_PATT_COLORRAM
+
0x2E
,
NV04_PGRAPH_PATT_COLORRAM
+
0x2F
,
NV04_PGRAPH_PATT_COLORRAM
+
0x2c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x30
,
NV04_PGRAPH_PATT_COLORRAM
+
0x31
,
NV04_PGRAPH_PATT_COLORRAM
+
0x32
,
NV04_PGRAPH_PATT_COLORRAM
+
0x33
,
NV04_PGRAPH_PATT_COLORRAM
+
0x34
,
NV04_PGRAPH_PATT_COLORRAM
+
0x35
,
NV04_PGRAPH_PATT_COLORRAM
+
0x36
,
NV04_PGRAPH_PATT_COLORRAM
+
0x37
,
NV04_PGRAPH_PATT_COLORRAM
+
0x38
,
NV04_PGRAPH_PATT_COLORRAM
+
0x39
,
NV04_PGRAPH_PATT_COLORRAM
+
0x3A
,
NV04_PGRAPH_PATT_COLORRAM
+
0x3B
,
NV04_PGRAPH_PATT_COLORRAM
+
0x3C
,
NV04_PGRAPH_PATT_COLORRAM
+
0x3D
,
NV04_PGRAPH_PATT_COLORRAM
+
0x3E
,
NV04_PGRAPH_PATT_COLORRAM
+
0x3F
,
NV04_PGRAPH_PATT_COLORRAM
+
0x3c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x40
,
NV04_PGRAPH_PATT_COLORRAM
+
0x44
,
NV04_PGRAPH_PATT_COLORRAM
+
0x48
,
NV04_PGRAPH_PATT_COLORRAM
+
0x4c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x50
,
NV04_PGRAPH_PATT_COLORRAM
+
0x54
,
NV04_PGRAPH_PATT_COLORRAM
+
0x58
,
NV04_PGRAPH_PATT_COLORRAM
+
0x5c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x60
,
NV04_PGRAPH_PATT_COLORRAM
+
0x64
,
NV04_PGRAPH_PATT_COLORRAM
+
0x68
,
NV04_PGRAPH_PATT_COLORRAM
+
0x6c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x70
,
NV04_PGRAPH_PATT_COLORRAM
+
0x74
,
NV04_PGRAPH_PATT_COLORRAM
+
0x78
,
NV04_PGRAPH_PATT_COLORRAM
+
0x7c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x80
,
NV04_PGRAPH_PATT_COLORRAM
+
0x84
,
NV04_PGRAPH_PATT_COLORRAM
+
0x88
,
NV04_PGRAPH_PATT_COLORRAM
+
0x8c
,
NV04_PGRAPH_PATT_COLORRAM
+
0x90
,
NV04_PGRAPH_PATT_COLORRAM
+
0x94
,
NV04_PGRAPH_PATT_COLORRAM
+
0x98
,
NV04_PGRAPH_PATT_COLORRAM
+
0x9c
,
NV04_PGRAPH_PATT_COLORRAM
+
0xa0
,
NV04_PGRAPH_PATT_COLORRAM
+
0xa4
,
NV04_PGRAPH_PATT_COLORRAM
+
0xa8
,
NV04_PGRAPH_PATT_COLORRAM
+
0xac
,
NV04_PGRAPH_PATT_COLORRAM
+
0xb0
,
NV04_PGRAPH_PATT_COLORRAM
+
0xb4
,
NV04_PGRAPH_PATT_COLORRAM
+
0xb8
,
NV04_PGRAPH_PATT_COLORRAM
+
0xbc
,
NV04_PGRAPH_PATT_COLORRAM
+
0xc0
,
NV04_PGRAPH_PATT_COLORRAM
+
0xc4
,
NV04_PGRAPH_PATT_COLORRAM
+
0xc8
,
NV04_PGRAPH_PATT_COLORRAM
+
0xcc
,
NV04_PGRAPH_PATT_COLORRAM
+
0xd0
,
NV04_PGRAPH_PATT_COLORRAM
+
0xd4
,
NV04_PGRAPH_PATT_COLORRAM
+
0xd8
,
NV04_PGRAPH_PATT_COLORRAM
+
0xdc
,
NV04_PGRAPH_PATT_COLORRAM
+
0xe0
,
NV04_PGRAPH_PATT_COLORRAM
+
0xe4
,
NV04_PGRAPH_PATT_COLORRAM
+
0xe8
,
NV04_PGRAPH_PATT_COLORRAM
+
0xec
,
NV04_PGRAPH_PATT_COLORRAM
+
0xf0
,
NV04_PGRAPH_PATT_COLORRAM
+
0xf4
,
NV04_PGRAPH_PATT_COLORRAM
+
0xf8
,
NV04_PGRAPH_PATT_COLORRAM
+
0xfc
,
NV04_PGRAPH_PATTERN
,
0x0040080c
,
NV04_PGRAPH_PATTERN_SHAPE
,
...
...
@@ -247,14 +251,6 @@ static uint32_t nv04_graph_ctx_regs[] = {
0x004004f8
,
0x0040047c
,
0x004004fc
,
0x0040053c
,
0x00400544
,
0x00400540
,
0x00400548
,
0x00400560
,
0x00400568
,
0x00400564
,
0x0040056c
,
0x00400534
,
0x00400538
,
0x00400514
,
...
...
@@ -341,9 +337,8 @@ static uint32_t nv04_graph_ctx_regs[] = {
0x00400500
,
0x00400504
,
NV04_PGRAPH_VALID1
,
NV04_PGRAPH_VALID2
NV04_PGRAPH_VALID2
,
NV04_PGRAPH_DEBUG_3
};
struct
graph_state
{
...
...
@@ -388,6 +383,18 @@ nv04_graph_context_switch(struct drm_device *dev)
pgraph
->
fifo_access
(
dev
,
true
);
}
static
uint32_t
*
ctx_reg
(
struct
graph_state
*
ctx
,
uint32_t
reg
)
{
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
nv04_graph_ctx_regs
);
i
++
)
{
if
(
nv04_graph_ctx_regs
[
i
]
==
reg
)
return
&
ctx
->
nv04
[
i
];
}
return
NULL
;
}
int
nv04_graph_create_context
(
struct
nouveau_channel
*
chan
)
{
struct
graph_state
*
pgraph_ctx
;
...
...
@@ -398,15 +405,8 @@ int nv04_graph_create_context(struct nouveau_channel *chan)
if
(
pgraph_ctx
==
NULL
)
return
-
ENOMEM
;
/* dev_priv->fifos[channel].pgraph_ctx_user = channel << 24; */
pgraph_ctx
->
nv04
[
0
]
=
0x0001ffff
;
/* is it really needed ??? */
#if 0
dev_priv->fifos[channel].pgraph_ctx[1] =
nv_rd32(dev, NV_PGRAPH_DEBUG_4);
dev_priv->fifos[channel].pgraph_ctx[2] =
nv_rd32(dev, 0x004006b0);
#endif
*
ctx_reg
(
pgraph_ctx
,
NV04_PGRAPH_DEBUG_3
)
=
0xfad4ff31
;
return
0
;
}
...
...
@@ -429,9 +429,13 @@ int nv04_graph_load_context(struct nouveau_channel *chan)
nv_wr32
(
dev
,
nv04_graph_ctx_regs
[
i
],
pgraph_ctx
->
nv04
[
i
]);
nv_wr32
(
dev
,
NV04_PGRAPH_CTX_CONTROL
,
0x10010100
);
nv_wr32
(
dev
,
NV04_PGRAPH_CTX_USER
,
chan
->
id
<<
24
);
tmp
=
nv_rd32
(
dev
,
NV04_PGRAPH_CTX_USER
)
&
0x00ffffff
;
nv_wr32
(
dev
,
NV04_PGRAPH_CTX_USER
,
tmp
|
chan
->
id
<<
24
);
tmp
=
nv_rd32
(
dev
,
NV04_PGRAPH_FFINTFC_ST2
);
nv_wr32
(
dev
,
NV04_PGRAPH_FFINTFC_ST2
,
tmp
&
0x000fffff
);
return
0
;
}
...
...
@@ -494,7 +498,7 @@ int nv04_graph_init(struct drm_device *dev)
nv_wr32
(
dev
,
NV04_PGRAPH_STATE
,
0xFFFFFFFF
);
nv_wr32
(
dev
,
NV04_PGRAPH_CTX_CONTROL
,
0x10000100
);
tmp
=
nv_rd32
(
dev
,
NV04_PGRAPH_CTX_USER
)
&
0x00ffffff
;
tmp
|=
dev_priv
->
engine
.
fifo
.
channels
<<
24
;
tmp
|=
(
dev_priv
->
engine
.
fifo
.
channels
-
1
)
<<
24
;
nv_wr32
(
dev
,
NV04_PGRAPH_CTX_USER
,
tmp
);
/* These don't belong here, they're part of a per-channel context */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录