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
ec0e5542
Commit
ec0e5542
authored
Dec 05, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/core: object.engine is always a nouveau_engine now
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
8000fb21
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
30 additions
and
33 deletions
+30
-33
drivers/gpu/drm/nouveau/core/core/engctx.c
drivers/gpu/drm/nouveau/core/core/engctx.c
+3
-4
drivers/gpu/drm/nouveau/core/core/engine.c
drivers/gpu/drm/nouveau/core/core/engine.c
+1
-1
drivers/gpu/drm/nouveau/core/core/gpuobj.c
drivers/gpu/drm/nouveau/core/core/gpuobj.c
+2
-2
drivers/gpu/drm/nouveau/core/core/object.c
drivers/gpu/drm/nouveau/core/core/object.c
+7
-7
drivers/gpu/drm/nouveau/core/core/parent.c
drivers/gpu/drm/nouveau/core/core/parent.c
+1
-1
drivers/gpu/drm/nouveau/core/core/printk.c
drivers/gpu/drm/nouveau/core/core/printk.c
+1
-1
drivers/gpu/drm/nouveau/core/core/ramht.c
drivers/gpu/drm/nouveau/core/core/ramht.c
+1
-1
drivers/gpu/drm/nouveau/core/core/subdev.c
drivers/gpu/drm/nouveau/core/core/subdev.c
+1
-1
drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c
drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c
+1
-1
drivers/gpu/drm/nouveau/core/engine/copy/nve0.c
drivers/gpu/drm/nouveau/core/engine/copy/nve0.c
+1
-1
drivers/gpu/drm/nouveau/core/engine/device/base.c
drivers/gpu/drm/nouveau/core/engine/device/base.c
+1
-1
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
+1
-2
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
+1
-2
drivers/gpu/drm/nouveau/core/include/core/engine.h
drivers/gpu/drm/nouveau/core/include/core/engine.h
+2
-2
drivers/gpu/drm/nouveau/core/include/core/object.h
drivers/gpu/drm/nouveau/core/include/core/object.h
+1
-1
drivers/gpu/drm/nouveau/core/include/core/subdev.h
drivers/gpu/drm/nouveau/core/include/core/subdev.h
+2
-2
drivers/gpu/drm/nouveau/core/subdev/bar/base.c
drivers/gpu/drm/nouveau/core/subdev/bar/base.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
+2
-2
No files found.
drivers/gpu/drm/nouveau/core/core/engctx.c
View file @
ec0e5542
...
...
@@ -102,7 +102,7 @@ nouveau_engctx_create_(struct nouveau_object *parent,
}
if
(
client
->
vm
)
atomic_inc
(
&
client
->
vm
->
engref
[
nv_engidx
(
eng
obj
)]);
atomic_inc
(
&
client
->
vm
->
engref
[
nv_engidx
(
eng
ine
)]);
list_add
(
&
nv_engctx
(
engctx
)
->
head
,
&
engine
->
contexts
);
nv_engctx
(
engctx
)
->
addr
=
~
0ULL
;
spin_unlock_irqrestore
(
&
engine
->
lock
,
save
);
...
...
@@ -112,8 +112,7 @@ nouveau_engctx_create_(struct nouveau_object *parent,
void
nouveau_engctx_destroy
(
struct
nouveau_engctx
*
engctx
)
{
struct
nouveau_object
*
engobj
=
nv_object
(
engctx
)
->
engine
;
struct
nouveau_engine
*
engine
=
nv_engine
(
engobj
);
struct
nouveau_engine
*
engine
=
engctx
->
gpuobj
.
object
.
engine
;
struct
nouveau_client
*
client
=
nouveau_client
(
engctx
);
unsigned
long
save
;
...
...
@@ -123,7 +122,7 @@ nouveau_engctx_destroy(struct nouveau_engctx *engctx)
spin_unlock_irqrestore
(
&
engine
->
lock
,
save
);
if
(
client
->
vm
)
atomic_dec
(
&
client
->
vm
->
engref
[
nv_engidx
(
eng
obj
)]);
atomic_dec
(
&
client
->
vm
->
engref
[
nv_engidx
(
eng
ine
)]);
if
(
engctx
->
gpuobj
.
size
)
nouveau_gpuobj_destroy
(
&
engctx
->
gpuobj
);
...
...
drivers/gpu/drm/nouveau/core/core/engine.c
View file @
ec0e5542
...
...
@@ -53,7 +53,7 @@ nouveau_engine_create_(struct nouveau_object *parent,
if
(
parent
)
{
struct
nouveau_device
*
device
=
nv_device
(
parent
);
int
engidx
=
nv_engidx
(
nv_object
(
engine
)
);
int
engidx
=
nv_engidx
(
engine
);
if
(
device
->
disable_mask
&
(
1ULL
<<
engidx
))
{
if
(
!
nouveau_boolopt
(
device
->
cfgopt
,
iname
,
false
))
{
...
...
drivers/gpu/drm/nouveau/core/core/gpuobj.c
View file @
ec0e5542
...
...
@@ -229,7 +229,7 @@ nouveau_gpuobj_new(struct nouveau_object *parent, struct nouveau_object *pargpu,
};
if
(
!
nv_iclass
(
engine
,
NV_SUBDEV_CLASS
))
engine
=
engine
->
engine
;
engine
=
&
engine
->
engine
->
subdev
.
object
;
BUG_ON
(
engine
==
NULL
);
return
nouveau_object_ctor
(
parent
,
engine
,
&
_nouveau_gpuobj_oclass
,
...
...
@@ -310,7 +310,7 @@ nouveau_gpuobj_dup(struct nouveau_object *parent, struct nouveau_gpuobj *base,
struct
nouveau_gpuobj
*
gpuobj
;
int
ret
;
ret
=
nouveau_object_create
(
parent
,
parent
->
engine
,
ret
=
nouveau_object_create
(
parent
,
&
parent
->
engine
->
subdev
.
object
,
&
nouveau_gpudup_oclass
,
0
,
&
gpuobj
);
*
pgpuobj
=
gpuobj
;
if
(
ret
)
...
...
drivers/gpu/drm/nouveau/core/core/object.c
View file @
ec0e5542
...
...
@@ -43,7 +43,7 @@ nouveau_object_create_(struct nouveau_object *parent,
return
-
ENOMEM
;
nouveau_object_ref
(
parent
,
&
object
->
parent
);
nouveau_object_ref
(
engine
,
&
object
->
engine
);
nouveau_object_ref
(
engine
,
(
struct
nouveau_object
**
)
&
object
->
engine
);
object
->
oclass
=
oclass
;
object
->
oclass
->
handle
|=
pclass
;
atomic_set
(
&
object
->
refcount
,
1
);
...
...
@@ -77,7 +77,7 @@ nouveau_object_destroy(struct nouveau_object *object)
list_del
(
&
object
->
list
);
spin_unlock
(
&
_objlist_lock
);
#endif
nouveau_object_ref
(
NULL
,
&
object
->
engine
);
nouveau_object_ref
(
NULL
,
(
struct
nouveau_object
**
)
&
object
->
engine
);
nouveau_object_ref
(
NULL
,
&
object
->
parent
);
kfree
(
object
);
}
...
...
@@ -182,7 +182,7 @@ nouveau_object_inc(struct nouveau_object *object)
if
(
object
->
engine
)
{
mutex_lock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
ret
=
nouveau_object_inc
(
object
->
engine
);
ret
=
nouveau_object_inc
(
&
object
->
engine
->
subdev
.
object
);
mutex_unlock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
if
(
ret
)
{
nv_error
(
object
,
"engine failed, %d
\n
"
,
ret
);
...
...
@@ -203,7 +203,7 @@ nouveau_object_inc(struct nouveau_object *object)
fail_self:
if
(
object
->
engine
)
{
mutex_lock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
nouveau_object_dec
(
object
->
engine
,
false
);
nouveau_object_dec
(
&
object
->
engine
->
subdev
.
object
,
false
);
mutex_unlock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
}
fail_engine:
...
...
@@ -228,7 +228,7 @@ nouveau_object_decf(struct nouveau_object *object)
if
(
object
->
engine
)
{
mutex_lock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
nouveau_object_dec
(
object
->
engine
,
false
);
nouveau_object_dec
(
&
object
->
engine
->
subdev
.
object
,
false
);
mutex_unlock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
}
...
...
@@ -255,7 +255,7 @@ nouveau_object_decs(struct nouveau_object *object)
if
(
object
->
engine
)
{
mutex_lock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
ret
=
nouveau_object_dec
(
object
->
engine
,
true
);
ret
=
nouveau_object_dec
(
&
object
->
engine
->
subdev
.
object
,
true
);
mutex_unlock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
if
(
ret
)
{
nv_warn
(
object
,
"engine failed suspend, %d
\n
"
,
ret
);
...
...
@@ -277,7 +277,7 @@ nouveau_object_decs(struct nouveau_object *object)
fail_parent:
if
(
object
->
engine
)
{
mutex_lock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
rret
=
nouveau_object_inc
(
object
->
engine
);
rret
=
nouveau_object_inc
(
&
object
->
engine
->
subdev
.
object
);
mutex_unlock
(
&
nv_subdev
(
object
->
engine
)
->
mutex
);
if
(
rret
)
nv_fatal
(
object
,
"engine failed to reinit, %d
\n
"
,
rret
);
...
...
drivers/gpu/drm/nouveau/core/core/parent.c
View file @
ec0e5542
...
...
@@ -39,7 +39,7 @@ nouveau_parent_sclass(struct nouveau_object *parent, u16 handle,
sclass
=
nv_parent
(
parent
)
->
sclass
;
while
(
sclass
)
{
if
((
sclass
->
oclass
->
handle
&
0xffff
)
==
handle
)
{
*
pengine
=
parent
->
engine
;
*
pengine
=
&
parent
->
engine
->
subdev
.
object
;
*
poclass
=
sclass
->
oclass
;
return
0
;
}
...
...
drivers/gpu/drm/nouveau/core/core/printk.c
View file @
ec0e5542
...
...
@@ -69,7 +69,7 @@ nv_printk_(struct nouveau_object *object, int level, const char *fmt, ...)
while
(
subdev
&&
!
nv_iclass
(
subdev
,
NV_SUBDEV_CLASS
))
subdev
=
subdev
->
parent
;
}
else
{
subdev
=
object
->
engine
;
subdev
=
&
object
->
engine
->
subdev
.
object
;
}
device
=
subdev
;
...
...
drivers/gpu/drm/nouveau/core/core/ramht.c
View file @
ec0e5542
...
...
@@ -96,7 +96,7 @@ nouveau_ramht_new(struct nouveau_object *parent, struct nouveau_object *pargpu,
int
ret
;
ret
=
nouveau_gpuobj_create
(
parent
,
parent
->
engine
?
parent
->
engine
:
parent
,
/* <nv50 ramht */
&
parent
->
engine
->
subdev
.
object
:
parent
,
/* <nv50 ramht */
&
nouveau_ramht_oclass
,
0
,
pargpu
,
size
,
align
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
ramht
);
*
pramht
=
ramht
;
...
...
drivers/gpu/drm/nouveau/core/core/subdev.c
View file @
ec0e5542
...
...
@@ -33,7 +33,7 @@ nouveau_subdev(void *obj, int idx)
struct
nouveau_object
*
object
=
nv_object
(
obj
);
while
(
object
&&
!
nv_iclass
(
object
,
NV_SUBDEV_CLASS
))
object
=
object
->
parent
;
if
(
object
==
NULL
||
nv_subidx
(
object
)
!=
idx
)
if
(
object
==
NULL
||
nv_subidx
(
nv_subdev
(
object
)
)
!=
idx
)
object
=
nv_device
(
obj
)
->
subdev
[
idx
];
return
object
?
nv_subdev
(
object
)
:
NULL
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c
View file @
ec0e5542
...
...
@@ -91,7 +91,7 @@ nvc0_copy_init(struct nouveau_object *object)
if
(
ret
)
return
ret
;
nv_wo32
(
priv
,
0x084
,
nv_engidx
(
object
)
-
NVDEV_ENGINE_COPY0
);
nv_wo32
(
priv
,
0x084
,
nv_engidx
(
&
priv
->
base
.
base
)
-
NVDEV_ENGINE_COPY0
);
return
0
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/copy/nve0.c
View file @
ec0e5542
...
...
@@ -69,7 +69,7 @@ nve0_copy_cclass = {
static
void
nve0_copy_intr
(
struct
nouveau_subdev
*
subdev
)
{
const
int
ce
=
nv_subidx
(
nv_object
(
subdev
)
)
-
NVDEV_ENGINE_COPY0
;
const
int
ce
=
nv_subidx
(
subdev
)
-
NVDEV_ENGINE_COPY0
;
struct
nve0_copy_priv
*
priv
=
(
void
*
)
subdev
;
u32
stat
=
nv_rd32
(
priv
,
0x104908
+
(
ce
*
0x1000
));
...
...
drivers/gpu/drm/nouveau/core/engine/device/base.c
View file @
ec0e5542
...
...
@@ -516,7 +516,7 @@ nv_device(void *obj)
while
(
device
&&
device
->
parent
)
device
=
device
->
parent
;
}
else
{
device
=
nv_object
(
obj
)
->
engine
;
device
=
&
nv_object
(
obj
)
->
engine
->
subdev
.
object
;
if
(
device
&&
device
->
parent
)
device
=
device
->
parent
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
View file @
ec0e5542
...
...
@@ -445,7 +445,6 @@ static void
nvc0_fifo_recover
(
struct
nvc0_fifo_priv
*
priv
,
struct
nouveau_engine
*
engine
,
struct
nvc0_fifo_chan
*
chan
)
{
struct
nouveau_object
*
engobj
=
nv_object
(
engine
);
u32
chid
=
chan
->
base
.
chid
;
unsigned
long
flags
;
...
...
@@ -456,7 +455,7 @@ nvc0_fifo_recover(struct nvc0_fifo_priv *priv, struct nouveau_engine *engine,
chan
->
state
=
KILLED
;
spin_lock_irqsave
(
&
priv
->
base
.
lock
,
flags
);
priv
->
mask
|=
1ULL
<<
nv_engidx
(
eng
obj
);
priv
->
mask
|=
1ULL
<<
nv_engidx
(
eng
ine
);
spin_unlock_irqrestore
(
&
priv
->
base
.
lock
,
flags
);
schedule_work
(
&
priv
->
fault
);
}
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
View file @
ec0e5542
...
...
@@ -471,7 +471,6 @@ static void
nve0_fifo_recover
(
struct
nve0_fifo_priv
*
priv
,
struct
nouveau_engine
*
engine
,
struct
nve0_fifo_chan
*
chan
)
{
struct
nouveau_object
*
engobj
=
nv_object
(
engine
);
u32
chid
=
chan
->
base
.
chid
;
unsigned
long
flags
;
...
...
@@ -482,7 +481,7 @@ nve0_fifo_recover(struct nve0_fifo_priv *priv, struct nouveau_engine *engine,
chan
->
state
=
KILLED
;
spin_lock_irqsave
(
&
priv
->
base
.
lock
,
flags
);
priv
->
mask
|=
1ULL
<<
nv_engidx
(
eng
obj
);
priv
->
mask
|=
1ULL
<<
nv_engidx
(
eng
ine
);
spin_unlock_irqrestore
(
&
priv
->
base
.
lock
,
flags
);
schedule_work
(
&
priv
->
fault
);
}
...
...
drivers/gpu/drm/nouveau/core/include/core/engine.h
View file @
ec0e5542
...
...
@@ -30,9 +30,9 @@ nv_engine(void *obj)
}
static
inline
int
nv_engidx
(
struct
nouveau_
object
*
object
)
nv_engidx
(
struct
nouveau_
engine
*
engine
)
{
return
nv_subidx
(
object
);
return
nv_subidx
(
&
engine
->
subdev
);
}
struct
nouveau_engine
*
nouveau_engine
(
void
*
obj
,
int
idx
);
...
...
drivers/gpu/drm/nouveau/core/include/core/object.h
View file @
ec0e5542
...
...
@@ -17,7 +17,7 @@
struct
nouveau_object
{
struct
nouveau_oclass
*
oclass
;
struct
nouveau_object
*
parent
;
struct
nouveau_
object
*
engine
;
struct
nouveau_
engine
*
engine
;
atomic_t
refcount
;
atomic_t
usecount
;
#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
...
...
drivers/gpu/drm/nouveau/core/include/core/subdev.h
View file @
ec0e5542
...
...
@@ -28,9 +28,9 @@ nv_subdev(void *obj)
}
static
inline
int
nv_subidx
(
struct
nouveau_
object
*
object
)
nv_subidx
(
struct
nouveau_
subdev
*
subdev
)
{
return
nv_hclass
(
nv_subdev
(
object
)
)
&
0xff
;
return
nv_hclass
(
subdev
)
&
0xff
;
}
struct
nouveau_subdev
*
nouveau_subdev
(
void
*
obj
,
int
idx
);
...
...
drivers/gpu/drm/nouveau/core/subdev/bar/base.c
View file @
ec0e5542
...
...
@@ -110,7 +110,7 @@ nouveau_bar_alloc(struct nouveau_bar *bar, struct nouveau_object *parent,
struct
nouveau_mem
*
mem
,
struct
nouveau_object
**
pobject
)
{
struct
nouveau_object
*
gpuobj
;
int
ret
=
nouveau_object_ctor
(
parent
,
parent
->
engine
,
int
ret
=
nouveau_object_ctor
(
parent
,
&
parent
->
engine
->
subdev
.
object
,
&
nouveau_barobj_oclass
,
mem
,
0
,
&
gpuobj
);
if
(
ret
==
0
)
...
...
drivers/gpu/drm/nouveau/core/subdev/instmem/base.c
View file @
ec0e5542
...
...
@@ -74,8 +74,8 @@ nouveau_instmem_alloc(struct nouveau_instmem *imem,
{
struct
nouveau_instmem_impl
*
impl
=
(
void
*
)
imem
->
base
.
object
.
oclass
;
struct
nouveau_instobj_args
args
=
{
.
size
=
size
,
.
align
=
align
};
return
nouveau_object_ctor
(
parent
,
parent
->
engine
,
impl
->
instobj
,
&
args
,
sizeof
(
args
),
pobject
);
return
nouveau_object_ctor
(
parent
,
&
parent
->
engine
->
subdev
.
object
,
impl
->
instobj
,
&
args
,
sizeof
(
args
),
pobject
);
}
int
...
...
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