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
102b49da
Commit
102b49da
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/parent: remove some (now) unnecessary special-case handling
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
493f189d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
49 deletions
+14
-49
drivers/gpu/drm/nouveau/include/nvkm/core/parent.h
drivers/gpu/drm/nouveau/include/nvkm/core/parent.h
+1
-7
drivers/gpu/drm/nouveau/nvkm/core/parent.c
drivers/gpu/drm/nouveau/nvkm/core/parent.c
+13
-42
No files found.
drivers/gpu/drm/nouveau/include/nvkm/core/parent.h
View file @
102b49da
...
...
@@ -2,16 +2,10 @@
#define __NVKM_PARENT_H__
#include <core/object.h>
struct
nvkm_sclass
{
struct
nvkm_sclass
*
sclass
;
struct
nvkm_engine
*
engine
;
struct
nvkm_oclass
*
oclass
;
};
struct
nvkm_parent
{
struct
nvkm_object
object
;
struct
nvkm_
s
class
*
sclass
;
struct
nvkm_
o
class
*
sclass
;
u64
engine
;
int
(
*
context_attach
)(
struct
nvkm_object
*
,
struct
nvkm_object
*
);
...
...
drivers/gpu/drm/nouveau/nvkm/core/parent.c
View file @
102b49da
...
...
@@ -30,35 +30,27 @@ nvkm_parent_sclass(struct nvkm_object *parent, u16 handle,
struct
nvkm_object
**
pengine
,
struct
nvkm_oclass
**
poclass
)
{
struct
nvkm_
sclass
*
s
class
;
struct
nvkm_
oclass
*
sclass
,
*
o
class
;
struct
nvkm_engine
*
engine
;
struct
nvkm_oclass
*
oclass
;
u64
mask
;
int
i
;
sclass
=
nv_parent
(
parent
)
->
sclass
;
while
(
sclas
s
)
{
if
(
(
sclass
->
oclass
->
handle
&
0xffff
)
==
handle
)
{
while
(
(
oclass
=
sclass
++
)
&&
oclass
->
ofunc
s
)
{
if
(
oclass
->
handle
==
handle
)
{
*
pengine
=
&
parent
->
engine
->
subdev
.
object
;
*
poclass
=
sclass
->
oclass
;
*
poclass
=
oclass
;
return
0
;
}
sclass
=
sclass
->
sclass
;
}
mask
=
nv_parent
(
parent
)
->
engine
;
while
(
mask
)
{
int
i
=
__ffs64
(
mask
);
if
(
nv_iclass
(
parent
,
NV_CLIENT_CLASS
))
engine
=
nv_engine
(
nv_client
(
parent
)
->
device
);
else
engine
=
nvkm_engine
(
parent
,
i
);
while
(
i
=
__ffs64
(
mask
),
mask
)
{
engine
=
nvkm_engine
(
parent
,
i
);
if
(
engine
)
{
oclass
=
engine
->
sclass
;
while
(
oclass
->
ofuncs
)
{
if
(
(
oclass
->
handle
&
0xffff
)
==
handle
)
{
if
(
oclass
->
handle
==
handle
)
{
*
pengine
=
nv_object
(
engine
);
*
poclass
=
oclass
;
return
0
;
...
...
@@ -76,17 +68,15 @@ nvkm_parent_sclass(struct nvkm_object *parent, u16 handle,
int
nvkm_parent_lclass
(
struct
nvkm_object
*
parent
,
u32
*
lclass
,
int
size
)
{
struct
nvkm_
sclass
*
s
class
;
struct
nvkm_
oclass
*
sclass
,
*
o
class
;
struct
nvkm_engine
*
engine
;
struct
nvkm_oclass
*
oclass
;
int
nr
=
-
1
,
i
;
u64
mask
;
sclass
=
nv_parent
(
parent
)
->
sclass
;
while
(
sclas
s
)
{
while
(
(
oclass
=
sclass
++
)
&&
oclass
->
ofunc
s
)
{
if
(
++
nr
<
size
)
lclass
[
nr
]
=
sclass
->
oclass
->
handle
&
0xffff
;
sclass
=
sclass
->
sclass
;
lclass
[
nr
]
=
oclass
->
handle
;
}
mask
=
nv_parent
(
parent
)
->
engine
;
...
...
@@ -95,7 +85,7 @@ nvkm_parent_lclass(struct nvkm_object *parent, u32 *lclass, int size)
if
(
engine
&&
(
oclass
=
engine
->
sclass
))
{
while
(
oclass
->
ofuncs
)
{
if
(
++
nr
<
size
)
lclass
[
nr
]
=
oclass
->
handle
&
0xffff
;
lclass
[
nr
]
=
oclass
->
handle
;
oclass
++
;
}
}
...
...
@@ -113,7 +103,6 @@ nvkm_parent_create_(struct nvkm_object *parent, struct nvkm_object *engine,
int
size
,
void
**
pobject
)
{
struct
nvkm_parent
*
object
;
struct
nvkm_sclass
*
nclass
;
int
ret
;
ret
=
nvkm_object_create_
(
parent
,
engine
,
oclass
,
pclass
|
...
...
@@ -122,18 +111,7 @@ nvkm_parent_create_(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
return
ret
;
while
(
sclass
&&
sclass
->
ofuncs
)
{
nclass
=
kzalloc
(
sizeof
(
*
nclass
),
GFP_KERNEL
);
if
(
!
nclass
)
return
-
ENOMEM
;
nclass
->
sclass
=
object
->
sclass
;
object
->
sclass
=
nclass
;
nclass
->
engine
=
engine
?
nv_engine
(
engine
)
:
NULL
;
nclass
->
oclass
=
sclass
;
sclass
++
;
}
object
->
sclass
=
sclass
;
object
->
engine
=
engcls
;
return
0
;
}
...
...
@@ -141,13 +119,6 @@ nvkm_parent_create_(struct nvkm_object *parent, struct nvkm_object *engine,
void
nvkm_parent_destroy
(
struct
nvkm_parent
*
parent
)
{
struct
nvkm_sclass
*
sclass
;
while
((
sclass
=
parent
->
sclass
))
{
parent
->
sclass
=
sclass
->
sclass
;
kfree
(
sclass
);
}
nvkm_object_destroy
(
&
parent
->
object
);
}
...
...
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