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
34cf01bc
Commit
34cf01bc
authored
Nov 22, 2010
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: allow gpuobj vinst to be a virtual address when necessary
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
b571fe21
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-0
drivers/gpu/drm/nouveau/nv50_instmem.c
drivers/gpu/drm/nouveau/nv50_instmem.c
+23
-2
No files found.
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
34cf01bc
...
...
@@ -158,6 +158,7 @@ enum nouveau_flags {
#define NVOBJ_FLAG_DONT_MAP (1 << 0)
#define NVOBJ_FLAG_ZERO_ALLOC (1 << 1)
#define NVOBJ_FLAG_ZERO_FREE (1 << 2)
#define NVOBJ_FLAG_VM (1 << 3)
#define NVOBJ_CINST_GLOBAL 0xdeadbeef
...
...
drivers/gpu/drm/nouveau/nv50_instmem.c
View file @
34cf01bc
...
...
@@ -302,6 +302,7 @@ nv50_instmem_resume(struct drm_device *dev)
struct
nv50_gpuobj_node
{
struct
nouveau_vram
*
vram
;
struct
nouveau_vma
chan_vma
;
u32
align
;
};
...
...
@@ -310,6 +311,7 @@ int
nv50_instmem_get
(
struct
nouveau_gpuobj
*
gpuobj
,
u32
size
,
u32
align
)
{
struct
drm_device
*
dev
=
gpuobj
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nv50_gpuobj_node
*
node
=
NULL
;
int
ret
;
...
...
@@ -328,6 +330,21 @@ nv50_instmem_get(struct nouveau_gpuobj *gpuobj, u32 size, u32 align)
}
gpuobj
->
vinst
=
node
->
vram
->
offset
;
if
(
gpuobj
->
flags
&
NVOBJ_FLAG_VM
)
{
ret
=
nouveau_vm_get
(
dev_priv
->
chan_vm
,
size
,
12
,
NV_MEM_ACCESS_RW
|
NV_MEM_ACCESS_SYS
,
&
node
->
chan_vma
);
if
(
ret
)
{
nv50_vram_del
(
dev
,
&
node
->
vram
);
kfree
(
node
);
return
ret
;
}
nouveau_vm_map
(
&
node
->
chan_vma
,
node
->
vram
);
gpuobj
->
vinst
=
node
->
chan_vma
.
offset
;
}
gpuobj
->
size
=
size
;
gpuobj
->
node
=
node
;
return
0
;
...
...
@@ -342,6 +359,10 @@ nv50_instmem_put(struct nouveau_gpuobj *gpuobj)
node
=
gpuobj
->
node
;
gpuobj
->
node
=
NULL
;
if
(
node
->
chan_vma
.
node
)
{
nouveau_vm_unmap
(
&
node
->
chan_vma
);
nouveau_vm_put
(
&
node
->
chan_vma
);
}
nv50_vram_del
(
dev
,
&
node
->
vram
);
kfree
(
node
);
}
...
...
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