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
c6b7e895
Commit
c6b7e895
authored
Mar 20, 2012
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nve0/ttm: implement buffer moves with weirdo pcopy-on-pgraph methods
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
f1c65e7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_bo.c
+24
-0
drivers/gpu/drm/nouveau/nouveau_dma.h
drivers/gpu/drm/nouveau/nouveau_dma.h
+1
-0
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+14
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_bo.c
View file @
c6b7e895
...
...
@@ -488,6 +488,27 @@ nouveau_bo_move_accel_cleanup(struct nouveau_channel *chan,
return
ret
;
}
static
int
nve0_bo_move_copy
(
struct
nouveau_channel
*
chan
,
struct
ttm_buffer_object
*
bo
,
struct
ttm_mem_reg
*
old_mem
,
struct
ttm_mem_reg
*
new_mem
)
{
struct
nouveau_mem
*
node
=
old_mem
->
mm_node
;
int
ret
=
RING_SPACE
(
chan
,
10
);
if
(
ret
==
0
)
{
BEGIN_NVC0
(
chan
,
2
,
NvSubCopy
,
0x0400
,
8
);
OUT_RING
(
chan
,
upper_32_bits
(
node
->
vma
[
0
].
offset
));
OUT_RING
(
chan
,
lower_32_bits
(
node
->
vma
[
0
].
offset
));
OUT_RING
(
chan
,
upper_32_bits
(
node
->
vma
[
1
].
offset
));
OUT_RING
(
chan
,
lower_32_bits
(
node
->
vma
[
1
].
offset
));
OUT_RING
(
chan
,
PAGE_SIZE
);
OUT_RING
(
chan
,
PAGE_SIZE
);
OUT_RING
(
chan
,
PAGE_SIZE
);
OUT_RING
(
chan
,
new_mem
->
num_pages
);
BEGIN_NVC0
(
chan
,
8
,
NvSubCopy
,
0x0300
,
0x0386
);
}
return
ret
;
}
static
int
nvc0_bo_move_m2mf
(
struct
nouveau_channel
*
chan
,
struct
ttm_buffer_object
*
bo
,
struct
ttm_mem_reg
*
old_mem
,
struct
ttm_mem_reg
*
new_mem
)
...
...
@@ -727,7 +748,10 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
if
(
dev_priv
->
card_type
<
NV_C0
)
ret
=
nv50_bo_move_m2mf
(
chan
,
bo
,
&
bo
->
mem
,
new_mem
);
else
if
(
dev_priv
->
card_type
<
NV_E0
)
ret
=
nvc0_bo_move_m2mf
(
chan
,
bo
,
&
bo
->
mem
,
new_mem
);
else
ret
=
nve0_bo_move_copy
(
chan
,
bo
,
&
bo
->
mem
,
new_mem
);
if
(
ret
==
0
)
{
ret
=
nouveau_bo_move_accel_cleanup
(
chan
,
nvbo
,
evict
,
no_wait_reserve
,
...
...
drivers/gpu/drm/nouveau/nouveau_dma.h
View file @
c6b7e895
...
...
@@ -53,6 +53,7 @@ enum {
NvSubCtxSurf2D
=
2
,
NvSub2D
=
3
,
NvSubGdiRect
=
3
,
NvSubCopy
=
4
,
NvSubImageBlit
=
4
};
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
View file @
c6b7e895
...
...
@@ -657,6 +657,20 @@ nouveau_card_channel_init(struct drm_device *dev)
BEGIN_NVC0
(
chan
,
2
,
NvSubM2MF
,
0x0000
,
1
);
OUT_RING
(
chan
,
0x00009039
);
}
else
if
(
dev_priv
->
card_type
<=
NV_E0
)
{
/* not used, but created to get a graph context */
ret
=
nouveau_gpuobj_gr_new
(
chan
,
0xa040
,
0xa040
);
if
(
ret
)
goto
error
;
/* bind strange copy engine to subchannel 4 (fixed...) */
ret
=
RING_SPACE
(
chan
,
2
);
if
(
ret
)
goto
error
;
BEGIN_NVC0
(
chan
,
2
,
NvSubCopy
,
0x0000
,
1
);
OUT_RING
(
chan
,
0x0000a0b5
);
}
FIRE_RING
(
chan
);
...
...
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