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
d02836b4
Commit
d02836b4
authored
Jun 07, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv84-nvc0: explicitly map semaphore buffer into channel vm
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
ce163f69
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
16 deletions
+14
-16
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-0
drivers/gpu/drm/nouveau/nouveau_fence.c
drivers/gpu/drm/nouveau/nouveau_fence.c
+13
-16
No files found.
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
d02836b4
...
@@ -240,6 +240,7 @@ struct nouveau_channel {
...
@@ -240,6 +240,7 @@ struct nouveau_channel {
uint32_t
sequence
;
uint32_t
sequence
;
uint32_t
sequence_ack
;
uint32_t
sequence_ack
;
atomic_t
last_sequence_irq
;
atomic_t
last_sequence_irq
;
struct
nouveau_vma
vma
;
}
fence
;
}
fence
;
/* DMA push buffer */
/* DMA push buffer */
...
...
drivers/gpu/drm/nouveau/nouveau_fence.c
View file @
d02836b4
...
@@ -336,6 +336,7 @@ semaphore_acquire(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
...
@@ -336,6 +336,7 @@ semaphore_acquire(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
{
{
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
nouveau_fence
*
fence
=
NULL
;
struct
nouveau_fence
*
fence
=
NULL
;
u64
offset
=
chan
->
fence
.
vma
.
offset
+
sema
->
mem
->
start
;
int
ret
;
int
ret
;
if
(
dev_priv
->
chipset
<
0x84
)
{
if
(
dev_priv
->
chipset
<
0x84
)
{
...
@@ -345,13 +346,10 @@ semaphore_acquire(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
...
@@ -345,13 +346,10 @@ semaphore_acquire(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
BEGIN_RING
(
chan
,
NvSubSw
,
NV_SW_DMA_SEMAPHORE
,
3
);
BEGIN_RING
(
chan
,
NvSubSw
,
NV_SW_DMA_SEMAPHORE
,
3
);
OUT_RING
(
chan
,
NvSema
);
OUT_RING
(
chan
,
NvSema
);
OUT_RING
(
chan
,
sema
->
mem
->
star
t
);
OUT_RING
(
chan
,
offse
t
);
OUT_RING
(
chan
,
1
);
OUT_RING
(
chan
,
1
);
}
else
}
else
if
(
dev_priv
->
chipset
<
0xc0
)
{
if
(
dev_priv
->
chipset
<
0xc0
)
{
struct
nouveau_vma
*
vma
=
&
dev_priv
->
fence
.
bo
->
vma
;
u64
offset
=
vma
->
offset
+
sema
->
mem
->
start
;
ret
=
RING_SPACE
(
chan
,
7
);
ret
=
RING_SPACE
(
chan
,
7
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -364,9 +362,6 @@ semaphore_acquire(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
...
@@ -364,9 +362,6 @@ semaphore_acquire(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
OUT_RING
(
chan
,
1
);
OUT_RING
(
chan
,
1
);
OUT_RING
(
chan
,
1
);
/* ACQUIRE_EQ */
OUT_RING
(
chan
,
1
);
/* ACQUIRE_EQ */
}
else
{
}
else
{
struct
nouveau_vma
*
vma
=
&
dev_priv
->
fence
.
bo
->
vma
;
u64
offset
=
vma
->
offset
+
sema
->
mem
->
start
;
ret
=
RING_SPACE
(
chan
,
5
);
ret
=
RING_SPACE
(
chan
,
5
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -394,6 +389,7 @@ semaphore_release(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
...
@@ -394,6 +389,7 @@ semaphore_release(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
{
{
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
nouveau_fence
*
fence
=
NULL
;
struct
nouveau_fence
*
fence
=
NULL
;
u64
offset
=
chan
->
fence
.
vma
.
offset
+
sema
->
mem
->
start
;
int
ret
;
int
ret
;
if
(
dev_priv
->
chipset
<
0x84
)
{
if
(
dev_priv
->
chipset
<
0x84
)
{
...
@@ -403,14 +399,11 @@ semaphore_release(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
...
@@ -403,14 +399,11 @@ semaphore_release(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
BEGIN_RING
(
chan
,
NvSubSw
,
NV_SW_DMA_SEMAPHORE
,
2
);
BEGIN_RING
(
chan
,
NvSubSw
,
NV_SW_DMA_SEMAPHORE
,
2
);
OUT_RING
(
chan
,
NvSema
);
OUT_RING
(
chan
,
NvSema
);
OUT_RING
(
chan
,
sema
->
mem
->
star
t
);
OUT_RING
(
chan
,
offse
t
);
BEGIN_RING
(
chan
,
NvSubSw
,
NV_SW_SEMAPHORE_RELEASE
,
1
);
BEGIN_RING
(
chan
,
NvSubSw
,
NV_SW_SEMAPHORE_RELEASE
,
1
);
OUT_RING
(
chan
,
1
);
OUT_RING
(
chan
,
1
);
}
else
}
else
if
(
dev_priv
->
chipset
<
0xc0
)
{
if
(
dev_priv
->
chipset
<
0xc0
)
{
struct
nouveau_vma
*
vma
=
&
dev_priv
->
fence
.
bo
->
vma
;
u64
offset
=
vma
->
offset
+
sema
->
mem
->
start
;
ret
=
RING_SPACE
(
chan
,
7
);
ret
=
RING_SPACE
(
chan
,
7
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -423,9 +416,6 @@ semaphore_release(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
...
@@ -423,9 +416,6 @@ semaphore_release(struct nouveau_channel *chan, struct nouveau_semaphore *sema)
OUT_RING
(
chan
,
1
);
OUT_RING
(
chan
,
1
);
OUT_RING
(
chan
,
2
);
/* RELEASE */
OUT_RING
(
chan
,
2
);
/* RELEASE */
}
else
{
}
else
{
struct
nouveau_vma
*
vma
=
&
dev_priv
->
fence
.
bo
->
vma
;
u64
offset
=
vma
->
offset
+
sema
->
mem
->
start
;
ret
=
RING_SPACE
(
chan
,
5
);
ret
=
RING_SPACE
(
chan
,
5
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -540,6 +530,12 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
...
@@ -540,6 +530,12 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
nouveau_gpuobj_ref
(
NULL
,
&
obj
);
nouveau_gpuobj_ref
(
NULL
,
&
obj
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
}
else
{
/* map fence bo into channel's vm */
ret
=
nouveau_bo_vma_add
(
dev_priv
->
fence
.
bo
,
chan
->
vm
,
&
chan
->
fence
.
vma
);
if
(
ret
)
return
ret
;
}
}
INIT_LIST_HEAD
(
&
chan
->
fence
.
pending
);
INIT_LIST_HEAD
(
&
chan
->
fence
.
pending
);
...
@@ -551,10 +547,10 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
...
@@ -551,10 +547,10 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
void
void
nouveau_fence_channel_fini
(
struct
nouveau_channel
*
chan
)
nouveau_fence_channel_fini
(
struct
nouveau_channel
*
chan
)
{
{
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
nouveau_fence
*
tmp
,
*
fence
;
struct
nouveau_fence
*
tmp
,
*
fence
;
spin_lock
(
&
chan
->
fence
.
lock
);
spin_lock
(
&
chan
->
fence
.
lock
);
list_for_each_entry_safe
(
fence
,
tmp
,
&
chan
->
fence
.
pending
,
entry
)
{
list_for_each_entry_safe
(
fence
,
tmp
,
&
chan
->
fence
.
pending
,
entry
)
{
fence
->
signalled
=
true
;
fence
->
signalled
=
true
;
list_del
(
&
fence
->
entry
);
list_del
(
&
fence
->
entry
);
...
@@ -564,8 +560,9 @@ nouveau_fence_channel_fini(struct nouveau_channel *chan)
...
@@ -564,8 +560,9 @@ nouveau_fence_channel_fini(struct nouveau_channel *chan)
kref_put
(
&
fence
->
refcount
,
nouveau_fence_del
);
kref_put
(
&
fence
->
refcount
,
nouveau_fence_del
);
}
}
spin_unlock
(
&
chan
->
fence
.
lock
);
spin_unlock
(
&
chan
->
fence
.
lock
);
nouveau_bo_vma_del
(
dev_priv
->
fence
.
bo
,
&
chan
->
fence
.
vma
);
}
}
int
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