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
259434ac
Commit
259434ac
authored
May 28, 2008
by
Alex Deucher
Committed by
Dave Airlie
Jun 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/radeon: fix pixcache and purge/cache flushing registers
Signed-off-by:
Dave Airlie
<
airlied@redhat.com
>
parent
d7463eb4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
18 deletions
+65
-18
drivers/char/drm/r300_reg.h
drivers/char/drm/r300_reg.h
+1
-1
drivers/char/drm/radeon_cp.c
drivers/char/drm/radeon_cp.c
+29
-9
drivers/char/drm/radeon_drv.h
drivers/char/drm/radeon_drv.h
+35
-8
No files found.
drivers/char/drm/r300_reg.h
View file @
259434ac
...
...
@@ -1346,7 +1346,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/* Guess by Vladimir.
* Set to 0A before 3D operations, set to 02 afterwards.
*/
#define R300_RB3D_DSTCACHE_CTLSTAT 0x4E4C
/*#define R300_RB3D_DSTCACHE_CTLSTAT 0x4E4C*/
# define R300_RB3D_DSTCACHE_UNKNOWN_02 0x00000002
# define R300_RB3D_DSTCACHE_UNKNOWN_0A 0x0000000A
...
...
drivers/char/drm/radeon_cp.c
View file @
259434ac
...
...
@@ -161,6 +161,7 @@ static int radeon_do_pixcache_flush(drm_radeon_private_t * dev_priv)
dev_priv
->
stats
.
boxes
|=
RADEON_BOX_WAIT_IDLE
;
if
((
dev_priv
->
flags
&
RADEON_FAMILY_MASK
)
<=
CHIP_RV280
)
{
tmp
=
RADEON_READ
(
RADEON_RB3D_DSTCACHE_CTLSTAT
);
tmp
|=
RADEON_RB3D_DC_FLUSH_ALL
;
RADEON_WRITE
(
RADEON_RB3D_DSTCACHE_CTLSTAT
,
tmp
);
...
...
@@ -172,6 +173,25 @@ static int radeon_do_pixcache_flush(drm_radeon_private_t * dev_priv)
}
DRM_UDELAY
(
1
);
}
}
else
{
/* 3D */
tmp
=
RADEON_READ
(
R300_RB3D_DSTCACHE_CTLSTAT
);
tmp
|=
RADEON_RB3D_DC_FLUSH_ALL
;
RADEON_WRITE
(
R300_RB3D_DSTCACHE_CTLSTAT
,
tmp
);
/* 2D */
tmp
=
RADEON_READ
(
RADEON_RB2D_DSTCACHE_CTLSTAT
);
tmp
|=
RADEON_RB3D_DC_FLUSH_ALL
;
RADEON_WRITE
(
RADEON_RB3D_DSTCACHE_CTLSTAT
,
tmp
);
for
(
i
=
0
;
i
<
dev_priv
->
usec_timeout
;
i
++
)
{
if
(
!
(
RADEON_READ
(
RADEON_RB2D_DSTCACHE_CTLSTAT
)
&
RADEON_RB3D_DC_BUSY
))
{
return
0
;
}
DRM_UDELAY
(
1
);
}
}
#if RADEON_FIFO_DEBUG
DRM_ERROR
(
"failed!
\n
"
);
...
...
drivers/char/drm/radeon_drv.h
View file @
259434ac
...
...
@@ -659,11 +659,18 @@ extern int r300_do_cp_cmdbuf(struct drm_device * dev,
# define RADEON_RB3D_ZC_FREE (1 << 2)
# define RADEON_RB3D_ZC_FLUSH_ALL 0x5
# define RADEON_RB3D_ZC_BUSY (1 << 31)
#define R300_ZB_ZCACHE_CTLSTAT 0x4f18
# define R300_ZC_FLUSH (1 << 0)
# define R300_ZC_FREE (1 << 1)
# define R300_ZC_FLUSH_ALL 0x3
# define R300_ZC_BUSY (1 << 31)
#define RADEON_RB3D_DSTCACHE_CTLSTAT 0x325c
# define RADEON_RB3D_DC_FLUSH (3 << 0)
# define RADEON_RB3D_DC_FREE (3 << 2)
# define RADEON_RB3D_DC_FLUSH_ALL 0xf
# define RADEON_RB3D_DC_BUSY (1 << 31)
#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c
# define R300_RB3D_DC_FINISH (1 << 4)
#define RADEON_RB3D_ZSTENCILCNTL 0x1c2c
# define RADEON_Z_TEST_MASK (7 << 4)
# define RADEON_Z_TEST_ALWAYS (7 << 4)
...
...
@@ -1178,23 +1185,43 @@ do { \
} while (0)
#define RADEON_FLUSH_CACHE() do { \
OUT_RING( CP_PACKET0( RADEON_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \
OUT_RING( RADEON_RB3D_DC_FLUSH ); \
if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \
OUT_RING(CP_PACKET0(RADEON_RB3D_DSTCACHE_CTLSTAT, 0)); \
OUT_RING(RADEON_RB3D_DC_FLUSH); \
} else { \
OUT_RING(CP_PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); \
OUT_RING(RADEON_RB3D_DC_FLUSH); \
} \
} while (0)
#define RADEON_PURGE_CACHE() do { \
OUT_RING( CP_PACKET0( RADEON_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \
OUT_RING( RADEON_RB3D_DC_FLUSH_ALL ); \
if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \
OUT_RING(CP_PACKET0(RADEON_RB3D_DSTCACHE_CTLSTAT, 0)); \
OUT_RING(RADEON_RB3D_DC_FLUSH_ALL); \
} else { \
OUT_RING(CP_PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); \
OUT_RING(RADEON_RB3D_DC_FLUSH_ALL); \
} \
} while (0)
#define RADEON_FLUSH_ZCACHE() do { \
OUT_RING( CP_PACKET0( RADEON_RB3D_ZCACHE_CTLSTAT, 0 ) ); \
OUT_RING( RADEON_RB3D_ZC_FLUSH ); \
if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \
OUT_RING(CP_PACKET0(RADEON_RB3D_ZCACHE_CTLSTAT, 0)); \
OUT_RING(RADEON_RB3D_ZC_FLUSH); \
} else { \
OUT_RING(CP_PACKET0(R300_ZB_ZCACHE_CTLSTAT, 0)); \
OUT_RING(R300_ZC_FLUSH); \
} \
} while (0)
#define RADEON_PURGE_ZCACHE() do { \
OUT_RING( CP_PACKET0( RADEON_RB3D_ZCACHE_CTLSTAT, 0 ) ); \
OUT_RING( RADEON_RB3D_ZC_FLUSH_ALL ); \
if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \
OUT_RING(CP_PACKET0(RADEON_RB3D_ZCACHE_CTLSTAT, 0)); \
OUT_RING(RADEON_RB3D_ZC_FLUSH_ALL); \
} else { \
OUT_RING(CP_PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); \
OUT_RING(R300_ZC_FLUSH_ALL); \
} \
} while (0)
/* ================================================================
...
...
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