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
96545299
Commit
96545299
authored
Nov 24, 2010
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nvc0: fix channel dma init paths
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
5216782b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
10 deletions
+38
-10
drivers/gpu/drm/nouveau/nouveau_channel.c
drivers/gpu/drm/nouveau/nouveau_channel.c
+16
-4
drivers/gpu/drm/nouveau/nouveau_dma.c
drivers/gpu/drm/nouveau/nouveau_dma.c
+16
-6
drivers/gpu/drm/nouveau/nouveau_dma.h
drivers/gpu/drm/nouveau/nouveau_dma.h
+6
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_channel.c
View file @
96545299
...
@@ -38,9 +38,14 @@ nouveau_channel_pushbuf_ctxdma_init(struct nouveau_channel *chan)
...
@@ -38,9 +38,14 @@ nouveau_channel_pushbuf_ctxdma_init(struct nouveau_channel *chan)
int
ret
;
int
ret
;
if
(
dev_priv
->
card_type
>=
NV_50
)
{
if
(
dev_priv
->
card_type
>=
NV_50
)
{
ret
=
nouveau_gpuobj_dma_new
(
chan
,
NV_CLASS_DMA_IN_MEMORY
,
0
,
if
(
dev_priv
->
card_type
<
NV_C0
)
{
(
1ULL
<<
40
),
NV_MEM_ACCESS_RO
,
ret
=
nouveau_gpuobj_dma_new
(
chan
,
NV_MEM_TARGET_VM
,
&
pushbuf
);
NV_CLASS_DMA_IN_MEMORY
,
0
,
(
1ULL
<<
40
),
NV_MEM_ACCESS_RO
,
NV_MEM_TARGET_VM
,
&
pushbuf
);
}
chan
->
pushbuf_base
=
pb
->
bo
.
offset
;
chan
->
pushbuf_base
=
pb
->
bo
.
offset
;
}
else
}
else
if
(
pb
->
bo
.
mem
.
mem_type
==
TTM_PL_TT
)
{
if
(
pb
->
bo
.
mem
.
mem_type
==
TTM_PL_TT
)
{
...
@@ -71,7 +76,7 @@ nouveau_channel_pushbuf_ctxdma_init(struct nouveau_channel *chan)
...
@@ -71,7 +76,7 @@ nouveau_channel_pushbuf_ctxdma_init(struct nouveau_channel *chan)
nouveau_gpuobj_ref
(
pushbuf
,
&
chan
->
pushbuf
);
nouveau_gpuobj_ref
(
pushbuf
,
&
chan
->
pushbuf
);
nouveau_gpuobj_ref
(
NULL
,
&
pushbuf
);
nouveau_gpuobj_ref
(
NULL
,
&
pushbuf
);
return
0
;
return
ret
;
}
}
static
struct
nouveau_bo
*
static
struct
nouveau_bo
*
...
@@ -99,6 +104,13 @@ nouveau_channel_user_pushbuf_alloc(struct drm_device *dev)
...
@@ -99,6 +104,13 @@ nouveau_channel_user_pushbuf_alloc(struct drm_device *dev)
return
NULL
;
return
NULL
;
}
}
ret
=
nouveau_bo_map
(
pushbuf
);
if
(
ret
)
{
nouveau_bo_unpin
(
pushbuf
);
nouveau_bo_ref
(
NULL
,
&
pushbuf
);
return
NULL
;
}
return
pushbuf
;
return
pushbuf
;
}
}
...
...
drivers/gpu/drm/nouveau/nouveau_dma.c
View file @
96545299
...
@@ -36,7 +36,7 @@ nouveau_dma_pre_init(struct nouveau_channel *chan)
...
@@ -36,7 +36,7 @@ nouveau_dma_pre_init(struct nouveau_channel *chan)
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
nouveau_bo
*
pushbuf
=
chan
->
pushbuf_bo
;
struct
nouveau_bo
*
pushbuf
=
chan
->
pushbuf_bo
;
if
(
dev_priv
->
card_type
=
=
NV_50
)
{
if
(
dev_priv
->
card_type
>
=
NV_50
)
{
const
int
ib_size
=
pushbuf
->
bo
.
mem
.
size
/
2
;
const
int
ib_size
=
pushbuf
->
bo
.
mem
.
size
/
2
;
chan
->
dma
.
ib_base
=
(
pushbuf
->
bo
.
mem
.
size
-
ib_size
)
>>
2
;
chan
->
dma
.
ib_base
=
(
pushbuf
->
bo
.
mem
.
size
-
ib_size
)
>>
2
;
...
@@ -61,6 +61,21 @@ nouveau_dma_init(struct nouveau_channel *chan)
...
@@ -61,6 +61,21 @@ nouveau_dma_init(struct nouveau_channel *chan)
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
ret
,
i
;
int
ret
,
i
;
if
(
dev_priv
->
card_type
>=
NV_C0
)
{
ret
=
nouveau_gpuobj_gr_new
(
chan
,
0x9039
,
0x9039
);
if
(
ret
)
return
ret
;
ret
=
RING_SPACE
(
chan
,
2
);
if
(
ret
)
return
ret
;
BEGIN_NVC0
(
chan
,
2
,
NvSubM2MF
,
0x0000
,
1
);
OUT_RING
(
chan
,
0x00009039
);
FIRE_RING
(
chan
);
return
0
;
}
/* Create NV_MEMORY_TO_MEMORY_FORMAT for buffer moves */
/* Create NV_MEMORY_TO_MEMORY_FORMAT for buffer moves */
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NvM2MF
,
dev_priv
->
card_type
<
NV_50
?
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NvM2MF
,
dev_priv
->
card_type
<
NV_50
?
0x0039
:
0x5039
);
0x0039
:
0x5039
);
...
@@ -72,11 +87,6 @@ nouveau_dma_init(struct nouveau_channel *chan)
...
@@ -72,11 +87,6 @@ nouveau_dma_init(struct nouveau_channel *chan)
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
/* Map push buffer */
ret
=
nouveau_bo_map
(
chan
->
pushbuf_bo
);
if
(
ret
)
return
ret
;
/* Insert NOPS for NOUVEAU_DMA_SKIPS */
/* Insert NOPS for NOUVEAU_DMA_SKIPS */
ret
=
RING_SPACE
(
chan
,
NOUVEAU_DMA_SKIPS
);
ret
=
RING_SPACE
(
chan
,
NOUVEAU_DMA_SKIPS
);
if
(
ret
)
if
(
ret
)
...
...
drivers/gpu/drm/nouveau/nouveau_dma.h
View file @
96545299
...
@@ -124,6 +124,12 @@ OUT_RING(struct nouveau_channel *chan, int data)
...
@@ -124,6 +124,12 @@ OUT_RING(struct nouveau_channel *chan, int data)
extern
void
extern
void
OUT_RINGp
(
struct
nouveau_channel
*
chan
,
const
void
*
data
,
unsigned
nr_dwords
);
OUT_RINGp
(
struct
nouveau_channel
*
chan
,
const
void
*
data
,
unsigned
nr_dwords
);
static
inline
void
BEGIN_NVC0
(
struct
nouveau_channel
*
chan
,
int
op
,
int
subc
,
int
mthd
,
int
size
)
{
OUT_RING
(
chan
,
(
op
<<
28
)
|
(
size
<<
16
)
|
(
subc
<<
13
)
|
(
mthd
>>
2
));
}
static
inline
void
static
inline
void
BEGIN_RING
(
struct
nouveau_channel
*
chan
,
int
subc
,
int
mthd
,
int
size
)
BEGIN_RING
(
struct
nouveau_channel
*
chan
,
int
subc
,
int
mthd
,
int
size
)
{
{
...
...
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