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
80fe155b
Commit
80fe155b
authored
Oct 08, 2012
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nvc0/dmaobj: implement initial bind() method
Currently unused. Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
f756944a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
drivers/gpu/drm/nouveau/core/engine/dmaobj/nvc0.c
drivers/gpu/drm/nouveau/core/engine/dmaobj/nvc0.c
+58
-1
drivers/gpu/drm/nouveau/core/include/core/class.h
drivers/gpu/drm/nouveau/core/include/core/class.h
+11
-0
No files found.
drivers/gpu/drm/nouveau/core/engine/dmaobj/nvc0.c
View file @
80fe155b
...
@@ -39,7 +39,9 @@ nvc0_dmaobj_bind(struct nouveau_dmaeng *dmaeng,
...
@@ -39,7 +39,9 @@ nvc0_dmaobj_bind(struct nouveau_dmaeng *dmaeng,
struct
nouveau_dmaobj
*
dmaobj
,
struct
nouveau_dmaobj
*
dmaobj
,
struct
nouveau_gpuobj
**
pgpuobj
)
struct
nouveau_gpuobj
**
pgpuobj
)
{
{
int
ret
=
0
;
u32
flags0
=
nv_mclass
(
dmaobj
);
u32
flags5
=
0x00000000
;
int
ret
;
if
(
!
nv_iclass
(
parent
,
NV_ENGCTX_CLASS
))
{
if
(
!
nv_iclass
(
parent
,
NV_ENGCTX_CLASS
))
{
switch
(
nv_mclass
(
parent
->
parent
))
{
switch
(
nv_mclass
(
parent
->
parent
))
{
...
@@ -49,6 +51,61 @@ nvc0_dmaobj_bind(struct nouveau_dmaeng *dmaeng,
...
@@ -49,6 +51,61 @@ nvc0_dmaobj_bind(struct nouveau_dmaeng *dmaeng,
}
else
}
else
return
0
;
return
0
;
if
(
!
(
dmaobj
->
conf0
&
NVC0_DMA_CONF0_ENABLE
))
{
if
(
dmaobj
->
target
==
NV_MEM_TARGET_VM
)
{
dmaobj
->
conf0
=
NVC0_DMA_CONF0_PRIV_VM
;
dmaobj
->
conf0
|=
NVC0_DMA_CONF0_TYPE_VM
;
}
else
{
dmaobj
->
conf0
=
NVC0_DMA_CONF0_PRIV_US
;
dmaobj
->
conf0
|=
NVC0_DMA_CONF0_TYPE_LINEAR
;
dmaobj
->
conf0
|=
0x00020000
;
}
}
flags0
|=
(
dmaobj
->
conf0
&
NVC0_DMA_CONF0_TYPE
)
<<
22
;
flags0
|=
(
dmaobj
->
conf0
&
NVC0_DMA_CONF0_PRIV
);
flags5
|=
(
dmaobj
->
conf0
&
NVC0_DMA_CONF0_UNKN
);
switch
(
dmaobj
->
target
)
{
case
NV_MEM_TARGET_VM
:
flags0
|=
0x00000000
;
break
;
case
NV_MEM_TARGET_VRAM
:
flags0
|=
0x00010000
;
break
;
case
NV_MEM_TARGET_PCI
:
flags0
|=
0x00020000
;
break
;
case
NV_MEM_TARGET_PCI_NOSNOOP
:
flags0
|=
0x00030000
;
break
;
default:
return
-
EINVAL
;
}
switch
(
dmaobj
->
access
)
{
case
NV_MEM_ACCESS_VM
:
break
;
case
NV_MEM_ACCESS_RO
:
flags0
|=
0x00040000
;
break
;
case
NV_MEM_ACCESS_WO
:
case
NV_MEM_ACCESS_RW
:
flags0
|=
0x00080000
;
break
;
}
ret
=
nouveau_gpuobj_new
(
parent
,
parent
,
24
,
32
,
0
,
pgpuobj
);
if
(
ret
==
0
)
{
nv_wo32
(
*
pgpuobj
,
0x00
,
flags0
);
nv_wo32
(
*
pgpuobj
,
0x04
,
lower_32_bits
(
dmaobj
->
limit
));
nv_wo32
(
*
pgpuobj
,
0x08
,
lower_32_bits
(
dmaobj
->
start
));
nv_wo32
(
*
pgpuobj
,
0x0c
,
upper_32_bits
(
dmaobj
->
limit
)
<<
24
|
upper_32_bits
(
dmaobj
->
start
));
nv_wo32
(
*
pgpuobj
,
0x10
,
0x00000000
);
nv_wo32
(
*
pgpuobj
,
0x14
,
flags5
);
}
return
ret
;
return
ret
;
}
}
...
...
drivers/gpu/drm/nouveau/core/include/core/class.h
View file @
80fe155b
...
@@ -69,6 +69,17 @@ struct nv_device_class {
...
@@ -69,6 +69,17 @@ struct nv_device_class {
#define NV50_DMA_CONF0_TYPE_LINEAR 0x00000000
#define NV50_DMA_CONF0_TYPE_LINEAR 0x00000000
#define NV50_DMA_CONF0_TYPE_VM 0x0000007f
#define NV50_DMA_CONF0_TYPE_VM 0x0000007f
/* NVC0:NVD9 */
#define NVC0_DMA_CONF0_ENABLE 0x80000000
#define NVC0_DMA_CONF0_PRIV 0x00300000
#define NVC0_DMA_CONF0_PRIV_VM 0x00000000
#define NVC0_DMA_CONF0_PRIV_US 0x00100000
#define NVC0_DMA_CONF0_PRIV__S 0x00200000
#define NVC0_DMA_CONF0_UNKN
/* PART? */
0x00030000
#define NVC0_DMA_CONF0_TYPE 0x000000ff
#define NVC0_DMA_CONF0_TYPE_LINEAR 0x00000000
#define NVC0_DMA_CONF0_TYPE_VM 0x000000ff
struct
nv_dma_class
{
struct
nv_dma_class
{
u32
flags
;
u32
flags
;
u32
pad0
;
u32
pad0
;
...
...
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