Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
359088d5
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看板
提交
359088d5
编写于
11月 01, 2017
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: remove trivial cases of nvxx_device() usage
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
920d2b5e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
37 deletion
+31
-37
drivers/gpu/drm/nouveau/nouveau_abi16.c
drivers/gpu/drm/nouveau/nouveau_abi16.c
+17
-13
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_bo.c
+14
-24
未找到文件。
drivers/gpu/drm/nouveau/nouveau_abi16.c
浏览文件 @
359088d5
...
...
@@ -185,29 +185,33 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
getparam
->
value
=
device
->
info
.
chipset
;
break
;
case
NOUVEAU_GETPARAM_PCI_VENDOR
:
if
(
nvxx_device
(
device
)
->
func
->
pci
)
if
(
device
->
info
.
platform
!=
NV_DEVICE_INFO_V0_SOC
)
getparam
->
value
=
dev
->
pdev
->
vendor
;
else
getparam
->
value
=
0
;
break
;
case
NOUVEAU_GETPARAM_PCI_DEVICE
:
if
(
nvxx_device
(
device
)
->
func
->
pci
)
if
(
device
->
info
.
platform
!=
NV_DEVICE_INFO_V0_SOC
)
getparam
->
value
=
dev
->
pdev
->
device
;
else
getparam
->
value
=
0
;
break
;
case
NOUVEAU_GETPARAM_BUS_TYPE
:
if
(
!
nvxx_device
(
device
)
->
func
->
pci
)
getparam
->
value
=
3
;
else
if
(
pci_find_capability
(
dev
->
pdev
,
PCI_CAP_ID_AGP
))
getparam
->
value
=
0
;
else
if
(
!
pci_is_pcie
(
dev
->
pdev
))
getparam
->
value
=
1
;
else
getparam
->
value
=
2
;
break
;
switch
(
device
->
info
.
platform
)
{
case
NV_DEVICE_INFO_V0_AGP
:
getparam
->
value
=
0
;
break
;
case
NV_DEVICE_INFO_V0_PCI
:
getparam
->
value
=
1
;
break
;
case
NV_DEVICE_INFO_V0_PCIE
:
getparam
->
value
=
2
;
break
;
case
NV_DEVICE_INFO_V0_SOC
:
getparam
->
value
=
3
;
break
;
case
NV_DEVICE_INFO_V0_IGP
:
if
(
!
pci_is_pcie
(
dev
->
pdev
))
getparam
->
value
=
1
;
else
getparam
->
value
=
2
;
break
;
default:
WARN_ON
(
1
);
break
;
}
case
NOUVEAU_GETPARAM_FB_SIZE
:
getparam
->
value
=
drm
->
gem
.
vram_available
;
break
;
...
...
drivers/gpu/drm/nouveau/nouveau_bo.c
浏览文件 @
359088d5
...
...
@@ -50,8 +50,7 @@ nv10_bo_update_tile_region(struct drm_device *dev, struct nouveau_drm_tile *reg,
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
int
i
=
reg
-
drm
->
tile
.
reg
;
struct
nvkm_device
*
device
=
nvxx_device
(
&
drm
->
client
.
device
);
struct
nvkm_fb
*
fb
=
device
->
fb
;
struct
nvkm_fb
*
fb
=
nvxx_fb
(
&
drm
->
client
.
device
);
struct
nvkm_fb_tile
*
tile
=
&
fb
->
tile
.
region
[
i
];
nouveau_fence_unref
(
&
reg
->
fence
);
...
...
@@ -459,7 +458,6 @@ void
nouveau_bo_sync_for_device
(
struct
nouveau_bo
*
nvbo
)
{
struct
nouveau_drm
*
drm
=
nouveau_bdev
(
nvbo
->
bo
.
bdev
);
struct
nvkm_device
*
device
=
nvxx_device
(
&
drm
->
client
.
device
);
struct
ttm_dma_tt
*
ttm_dma
=
(
struct
ttm_dma_tt
*
)
nvbo
->
bo
.
ttm
;
int
i
;
...
...
@@ -471,7 +469,8 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)
return
;
for
(
i
=
0
;
i
<
ttm_dma
->
ttm
.
num_pages
;
i
++
)
dma_sync_single_for_device
(
device
->
dev
,
ttm_dma
->
dma_address
[
i
],
dma_sync_single_for_device
(
drm
->
dev
->
dev
,
ttm_dma
->
dma_address
[
i
],
PAGE_SIZE
,
DMA_TO_DEVICE
);
}
...
...
@@ -479,7 +478,6 @@ void
nouveau_bo_sync_for_cpu
(
struct
nouveau_bo
*
nvbo
)
{
struct
nouveau_drm
*
drm
=
nouveau_bdev
(
nvbo
->
bo
.
bdev
);
struct
nvkm_device
*
device
=
nvxx_device
(
&
drm
->
client
.
device
);
struct
ttm_dma_tt
*
ttm_dma
=
(
struct
ttm_dma_tt
*
)
nvbo
->
bo
.
ttm
;
int
i
;
...
...
@@ -491,7 +489,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)
return
;
for
(
i
=
0
;
i
<
ttm_dma
->
ttm
.
num_pages
;
i
++
)
dma_sync_single_for_cpu
(
d
evice
->
dev
,
ttm_dma
->
dma_address
[
i
],
dma_sync_single_for_cpu
(
d
rm
->
dev
->
dev
,
ttm_dma
->
dma_address
[
i
],
PAGE_SIZE
,
DMA_FROM_DEVICE
);
}
...
...
@@ -1468,9 +1466,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm)
{
struct
ttm_dma_tt
*
ttm_dma
=
(
void
*
)
ttm
;
struct
nouveau_drm
*
drm
;
struct
nvkm_device
*
device
;
struct
drm_device
*
dev
;
struct
device
*
pdev
;
struct
device
*
dev
;
unsigned
i
;
int
r
;
bool
slave
=
!!
(
ttm
->
page_flags
&
TTM_PAGE_FLAG_SG
);
...
...
@@ -1487,9 +1483,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm)
}
drm
=
nouveau_bdev
(
ttm
->
bdev
);
device
=
nvxx_device
(
&
drm
->
client
.
device
);
dev
=
drm
->
dev
;
pdev
=
device
->
dev
;
dev
=
drm
->
dev
->
dev
;
#if IS_ENABLED(CONFIG_AGP)
if
(
drm
->
agp
.
bridge
)
{
...
...
@@ -1499,7 +1493,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm)
#if IS_ENABLED(CONFIG_SWIOTLB) && IS_ENABLED(CONFIG_X86)
if
(
swiotlb_nr_tbl
())
{
return
ttm_dma_populate
((
void
*
)
ttm
,
dev
->
dev
);
return
ttm_dma_populate
((
void
*
)
ttm
,
dev
);
}
#endif
...
...
@@ -1511,12 +1505,12 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm)
for
(
i
=
0
;
i
<
ttm
->
num_pages
;
i
++
)
{
dma_addr_t
addr
;
addr
=
dma_map_page
(
p
dev
,
ttm
->
pages
[
i
],
0
,
PAGE_SIZE
,
addr
=
dma_map_page
(
dev
,
ttm
->
pages
[
i
],
0
,
PAGE_SIZE
,
DMA_BIDIRECTIONAL
);
if
(
dma_mapping_error
(
p
dev
,
addr
))
{
if
(
dma_mapping_error
(
dev
,
addr
))
{
while
(
i
--
)
{
dma_unmap_page
(
p
dev
,
ttm_dma
->
dma_address
[
i
],
dma_unmap_page
(
dev
,
ttm_dma
->
dma_address
[
i
],
PAGE_SIZE
,
DMA_BIDIRECTIONAL
);
ttm_dma
->
dma_address
[
i
]
=
0
;
}
...
...
@@ -1534,9 +1528,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm)
{
struct
ttm_dma_tt
*
ttm_dma
=
(
void
*
)
ttm
;
struct
nouveau_drm
*
drm
;
struct
nvkm_device
*
device
;
struct
drm_device
*
dev
;
struct
device
*
pdev
;
struct
device
*
dev
;
unsigned
i
;
bool
slave
=
!!
(
ttm
->
page_flags
&
TTM_PAGE_FLAG_SG
);
...
...
@@ -1544,9 +1536,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm)
return
;
drm
=
nouveau_bdev
(
ttm
->
bdev
);
device
=
nvxx_device
(
&
drm
->
client
.
device
);
dev
=
drm
->
dev
;
pdev
=
device
->
dev
;
dev
=
drm
->
dev
->
dev
;
#if IS_ENABLED(CONFIG_AGP)
if
(
drm
->
agp
.
bridge
)
{
...
...
@@ -1557,14 +1547,14 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm)
#if IS_ENABLED(CONFIG_SWIOTLB) && IS_ENABLED(CONFIG_X86)
if
(
swiotlb_nr_tbl
())
{
ttm_dma_unpopulate
((
void
*
)
ttm
,
dev
->
dev
);
ttm_dma_unpopulate
((
void
*
)
ttm
,
dev
);
return
;
}
#endif
for
(
i
=
0
;
i
<
ttm
->
num_pages
;
i
++
)
{
if
(
ttm_dma
->
dma_address
[
i
])
{
dma_unmap_page
(
p
dev
,
ttm_dma
->
dma_address
[
i
],
PAGE_SIZE
,
dma_unmap_page
(
dev
,
ttm_dma
->
dma_address
[
i
],
PAGE_SIZE
,
DMA_BIDIRECTIONAL
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录