Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
359088d5
Commit
359088d5
authored
Nov 01, 2017
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: remove trivial cases of nvxx_device() usage
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
920d2b5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
37 deletions
+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
No files found.
drivers/gpu/drm/nouveau/nouveau_abi16.c
View file @
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
View file @
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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment