diff options
-rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r100_track.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r300_reg.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/reg_srcs/r300 | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/reg_srcs/r420 | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/reg_srcs/rs600 | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/reg_srcs/rv515 | 3 |
8 files changed, 49 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index fdf4bc67ae58..56deae5bf02e 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -3381,6 +3381,26 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track) | |||
3381 | } | 3381 | } |
3382 | track->zb_dirty = false; | 3382 | track->zb_dirty = false; |
3383 | 3383 | ||
3384 | if (track->aa_dirty && track->aaresolve) { | ||
3385 | if (track->aa.robj == NULL) { | ||
3386 | DRM_ERROR("[drm] No buffer for AA resolve buffer %d !\n", i); | ||
3387 | return -EINVAL; | ||
3388 | } | ||
3389 | /* I believe the format comes from colorbuffer0. */ | ||
3390 | size = track->aa.pitch * track->cb[0].cpp * track->maxy; | ||
3391 | size += track->aa.offset; | ||
3392 | if (size > radeon_bo_size(track->aa.robj)) { | ||
3393 | DRM_ERROR("[drm] Buffer too small for AA resolve buffer %d " | ||
3394 | "(need %lu have %lu) !\n", i, size, | ||
3395 | radeon_bo_size(track->aa.robj)); | ||
3396 | DRM_ERROR("[drm] AA resolve buffer %d (%u %u %u %u)\n", | ||
3397 | i, track->aa.pitch, track->cb[0].cpp, | ||
3398 | track->aa.offset, track->maxy); | ||
3399 | return -EINVAL; | ||
3400 | } | ||
3401 | } | ||
3402 | track->aa_dirty = false; | ||
3403 | |||
3384 | prim_walk = (track->vap_vf_cntl >> 4) & 0x3; | 3404 | prim_walk = (track->vap_vf_cntl >> 4) & 0x3; |
3385 | if (track->vap_vf_cntl & (1 << 14)) { | 3405 | if (track->vap_vf_cntl & (1 << 14)) { |
3386 | nverts = track->vap_alt_nverts; | 3406 | nverts = track->vap_alt_nverts; |
@@ -3455,6 +3475,7 @@ void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track | |||
3455 | track->cb_dirty = true; | 3475 | track->cb_dirty = true; |
3456 | track->zb_dirty = true; | 3476 | track->zb_dirty = true; |
3457 | track->tex_dirty = true; | 3477 | track->tex_dirty = true; |
3478 | track->aa_dirty = true; | ||
3458 | 3479 | ||
3459 | if (rdev->family < CHIP_R300) { | 3480 | if (rdev->family < CHIP_R300) { |
3460 | track->num_cb = 1; | 3481 | track->num_cb = 1; |
@@ -3469,6 +3490,8 @@ void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track | |||
3469 | track->num_texture = 16; | 3490 | track->num_texture = 16; |
3470 | track->maxy = 4096; | 3491 | track->maxy = 4096; |
3471 | track->separate_cube = 0; | 3492 | track->separate_cube = 0; |
3493 | track->aaresolve = true; | ||
3494 | track->aa.robj = NULL; | ||
3472 | } | 3495 | } |
3473 | 3496 | ||
3474 | for (i = 0; i < track->num_cb; i++) { | 3497 | for (i = 0; i < track->num_cb; i++) { |
diff --git a/drivers/gpu/drm/radeon/r100_track.h b/drivers/gpu/drm/radeon/r100_track.h index ee85c4a1fc08..2fef9de7f363 100644 --- a/drivers/gpu/drm/radeon/r100_track.h +++ b/drivers/gpu/drm/radeon/r100_track.h | |||
@@ -66,15 +66,17 @@ struct r100_cs_track { | |||
66 | struct r100_cs_track_array arrays[11]; | 66 | struct r100_cs_track_array arrays[11]; |
67 | struct r100_cs_track_cb cb[R300_MAX_CB]; | 67 | struct r100_cs_track_cb cb[R300_MAX_CB]; |
68 | struct r100_cs_track_cb zb; | 68 | struct r100_cs_track_cb zb; |
69 | struct r100_cs_track_cb aa; | ||
69 | struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE]; | 70 | struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE]; |
70 | bool z_enabled; | 71 | bool z_enabled; |
71 | bool separate_cube; | 72 | bool separate_cube; |
72 | bool zb_cb_clear; | 73 | bool zb_cb_clear; |
73 | bool blend_read_enable; | 74 | bool blend_read_enable; |
74 | |||
75 | bool cb_dirty; | 75 | bool cb_dirty; |
76 | bool zb_dirty; | 76 | bool zb_dirty; |
77 | bool tex_dirty; | 77 | bool tex_dirty; |
78 | bool aa_dirty; | ||
79 | bool aaresolve; | ||
78 | }; | 80 | }; |
79 | 81 | ||
80 | int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track); | 82 | int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track); |
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 862b61742b82..768c60ee4ab6 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -1104,6 +1104,27 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
1104 | track->blend_read_enable = !!(idx_value & (1 << 2)); | 1104 | track->blend_read_enable = !!(idx_value & (1 << 2)); |
1105 | track->cb_dirty = true; | 1105 | track->cb_dirty = true; |
1106 | break; | 1106 | break; |
1107 | case R300_RB3D_AARESOLVE_OFFSET: | ||
1108 | r = r100_cs_packet_next_reloc(p, &reloc); | ||
1109 | if (r) { | ||
1110 | DRM_ERROR("No reloc for ib[%d]=0x%04X\n", | ||
1111 | idx, reg); | ||
1112 | r100_cs_dump_packet(p, pkt); | ||
1113 | return r; | ||
1114 | } | ||
1115 | track->aa.robj = reloc->robj; | ||
1116 | track->aa.offset = idx_value; | ||
1117 | track->aa_dirty = true; | ||
1118 | ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); | ||
1119 | break; | ||
1120 | case R300_RB3D_AARESOLVE_PITCH: | ||
1121 | track->aa.pitch = idx_value & 0x3FFE; | ||
1122 | track->aa_dirty = true; | ||
1123 | break; | ||
1124 | case R300_RB3D_AARESOLVE_CTL: | ||
1125 | track->aaresolve = idx_value & 0x1; | ||
1126 | track->aa_dirty = true; | ||
1127 | break; | ||
1107 | case 0x4f30: /* ZB_MASK_OFFSET */ | 1128 | case 0x4f30: /* ZB_MASK_OFFSET */ |
1108 | case 0x4f34: /* ZB_ZMASK_PITCH */ | 1129 | case 0x4f34: /* ZB_ZMASK_PITCH */ |
1109 | case 0x4f44: /* ZB_HIZ_OFFSET */ | 1130 | case 0x4f44: /* ZB_HIZ_OFFSET */ |
diff --git a/drivers/gpu/drm/radeon/r300_reg.h b/drivers/gpu/drm/radeon/r300_reg.h index 1a0d5362cd79..f0bce399c9f3 100644 --- a/drivers/gpu/drm/radeon/r300_reg.h +++ b/drivers/gpu/drm/radeon/r300_reg.h | |||
@@ -1371,6 +1371,8 @@ | |||
1371 | #define R300_RB3D_COLORPITCH2 0x4E40 /* GUESS */ | 1371 | #define R300_RB3D_COLORPITCH2 0x4E40 /* GUESS */ |
1372 | #define R300_RB3D_COLORPITCH3 0x4E44 /* GUESS */ | 1372 | #define R300_RB3D_COLORPITCH3 0x4E44 /* GUESS */ |
1373 | 1373 | ||
1374 | #define R300_RB3D_AARESOLVE_OFFSET 0x4E80 | ||
1375 | #define R300_RB3D_AARESOLVE_PITCH 0x4E84 | ||
1374 | #define R300_RB3D_AARESOLVE_CTL 0x4E88 | 1376 | #define R300_RB3D_AARESOLVE_CTL 0x4E88 |
1375 | /* gap */ | 1377 | /* gap */ |
1376 | 1378 | ||
diff --git a/drivers/gpu/drm/radeon/reg_srcs/r300 b/drivers/gpu/drm/radeon/reg_srcs/r300 index 13a94e2ee03b..e8a1786b6426 100644 --- a/drivers/gpu/drm/radeon/reg_srcs/r300 +++ b/drivers/gpu/drm/radeon/reg_srcs/r300 | |||
@@ -704,9 +704,6 @@ r300 0x4f60 | |||
704 | 0x4E74 RB3D_CMASK_WRINDEX | 704 | 0x4E74 RB3D_CMASK_WRINDEX |
705 | 0x4E78 RB3D_CMASK_DWORD | 705 | 0x4E78 RB3D_CMASK_DWORD |
706 | 0x4E7C RB3D_CMASK_RDINDEX | 706 | 0x4E7C RB3D_CMASK_RDINDEX |
707 | 0x4E80 RB3D_AARESOLVE_OFFSET | ||
708 | 0x4E84 RB3D_AARESOLVE_PITCH | ||
709 | 0x4E88 RB3D_AARESOLVE_CTL | ||
710 | 0x4EA0 RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD | 707 | 0x4EA0 RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD |
711 | 0x4EA4 RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD | 708 | 0x4EA4 RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD |
712 | 0x4F04 ZB_ZSTENCILCNTL | 709 | 0x4F04 ZB_ZSTENCILCNTL |
diff --git a/drivers/gpu/drm/radeon/reg_srcs/r420 b/drivers/gpu/drm/radeon/reg_srcs/r420 index 5c95cf87f7f2..722074e21e2f 100644 --- a/drivers/gpu/drm/radeon/reg_srcs/r420 +++ b/drivers/gpu/drm/radeon/reg_srcs/r420 | |||
@@ -770,9 +770,6 @@ r420 0x4f60 | |||
770 | 0x4E74 RB3D_CMASK_WRINDEX | 770 | 0x4E74 RB3D_CMASK_WRINDEX |
771 | 0x4E78 RB3D_CMASK_DWORD | 771 | 0x4E78 RB3D_CMASK_DWORD |
772 | 0x4E7C RB3D_CMASK_RDINDEX | 772 | 0x4E7C RB3D_CMASK_RDINDEX |
773 | 0x4E80 RB3D_AARESOLVE_OFFSET | ||
774 | 0x4E84 RB3D_AARESOLVE_PITCH | ||
775 | 0x4E88 RB3D_AARESOLVE_CTL | ||
776 | 0x4EA0 RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD | 773 | 0x4EA0 RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD |
777 | 0x4EA4 RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD | 774 | 0x4EA4 RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD |
778 | 0x4F04 ZB_ZSTENCILCNTL | 775 | 0x4F04 ZB_ZSTENCILCNTL |
diff --git a/drivers/gpu/drm/radeon/reg_srcs/rs600 b/drivers/gpu/drm/radeon/reg_srcs/rs600 index 263109c1d0c8..d9f62866bbc1 100644 --- a/drivers/gpu/drm/radeon/reg_srcs/rs600 +++ b/drivers/gpu/drm/radeon/reg_srcs/rs600 | |||
@@ -770,9 +770,6 @@ rs600 0x6d40 | |||
770 | 0x4E74 RB3D_CMASK_WRINDEX | 770 | 0x4E74 RB3D_CMASK_WRINDEX |
771 | 0x4E78 RB3D_CMASK_DWORD | 771 | 0x4E78 RB3D_CMASK_DWORD |
772 | 0x4E7C RB3D_CMASK_RDINDEX | 772 | 0x4E7C RB3D_CMASK_RDINDEX |
773 | 0x4E80 RB3D_AARESOLVE_OFFSET | ||
774 | 0x4E84 RB3D_AARESOLVE_PITCH | ||
775 | 0x4E88 RB3D_AARESOLVE_CTL | ||
776 | 0x4EA0 RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD | 773 | 0x4EA0 RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD |
777 | 0x4EA4 RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD | 774 | 0x4EA4 RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD |
778 | 0x4F04 ZB_ZSTENCILCNTL | 775 | 0x4F04 ZB_ZSTENCILCNTL |
diff --git a/drivers/gpu/drm/radeon/reg_srcs/rv515 b/drivers/gpu/drm/radeon/reg_srcs/rv515 index eeed003f14c7..911a8fbd32bb 100644 --- a/drivers/gpu/drm/radeon/reg_srcs/rv515 +++ b/drivers/gpu/drm/radeon/reg_srcs/rv515 | |||
@@ -481,9 +481,6 @@ rv515 0x6d40 | |||
481 | 0x4E74 RB3D_CMASK_WRINDEX | 481 | 0x4E74 RB3D_CMASK_WRINDEX |
482 | 0x4E78 RB3D_CMASK_DWORD | 482 | 0x4E78 RB3D_CMASK_DWORD |
483 | 0x4E7C RB3D_CMASK_RDINDEX | 483 | 0x4E7C RB3D_CMASK_RDINDEX |
484 | 0x4E80 RB3D_AARESOLVE_OFFSET | ||
485 | 0x4E84 RB3D_AARESOLVE_PITCH | ||
486 | 0x4E88 RB3D_AARESOLVE_CTL | ||
487 | 0x4EA0 RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD | 484 | 0x4EA0 RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD |
488 | 0x4EA4 RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD | 485 | 0x4EA4 RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD |
489 | 0x4EF8 RB3D_CONSTANT_COLOR_AR | 486 | 0x4EF8 RB3D_CONSTANT_COLOR_AR |