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
nexedi
linux
Commits
45ea5031
Commit
45ea5031
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/core: switch to gpuobj accessor macros
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
384af9ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c
drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c
+6
-2
drivers/gpu/drm/nouveau/nvkm/core/ramht.c
drivers/gpu/drm/nouveau/nvkm/core/ramht.c
+15
-7
No files found.
drivers/gpu/drm/nouveau/nvkm/core/gpuobj.c
View file @
45ea5031
...
...
@@ -34,8 +34,10 @@ nvkm_gpuobj_destroy(struct nvkm_gpuobj *gpuobj)
int
i
;
if
(
gpuobj
->
flags
&
NVOBJ_FLAG_ZERO_FREE
)
{
nvkm_kmap
(
gpuobj
);
for
(
i
=
0
;
i
<
gpuobj
->
size
;
i
+=
4
)
nv_wo32
(
gpuobj
,
i
,
0x00000000
);
nvkm_wo32
(
gpuobj
,
i
,
0x00000000
);
nvkm_done
(
gpuobj
);
}
if
(
gpuobj
->
node
)
...
...
@@ -123,8 +125,10 @@ nvkm_gpuobj_create_(struct nvkm_object *parent, struct nvkm_object *engine,
}
if
(
flags
&
NVOBJ_FLAG_ZERO_ALLOC
)
{
nvkm_kmap
(
gpuobj
);
for
(
i
=
0
;
i
<
gpuobj
->
size
;
i
+=
4
)
nv_wo32
(
gpuobj
,
i
,
0x00000000
);
nvkm_wo32
(
gpuobj
,
i
,
0x00000000
);
nvkm_done
(
gpuobj
);
}
return
ret
;
...
...
drivers/gpu/drm/nouveau/nvkm/core/ramht.c
View file @
45ea5031
...
...
@@ -42,35 +42,43 @@ nvkm_ramht_hash(struct nvkm_ramht *ramht, int chid, u32 handle)
int
nvkm_ramht_insert
(
struct
nvkm_ramht
*
ramht
,
int
chid
,
u32
handle
,
u32
context
)
{
struct
nvkm_gpuobj
*
gpuobj
=
&
ramht
->
gpuobj
;
struct
nvkm_bar
*
bar
=
nvkm_bar
(
ramht
);
int
ret
=
-
ENOSPC
;
u32
co
,
ho
;
co
=
ho
=
nvkm_ramht_hash
(
ramht
,
chid
,
handle
);
nvkm_kmap
(
gpuobj
);
do
{
if
(
!
nv
_ro32
(
ramht
,
co
+
4
))
{
nv
_wo32
(
ramht
,
co
+
0
,
handle
);
nv
_wo32
(
ramht
,
co
+
4
,
context
);
if
(
!
nv
km_ro32
(
gpuobj
,
co
+
4
))
{
nv
km_wo32
(
gpuobj
,
co
+
0
,
handle
);
nv
km_wo32
(
gpuobj
,
co
+
4
,
context
);
if
(
bar
)
bar
->
flush
(
bar
);
return
co
;
ret
=
co
;
break
;
}
co
+=
8
;
if
(
co
>=
nv_gpuobj
(
ramht
)
->
size
)
co
=
0
;
}
while
(
co
!=
ho
);
nvkm_done
(
gpuobj
);
return
-
ENOMEM
;
return
ret
;
}
void
nvkm_ramht_remove
(
struct
nvkm_ramht
*
ramht
,
int
cookie
)
{
struct
nvkm_gpuobj
*
gpuobj
=
&
ramht
->
gpuobj
;
struct
nvkm_bar
*
bar
=
nvkm_bar
(
ramht
);
nv_wo32
(
ramht
,
cookie
+
0
,
0x00000000
);
nv_wo32
(
ramht
,
cookie
+
4
,
0x00000000
);
nvkm_kmap
(
gpuobj
);
nvkm_wo32
(
gpuobj
,
cookie
+
0
,
0x00000000
);
nvkm_wo32
(
gpuobj
,
cookie
+
4
,
0x00000000
);
if
(
bar
)
bar
->
flush
(
bar
);
nvkm_done
(
gpuobj
);
}
static
struct
nvkm_oclass
...
...
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