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
7589563e
Commit
7589563e
authored
Oct 03, 2013
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv50-/sw: share engine/channel constructor between implementations
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
c46c3ddf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
51 deletions
+37
-51
drivers/gpu/drm/nouveau/core/engine/software/nv50.c
drivers/gpu/drm/nouveau/core/engine/software/nv50.c
+13
-8
drivers/gpu/drm/nouveau/core/engine/software/nv50.h
drivers/gpu/drm/nouveau/core/engine/software/nv50.h
+16
-0
drivers/gpu/drm/nouveau/core/engine/software/nvc0.c
drivers/gpu/drm/nouveau/core/engine/software/nvc0.c
+8
-43
No files found.
drivers/gpu/drm/nouveau/core/engine/software/nv50.c
View file @
7589563e
...
...
@@ -147,12 +147,13 @@ nv50_software_vblsem_release(struct nouveau_eventh *event, int head)
return
NVKM_EVENT_DROP
;
}
static
int
int
nv50_software_context_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nv50_software_cclass
*
pclass
=
(
void
*
)
oclass
;
struct
nv50_software_chan
*
chan
;
int
ret
;
...
...
@@ -162,30 +163,32 @@ nv50_software_context_ctor(struct nouveau_object *parent,
return
ret
;
chan
->
vblank
.
channel
=
nv_gpuobj
(
parent
->
parent
)
->
addr
>>
12
;
chan
->
vblank
.
event
.
func
=
nv50_software_vblsem_release
;
chan
->
vblank
.
event
.
func
=
pclass
->
vblank
;
return
0
;
}
static
struct
n
ouveau_o
class
static
struct
n
v50_software_c
class
nv50_software_cclass
=
{
.
handle
=
NV_ENGCTX
(
SW
,
0x50
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
base
.
handle
=
NV_ENGCTX
(
SW
,
0x50
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv50_software_context_ctor
,
.
dtor
=
_nouveau_software_context_dtor
,
.
init
=
_nouveau_software_context_init
,
.
fini
=
_nouveau_software_context_fini
,
},
.
vblank
=
nv50_software_vblsem_release
,
};
/*******************************************************************************
* software engine/subdev functions
******************************************************************************/
static
int
int
nv50_software_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nv50_software_oclass
*
pclass
=
(
void
*
)
oclass
;
struct
nv50_software_priv
*
priv
;
int
ret
;
...
...
@@ -194,8 +197,8 @@ nv50_software_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
if
(
ret
)
return
ret
;
nv_engine
(
priv
)
->
cclass
=
&
nv50_software_
cclass
;
nv_engine
(
priv
)
->
sclass
=
nv50_software_
sclass
;
nv_engine
(
priv
)
->
cclass
=
pclass
->
cclass
;
nv_engine
(
priv
)
->
sclass
=
pclass
->
sclass
;
nv_subdev
(
priv
)
->
intr
=
nv04_software_intr
;
return
0
;
}
...
...
@@ -209,4 +212,6 @@ nv50_software_oclass = &(struct nv50_software_oclass) {
.
init
=
_nouveau_software_init
,
.
fini
=
_nouveau_software_fini
,
},
.
cclass
=
&
nv50_software_cclass
.
base
,
.
sclass
=
nv50_software_sclass
,
}.
base
;
drivers/gpu/drm/nouveau/core/engine/software/nv50.h
View file @
7589563e
...
...
@@ -5,12 +5,23 @@
struct
nv50_software_oclass
{
struct
nouveau_oclass
base
;
struct
nouveau_oclass
*
cclass
;
struct
nouveau_oclass
*
sclass
;
};
struct
nv50_software_priv
{
struct
nouveau_software
base
;
};
int
nv50_software_ctor
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
void
*
,
u32
,
struct
nouveau_object
**
);
struct
nv50_software_cclass
{
struct
nouveau_oclass
base
;
int
(
*
vblank
)(
struct
nouveau_eventh
*
,
int
);
};
struct
nv50_software_chan
{
struct
nouveau_software_chan
base
;
struct
{
...
...
@@ -22,4 +33,9 @@ struct nv50_software_chan {
}
vblank
;
};
int
nv50_software_context_ctor
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
void
*
,
u32
,
struct
nouveau_object
**
);
#endif
drivers/gpu/drm/nouveau/core/engine/software/nvc0.c
View file @
7589563e
...
...
@@ -154,66 +154,31 @@ nvc0_software_vblsem_release(struct nouveau_eventh *event, int head)
return
NVKM_EVENT_DROP
;
}
static
int
nvc0_software_context_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nv50_software_chan
*
chan
;
int
ret
;
ret
=
nouveau_software_context_create
(
parent
,
engine
,
oclass
,
&
chan
);
*
pobject
=
nv_object
(
chan
);
if
(
ret
)
return
ret
;
chan
->
vblank
.
channel
=
nv_gpuobj
(
parent
->
parent
)
->
addr
>>
12
;
chan
->
vblank
.
event
.
func
=
nvc0_software_vblsem_release
;
return
0
;
}
static
struct
nouveau_oclass
static
struct
nv50_software_cclass
nvc0_software_cclass
=
{
.
handle
=
NV_ENGCTX
(
SW
,
0xc0
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv
c
0_software_context_ctor
,
.
base
.
handle
=
NV_ENGCTX
(
SW
,
0xc0
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv
5
0_software_context_ctor
,
.
dtor
=
_nouveau_software_context_dtor
,
.
init
=
_nouveau_software_context_init
,
.
fini
=
_nouveau_software_context_fini
,
},
.
vblank
=
nvc0_software_vblsem_release
,
};
/*******************************************************************************
* software engine/subdev functions
******************************************************************************/
static
int
nvc0_software_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nv50_software_priv
*
priv
;
int
ret
;
ret
=
nouveau_software_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
nv_engine
(
priv
)
->
cclass
=
&
nvc0_software_cclass
;
nv_engine
(
priv
)
->
sclass
=
nvc0_software_sclass
;
nv_subdev
(
priv
)
->
intr
=
nv04_software_intr
;
return
0
;
}
struct
nouveau_oclass
*
nvc0_software_oclass
=
&
(
struct
nv50_software_oclass
)
{
.
base
.
handle
=
NV_ENGINE
(
SW
,
0xc0
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv
c
0_software_ctor
,
.
ctor
=
nv
5
0_software_ctor
,
.
dtor
=
_nouveau_software_dtor
,
.
init
=
_nouveau_software_init
,
.
fini
=
_nouveau_software_fini
,
},
.
cclass
=
&
nvc0_software_cclass
.
base
,
.
sclass
=
nvc0_software_sclass
,
}.
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