All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Samuel Li <samuel.li-5C7GfCeVMHo@public.gmane.org>
Cc: "Alex Deucher" <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	"Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>,
	"amd-gfx list"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: consider user preference when pinning for SG display
Date: Fri, 18 May 2018 15:16:41 -0400	[thread overview]
Message-ID: <CADnq5_O+y23n9wKdWNbTk8phx34Tt3Cj3NRQ2AqN=qAmYrxppQ@mail.gmail.com> (raw)
In-Reply-To: <2672d966-febd-6132-a785-01cdd04fea15-5C7GfCeVMHo@public.gmane.org>

On Fri, May 18, 2018 at 2:22 PM, Samuel Li <samuel.li@amd.com> wrote:
>
>
> On 2018-05-18 04:21 AM, Michel Dänzer wrote:
>> On 2018-05-17 06:55 PM, Alex Deucher wrote:
>>> If the pin domain is set to GTT | VRAM, look at the preferred domains
>>> for the bo and respect that if it's been set explicitly.
>>>
>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>> ---
>>>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 9 +++++++--
>>>  1 file changed, 7 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>>> index 6a9e46ae7f0a..16192f17653e 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>>> @@ -704,9 +704,14 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
>>>       * See function amdgpu_display_supported_domains()
>>>       */
>>>      if (domain == (AMDGPU_GEM_DOMAIN_VRAM | AMDGPU_GEM_DOMAIN_GTT)) {
>>> -            domain = AMDGPU_GEM_DOMAIN_VRAM;
>>> -            if (adev->gmc.real_vram_size <= AMDGPU_SG_THRESHOLD)
>>> +            if (bo->preferred_domains == AMDGPU_GEM_DOMAIN_VRAM)
>>> +                    domain = AMDGPU_GEM_DOMAIN_VRAM; /* if user really wants vram, respect it */
>>> +            else if (bo->preferred_domains == AMDGPU_GEM_DOMAIN_GTT)
>>> +                    domain = AMDGPU_GEM_DOMAIN_GTT; /* if user really wants gtt, respect it */
>>
>> I'd spell VRAM and GTT in capital letters in the comments.
>>
>>
>>> +            else if (adev->gmc.real_vram_size <= AMDGPU_SG_THRESHOLD)
>>>                      domain = AMDGPU_GEM_DOMAIN_GTT;
>>> +            else
>>> +                    domain = AMDGPU_GEM_DOMAIN_VRAM;
>>>      }
>>
>> Is everything in place to deal with any issues that might occur when
>> flipping between buffers in VRAM and GTT?
>>
> Besides this question, I am also wondering how to deal with the first display buffer created in kernel at amdgpufb_create_pinned_object()?

amdgpufb_create_pinned_object() calls
amdgpu_display_supported_domains() for the initial domain and
amdgpu_gem_object_create() uses that for the preferred domain so it
won't change the behavior there.

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

  parent reply	other threads:[~2018-05-18 19:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 16:55 [PATCH] drm/amdgpu: consider user preference when pinning for SG display Alex Deucher
     [not found] ` <20180517165521.8581-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-05-18  8:21   ` Michel Dänzer
     [not found]     ` <4dc6cde7-fb5c-81c2-6678-8e90e1beb78e-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-18 18:22       ` Samuel Li
     [not found]         ` <2672d966-febd-6132-a785-01cdd04fea15-5C7GfCeVMHo@public.gmane.org>
2018-05-18 19:16           ` Alex Deucher [this message]
     [not found]             ` <CADnq5_O+y23n9wKdWNbTk8phx34Tt3Cj3NRQ2AqN=qAmYrxppQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-05-19 15:59               ` Christian König
     [not found]                 ` <7d9abb21-8cd9-c860-8fd1-5e8a74278a01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-05-22  7:22                   ` Michel Dänzer
     [not found]                     ` <261e78e9-99d7-ce99-9866-701bce2e639a-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-22  9:11                       ` Christian König
     [not found]                         ` <666cebe0-1878-bbbb-e9f9-9fdb645a1cbc-5C7GfCeVMHo@public.gmane.org>
2018-05-22  9:26                           ` Michel Dänzer
     [not found]                             ` <c695e7bd-ea92-3249-dbc4-38ef2cbb3199-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-22 10:04                               ` Christian König
2018-05-18 19:12       ` Alex Deucher
     [not found]         ` <CADnq5_OWqfzjtB2XQ4hQB8fb89G=Bmx4LtJvCEHdCKDjnHZkUQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-05-22 14:24           ` Michel Dänzer
2018-05-18  9:56   ` Christian König

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='CADnq5_O+y23n9wKdWNbTk8phx34Tt3Cj3NRQ2AqN=qAmYrxppQ@mail.gmail.com' \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=michel-otUistvHUpPR7s880joybQ@public.gmane.org \
    --cc=samuel.li-5C7GfCeVMHo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.