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
a4154bbf
Commit
a4154bbf
authored
Feb 10, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv50-nvc0: move vm bind/unbind to move_notify hook
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
db5c8e29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
22 deletions
+37
-22
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_bo.c
+37
-22
No files found.
drivers/gpu/drm/nouveau/nouveau_bo.c
View file @
a4154bbf
...
...
@@ -805,6 +805,25 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr,
return
ret
;
}
static
void
nouveau_bo_move_ntfy
(
struct
ttm_buffer_object
*
bo
,
struct
ttm_mem_reg
*
new_mem
)
{
struct
drm_nouveau_private
*
dev_priv
=
nouveau_bdev
(
bo
->
bdev
);
struct
nouveau_bo
*
nvbo
=
nouveau_bo
(
bo
);
if
(
dev_priv
->
card_type
<
NV_50
||
nvbo
->
no_vm
)
return
;
switch
(
new_mem
->
mem_type
)
{
case
TTM_PL_VRAM
:
nouveau_vm_map
(
&
nvbo
->
vma
,
new_mem
->
mm_node
);
break
;
case
TTM_PL_TT
:
default:
break
;
}
}
static
int
nouveau_bo_vm_bind
(
struct
ttm_buffer_object
*
bo
,
struct
ttm_mem_reg
*
new_mem
,
struct
nouveau_tile_reg
**
new_tile
)
...
...
@@ -812,19 +831,13 @@ nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem,
struct
drm_nouveau_private
*
dev_priv
=
nouveau_bdev
(
bo
->
bdev
);
struct
drm_device
*
dev
=
dev_priv
->
dev
;
struct
nouveau_bo
*
nvbo
=
nouveau_bo
(
bo
);
u
int64_t
offset
;
u
64
offset
=
new_mem
->
start
<<
PAGE_SHIFT
;
if
(
new_mem
->
mem_type
!=
TTM_PL_VRAM
)
{
/* Nothing to do. */
*
new_tile
=
NULL
;
*
new_tile
=
NULL
;
if
(
new_mem
->
mem_type
!=
TTM_PL_VRAM
)
return
0
;
}
offset
=
new_mem
->
start
<<
PAGE_SHIFT
;
if
(
dev_priv
->
chan_vm
)
{
nouveau_vm_map
(
&
nvbo
->
vma
,
new_mem
->
mm_node
);
}
else
if
(
dev_priv
->
card_type
>=
NV_10
)
{
if
(
dev_priv
->
card_type
>=
NV_10
)
{
*
new_tile
=
nv10_mem_set_tiling
(
dev
,
offset
,
new_mem
->
size
,
nvbo
->
tile_mode
,
nvbo
->
tile_flags
);
...
...
@@ -841,11 +854,8 @@ nouveau_bo_vm_cleanup(struct ttm_buffer_object *bo,
struct
drm_nouveau_private
*
dev_priv
=
nouveau_bdev
(
bo
->
bdev
);
struct
drm_device
*
dev
=
dev_priv
->
dev
;
if
(
dev_priv
->
card_type
>=
NV_10
&&
dev_priv
->
card_type
<
NV_50
)
{
nv10_mem_put_tile_region
(
dev
,
*
old_tile
,
bo
->
sync_obj
);
*
old_tile
=
new_tile
;
}
nv10_mem_put_tile_region
(
dev
,
*
old_tile
,
bo
->
sync_obj
);
*
old_tile
=
new_tile
;
}
static
int
...
...
@@ -859,9 +869,11 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr,
struct
nouveau_tile_reg
*
new_tile
=
NULL
;
int
ret
=
0
;
ret
=
nouveau_bo_vm_bind
(
bo
,
new_mem
,
&
new_tile
);
if
(
ret
)
return
ret
;
if
(
dev_priv
->
card_type
<
NV_50
)
{
ret
=
nouveau_bo_vm_bind
(
bo
,
new_mem
,
&
new_tile
);
if
(
ret
)
return
ret
;
}
/* Fake bo copy. */
if
(
old_mem
->
mem_type
==
TTM_PL_SYSTEM
&&
!
bo
->
ttm
)
{
...
...
@@ -892,10 +904,12 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr,
ret
=
ttm_bo_move_memcpy
(
bo
,
evict
,
no_wait_reserve
,
no_wait_gpu
,
new_mem
);
out:
if
(
ret
)
nouveau_bo_vm_cleanup
(
bo
,
NULL
,
&
new_tile
);
else
nouveau_bo_vm_cleanup
(
bo
,
new_tile
,
&
nvbo
->
tile
);
if
(
dev_priv
->
card_type
<
NV_50
)
{
if
(
ret
)
nouveau_bo_vm_cleanup
(
bo
,
NULL
,
&
new_tile
);
else
nouveau_bo_vm_cleanup
(
bo
,
new_tile
,
&
nvbo
->
tile
);
}
return
ret
;
}
...
...
@@ -1039,6 +1053,7 @@ struct ttm_bo_driver nouveau_bo_driver = {
.
invalidate_caches
=
nouveau_bo_invalidate_caches
,
.
init_mem_type
=
nouveau_bo_init_mem_type
,
.
evict_flags
=
nouveau_bo_evict_flags
,
.
move_notify
=
nouveau_bo_move_ntfy
,
.
move
=
nouveau_bo_move
,
.
verify_access
=
nouveau_bo_verify_access
,
.
sync_obj_signaled
=
__nouveau_fence_signalled
,
...
...
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