AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
Cc: christian.koenig-5C7GfCeVMHo@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/2] drm/amdgpu: allocate gart memory when it's required
Date: Tue, 26 Jun 2018 16:32:04 +0800	[thread overview]
Message-ID: <5B31FA04.3050004@amd.com> (raw)
In-Reply-To: <87a2a6dc-e07c-d41f-0691-afa48d0f7925-otUistvHUpPR7s880joybQ@public.gmane.org>

On 06/26/2018 03:42 PM, Michel Dänzer wrote:
> On 2018-06-26 08:00 AM, Junwei Zhang wrote:
>> Instead of calling gart memory on every bo pin,
>> allocates it on demand
>>
>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>
>> [...]
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>> index 036b6f7..0d1c4be 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>> @@ -194,6 +194,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
>>   		goto unreserve;
>>   	}
>>
>> +	r = amdgpu_ttm_alloc_gart(&new_abo->tbo);
>> +	if (unlikely(r != 0)) {
>> +		DRM_ERROR("%p bind failed\n", new_abo);
>> +		goto unreserve;
>> +	}
>
> The error case here also needs to unpin the BO, otherwise we leak the
> pin. I suspect the same issue applies to at least some of the other
> places modified by this patch.

Aha, I felt into the similar error.

will update v2 and find one more unpin issue for bo creation in patch 3.

Jerry
>
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-06-26  8:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26  6:00 [PATCH 1/2] drm/amdgpu: separate gpu address from bo pin Junwei Zhang
     [not found] ` <1529992843-649-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-06-26  6:00   ` [PATCH 2/2] drm/amdgpu: allocate gart memory when it's required Junwei Zhang
     [not found]     ` <1529992843-649-2-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-06-26  7:42       ` Michel Dänzer
     [not found]         ` <87a2a6dc-e07c-d41f-0691-afa48d0f7925-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-26  8:32           ` Zhang, Jerry (Junwei) [this message]
2018-06-26  7:46   ` [PATCH 1/2] drm/amdgpu: separate gpu address from bo pin Michel Dänzer
     [not found]     ` <6c63256a-17d2-ee6e-8b3c-2e0a928aeb84-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-26  8:28       ` Zhang, Jerry (Junwei)
     [not found]         ` <5B31F946.6020404-5C7GfCeVMHo@public.gmane.org>
2018-06-26  8:35           ` Michel Dänzer
     [not found]             ` <eac68f86-a5f9-110e-3970-ee8a8404934a-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-26  8:39               ` Zhang, Jerry (Junwei)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5B31FA04.3050004@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=michel-otUistvHUpPR7s880joybQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox