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
e94654e2
Commit
e94654e2
authored
Aug 11, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/bar: ioremap only the areas that we're actually using
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
98faa78c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
+19
-20
drivers/gpu/drm/nouveau/core/include/subdev/bar.h
drivers/gpu/drm/nouveau/core/include/subdev/bar.h
+0
-1
drivers/gpu/drm/nouveau/core/subdev/bar/base.c
drivers/gpu/drm/nouveau/core/subdev/bar/base.c
+19
-19
No files found.
drivers/gpu/drm/nouveau/core/include/subdev/bar.h
View file @
e94654e2
...
...
@@ -12,7 +12,6 @@ struct nouveau_bar {
int
(
*
alloc
)(
struct
nouveau_bar
*
,
struct
nouveau_object
*
,
struct
nouveau_mem
*
,
struct
nouveau_object
**
);
void
__iomem
*
iomem
;
int
(
*
kmap
)(
struct
nouveau_bar
*
,
struct
nouveau_mem
*
,
u32
flags
,
struct
nouveau_vma
*
);
...
...
drivers/gpu/drm/nouveau/core/subdev/bar/base.c
View file @
e94654e2
...
...
@@ -38,10 +38,12 @@ struct nouveau_barobj {
static
int
nouveau_barobj_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
mem
,
u32
size
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nouveau_device
*
device
=
nv_device
(
parent
);
struct
nouveau_bar
*
bar
=
(
void
*
)
engine
;
struct
nouveau_mem
*
mem
=
data
;
struct
nouveau_barobj
*
barobj
;
int
ret
;
...
...
@@ -54,7 +56,13 @@ nouveau_barobj_ctor(struct nouveau_object *parent,
if
(
ret
)
return
ret
;
barobj
->
iomem
=
bar
->
iomem
+
(
u32
)
barobj
->
vma
.
offset
;
barobj
->
iomem
=
ioremap
(
nv_device_resource_start
(
device
,
3
)
+
(
u32
)
barobj
->
vma
.
offset
,
mem
->
size
<<
12
);
if
(
!
barobj
->
iomem
)
{
nv_warn
(
bar
,
"PRAMIN ioremap failed
\n
"
);
return
-
ENOMEM
;
}
return
0
;
}
...
...
@@ -63,8 +71,11 @@ nouveau_barobj_dtor(struct nouveau_object *object)
{
struct
nouveau_bar
*
bar
=
(
void
*
)
object
->
engine
;
struct
nouveau_barobj
*
barobj
=
(
void
*
)
object
;
if
(
barobj
->
vma
.
node
)
if
(
barobj
->
vma
.
node
)
{
if
(
barobj
->
iomem
)
iounmap
(
barobj
->
iomem
);
bar
->
unmap
(
bar
,
&
barobj
->
vma
);
}
nouveau_object_destroy
(
&
barobj
->
base
);
}
...
...
@@ -99,12 +110,11 @@ nouveau_bar_alloc(struct nouveau_bar *bar, struct nouveau_object *parent,
struct
nouveau_mem
*
mem
,
struct
nouveau_object
**
pobject
)
{
struct
nouveau_object
*
engine
=
nv_object
(
bar
);
int
ret
=
-
ENOMEM
;
if
(
bar
->
iomem
)
{
ret
=
nouveau_object_ctor
(
parent
,
engine
,
&
nouveau_barobj_oclass
,
mem
,
0
,
pobject
);
}
struct
nouveau_object
*
gpuobj
;
int
ret
=
nouveau_object_ctor
(
parent
,
engine
,
&
nouveau_barobj_oclass
,
mem
,
0
,
&
gpuobj
);
if
(
ret
==
0
)
*
pobject
=
gpuobj
;
return
ret
;
}
...
...
@@ -113,7 +123,6 @@ nouveau_bar_create_(struct nouveau_object *parent,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
int
length
,
void
**
pobject
)
{
struct
nouveau_device
*
device
=
nv_device
(
parent
);
struct
nouveau_bar
*
bar
;
int
ret
;
...
...
@@ -123,21 +132,12 @@ nouveau_bar_create_(struct nouveau_object *parent,
if
(
ret
)
return
ret
;
if
(
nv_device_resource_len
(
device
,
3
)
!=
0
)
{
bar
->
iomem
=
ioremap
(
nv_device_resource_start
(
device
,
3
),
nv_device_resource_len
(
device
,
3
));
if
(
!
bar
->
iomem
)
nv_warn
(
bar
,
"PRAMIN ioremap failed
\n
"
);
}
return
0
;
}
void
nouveau_bar_destroy
(
struct
nouveau_bar
*
bar
)
{
if
(
bar
->
iomem
)
iounmap
(
bar
->
iomem
);
nouveau_subdev_destroy
(
&
bar
->
base
);
}
...
...
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