diff options
author | Dave Airlie <airlied@redhat.com> | 2008-02-07 00:01:05 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-02-07 00:13:40 -0500 |
commit | 3d5e2c13b13468f5eb2ac9323690af7e17f195fe (patch) | |
tree | c282c2a8413ca5096877360d86402df08bec6b3a /drivers/char/drm/r300_cmdbuf.c | |
parent | 576cc458a64673ecf3fa7f1bab751e52fd939071 (diff) |
drm: add initial r500 drm support
This adds CP support for the r500 series of chips, and allows
accel 2D support on these chips with a new radeon driver.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/drm/r300_cmdbuf.c')
-rw-r--r-- | drivers/char/drm/r300_cmdbuf.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/drivers/char/drm/r300_cmdbuf.c b/drivers/char/drm/r300_cmdbuf.c index 8cd82710f6a0..0f4afc44245c 100644 --- a/drivers/char/drm/r300_cmdbuf.c +++ b/drivers/char/drm/r300_cmdbuf.c | |||
@@ -77,23 +77,31 @@ static int r300_emit_cliprects(drm_radeon_private_t *dev_priv, | |||
77 | return -EFAULT; | 77 | return -EFAULT; |
78 | } | 78 | } |
79 | 79 | ||
80 | box.x1 = | 80 | if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV515) { |
81 | (box.x1 + | 81 | box.x1 = (box.x1) & |
82 | R300_CLIPRECT_OFFSET) & R300_CLIPRECT_MASK; | 82 | R300_CLIPRECT_MASK; |
83 | box.y1 = | 83 | box.y1 = (box.y1) & |
84 | (box.y1 + | 84 | R300_CLIPRECT_MASK; |
85 | R300_CLIPRECT_OFFSET) & R300_CLIPRECT_MASK; | 85 | box.x2 = (box.x2) & |
86 | box.x2 = | 86 | R300_CLIPRECT_MASK; |
87 | (box.x2 + | 87 | box.y2 = (box.y2) & |
88 | R300_CLIPRECT_OFFSET) & R300_CLIPRECT_MASK; | 88 | R300_CLIPRECT_MASK; |
89 | box.y2 = | 89 | } else { |
90 | (box.y2 + | 90 | box.x1 = (box.x1 + R300_CLIPRECT_OFFSET) & |
91 | R300_CLIPRECT_OFFSET) & R300_CLIPRECT_MASK; | 91 | R300_CLIPRECT_MASK; |
92 | box.y1 = (box.y1 + R300_CLIPRECT_OFFSET) & | ||
93 | R300_CLIPRECT_MASK; | ||
94 | box.x2 = (box.x2 + R300_CLIPRECT_OFFSET) & | ||
95 | R300_CLIPRECT_MASK; | ||
96 | box.y2 = (box.y2 + R300_CLIPRECT_OFFSET) & | ||
97 | R300_CLIPRECT_MASK; | ||
92 | 98 | ||
99 | } | ||
93 | OUT_RING((box.x1 << R300_CLIPRECT_X_SHIFT) | | 100 | OUT_RING((box.x1 << R300_CLIPRECT_X_SHIFT) | |
94 | (box.y1 << R300_CLIPRECT_Y_SHIFT)); | 101 | (box.y1 << R300_CLIPRECT_Y_SHIFT)); |
95 | OUT_RING((box.x2 << R300_CLIPRECT_X_SHIFT) | | 102 | OUT_RING((box.x2 << R300_CLIPRECT_X_SHIFT) | |
96 | (box.y2 << R300_CLIPRECT_Y_SHIFT)); | 103 | (box.y2 << R300_CLIPRECT_Y_SHIFT)); |
104 | |||
97 | } | 105 | } |
98 | 106 | ||
99 | OUT_RING_REG(R300_RE_CLIPRECT_CNTL, r300_cliprect_cntl[nr - 1]); | 107 | OUT_RING_REG(R300_RE_CLIPRECT_CNTL, r300_cliprect_cntl[nr - 1]); |
@@ -133,9 +141,11 @@ static int r300_emit_cliprects(drm_radeon_private_t *dev_priv, | |||
133 | 141 | ||
134 | static u8 r300_reg_flags[0x10000 >> 2]; | 142 | static u8 r300_reg_flags[0x10000 >> 2]; |
135 | 143 | ||
136 | void r300_init_reg_flags(void) | 144 | void r300_init_reg_flags(struct drm_device *dev) |
137 | { | 145 | { |
138 | int i; | 146 | int i; |
147 | drm_radeon_private_t *dev_priv = dev->dev_private; | ||
148 | |||
139 | memset(r300_reg_flags, 0, 0x10000 >> 2); | 149 | memset(r300_reg_flags, 0, 0x10000 >> 2); |
140 | #define ADD_RANGE_MARK(reg, count,mark) \ | 150 | #define ADD_RANGE_MARK(reg, count,mark) \ |
141 | for(i=((reg)>>2);i<((reg)>>2)+(count);i++)\ | 151 | for(i=((reg)>>2);i<((reg)>>2)+(count);i++)\ |
@@ -230,6 +240,9 @@ void r300_init_reg_flags(void) | |||
230 | ADD_RANGE(R300_VAP_INPUT_ROUTE_0_0, 8); | 240 | ADD_RANGE(R300_VAP_INPUT_ROUTE_0_0, 8); |
231 | ADD_RANGE(R300_VAP_INPUT_ROUTE_1_0, 8); | 241 | ADD_RANGE(R300_VAP_INPUT_ROUTE_1_0, 8); |
232 | 242 | ||
243 | if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV515) { | ||
244 | ADD_RANGE(0x4074, 16); | ||
245 | } | ||
233 | } | 246 | } |
234 | 247 | ||
235 | static __inline__ int r300_check_range(unsigned reg, int count) | 248 | static __inline__ int r300_check_range(unsigned reg, int count) |