Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
d01c3092
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d01c3092
编写于
8月 10, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/device: add method to retrieve some basic device info
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
8ec2a6ec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
171 addition
and
37 deletion
+171
-37
drivers/gpu/drm/nouveau/core/core/client.c
drivers/gpu/drm/nouveau/core/core/client.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/device/base.c
drivers/gpu/drm/nouveau/core/engine/device/base.c
+126
-37
drivers/gpu/drm/nouveau/core/include/nvif/class.h
drivers/gpu/drm/nouveau/core/include/nvif/class.h
+1
-0
drivers/gpu/drm/nouveau/nvif/class.h
drivers/gpu/drm/nouveau/nvif/class.h
+43
-0
未找到文件。
drivers/gpu/drm/nouveau/core/core/client.c
浏览文件 @
d01c3092
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include <core/client.h>
#include <core/client.h>
#include <core/handle.h>
#include <core/handle.h>
#include <core/option.h>
#include <core/option.h>
#include <nvif/class.h>
#include <nvif/unpack.h>
#include <nvif/unpack.h>
#include <nvif/event.h>
#include <nvif/event.h>
...
...
drivers/gpu/drm/nouveau/core/engine/device/base.c
浏览文件 @
d01c3092
...
@@ -26,9 +26,13 @@
...
@@ -26,9 +26,13 @@
#include <core/device.h>
#include <core/device.h>
#include <core/client.h>
#include <core/client.h>
#include <core/option.h>
#include <core/option.h>
#include <nvif/unpack.h>
#include <nvif/class.h>
#include <core/class.h>
#include <core/class.h>
#include <subdev/fb.h>
#include <subdev/instmem.h>
#include "priv.h"
#include "priv.h"
#include "acpi.h"
#include "acpi.h"
...
@@ -53,11 +57,131 @@ nouveau_device_find(u64 name)
...
@@ -53,11 +57,131 @@ nouveau_device_find(u64 name)
/******************************************************************************
/******************************************************************************
* nouveau_devobj (0x0080): class implementation
* nouveau_devobj (0x0080): class implementation
*****************************************************************************/
*****************************************************************************/
struct
nouveau_devobj
{
struct
nouveau_devobj
{
struct
nouveau_parent
base
;
struct
nouveau_parent
base
;
struct
nouveau_object
*
subdev
[
NVDEV_SUBDEV_NR
];
struct
nouveau_object
*
subdev
[
NVDEV_SUBDEV_NR
];
};
};
static
int
nouveau_devobj_info
(
struct
nouveau_object
*
object
,
void
*
data
,
u32
size
)
{
struct
nouveau_device
*
device
=
nv_device
(
object
);
struct
nouveau_fb
*
pfb
=
nouveau_fb
(
device
);
struct
nouveau_instmem
*
imem
=
nouveau_instmem
(
device
);
union
{
struct
nv_device_info_v0
v0
;
}
*
args
=
data
;
int
ret
;
nv_ioctl
(
object
,
"device info size %d
\n
"
,
size
);
if
(
nvif_unpack
(
args
->
v0
,
0
,
0
,
false
))
{
nv_ioctl
(
object
,
"device info vers %d
\n
"
,
args
->
v0
.
version
);
}
else
return
ret
;
switch
(
device
->
chipset
)
{
case
0x01a
:
case
0x01f
:
case
0x04c
:
case
0x04e
:
case
0x063
:
case
0x067
:
case
0x068
:
case
0x0aa
:
case
0x0ac
:
case
0x0af
:
args
->
v0
.
platform
=
NV_DEVICE_INFO_V0_IGP
;
break
;
default:
if
(
device
->
pdev
)
{
if
(
pci_find_capability
(
device
->
pdev
,
PCI_CAP_ID_AGP
))
args
->
v0
.
platform
=
NV_DEVICE_INFO_V0_AGP
;
else
if
(
pci_is_pcie
(
device
->
pdev
))
args
->
v0
.
platform
=
NV_DEVICE_INFO_V0_PCIE
;
else
args
->
v0
.
platform
=
NV_DEVICE_INFO_V0_PCI
;
}
else
{
args
->
v0
.
platform
=
NV_DEVICE_INFO_V0_SOC
;
}
break
;
}
switch
(
device
->
card_type
)
{
case
NV_04
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_TNT
;
break
;
case
NV_10
:
case
NV_11
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_CELSIUS
;
break
;
case
NV_20
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_KELVIN
;
break
;
case
NV_30
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_RANKINE
;
break
;
case
NV_40
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_CURIE
;
break
;
case
NV_50
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_TESLA
;
break
;
case
NV_C0
:
case
NV_D0
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_FERMI
;
break
;
case
NV_E0
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_KEPLER
;
break
;
case
GM100
:
args
->
v0
.
family
=
NV_DEVICE_INFO_V0_MAXWELL
;
break
;
default:
args
->
v0
.
family
=
0
;
break
;
}
args
->
v0
.
chipset
=
device
->
chipset
;
args
->
v0
.
revision
=
device
->
chipset
>=
0x10
?
nv_rd32
(
device
,
0
)
:
0x00
;
if
(
pfb
)
args
->
v0
.
ram_size
=
args
->
v0
.
ram_user
=
pfb
->
ram
->
size
;
else
args
->
v0
.
ram_size
=
args
->
v0
.
ram_user
=
0
;
if
(
imem
)
args
->
v0
.
ram_user
=
args
->
v0
.
ram_user
-
imem
->
reserved
;
return
0
;
}
static
int
nouveau_devobj_mthd
(
struct
nouveau_object
*
object
,
u32
mthd
,
void
*
data
,
u32
size
)
{
switch
(
mthd
)
{
case
NV_DEVICE_V0_INFO
:
return
nouveau_devobj_info
(
object
,
data
,
size
);
default:
break
;
}
return
-
EINVAL
;
}
static
u8
nouveau_devobj_rd08
(
struct
nouveau_object
*
object
,
u64
addr
)
{
return
nv_rd08
(
object
->
engine
,
addr
);
}
static
u16
nouveau_devobj_rd16
(
struct
nouveau_object
*
object
,
u64
addr
)
{
return
nv_rd16
(
object
->
engine
,
addr
);
}
static
u32
nouveau_devobj_rd32
(
struct
nouveau_object
*
object
,
u64
addr
)
{
return
nv_rd32
(
object
->
engine
,
addr
);
}
static
void
nouveau_devobj_wr08
(
struct
nouveau_object
*
object
,
u64
addr
,
u8
data
)
{
nv_wr08
(
object
->
engine
,
addr
,
data
);
}
static
void
nouveau_devobj_wr16
(
struct
nouveau_object
*
object
,
u64
addr
,
u16
data
)
{
nv_wr16
(
object
->
engine
,
addr
,
data
);
}
static
void
nouveau_devobj_wr32
(
struct
nouveau_object
*
object
,
u64
addr
,
u32
data
)
{
nv_wr32
(
object
->
engine
,
addr
,
data
);
}
static
const
u64
disable_map
[]
=
{
static
const
u64
disable_map
[]
=
{
[
NVDEV_SUBDEV_VBIOS
]
=
NV_DEVICE_DISABLE_VBIOS
,
[
NVDEV_SUBDEV_VBIOS
]
=
NV_DEVICE_DISABLE_VBIOS
,
[
NVDEV_SUBDEV_DEVINIT
]
=
NV_DEVICE_DISABLE_CORE
,
[
NVDEV_SUBDEV_DEVINIT
]
=
NV_DEVICE_DISABLE_CORE
,
...
@@ -311,48 +435,13 @@ nouveau_devobj_dtor(struct nouveau_object *object)
...
@@ -311,48 +435,13 @@ nouveau_devobj_dtor(struct nouveau_object *object)
nouveau_parent_destroy
(
&
devobj
->
base
);
nouveau_parent_destroy
(
&
devobj
->
base
);
}
}
static
u8
nouveau_devobj_rd08
(
struct
nouveau_object
*
object
,
u64
addr
)
{
return
nv_rd08
(
object
->
engine
,
addr
);
}
static
u16
nouveau_devobj_rd16
(
struct
nouveau_object
*
object
,
u64
addr
)
{
return
nv_rd16
(
object
->
engine
,
addr
);
}
static
u32
nouveau_devobj_rd32
(
struct
nouveau_object
*
object
,
u64
addr
)
{
return
nv_rd32
(
object
->
engine
,
addr
);
}
static
void
nouveau_devobj_wr08
(
struct
nouveau_object
*
object
,
u64
addr
,
u8
data
)
{
nv_wr08
(
object
->
engine
,
addr
,
data
);
}
static
void
nouveau_devobj_wr16
(
struct
nouveau_object
*
object
,
u64
addr
,
u16
data
)
{
nv_wr16
(
object
->
engine
,
addr
,
data
);
}
static
void
nouveau_devobj_wr32
(
struct
nouveau_object
*
object
,
u64
addr
,
u32
data
)
{
nv_wr32
(
object
->
engine
,
addr
,
data
);
}
static
struct
nouveau_ofuncs
static
struct
nouveau_ofuncs
nouveau_devobj_ofuncs
=
{
nouveau_devobj_ofuncs
=
{
.
ctor
=
nouveau_devobj_ctor
,
.
ctor
=
nouveau_devobj_ctor
,
.
dtor
=
nouveau_devobj_dtor
,
.
dtor
=
nouveau_devobj_dtor
,
.
init
=
_nouveau_parent_init
,
.
init
=
_nouveau_parent_init
,
.
fini
=
_nouveau_parent_fini
,
.
fini
=
_nouveau_parent_fini
,
.
mthd
=
nouveau_devobj_mthd
,
.
rd08
=
nouveau_devobj_rd08
,
.
rd08
=
nouveau_devobj_rd08
,
.
rd16
=
nouveau_devobj_rd16
,
.
rd16
=
nouveau_devobj_rd16
,
.
rd32
=
nouveau_devobj_rd32
,
.
rd32
=
nouveau_devobj_rd32
,
...
...
drivers/gpu/drm/nouveau/core/include/nvif/class.h
0 → 120000
浏览文件 @
d01c3092
..
/
..
/
..
/
nvif
/
class
.
h
\ No newline at end of file
drivers/gpu/drm/nouveau/nvif/class.h
0 → 100644
浏览文件 @
d01c3092
#ifndef __NVIF_CLASS_H__
#define __NVIF_CLASS_H__
/*******************************************************************************
* class identifiers
******************************************************************************/
/* the below match nvidia-assigned (either in hw, or sw) class numbers */
#define NV_DEVICE 0x00000080
/*******************************************************************************
* device
******************************************************************************/
#define NV_DEVICE_V0_INFO 0x00
struct
nv_device_info_v0
{
__u8
version
;
#define NV_DEVICE_INFO_V0_IGP 0x00
#define NV_DEVICE_INFO_V0_PCI 0x01
#define NV_DEVICE_INFO_V0_AGP 0x02
#define NV_DEVICE_INFO_V0_PCIE 0x03
#define NV_DEVICE_INFO_V0_SOC 0x04
__u8
platform
;
__u16
chipset
;
/* from NV_PMC_BOOT_0 */
__u8
revision
;
/* from NV_PMC_BOOT_0 */
#define NV_DEVICE_INFO_V0_TNT 0x01
#define NV_DEVICE_INFO_V0_CELSIUS 0x02
#define NV_DEVICE_INFO_V0_KELVIN 0x03
#define NV_DEVICE_INFO_V0_RANKINE 0x04
#define NV_DEVICE_INFO_V0_CURIE 0x05
#define NV_DEVICE_INFO_V0_TESLA 0x06
#define NV_DEVICE_INFO_V0_FERMI 0x07
#define NV_DEVICE_INFO_V0_KEPLER 0x08
#define NV_DEVICE_INFO_V0_MAXWELL 0x09
__u8
family
;
__u8
pad06
[
2
];
__u64
ram_size
;
__u64
ram_user
;
};
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录