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
588d7d12
Commit
588d7d12
authored
Dec 13, 2009
by
Francisco Jerez
Committed by
Ben Skeggs
Jan 11, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: Add cache_flush/pull fifo engine functions.
Signed-off-by:
Francisco Jerez
<
currojerez@riseup.net
>
parent
e8d6d615
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
+48
-0
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+4
-0
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+10
-0
drivers/gpu/drm/nouveau/nv04_fifo.c
drivers/gpu/drm/nouveau/nv04_fifo.c
+34
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
588d7d12
...
@@ -292,6 +292,8 @@ struct nouveau_fifo_engine {
...
@@ -292,6 +292,8 @@ struct nouveau_fifo_engine {
void
(
*
disable
)(
struct
drm_device
*
);
void
(
*
disable
)(
struct
drm_device
*
);
void
(
*
enable
)(
struct
drm_device
*
);
void
(
*
enable
)(
struct
drm_device
*
);
bool
(
*
reassign
)(
struct
drm_device
*
,
bool
enable
);
bool
(
*
reassign
)(
struct
drm_device
*
,
bool
enable
);
bool
(
*
cache_flush
)(
struct
drm_device
*
dev
);
bool
(
*
cache_pull
)(
struct
drm_device
*
dev
,
bool
enable
);
int
(
*
channel_id
)(
struct
drm_device
*
);
int
(
*
channel_id
)(
struct
drm_device
*
);
...
@@ -889,6 +891,8 @@ extern int nv04_fifo_init(struct drm_device *);
...
@@ -889,6 +891,8 @@ extern int nv04_fifo_init(struct drm_device *);
extern
void
nv04_fifo_disable
(
struct
drm_device
*
);
extern
void
nv04_fifo_disable
(
struct
drm_device
*
);
extern
void
nv04_fifo_enable
(
struct
drm_device
*
);
extern
void
nv04_fifo_enable
(
struct
drm_device
*
);
extern
bool
nv04_fifo_reassign
(
struct
drm_device
*
,
bool
);
extern
bool
nv04_fifo_reassign
(
struct
drm_device
*
,
bool
);
extern
bool
nv04_fifo_cache_flush
(
struct
drm_device
*
);
extern
bool
nv04_fifo_cache_pull
(
struct
drm_device
*
,
bool
);
extern
int
nv04_fifo_channel_id
(
struct
drm_device
*
);
extern
int
nv04_fifo_channel_id
(
struct
drm_device
*
);
extern
int
nv04_fifo_create_context
(
struct
nouveau_channel
*
);
extern
int
nv04_fifo_create_context
(
struct
nouveau_channel
*
);
extern
void
nv04_fifo_destroy_context
(
struct
nouveau_channel
*
);
extern
void
nv04_fifo_destroy_context
(
struct
nouveau_channel
*
);
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
View file @
588d7d12
...
@@ -76,6 +76,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
...
@@ -76,6 +76,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
cache_flush
=
nv04_fifo_cache_flush
;
engine
->
fifo
.
cache_pull
=
nv04_fifo_cache_pull
;
engine
->
fifo
.
channel_id
=
nv04_fifo_channel_id
;
engine
->
fifo
.
channel_id
=
nv04_fifo_channel_id
;
engine
->
fifo
.
create_context
=
nv04_fifo_create_context
;
engine
->
fifo
.
create_context
=
nv04_fifo_create_context
;
engine
->
fifo
.
destroy_context
=
nv04_fifo_destroy_context
;
engine
->
fifo
.
destroy_context
=
nv04_fifo_destroy_context
;
...
@@ -115,6 +117,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
...
@@ -115,6 +117,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
cache_flush
=
nv04_fifo_cache_flush
;
engine
->
fifo
.
cache_pull
=
nv04_fifo_cache_pull
;
engine
->
fifo
.
channel_id
=
nv10_fifo_channel_id
;
engine
->
fifo
.
channel_id
=
nv10_fifo_channel_id
;
engine
->
fifo
.
create_context
=
nv10_fifo_create_context
;
engine
->
fifo
.
create_context
=
nv10_fifo_create_context
;
engine
->
fifo
.
destroy_context
=
nv10_fifo_destroy_context
;
engine
->
fifo
.
destroy_context
=
nv10_fifo_destroy_context
;
...
@@ -154,6 +158,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
...
@@ -154,6 +158,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
cache_flush
=
nv04_fifo_cache_flush
;
engine
->
fifo
.
cache_pull
=
nv04_fifo_cache_pull
;
engine
->
fifo
.
channel_id
=
nv10_fifo_channel_id
;
engine
->
fifo
.
channel_id
=
nv10_fifo_channel_id
;
engine
->
fifo
.
create_context
=
nv10_fifo_create_context
;
engine
->
fifo
.
create_context
=
nv10_fifo_create_context
;
engine
->
fifo
.
destroy_context
=
nv10_fifo_destroy_context
;
engine
->
fifo
.
destroy_context
=
nv10_fifo_destroy_context
;
...
@@ -193,6 +199,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
...
@@ -193,6 +199,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
cache_flush
=
nv04_fifo_cache_flush
;
engine
->
fifo
.
cache_pull
=
nv04_fifo_cache_pull
;
engine
->
fifo
.
channel_id
=
nv10_fifo_channel_id
;
engine
->
fifo
.
channel_id
=
nv10_fifo_channel_id
;
engine
->
fifo
.
create_context
=
nv10_fifo_create_context
;
engine
->
fifo
.
create_context
=
nv10_fifo_create_context
;
engine
->
fifo
.
destroy_context
=
nv10_fifo_destroy_context
;
engine
->
fifo
.
destroy_context
=
nv10_fifo_destroy_context
;
...
@@ -233,6 +241,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
...
@@ -233,6 +241,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
disable
=
nv04_fifo_disable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
enable
=
nv04_fifo_enable
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
reassign
=
nv04_fifo_reassign
;
engine
->
fifo
.
cache_flush
=
nv04_fifo_cache_flush
;
engine
->
fifo
.
cache_pull
=
nv04_fifo_cache_pull
;
engine
->
fifo
.
channel_id
=
nv10_fifo_channel_id
;
engine
->
fifo
.
channel_id
=
nv10_fifo_channel_id
;
engine
->
fifo
.
create_context
=
nv40_fifo_create_context
;
engine
->
fifo
.
create_context
=
nv40_fifo_create_context
;
engine
->
fifo
.
destroy_context
=
nv40_fifo_destroy_context
;
engine
->
fifo
.
destroy_context
=
nv40_fifo_destroy_context
;
...
...
drivers/gpu/drm/nouveau/nv04_fifo.c
View file @
588d7d12
...
@@ -71,6 +71,40 @@ nv04_fifo_reassign(struct drm_device *dev, bool enable)
...
@@ -71,6 +71,40 @@ nv04_fifo_reassign(struct drm_device *dev, bool enable)
return
(
reassign
==
1
);
return
(
reassign
==
1
);
}
}
bool
nv04_fifo_cache_flush
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_timer_engine
*
ptimer
=
&
dev_priv
->
engine
.
timer
;
uint64_t
start
=
ptimer
->
read
(
dev
);
do
{
if
(
nv_rd32
(
dev
,
NV03_PFIFO_CACHE1_GET
)
==
nv_rd32
(
dev
,
NV03_PFIFO_CACHE1_PUT
))
return
true
;
}
while
(
ptimer
->
read
(
dev
)
-
start
<
100000000
);
NV_ERROR
(
dev
,
"Timeout flushing the PFIFO cache.
\n
"
);
return
false
;
}
bool
nv04_fifo_cache_pull
(
struct
drm_device
*
dev
,
bool
enable
)
{
uint32_t
pull
=
nv_rd32
(
dev
,
NV04_PFIFO_CACHE1_PULL0
);
if
(
enable
)
{
nv_wr32
(
dev
,
NV04_PFIFO_CACHE1_PULL0
,
pull
|
1
);
}
else
{
nv_wr32
(
dev
,
NV04_PFIFO_CACHE1_PULL0
,
pull
&
~
1
);
nv_wr32
(
dev
,
NV04_PFIFO_CACHE1_HASH
,
0
);
}
return
!!
(
pull
&
1
);
}
int
int
nv04_fifo_channel_id
(
struct
drm_device
*
dev
)
nv04_fifo_channel_id
(
struct
drm_device
*
dev
)
{
{
...
...
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