Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a763951a
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看板
提交
a763951a
编写于
11月 05, 2013
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nv108/fifo: initial support
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
a0f95f11
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
115 addition
and
55 deletion
+115
-55
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+1
-0
drivers/gpu/drm/nouveau/core/engine/device/nve0.c
drivers/gpu/drm/nouveau/core/engine/device/nve0.c
+1
-1
drivers/gpu/drm/nouveau/core/engine/fifo/nv108.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv108.c
+37
-0
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
+58
-54
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.h
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.h
+17
-0
drivers/gpu/drm/nouveau/core/include/engine/fifo.h
drivers/gpu/drm/nouveau/core/include/engine/fifo.h
+1
-0
未找到文件。
drivers/gpu/drm/nouveau/Makefile
浏览文件 @
a763951a
...
@@ -232,6 +232,7 @@ nouveau-y += core/engine/fifo/nv50.o
...
@@ -232,6 +232,7 @@ nouveau-y += core/engine/fifo/nv50.o
nouveau-y
+=
core/engine/fifo/nv84.o
nouveau-y
+=
core/engine/fifo/nv84.o
nouveau-y
+=
core/engine/fifo/nvc0.o
nouveau-y
+=
core/engine/fifo/nvc0.o
nouveau-y
+=
core/engine/fifo/nve0.o
nouveau-y
+=
core/engine/fifo/nve0.o
nouveau-y
+=
core/engine/fifo/nv108.o
nouveau-y
+=
core/engine/graph/ctxnv40.o
nouveau-y
+=
core/engine/graph/ctxnv40.o
nouveau-y
+=
core/engine/graph/ctxnv50.o
nouveau-y
+=
core/engine/graph/ctxnv50.o
nouveau-y
+=
core/engine/graph/ctxnvc0.o
nouveau-y
+=
core/engine/graph/ctxnvc0.o
...
...
drivers/gpu/drm/nouveau/core/engine/device/nve0.c
浏览文件 @
a763951a
...
@@ -212,8 +212,8 @@ nve0_identify(struct nouveau_device *device)
...
@@ -212,8 +212,8 @@ nve0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nv108_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nv108_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv108_fifo_oclass
;
#if 0
#if 0
device->oclass[NVDEV_ENGINE_FIFO ] = nve0_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nvc0_software_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nvc0_software_oclass;
device->oclass[NVDEV_ENGINE_GR ] = nvf0_graph_oclass;
device->oclass[NVDEV_ENGINE_GR ] = nvf0_graph_oclass;
#endif
#endif
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nv108.c
0 → 100644
浏览文件 @
a763951a
/*
* Copyright 2013 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 "nve0.h"
struct
nouveau_oclass
*
nv108_fifo_oclass
=
&
(
struct
nve0_fifo_impl
)
{
.
base
.
handle
=
NV_ENGINE
(
FIFO
,
0x08
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nve0_fifo_ctor
,
.
dtor
=
nve0_fifo_dtor
,
.
init
=
nve0_fifo_init
,
.
fini
=
_nouveau_fifo_fini
,
},
.
channels
=
1024
,
}.
base
;
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
浏览文件 @
a763951a
...
@@ -36,7 +36,8 @@
...
@@ -36,7 +36,8 @@
#include <subdev/vm.h>
#include <subdev/vm.h>
#include <engine/dmaobj.h>
#include <engine/dmaobj.h>
#include <engine/fifo.h>
#include "nve0.h"
#define _(a,b) { (a), ((1ULL << (a)) | (b)) }
#define _(a,b) { (a), ((1ULL << (a)) | (b)) }
static
const
struct
{
static
const
struct
{
...
@@ -575,15 +576,64 @@ nve0_fifo_uevent_disable(struct nouveau_event *event, int index)
...
@@ -575,15 +576,64 @@ nve0_fifo_uevent_disable(struct nouveau_event *event, int index)
nv_mask
(
priv
,
0x002140
,
0x80000000
,
0x00000000
);
nv_mask
(
priv
,
0x002140
,
0x80000000
,
0x00000000
);
}
}
static
int
int
nve0_fifo_init
(
struct
nouveau_object
*
object
)
{
struct
nve0_fifo_priv
*
priv
=
(
void
*
)
object
;
int
ret
,
i
;
ret
=
nouveau_fifo_init
(
&
priv
->
base
);
if
(
ret
)
return
ret
;
/* enable all available PSUBFIFOs */
nv_wr32
(
priv
,
0x000204
,
0xffffffff
);
priv
->
spoon_nr
=
hweight32
(
nv_rd32
(
priv
,
0x000204
));
nv_debug
(
priv
,
"%d subfifo(s)
\n
"
,
priv
->
spoon_nr
);
/* PSUBFIFO[n] */
for
(
i
=
0
;
i
<
priv
->
spoon_nr
;
i
++
)
{
nv_mask
(
priv
,
0x04013c
+
(
i
*
0x2000
),
0x10000100
,
0x00000000
);
nv_wr32
(
priv
,
0x040108
+
(
i
*
0x2000
),
0xffffffff
);
/* INTR */
nv_wr32
(
priv
,
0x04010c
+
(
i
*
0x2000
),
0xfffffeff
);
/* INTREN */
}
nv_wr32
(
priv
,
0x002254
,
0x10000000
|
priv
->
user
.
bar
.
offset
>>
12
);
nv_wr32
(
priv
,
0x002a00
,
0xffffffff
);
nv_wr32
(
priv
,
0x002100
,
0xffffffff
);
nv_wr32
(
priv
,
0x002140
,
0x3fffffff
);
return
0
;
}
void
nve0_fifo_dtor
(
struct
nouveau_object
*
object
)
{
struct
nve0_fifo_priv
*
priv
=
(
void
*
)
object
;
int
i
;
nouveau_gpuobj_unmap
(
&
priv
->
user
.
bar
);
nouveau_gpuobj_ref
(
NULL
,
&
priv
->
user
.
mem
);
for
(
i
=
0
;
i
<
FIFO_ENGINE_NR
;
i
++
)
{
nouveau_gpuobj_ref
(
NULL
,
&
priv
->
engine
[
i
].
playlist
[
1
]);
nouveau_gpuobj_ref
(
NULL
,
&
priv
->
engine
[
i
].
playlist
[
0
]);
}
nouveau_fifo_destroy
(
&
priv
->
base
);
}
int
nve0_fifo_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
nve0_fifo_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
struct
nouveau_object
**
pobject
)
{
{
struct
nve0_fifo_impl
*
impl
=
(
void
*
)
oclass
;
struct
nve0_fifo_priv
*
priv
;
struct
nve0_fifo_priv
*
priv
;
int
ret
,
i
;
int
ret
,
i
;
ret
=
nouveau_fifo_create
(
parent
,
engine
,
oclass
,
0
,
4095
,
&
priv
);
ret
=
nouveau_fifo_create
(
parent
,
engine
,
oclass
,
0
,
impl
->
channels
-
1
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -621,60 +671,14 @@ nve0_fifo_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
...
@@ -621,60 +671,14 @@ nve0_fifo_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return
0
;
return
0
;
}
}
static
void
nve0_fifo_dtor
(
struct
nouveau_object
*
object
)
{
struct
nve0_fifo_priv
*
priv
=
(
void
*
)
object
;
int
i
;
nouveau_gpuobj_unmap
(
&
priv
->
user
.
bar
);
nouveau_gpuobj_ref
(
NULL
,
&
priv
->
user
.
mem
);
for
(
i
=
0
;
i
<
FIFO_ENGINE_NR
;
i
++
)
{
nouveau_gpuobj_ref
(
NULL
,
&
priv
->
engine
[
i
].
playlist
[
1
]);
nouveau_gpuobj_ref
(
NULL
,
&
priv
->
engine
[
i
].
playlist
[
0
]);
}
nouveau_fifo_destroy
(
&
priv
->
base
);
}
static
int
nve0_fifo_init
(
struct
nouveau_object
*
object
)
{
struct
nve0_fifo_priv
*
priv
=
(
void
*
)
object
;
int
ret
,
i
;
ret
=
nouveau_fifo_init
(
&
priv
->
base
);
if
(
ret
)
return
ret
;
/* enable all available PSUBFIFOs */
nv_wr32
(
priv
,
0x000204
,
0xffffffff
);
priv
->
spoon_nr
=
hweight32
(
nv_rd32
(
priv
,
0x000204
));
nv_debug
(
priv
,
"%d subfifo(s)
\n
"
,
priv
->
spoon_nr
);
/* PSUBFIFO[n] */
for
(
i
=
0
;
i
<
priv
->
spoon_nr
;
i
++
)
{
nv_mask
(
priv
,
0x04013c
+
(
i
*
0x2000
),
0x10000100
,
0x00000000
);
nv_wr32
(
priv
,
0x040108
+
(
i
*
0x2000
),
0xffffffff
);
/* INTR */
nv_wr32
(
priv
,
0x04010c
+
(
i
*
0x2000
),
0xfffffeff
);
/* INTREN */
}
nv_wr32
(
priv
,
0x002254
,
0x10000000
|
priv
->
user
.
bar
.
offset
>>
12
);
nv_wr32
(
priv
,
0x002a00
,
0xffffffff
);
nv_wr32
(
priv
,
0x002100
,
0xffffffff
);
nv_wr32
(
priv
,
0x002140
,
0x3fffffff
);
return
0
;
}
struct
nouveau_oclass
*
struct
nouveau_oclass
*
nve0_fifo_oclass
=
&
(
struct
n
ouveau_oclass
)
{
nve0_fifo_oclass
=
&
(
struct
n
ve0_fifo_impl
)
{
.
handle
=
NV_ENGINE
(
FIFO
,
0xe0
),
.
base
.
handle
=
NV_ENGINE
(
FIFO
,
0xe0
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nve0_fifo_ctor
,
.
ctor
=
nve0_fifo_ctor
,
.
dtor
=
nve0_fifo_dtor
,
.
dtor
=
nve0_fifo_dtor
,
.
init
=
nve0_fifo_init
,
.
init
=
nve0_fifo_init
,
.
fini
=
_nouveau_fifo_fini
,
.
fini
=
_nouveau_fifo_fini
,
},
},
};
.
channels
=
4096
,
}.
base
;
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.h
0 → 100644
浏览文件 @
a763951a
#ifndef __NVKM_FIFO_NVE0_H__
#define __NVKM_FIFO_NVE0_H__
#include <engine/fifo.h>
int
nve0_fifo_ctor
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
void
*
,
u32
,
struct
nouveau_object
**
);
void
nve0_fifo_dtor
(
struct
nouveau_object
*
);
int
nve0_fifo_init
(
struct
nouveau_object
*
);
struct
nve0_fifo_impl
{
struct
nouveau_oclass
base
;
u32
channels
;
};
#endif
drivers/gpu/drm/nouveau/core/include/engine/fifo.h
浏览文件 @
a763951a
...
@@ -109,6 +109,7 @@ extern struct nouveau_oclass *nv50_fifo_oclass;
...
@@ -109,6 +109,7 @@ extern struct nouveau_oclass *nv50_fifo_oclass;
extern
struct
nouveau_oclass
*
nv84_fifo_oclass
;
extern
struct
nouveau_oclass
*
nv84_fifo_oclass
;
extern
struct
nouveau_oclass
*
nvc0_fifo_oclass
;
extern
struct
nouveau_oclass
*
nvc0_fifo_oclass
;
extern
struct
nouveau_oclass
*
nve0_fifo_oclass
;
extern
struct
nouveau_oclass
*
nve0_fifo_oclass
;
extern
struct
nouveau_oclass
*
nv108_fifo_oclass
;
void
nv04_fifo_intr
(
struct
nouveau_subdev
*
);
void
nv04_fifo_intr
(
struct
nouveau_subdev
*
);
int
nv04_fifo_context_attach
(
struct
nouveau_object
*
,
struct
nouveau_object
*
);
int
nv04_fifo_context_attach
(
struct
nouveau_object
*
,
struct
nouveau_object
*
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录