aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/r300_cmdbuf.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-09-30 04:37:36 -0400
committerDave Airlie <airlied@linux.ie>2005-09-30 04:37:36 -0400
commitb3a83639895a422b25f72eec0a5d1d88c3ac4e9e (patch)
tree1cd03d53cccb01964ea57564d7be575a29b7fec2 /drivers/char/drm/r300_cmdbuf.c
parent689b9d74b1c00e1316fbb7d1e912fe1227fdb1ab (diff)
drm: fix all sparse warning on 32-bit x86
Finally cleaned up the sparse warnings for the drm. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/r300_cmdbuf.c')
-rw-r--r--drivers/char/drm/r300_cmdbuf.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/char/drm/r300_cmdbuf.c b/drivers/char/drm/r300_cmdbuf.c
index aa66f46279e7..3a1ac5f78b43 100644
--- a/drivers/char/drm/r300_cmdbuf.c
+++ b/drivers/char/drm/r300_cmdbuf.c
@@ -53,7 +53,7 @@ static const int r300_cliprect_cntl[4] = {
53 * buffer, starting with index n. 53 * buffer, starting with index n.
54 */ 54 */
55static int r300_emit_cliprects(drm_radeon_private_t * dev_priv, 55static int r300_emit_cliprects(drm_radeon_private_t * dev_priv,
56 drm_radeon_cmd_buffer_t * cmdbuf, int n) 56 drm_radeon_kcmd_buffer_t * cmdbuf, int n)
57{ 57{
58 drm_clip_rect_t box; 58 drm_clip_rect_t box;
59 int nr; 59 int nr;
@@ -131,7 +131,7 @@ static int r300_emit_cliprects(drm_radeon_private_t * dev_priv,
131 return 0; 131 return 0;
132} 132}
133 133
134u8 r300_reg_flags[0x10000 >> 2]; 134static u8 r300_reg_flags[0x10000 >> 2];
135 135
136void r300_init_reg_flags(void) 136void r300_init_reg_flags(void)
137{ 137{
@@ -260,7 +260,7 @@ static __inline__ int r300_check_offset(drm_radeon_private_t * dev_priv,
260 260
261static __inline__ int r300_emit_carefully_checked_packet0(drm_radeon_private_t * 261static __inline__ int r300_emit_carefully_checked_packet0(drm_radeon_private_t *
262 dev_priv, 262 dev_priv,
263 drm_radeon_cmd_buffer_t 263 drm_radeon_kcmd_buffer_t
264 * cmdbuf, 264 * cmdbuf,
265 drm_r300_cmd_header_t 265 drm_r300_cmd_header_t
266 header) 266 header)
@@ -281,7 +281,7 @@ static __inline__ int r300_emit_carefully_checked_packet0(drm_radeon_private_t *
281 return DRM_ERR(EINVAL); 281 return DRM_ERR(EINVAL);
282 } 282 }
283 for (i = 0; i < sz; i++) { 283 for (i = 0; i < sz; i++) {
284 values[i] = ((int __user *)cmdbuf->buf)[i]; 284 values[i] = ((int *)cmdbuf->buf)[i];
285 switch (r300_reg_flags[(reg >> 2) + i]) { 285 switch (r300_reg_flags[(reg >> 2) + i]) {
286 case MARK_SAFE: 286 case MARK_SAFE:
287 break; 287 break;
@@ -318,7 +318,7 @@ static __inline__ int r300_emit_carefully_checked_packet0(drm_radeon_private_t *
318 * Note that checks are performed on contents and addresses of the registers 318 * Note that checks are performed on contents and addresses of the registers
319 */ 319 */
320static __inline__ int r300_emit_packet0(drm_radeon_private_t * dev_priv, 320static __inline__ int r300_emit_packet0(drm_radeon_private_t * dev_priv,
321 drm_radeon_cmd_buffer_t * cmdbuf, 321 drm_radeon_kcmd_buffer_t * cmdbuf,
322 drm_r300_cmd_header_t header) 322 drm_r300_cmd_header_t header)
323{ 323{
324 int reg; 324 int reg;
@@ -349,7 +349,7 @@ static __inline__ int r300_emit_packet0(drm_radeon_private_t * dev_priv,
349 349
350 BEGIN_RING(1 + sz); 350 BEGIN_RING(1 + sz);
351 OUT_RING(CP_PACKET0(reg, sz - 1)); 351 OUT_RING(CP_PACKET0(reg, sz - 1));
352 OUT_RING_TABLE((int __user *)cmdbuf->buf, sz); 352 OUT_RING_TABLE((int *)cmdbuf->buf, sz);
353 ADVANCE_RING(); 353 ADVANCE_RING();
354 354
355 cmdbuf->buf += sz * 4; 355 cmdbuf->buf += sz * 4;
@@ -364,7 +364,7 @@ static __inline__ int r300_emit_packet0(drm_radeon_private_t * dev_priv,
364 * Called by r300_do_cp_cmdbuf. 364 * Called by r300_do_cp_cmdbuf.
365 */ 365 */
366static __inline__ int r300_emit_vpu(drm_radeon_private_t * dev_priv, 366static __inline__ int r300_emit_vpu(drm_radeon_private_t * dev_priv,
367 drm_radeon_cmd_buffer_t * cmdbuf, 367 drm_radeon_kcmd_buffer_t * cmdbuf,
368 drm_r300_cmd_header_t header) 368 drm_r300_cmd_header_t header)
369{ 369{
370 int sz; 370 int sz;
@@ -386,7 +386,7 @@ static __inline__ int r300_emit_vpu(drm_radeon_private_t * dev_priv,
386 OUT_RING_REG(R300_VAP_PVS_WAITIDLE, 0); 386 OUT_RING_REG(R300_VAP_PVS_WAITIDLE, 0);
387 OUT_RING_REG(R300_VAP_PVS_UPLOAD_ADDRESS, addr); 387 OUT_RING_REG(R300_VAP_PVS_UPLOAD_ADDRESS, addr);
388 OUT_RING(CP_PACKET0_TABLE(R300_VAP_PVS_UPLOAD_DATA, sz * 4 - 1)); 388 OUT_RING(CP_PACKET0_TABLE(R300_VAP_PVS_UPLOAD_DATA, sz * 4 - 1));
389 OUT_RING_TABLE((int __user *)cmdbuf->buf, sz * 4); 389 OUT_RING_TABLE((int *)cmdbuf->buf, sz * 4);
390 390
391 ADVANCE_RING(); 391 ADVANCE_RING();
392 392
@@ -401,7 +401,7 @@ static __inline__ int r300_emit_vpu(drm_radeon_private_t * dev_priv,
401 * Called by r300_emit_packet3. 401 * Called by r300_emit_packet3.
402 */ 402 */
403static __inline__ int r300_emit_clear(drm_radeon_private_t * dev_priv, 403static __inline__ int r300_emit_clear(drm_radeon_private_t * dev_priv,
404 drm_radeon_cmd_buffer_t * cmdbuf) 404 drm_radeon_kcmd_buffer_t * cmdbuf)
405{ 405{
406 RING_LOCALS; 406 RING_LOCALS;
407 407
@@ -412,7 +412,7 @@ static __inline__ int r300_emit_clear(drm_radeon_private_t * dev_priv,
412 OUT_RING(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); 412 OUT_RING(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8));
413 OUT_RING(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | 413 OUT_RING(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING |
414 (1 << R300_PRIM_NUM_VERTICES_SHIFT)); 414 (1 << R300_PRIM_NUM_VERTICES_SHIFT));
415 OUT_RING_TABLE((int __user *)cmdbuf->buf, 8); 415 OUT_RING_TABLE((int *)cmdbuf->buf, 8);
416 ADVANCE_RING(); 416 ADVANCE_RING();
417 417
418 cmdbuf->buf += 8 * 4; 418 cmdbuf->buf += 8 * 4;
@@ -422,7 +422,7 @@ static __inline__ int r300_emit_clear(drm_radeon_private_t * dev_priv,
422} 422}
423 423
424static __inline__ int r300_emit_3d_load_vbpntr(drm_radeon_private_t * dev_priv, 424static __inline__ int r300_emit_3d_load_vbpntr(drm_radeon_private_t * dev_priv,
425 drm_radeon_cmd_buffer_t * cmdbuf, 425 drm_radeon_kcmd_buffer_t * cmdbuf,
426 u32 header) 426 u32 header)
427{ 427{
428 int count, i, k; 428 int count, i, k;
@@ -490,7 +490,7 @@ static __inline__ int r300_emit_3d_load_vbpntr(drm_radeon_private_t * dev_priv,
490} 490}
491 491
492static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv, 492static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv,
493 drm_radeon_cmd_buffer_t * cmdbuf) 493 drm_radeon_kcmd_buffer_t * cmdbuf)
494{ 494{
495 u32 header; 495 u32 header;
496 int count; 496 int count;
@@ -503,7 +503,7 @@ static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv,
503 We need to be smarter. */ 503 We need to be smarter. */
504 504
505 /* obtain first word - actual packet3 header */ 505 /* obtain first word - actual packet3 header */
506 header = *(u32 __user *) cmdbuf->buf; 506 header = *(u32 *) cmdbuf->buf;
507 507
508 /* Is it packet 3 ? */ 508 /* Is it packet 3 ? */
509 if ((header >> 30) != 0x3) { 509 if ((header >> 30) != 0x3) {
@@ -541,7 +541,7 @@ static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv,
541 541
542 BEGIN_RING(count + 2); 542 BEGIN_RING(count + 2);
543 OUT_RING(header); 543 OUT_RING(header);
544 OUT_RING_TABLE((int __user *)(cmdbuf->buf + 4), count + 1); 544 OUT_RING_TABLE((int *)(cmdbuf->buf + 4), count + 1);
545 ADVANCE_RING(); 545 ADVANCE_RING();
546 546
547 cmdbuf->buf += (count + 2) * 4; 547 cmdbuf->buf += (count + 2) * 4;
@@ -555,12 +555,12 @@ static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t * dev_priv,
555 * Called by r300_do_cp_cmdbuf. 555 * Called by r300_do_cp_cmdbuf.
556 */ 556 */
557static __inline__ int r300_emit_packet3(drm_radeon_private_t * dev_priv, 557static __inline__ int r300_emit_packet3(drm_radeon_private_t * dev_priv,
558 drm_radeon_cmd_buffer_t * cmdbuf, 558 drm_radeon_kcmd_buffer_t * cmdbuf,
559 drm_r300_cmd_header_t header) 559 drm_r300_cmd_header_t header)
560{ 560{
561 int n; 561 int n;
562 int ret; 562 int ret;
563 char __user *orig_buf = cmdbuf->buf; 563 char *orig_buf = cmdbuf->buf;
564 int orig_bufsz = cmdbuf->bufsz; 564 int orig_bufsz = cmdbuf->bufsz;
565 565
566 /* This is a do-while-loop so that we run the interior at least once, 566 /* This is a do-while-loop so that we run the interior at least once,
@@ -659,7 +659,7 @@ static void r300_discard_buffer(drm_device_t * dev, drm_buf_t * buf)
659 */ 659 */
660int r300_do_cp_cmdbuf(drm_device_t * dev, 660int r300_do_cp_cmdbuf(drm_device_t * dev,
661 DRMFILE filp, 661 DRMFILE filp,
662 drm_file_t * filp_priv, drm_radeon_cmd_buffer_t * cmdbuf) 662 drm_file_t * filp_priv, drm_radeon_kcmd_buffer_t * cmdbuf)
663{ 663{
664 drm_radeon_private_t *dev_priv = dev->dev_private; 664 drm_radeon_private_t *dev_priv = dev->dev_private;
665 drm_device_dma_t *dma = dev->dma; 665 drm_device_dma_t *dma = dev->dma;