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
97944ab0
Commit
97944ab0
authored
Aug 13, 2003
by
Dave Jones
Committed by
Linus Torvalds
Aug 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] cpu_relax whilst in busy-wait loops.
parent
dfeee41e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
15 deletions
+32
-15
drivers/char/drm/gamma_dma.c
drivers/char/drm/gamma_dma.c
+32
-15
No files found.
drivers/char/drm/gamma_dma.c
View file @
97944ab0
...
...
@@ -44,9 +44,14 @@ static inline void gamma_dma_dispatch(drm_device_t *dev, unsigned long address,
drm_gamma_private_t
*
dev_priv
=
(
drm_gamma_private_t
*
)
dev
->
dev_private
;
mb
();
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
2
);
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
2
)
cpu_relax
();
GAMMA_WRITE
(
GAMMA_DMAADDRESS
,
address
);
while
(
GAMMA_READ
(
GAMMA_GCOMMANDSTATUS
)
!=
4
);
while
(
GAMMA_READ
(
GAMMA_GCOMMANDSTATUS
)
!=
4
)
cpu_relax
();
GAMMA_WRITE
(
GAMMA_DMACOUNT
,
length
/
4
);
}
...
...
@@ -54,16 +59,18 @@ void gamma_dma_quiescent_single(drm_device_t *dev)
{
drm_gamma_private_t
*
dev_priv
=
(
drm_gamma_private_t
*
)
dev
->
dev_private
;
while
(
GAMMA_READ
(
GAMMA_DMACOUNT
));
while
(
GAMMA_READ
(
GAMMA_DMACOUNT
))
cpu_relax
();
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
2
);
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
2
)
cpu_relax
();
GAMMA_WRITE
(
GAMMA_FILTERMODE
,
1
<<
10
);
GAMMA_WRITE
(
GAMMA_SYNC
,
0
);
do
{
while
(
!
GAMMA_READ
(
GAMMA_OUTFIFOWORDS
))
;
cpu_relax
()
;
}
while
(
GAMMA_READ
(
GAMMA_OUTPUTFIFO
)
!=
GAMMA_SYNC_TAG
);
}
...
...
@@ -71,9 +78,11 @@ void gamma_dma_quiescent_dual(drm_device_t *dev)
{
drm_gamma_private_t
*
dev_priv
=
(
drm_gamma_private_t
*
)
dev
->
dev_private
;
while
(
GAMMA_READ
(
GAMMA_DMACOUNT
));
while
(
GAMMA_READ
(
GAMMA_DMACOUNT
))
cpu_relax
();
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
3
);
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
3
)
cpu_relax
();
GAMMA_WRITE
(
GAMMA_BROADCASTMASK
,
3
);
GAMMA_WRITE
(
GAMMA_FILTERMODE
,
1
<<
10
);
...
...
@@ -81,12 +90,14 @@ void gamma_dma_quiescent_dual(drm_device_t *dev)
/* Read from first MX */
do
{
while
(
!
GAMMA_READ
(
GAMMA_OUTFIFOWORDS
));
while
(
!
GAMMA_READ
(
GAMMA_OUTFIFOWORDS
))
cpu_relax
();
}
while
(
GAMMA_READ
(
GAMMA_OUTPUTFIFO
)
!=
GAMMA_SYNC_TAG
);
/* Read from second MX */
do
{
while
(
!
GAMMA_READ
(
GAMMA_OUTFIFOWORDS
+
0x10000
));
while
(
!
GAMMA_READ
(
GAMMA_OUTFIFOWORDS
+
0x10000
))
cpu_relax
();
}
while
(
GAMMA_READ
(
GAMMA_OUTPUTFIFO
+
0x10000
)
!=
GAMMA_SYNC_TAG
);
}
...
...
@@ -94,14 +105,15 @@ void gamma_dma_ready(drm_device_t *dev)
{
drm_gamma_private_t
*
dev_priv
=
(
drm_gamma_private_t
*
)
dev
->
dev_private
;
while
(
GAMMA_READ
(
GAMMA_DMACOUNT
));
while
(
GAMMA_READ
(
GAMMA_DMACOUNT
))
cpu_relax
();
}
static
inline
int
gamma_dma_is_ready
(
drm_device_t
*
dev
)
{
drm_gamma_private_t
*
dev_priv
=
(
drm_gamma_private_t
*
)
dev
->
dev_private
;
return
(
!
GAMMA_READ
(
GAMMA_DMACOUNT
));
return
(
!
GAMMA_READ
(
GAMMA_DMACOUNT
));
}
irqreturn_t
gamma_dma_service
(
int
irq
,
void
*
device
,
struct
pt_regs
*
regs
)
...
...
@@ -113,7 +125,9 @@ irqreturn_t gamma_dma_service(int irq, void *device, struct pt_regs *regs)
atomic_inc
(
&
dev
->
counts
[
6
]);
/* _DRM_STAT_IRQ */
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
3
);
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
3
)
cpu_relax
();
GAMMA_WRITE
(
GAMMA_GDELAYTIMER
,
0xc350
/
2
);
/* 0x05S */
GAMMA_WRITE
(
GAMMA_GCOMMANDINTFLAGS
,
8
);
GAMMA_WRITE
(
GAMMA_GINTFLAGS
,
0x2001
);
...
...
@@ -824,7 +838,8 @@ void DRM(driver_irq_preinstall)( drm_device_t *dev ) {
drm_gamma_private_t
*
dev_priv
=
(
drm_gamma_private_t
*
)
dev
->
dev_private
;
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
2
);
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
2
)
cpu_relax
();
GAMMA_WRITE
(
GAMMA_GCOMMANDMODE
,
0x00000004
);
GAMMA_WRITE
(
GAMMA_GDMACONTROL
,
0x00000000
);
...
...
@@ -834,7 +849,8 @@ void DRM(driver_irq_postinstall)( drm_device_t *dev ) {
drm_gamma_private_t
*
dev_priv
=
(
drm_gamma_private_t
*
)
dev
->
dev_private
;
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
3
);
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
3
)
cpu_relax
();
GAMMA_WRITE
(
GAMMA_GINTENABLE
,
0x00002001
);
GAMMA_WRITE
(
GAMMA_COMMANDINTENABLE
,
0x00000008
);
...
...
@@ -847,7 +863,8 @@ void DRM(driver_irq_uninstall)( drm_device_t *dev ) {
if
(
!
dev_priv
)
return
;
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
3
);
while
(
GAMMA_READ
(
GAMMA_INFIFOSPACE
)
<
3
)
cpu_relax
();
GAMMA_WRITE
(
GAMMA_GDELAYTIMER
,
0x00000000
);
GAMMA_WRITE
(
GAMMA_COMMANDINTENABLE
,
0x00000000
);
...
...
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