drm/radeon: use DMA_RESV_USAGE_KERNEL
Always wait for kernel fences before kmap and not only for UVD kmaps. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-7-christian.koenig@amd.com
This commit is contained in:
parent
c35fcfa344
commit
91f0c245dd
@ -219,7 +219,12 @@ int radeon_bo_create(struct radeon_device *rdev,
|
||||
int radeon_bo_kmap(struct radeon_bo *bo, void **ptr)
|
||||
{
|
||||
bool is_iomem;
|
||||
int r;
|
||||
long r;
|
||||
|
||||
r = dma_resv_wait_timeout(bo->tbo.base.resv, DMA_RESV_USAGE_KERNEL,
|
||||
false, MAX_SCHEDULE_TIMEOUT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (bo->kptr) {
|
||||
if (ptr) {
|
||||
|
@ -470,24 +470,16 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
|
||||
int32_t *msg, msg_type, handle;
|
||||
unsigned img_size = 0;
|
||||
void *ptr;
|
||||
long r;
|
||||
int i;
|
||||
int i, r;
|
||||
|
||||
if (offset & 0x3F) {
|
||||
DRM_ERROR("UVD messages must be 64 byte aligned!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = dma_resv_wait_timeout(bo->tbo.base.resv, DMA_RESV_USAGE_WRITE,
|
||||
false, MAX_SCHEDULE_TIMEOUT);
|
||||
if (r <= 0) {
|
||||
DRM_ERROR("Failed waiting for UVD message (%ld)!\n", r);
|
||||
return r ? r : -ETIME;
|
||||
}
|
||||
|
||||
r = radeon_bo_kmap(bo, &ptr);
|
||||
if (r) {
|
||||
DRM_ERROR("Failed mapping the UVD message (%ld)!\n", r);
|
||||
DRM_ERROR("Failed mapping the UVD message (%d)!\n", r);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user