diff mbox

[5/5] drm/amdgpu: validate duplicates first

Message ID 1452522922-2614-5-git-send-email-deathsimple@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König Jan. 11, 2016, 2:35 p.m. UTC
From: Christian König <christian.koenig@amd.com>

Most VM BOs end up in the duplicates list, validate it
first make -ENOMEM less likely.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <David1.Zhou@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Deucher Jan. 13, 2016, 5:23 p.m. UTC | #1
On Mon, Jan 11, 2016 at 9:35 AM, Christian König
<deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> Most VM BOs end up in the duplicates list, validate it
> first make -ENOMEM less likely.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Reviewed-by: Chunming Zhou <David1.Zhou@amd.com>

Applied the series.  thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 1fffc33..6f89f8e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -421,11 +421,11 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p)
>
>         amdgpu_vm_get_pt_bos(&fpriv->vm, &duplicates);
>
> -       r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated);
> +       r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &duplicates);
>         if (r)
>                 goto error_validate;
>
> -       r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &duplicates);
> +       r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated);
>
>  error_validate:
>         if (r) {
> --
> 2.5.0
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 1fffc33..6f89f8e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -421,11 +421,11 @@  static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p)
 
 	amdgpu_vm_get_pt_bos(&fpriv->vm, &duplicates);
 
-	r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated);
+	r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &duplicates);
 	if (r)
 		goto error_validate;
 
-	r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &duplicates);
+	r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated);
 
 error_validate:
 	if (r) {