Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84ef4c12 authored by Dave Airlie's avatar Dave Airlie Committed by Alex Deucher
Browse files

drm/radeon: add cayman VM support for append packet.



This adds support for SET_APPEND_CNT packet3 to the VM paths.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent adcec288
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -3483,6 +3483,27 @@ static int evergreen_vm_packet3_check(struct radeon_device *rdev,
			}
		}
		break;
	case PACKET3_SET_APPEND_CNT: {
		uint32_t areg;
		uint32_t allowed_reg_base;

		if (pkt->count != 2) {
			DRM_ERROR("bad SET_APPEND_CNT (invalid count)\n");
			return -EINVAL;
		}

		allowed_reg_base = GDS_APPEND_COUNT_0;
		allowed_reg_base -= PACKET3_SET_CONTEXT_REG_START;
		allowed_reg_base >>= 2;

		areg = idx_value >> 16;
		if (areg < allowed_reg_base || areg > (allowed_reg_base + 11)) {
			DRM_ERROR("forbidden register for append cnt 0x%08x at %d\n",
				  areg, idx);
			return -EINVAL;
		}
		break;
	}
	default:
		return -EINVAL;
	}