dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: "Michel Dänzer" <michel@daenzer.net>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/radeon: remove visible vram size limit on bo allocation
Date: Thu, 17 Jul 2014 18:44:54 +0200	[thread overview]
Message-ID: <53C7FD86.8050008@vodafone.de> (raw)
In-Reply-To: <CADnq5_PmAYYxbXW1=d_m56=Qqfxq1k2HSMJ_MG2cDYMS0Byp-w@mail.gmail.com>

Am 17.07.2014 18:29, schrieb Alex Deucher:
> On Thu, Jul 17, 2014 at 10:28 AM, Christian König
> <deathsimple@vodafone.de> wrote:
>> Am 17.07.2014 06:02, schrieb Michel Dänzer:
>>
>>> On 17.07.2014 02:26, Alex Deucher wrote:
>>>> Now that fallback to gtt is fixed for cpu access, we can
>>>> remove this limit.
>>>>
>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>> ---
>>>>    drivers/gpu/drm/radeon/radeon_gem.c | 7 +++++--
>>>>    1 file changed, 5 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c
>>>> b/drivers/gpu/drm/radeon/radeon_gem.c
>>>> index fdd189b..07a13c9 100644
>>>> --- a/drivers/gpu/drm/radeon/radeon_gem.c
>>>> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
>>>> @@ -55,8 +55,11 @@ int radeon_gem_object_create(struct radeon_device
>>>> *rdev, int size,
>>>>                  alignment = PAGE_SIZE;
>>>>          }
>>>>    -     /* maximun bo size is the minimun btw visible vram and gtt size
>>>> */
>>>> -       max_size = min(rdev->mc.visible_vram_size, rdev->mc.gtt_size);
>>>> +       /* Maximum bo size is the gtt size since we use the gtt to handle
>>>> +        * vram to system pool migrations.  We could probably remove this
>>>> +        * check altogether with a little additional work.
>>>> +        */
>>>> +       max_size = rdev->mc.gtt_size;
>>>>          if (size > max_size) {
>>>>                  DRM_DEBUG("Allocation size %dMb bigger than %ldMb
>>>> limit\n",
>>>>                            size >> 20, max_size >> 20);
>>> A BO of size rdev->mc.gtt_size can never actually be bound to GTT,
>>> because we have some pinned BOs in there. I think it's a bit
>>> disingenuous to let userspace allocate a BO that can never actually be
>>> used by the GPU. :)
>>>
>>> The hack I attached to
>>> https://bugs.freedesktop.org/show_bug.cgi?id=78717 has a start for
>>> dealing with that. I was running that patch for a while and didn't
>>> notice any bad effects from it.
>>
>> Haven't looked at the patch yet, but can't we just go over all existing
>> allocations on PIN and figure out the largest free area and save that value?
>> I mean pinning of GTT memory happens rarely and mostly on system startup.
>
> How about that attached patches?

LGTM. My thinking was more complicated, but this should be fine as well.

Patches are: Reviewed-by: Christian König <christian.koenig@amd.com>

Christian.

>
> Alex

  reply	other threads:[~2014-07-17 16:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 17:26 [PATCH] drm/radeon: remove visible vram size limit on bo allocation Alex Deucher
2014-07-16 17:56 ` Christian König
2014-07-17  4:02 ` Michel Dänzer
2014-07-17 14:28   ` Christian König
2014-07-17 15:49     ` Alex Deucher
2014-07-17 16:29     ` Alex Deucher
2014-07-17 16:44       ` Christian König [this message]
2014-07-18  0:41       ` Michel Dänzer
2014-07-18  3:26         ` Alex Deucher
2014-07-18  3:30           ` Michel Dänzer

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=53C7FD86.8050008@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=michel@daenzer.net \
    /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