aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600_cs.c
diff options
context:
space:
mode:
authorIlija Hadzic <ihadzic@research.bell-labs.com>2013-01-02 18:27:44 -0500
committerAlex Deucher <alexander.deucher@amd.com>2013-01-31 16:24:44 -0500
commitd6e18a3406d401edeb96a01c7bb9d1689454c41b (patch)
tree9b3d4b39544c891bd3d6a27f4fef9a5148b9fa88 /drivers/gpu/drm/radeon/r600_cs.c
parent40592a17b8747903be95338f461573916a71d739 (diff)
drm/radeon: add a check to wait_reg_mem command
WAIT_REG_MEM on register does not allow the use of PFP. Enforce this restriction when checking packets sent from userland. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Reviewed-by: Marek Olšák <maraeo@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_cs.c')
-rw-r--r--drivers/gpu/drm/radeon/r600_cs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index e61a013e63fc..9d833728ed00 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -949,6 +949,11 @@ int r600_cs_common_vline_parse(struct radeon_cs_parser *p,
949 DRM_ERROR("vline WAIT_REG_MEM waiting on MEM instead of REG\n"); 949 DRM_ERROR("vline WAIT_REG_MEM waiting on MEM instead of REG\n");
950 return -EINVAL; 950 return -EINVAL;
951 } 951 }
952 /* bit 8 is me (0) or pfp (1) */
953 if (wait_reg_mem_info & 0x100) {
954 DRM_ERROR("vline WAIT_REG_MEM waiting on PFP instead of ME\n");
955 return -EINVAL;
956 }
952 /* waiting for value to be equal */ 957 /* waiting for value to be equal */
953 if ((wait_reg_mem_info & 0x7) != 0x3) { 958 if ((wait_reg_mem_info & 0x7) != 0x3) {
954 DRM_ERROR("vline WAIT_REG_MEM function not equal\n"); 959 DRM_ERROR("vline WAIT_REG_MEM function not equal\n");
@@ -1847,6 +1852,9 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
1847 1852
1848 ib[idx+1] = (ib[idx+1] & 0x3) | (offset & 0xfffffff0); 1853 ib[idx+1] = (ib[idx+1] & 0x3) | (offset & 0xfffffff0);
1849 ib[idx+2] = upper_32_bits(offset) & 0xff; 1854 ib[idx+2] = upper_32_bits(offset) & 0xff;
1855 } else if (idx_value & 0x100) {
1856 DRM_ERROR("cannot use PFP on REG wait\n");
1857 return -EINVAL;
1850 } 1858 }
1851 break; 1859 break;
1852 case PACKET3_CP_DMA: 1860 case PACKET3_CP_DMA: