Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ac94a343
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ac94a343
编写于
7月 08, 2010
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nv50: cleanup nv50_fifo.c
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
3b569e0f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
45 addition
and
73 deletion
+45
-73
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+3
-2
drivers/gpu/drm/nouveau/nv50_fifo.c
drivers/gpu/drm/nouveau/nv50_fifo.c
+40
-67
drivers/gpu/drm/nouveau/nv50_graph.c
drivers/gpu/drm/nouveau/nv50_graph.c
+2
-4
未找到文件。
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
ac94a343
...
...
@@ -294,10 +294,11 @@ struct nouveau_fb_engine {
};
struct
nouveau_fifo_engine
{
void
*
priv
;
int
channels
;
struct
nouveau_gpuobj_ref
*
playlist
[
2
];
int
cur_playlist
;
int
(
*
init
)(
struct
drm_device
*
);
void
(
*
takedown
)(
struct
drm_device
*
);
...
...
drivers/gpu/drm/nouveau/nv50_fifo.c
浏览文件 @
ac94a343
...
...
@@ -28,25 +28,18 @@
#include "drm.h"
#include "nouveau_drv.h"
struct
nv50_fifo_priv
{
struct
nouveau_gpuobj_ref
*
thingo
[
2
];
int
cur_thingo
;
};
#define IS_G80 ((dev_priv->chipset & 0xf0) == 0x50)
static
void
nv50_fifo_
init_thingo
(
struct
drm_device
*
dev
)
nv50_fifo_
playlist_update
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
n
v50_fifo_priv
*
priv
=
dev_priv
->
engine
.
fifo
.
priv
;
struct
n
ouveau_fifo_engine
*
pfifo
=
&
dev_priv
->
engine
.
fifo
;
struct
nouveau_gpuobj_ref
*
cur
;
int
i
,
nr
;
NV_DEBUG
(
dev
,
"
\n
"
);
cur
=
p
riv
->
thingo
[
priv
->
cur_thingo
];
p
riv
->
cur_thingo
=
!
priv
->
cur_thingo
;
cur
=
p
fifo
->
playlist
[
pfifo
->
cur_playlist
];
p
fifo
->
cur_playlist
=
!
pfifo
->
cur_playlist
;
/* We never schedule channel 0 or 127 */
for
(
i
=
1
,
nr
=
0
;
i
<
127
;
i
++
)
{
...
...
@@ -60,8 +53,8 @@ nv50_fifo_init_thingo(struct drm_device *dev)
nv_wr32
(
dev
,
0x2500
,
0x101
);
}
static
int
nv50_fifo_channel_enable
(
struct
drm_device
*
dev
,
int
channel
,
bool
nt
)
static
void
nv50_fifo_channel_enable
(
struct
drm_device
*
dev
,
int
channel
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_channel
*
chan
=
dev_priv
->
fifos
[
channel
];
...
...
@@ -69,37 +62,28 @@ nv50_fifo_channel_enable(struct drm_device *dev, int channel, bool nt)
NV_DEBUG
(
dev
,
"ch%d
\n
"
,
channel
);
if
(
!
chan
->
ramfc
)
return
-
EINVAL
;
if
(
IS_G80
)
if
(
dev_priv
->
chipset
==
0x50
)
inst
=
chan
->
ramfc
->
instance
>>
12
;
else
inst
=
chan
->
ramfc
->
instance
>>
8
;
nv_wr32
(
dev
,
NV50_PFIFO_CTX_TABLE
(
channel
),
inst
|
NV50_PFIFO_CTX_TABLE_CHANNEL_ENABLED
);
if
(
!
nt
)
nv50_fifo_init_thingo
(
dev
);
return
0
;
nv_wr32
(
dev
,
NV50_PFIFO_CTX_TABLE
(
channel
),
inst
|
NV50_PFIFO_CTX_TABLE_CHANNEL_ENABLED
);
}
static
void
nv50_fifo_channel_disable
(
struct
drm_device
*
dev
,
int
channel
,
bool
nt
)
nv50_fifo_channel_disable
(
struct
drm_device
*
dev
,
int
channel
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
uint32_t
inst
;
NV_DEBUG
(
dev
,
"ch%d
, nt=%d
\n
"
,
channel
,
nt
);
NV_DEBUG
(
dev
,
"ch%d
\n
"
,
channel
);
if
(
IS_G8
0
)
if
(
dev_priv
->
chipset
==
0x5
0
)
inst
=
NV50_PFIFO_CTX_TABLE_INSTANCE_MASK_G80
;
else
inst
=
NV50_PFIFO_CTX_TABLE_INSTANCE_MASK_G84
;
nv_wr32
(
dev
,
NV50_PFIFO_CTX_TABLE
(
channel
),
inst
);
if
(
!
nt
)
nv50_fifo_init_thingo
(
dev
);
}
static
void
...
...
@@ -132,12 +116,12 @@ nv50_fifo_init_context_table(struct drm_device *dev)
for
(
i
=
0
;
i
<
NV50_PFIFO_CTX_TABLE__SIZE
;
i
++
)
{
if
(
dev_priv
->
fifos
[
i
])
nv50_fifo_channel_enable
(
dev
,
i
,
true
);
nv50_fifo_channel_enable
(
dev
,
i
);
else
nv50_fifo_channel_disable
(
dev
,
i
,
true
);
nv50_fifo_channel_disable
(
dev
,
i
);
}
nv50_fifo_
init_thingo
(
dev
);
nv50_fifo_
playlist_update
(
dev
);
}
static
void
...
...
@@ -161,41 +145,38 @@ nv50_fifo_init_regs(struct drm_device *dev)
nv_wr32
(
dev
,
0x3270
,
0
);
/* Enable dummy channels setup by nv50_instmem.c */
nv50_fifo_channel_enable
(
dev
,
0
,
true
);
nv50_fifo_channel_enable
(
dev
,
127
,
true
);
nv50_fifo_channel_enable
(
dev
,
0
);
nv50_fifo_channel_enable
(
dev
,
127
);
}
int
nv50_fifo_init
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
n
v50_fifo_priv
*
priv
;
struct
n
ouveau_fifo_engine
*
pfifo
=
&
dev_priv
->
engine
.
fifo
;
int
ret
;
NV_DEBUG
(
dev
,
"
\n
"
);
priv
=
dev_priv
->
engine
.
fifo
.
priv
;
if
(
priv
)
{
priv
->
cur_thingo
=
!
priv
->
cur_thingo
;
if
(
pfifo
->
playlist
[
0
])
{
pfifo
->
cur_playlist
=
!
pfifo
->
cur_playlist
;
goto
just_reset
;
}
priv
=
kzalloc
(
sizeof
(
*
priv
),
GFP_KERNEL
);
if
(
!
priv
)
return
-
ENOMEM
;
dev_priv
->
engine
.
fifo
.
priv
=
priv
;
ret
=
nouveau_gpuobj_new_ref
(
dev
,
NULL
,
NULL
,
0
,
128
*
4
,
0x1000
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
priv
->
thingo
[
0
]);
NVOBJ_FLAG_ZERO_ALLOC
,
&
pfifo
->
playlist
[
0
]);
if
(
ret
)
{
NV_ERROR
(
dev
,
"error creating
thingo
0: %d
\n
"
,
ret
);
NV_ERROR
(
dev
,
"error creating
playlist
0: %d
\n
"
,
ret
);
return
ret
;
}
ret
=
nouveau_gpuobj_new_ref
(
dev
,
NULL
,
NULL
,
0
,
128
*
4
,
0x1000
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
priv
->
thingo
[
1
]);
NVOBJ_FLAG_ZERO_ALLOC
,
&
pfifo
->
playlist
[
1
]);
if
(
ret
)
{
NV_ERROR
(
dev
,
"error creating thingo1: %d
\n
"
,
ret
);
nouveau_gpuobj_ref_del
(
dev
,
&
pfifo
->
playlist
[
0
]);
NV_ERROR
(
dev
,
"error creating playlist 1: %d
\n
"
,
ret
);
return
ret
;
}
...
...
@@ -215,18 +196,15 @@ void
nv50_fifo_takedown
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
n
v50_fifo_priv
*
priv
=
dev_priv
->
engine
.
fifo
.
priv
;
struct
n
ouveau_fifo_engine
*
pfifo
=
&
dev_priv
->
engine
.
fifo
;
NV_DEBUG
(
dev
,
"
\n
"
);
if
(
!
p
riv
)
if
(
!
p
fifo
->
playlist
[
0
]
)
return
;
nouveau_gpuobj_ref_del
(
dev
,
&
priv
->
thingo
[
0
]);
nouveau_gpuobj_ref_del
(
dev
,
&
priv
->
thingo
[
1
]);
dev_priv
->
engine
.
fifo
.
priv
=
NULL
;
kfree
(
priv
);
nouveau_gpuobj_ref_del
(
dev
,
&
pfifo
->
playlist
[
0
]);
nouveau_gpuobj_ref_del
(
dev
,
&
pfifo
->
playlist
[
1
]);
}
int
...
...
@@ -247,7 +225,7 @@ nv50_fifo_create_context(struct nouveau_channel *chan)
NV_DEBUG
(
dev
,
"ch%d
\n
"
,
chan
->
id
);
if
(
IS_G8
0
)
{
if
(
dev_priv
->
chipset
==
0x5
0
)
{
uint32_t
ramin_poffset
=
chan
->
ramin
->
gpuobj
->
im_pramin
->
start
;
uint32_t
ramin_voffset
=
chan
->
ramin
->
gpuobj
->
im_backing_start
;
...
...
@@ -292,7 +270,7 @@ nv50_fifo_create_context(struct nouveau_channel *chan)
chan
->
dma
.
ib_base
*
4
);
nv_wo32
(
dev
,
ramfc
,
0x54
/
4
,
drm_order
(
chan
->
dma
.
ib_max
+
1
)
<<
16
);
if
(
!
IS_G8
0
)
{
if
(
dev_priv
->
chipset
!=
0x5
0
)
{
nv_wo32
(
dev
,
chan
->
ramin
->
gpuobj
,
0
,
chan
->
id
);
nv_wo32
(
dev
,
chan
->
ramin
->
gpuobj
,
1
,
chan
->
ramfc
->
instance
>>
8
);
...
...
@@ -303,14 +281,8 @@ nv50_fifo_create_context(struct nouveau_channel *chan)
dev_priv
->
engine
.
instmem
.
flush
(
dev
);
ret
=
nv50_fifo_channel_enable
(
dev
,
chan
->
id
,
false
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"error enabling ch%d: %d
\n
"
,
chan
->
id
,
ret
);
spin_unlock_irqrestore
(
&
dev_priv
->
context_switch_lock
,
flags
);
nouveau_gpuobj_ref_del
(
dev
,
&
chan
->
ramfc
);
return
ret
;
}
nv50_fifo_channel_enable
(
dev
,
chan
->
id
);
nv50_fifo_playlist_update
(
dev
);
spin_unlock_irqrestore
(
&
dev_priv
->
context_switch_lock
,
flags
);
return
0
;
}
...
...
@@ -325,11 +297,12 @@ nv50_fifo_destroy_context(struct nouveau_channel *chan)
/* This will ensure the channel is seen as disabled. */
chan
->
ramfc
=
NULL
;
nv50_fifo_channel_disable
(
dev
,
chan
->
id
,
false
);
nv50_fifo_channel_disable
(
dev
,
chan
->
id
);
/* Dummy channel, also used on ch 127 */
if
(
chan
->
id
==
0
)
nv50_fifo_channel_disable
(
dev
,
127
,
false
);
nv50_fifo_channel_disable
(
dev
,
127
);
nv50_fifo_playlist_update
(
dev
);
nouveau_gpuobj_ref_del
(
dev
,
&
ramfc
);
nouveau_gpuobj_ref_del
(
dev
,
&
chan
->
cache
);
...
...
@@ -391,7 +364,7 @@ nv50_fifo_load_context(struct nouveau_channel *chan)
nv_wr32
(
dev
,
NV03_PFIFO_CACHE1_GET
,
0
);
/* guessing that all the 0x34xx regs aren't on NV50 */
if
(
!
IS_G8
0
)
{
if
(
dev_priv
->
chipset
!=
0x5
0
)
{
nv_wr32
(
dev
,
0x340c
,
nv_ro32
(
dev
,
ramfc
,
0x88
/
4
));
nv_wr32
(
dev
,
0x3400
,
nv_ro32
(
dev
,
ramfc
,
0x8c
/
4
));
nv_wr32
(
dev
,
0x3404
,
nv_ro32
(
dev
,
ramfc
,
0x90
/
4
));
...
...
@@ -473,7 +446,7 @@ nv50_fifo_unload_context(struct drm_device *dev)
}
/* guessing that all the 0x34xx regs aren't on NV50 */
if
(
!
IS_G8
0
)
{
if
(
dev_priv
->
chipset
!=
0x5
0
)
{
nv_wo32
(
dev
,
ramfc
,
0x84
/
4
,
ptr
>>
1
);
nv_wo32
(
dev
,
ramfc
,
0x88
/
4
,
nv_rd32
(
dev
,
0x340c
));
nv_wo32
(
dev
,
ramfc
,
0x8c
/
4
,
nv_rd32
(
dev
,
0x3400
));
...
...
drivers/gpu/drm/nouveau/nv50_graph.c
浏览文件 @
ac94a343
...
...
@@ -30,8 +30,6 @@
#include "nouveau_grctx.h"
#define IS_G80 ((dev_priv->chipset & 0xf0) == 0x50)
static
void
nv50_graph_init_reset
(
struct
drm_device
*
dev
)
{
...
...
@@ -221,7 +219,7 @@ nv50_graph_create_context(struct nouveau_channel *chan)
return
ret
;
obj
=
chan
->
ramin_grctx
->
gpuobj
;
hdr
=
IS_G80
?
0x200
:
0x20
;
hdr
=
(
dev_priv
->
chipset
==
0x50
)
?
0x200
:
0x20
;
nv_wo32
(
dev
,
ramin
,
(
hdr
+
0x00
)
/
4
,
0x00190002
);
nv_wo32
(
dev
,
ramin
,
(
hdr
+
0x04
)
/
4
,
chan
->
ramin_grctx
->
instance
+
pgraph
->
grctx_size
-
1
);
...
...
@@ -246,7 +244,7 @@ nv50_graph_destroy_context(struct nouveau_channel *chan)
{
struct
drm_device
*
dev
=
chan
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
i
,
hdr
=
IS_G80
?
0x200
:
0x20
;
int
i
,
hdr
=
(
dev_priv
->
chipset
==
0x50
)
?
0x200
:
0x20
;
NV_DEBUG
(
dev
,
"ch%d
\n
"
,
chan
->
id
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录