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
5bf561ee
Commit
5bf561ee
authored
Dec 15, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/gr/gf100-: subclass nvkm_object to store channel pointer
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
f01c4e68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+28
-0
No files found.
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
View file @
5bf561ee
...
...
@@ -140,6 +140,12 @@ gf100_gr_zbc_depth_get(struct gf100_gr *gr, int format,
/*******************************************************************************
* Graphics object classes
******************************************************************************/
#define gf100_gr_object(p) container_of((p), struct gf100_gr_object, object)
struct
gf100_gr_object
{
struct
nvkm_object
object
;
struct
gf100_gr_chan
*
chan
;
};
static
int
gf100_fermi_mthd_zbc_color
(
struct
nvkm_object
*
object
,
void
*
data
,
u32
size
)
...
...
@@ -258,6 +264,27 @@ gf100_gr_mthd_sw(struct nvkm_device *device, u16 class, u32 mthd, u32 data)
return
false
;
}
static
const
struct
nvkm_object_func
gf100_gr_object_func
=
{
};
static
int
gf100_gr_object_new
(
const
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
{
struct
gf100_gr_chan
*
chan
=
gf100_gr_chan
(
oclass
->
parent
);
struct
gf100_gr_object
*
object
;
if
(
!
(
object
=
kzalloc
(
sizeof
(
*
object
),
GFP_KERNEL
)))
return
-
ENOMEM
;
*
pobject
=
&
object
->
object
;
nvkm_object_ctor
(
oclass
->
base
.
func
?
oclass
->
base
.
func
:
&
gf100_gr_object_func
,
oclass
,
&
object
->
object
);
object
->
chan
=
chan
;
return
0
;
}
static
int
gf100_gr_object_get
(
struct
nvkm_gr
*
base
,
int
index
,
struct
nvkm_sclass
*
sclass
)
{
...
...
@@ -267,6 +294,7 @@ gf100_gr_object_get(struct nvkm_gr *base, int index, struct nvkm_sclass *sclass)
while
(
gr
->
func
->
sclass
[
c
].
oclass
)
{
if
(
c
++
==
index
)
{
*
sclass
=
gr
->
func
->
sclass
[
index
];
sclass
->
ctor
=
gf100_gr_object_new
;
return
index
;
}
}
...
...
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