[PATCH 3/3] drm/amdgpu: further mitigate workaround for i915
Alex Deucher
alexdeucher at gmail.com
Mon Mar 5 18:23:03 UTC 2018
On Mon, Mar 5, 2018 at 7:00 AM, Christian König
<ckoenig.leichtzumerken at gmail.com> wrote:
> Disable the workaround on imported BOs as well.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
Series is:
Reviewed-by: Alex Deucher <alexdeucher at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
> index 8ce74a1d9966..fb66b45548d3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
> @@ -107,12 +107,18 @@ amdgpu_gem_prime_import_sg_table(struct drm_device *dev,
> ww_mutex_lock(&resv->lock, NULL);
> ret = amdgpu_bo_create(adev, attach->dmabuf->size, PAGE_SIZE, false,
> AMDGPU_GEM_DOMAIN_GTT, 0, sg, resv, &bo);
> - ww_mutex_unlock(&resv->lock);
> if (ret)
> - return ERR_PTR(ret);
> + goto error;
> +
> + if (attach->dmabuf->ops != &amdgpu_dmabuf_ops)
> + bo->prime_shared_count = 1;
>
> - bo->prime_shared_count = 1;
> + ww_mutex_unlock(&resv->lock);
> return &bo->gem_base;
> +
> +error:
> + ww_mutex_unlock(&resv->lock);
> + return ERR_PTR(ret);
> }
>
> static int amdgpu_gem_map_attach(struct dma_buf *dma_buf,
> --
> 2.14.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list