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

Commit a92c7d55 authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/radeon: cleanup UVD address checks



Message and feedback buffers must be at start of
VRAM, not at start of address space.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent abf1457b
Loading
Loading
Loading
Loading
+14 −12
Original line number Original line Diff line number Diff line
@@ -415,24 +415,26 @@ static int radeon_uvd_cs_reloc(struct radeon_cs_parser *p,
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (cmd == 0) {
	if ((start >> 28) != (end >> 28)) {
		if (end & 0xFFFFFFFFF0000000) {
		DRM_ERROR("reloc %LX-%LX crossing 256MB boundary!\n",
			DRM_ERROR("msg buffer %LX-%LX out of 256MB segment!\n",
			  start, end);
		return -EINVAL;
	}

	/* TODO: is this still necessary on NI+ ? */
	if ((cmd == 0 || cmd == 0x3) &&
	    (start >> 28) != (p->rdev->uvd.gpu_addr >> 28)) {
		DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n",
			  start, end);
			  start, end);
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (cmd == 0) {
		r = radeon_uvd_cs_msg(p, reloc->robj, offset, buf_sizes);
		r = radeon_uvd_cs_msg(p, reloc->robj, offset, buf_sizes);
		if (r)
		if (r)
			return r;
			return r;
	}
	}


	if ((start & 0xFFFFFFFFF0000000) != (end & 0xFFFFFFFFF0000000)) {
		DRM_ERROR("reloc %LX-%LX crossing 256MB boundary!\n",
			  start, end);
		return -EINVAL;
	}

	return 0;
	return 0;
}
}