[PATCH 2/3] drm/amdgpu: Remove VRAM from shared bo domains.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 18, 2018 at 5:51 PM, Samuel Li <Samuel.Li at amd.com> wrote:
> Signed-off-by: Samuel Li <Samuel.Li at amd.com>

Please add a commit message.  E.g.,

This fixes a potential regression introduced when SG display support
was initially added which could lead to a shared
buffer ending up pinned in vram.  Check if GTT is allowed in the
domain and use that if so, otherwise return an error.

With that fixed:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 24f582c..8dc782a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -689,8 +689,12 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
>                 return -EINVAL;
>
>         /* A shared bo cannot be migrated to VRAM */
> -       if (bo->prime_shared_count && (domain == AMDGPU_GEM_DOMAIN_VRAM))
> -               return -EINVAL;
> +       if (bo->prime_shared_count) {
> +               if (domain & AMDGPU_GEM_DOMAIN_GTT)
> +                       domain = AMDGPU_GEM_DOMAIN_GTT;
> +               else
> +                       return -EINVAL;
> +       }
>
>         if (bo->pin_count) {
>                 uint32_t mem_type = bo->tbo.mem.mem_type;
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux