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
00c55507
Commit
00c55507
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/imem: switch to subdev printk macros
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
18019e95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
+15
-11
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c
+2
-2
No files found.
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
View file @
00c55507
...
...
@@ -207,6 +207,7 @@ gk20a_instobj_ctor_dma(struct nvkm_object *parent, struct nvkm_object *engine,
{
struct
gk20a_instobj_dma
*
node
;
struct
gk20a_instmem
*
imem
=
(
void
*
)
nvkm_instmem
(
parent
);
struct
nvkm_subdev
*
subdev
=
&
imem
->
base
.
subdev
;
struct
device
*
dev
=
nv_device_base
(
nv_device
(
parent
));
int
ret
;
...
...
@@ -220,14 +221,15 @@ gk20a_instobj_ctor_dma(struct nvkm_object *parent, struct nvkm_object *engine,
&
node
->
handle
,
GFP_KERNEL
,
&
imem
->
attrs
);
if
(
!
node
->
cpuaddr
)
{
nv
_error
(
imem
,
"cannot allocate DMA memory
\n
"
);
nv
km_error
(
subdev
,
"cannot allocate DMA memory
\n
"
);
return
-
ENOMEM
;
}
/* alignment check */
if
(
unlikely
(
node
->
handle
&
(
align
-
1
)))
nv_warn
(
imem
,
"memory not aligned as requested: %pad (0x%x)
\n
"
,
&
node
->
handle
,
align
);
nvkm_warn
(
subdev
,
"memory not aligned as requested: %pad (0x%x)
\n
"
,
&
node
->
handle
,
align
);
/* present memory for being mapped using small pages */
node
->
r
.
type
=
12
;
...
...
@@ -249,6 +251,7 @@ gk20a_instobj_ctor_iommu(struct nvkm_object *parent, struct nvkm_object *engine,
{
struct
gk20a_instobj_iommu
*
node
;
struct
gk20a_instmem
*
imem
=
(
void
*
)
nvkm_instmem
(
parent
);
struct
nvkm_subdev
*
subdev
=
&
imem
->
base
.
subdev
;
struct
nvkm_mm_node
*
r
;
int
ret
;
int
i
;
...
...
@@ -277,7 +280,7 @@ gk20a_instobj_ctor_iommu(struct nvkm_object *parent, struct nvkm_object *engine,
align
>>
imem
->
iommu_pgshift
,
&
r
);
mutex_unlock
(
imem
->
mm_mutex
);
if
(
ret
)
{
nv
_error
(
imem
,
"virtual space is full!
\n
"
);
nv
km_error
(
subdev
,
"virtual space is full!
\n
"
);
goto
free_pages
;
}
...
...
@@ -289,7 +292,7 @@ gk20a_instobj_ctor_iommu(struct nvkm_object *parent, struct nvkm_object *engine,
ret
=
iommu_map
(
imem
->
domain
,
offset
,
page_to_phys
(
p
),
PAGE_SIZE
,
IOMMU_READ
|
IOMMU_WRITE
);
if
(
ret
<
0
)
{
nv
_error
(
imem
,
"IOMMU mapping failure: %d
\n
"
,
ret
);
nv
km_error
(
subdev
,
"IOMMU mapping failure: %d
\n
"
,
ret
);
while
(
i
--
>
0
)
{
offset
-=
PAGE_SIZE
;
...
...
@@ -329,11 +332,12 @@ gk20a_instobj_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_instobj_args
*
args
=
data
;
struct
gk20a_instmem
*
imem
=
(
void
*
)
nvkm_instmem
(
parent
);
struct
gk20a_instobj
*
node
;
struct
nvkm_subdev
*
subdev
=
&
imem
->
base
.
subdev
;
u32
size
,
align
;
int
ret
;
nv
_debug
(
parent
,
"%s (%s): size: %x align: %x
\n
"
,
__func__
,
imem
->
domain
?
"IOMMU"
:
"DMA"
,
args
->
size
,
args
->
align
);
nv
km_debug
(
subdev
,
"%s (%s): size: %x align: %x
\n
"
,
__func__
,
imem
->
domain
?
"IOMMU"
:
"DMA"
,
args
->
size
,
args
->
align
);
/* Round size and align to page bounds */
size
=
max
(
roundup
(
args
->
size
,
PAGE_SIZE
),
PAGE_SIZE
);
...
...
@@ -359,8 +363,8 @@ gk20a_instobj_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
node
->
base
.
addr
=
node
->
mem
->
offset
;
node
->
base
.
size
=
size
;
nv
_debug
(
parent
,
"alloc size: 0x%x, align: 0x%x, gaddr: 0x%llx
\n
"
,
size
,
align
,
node
->
mem
->
offset
);
nv
km_debug
(
subdev
,
"alloc size: 0x%x, align: 0x%x, gaddr: 0x%llx
\n
"
,
size
,
align
,
node
->
mem
->
offset
);
return
0
;
}
...
...
@@ -410,7 +414,7 @@ gk20a_instmem_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
imem
->
iommu_pgshift
=
plat
->
gpu
->
iommu
.
pgshift
;
imem
->
mm_mutex
=
&
plat
->
gpu
->
iommu
.
mutex
;
nv
_info
(
imem
,
"using IOMMU
\n
"
);
nv
km_info
(
&
imem
->
base
.
subdev
,
"using IOMMU
\n
"
);
}
else
{
init_dma_attrs
(
&
imem
->
attrs
);
/*
...
...
@@ -422,7 +426,7 @@ gk20a_instmem_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
dma_set_attr
(
DMA_ATTR_WRITE_COMBINE
,
&
imem
->
attrs
);
dma_set_attr
(
DMA_ATTR_NO_KERNEL_MAPPING
,
&
imem
->
attrs
);
nv
_info
(
imem
,
"using DMA API
\n
"
);
nv
km_info
(
&
imem
->
base
.
subdev
,
"using DMA API
\n
"
);
}
return
0
;
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv40.c
View file @
00c55507
...
...
@@ -49,7 +49,7 @@ nv40_instmem_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
{
struct
nvkm_device
*
device
=
nv_device
(
parent
)
;
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nv04_instmem
*
imem
;
int
ret
,
bar
,
vs
;
...
...
@@ -67,7 +67,7 @@ nv40_instmem_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
imem
->
iomem
=
ioremap
(
nv_device_resource_start
(
device
,
bar
),
nv_device_resource_len
(
device
,
bar
));
if
(
!
imem
->
iomem
)
{
nv
_error
(
imem
,
"unable to map PRAMIN BAR
\n
"
);
nv
km_error
(
&
imem
->
base
.
subdev
,
"unable to map PRAMIN BAR
\n
"
);
return
-
EFAULT
;
}
...
...
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