All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Dave Airlie <airlied@gmail.com>
Cc: "Michel Dänzer" <michel@daenzer.net>,
	jglisse@redhat.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/radeon/kms: forbid big bo allocation (fdo 31708) v3
Date: Thu, 9 Dec 2010 07:57:31 -0500	[thread overview]
Message-ID: <AANLkTikge-4VusJH_AXD+SSpcwN-3kGpwX+PqV9Lcib+@mail.gmail.com> (raw)
In-Reply-To: <AANLkTik7yx270mkP8PYMzQbJhuUSh4k_2eepu+rCJw+z@mail.gmail.com>

2010/12/9 Dave Airlie <airlied@gmail.com>:
> 2010/12/9 Michel Dänzer <michel@daenzer.net>:
>> On Fre, 2010-12-03 at 16:38 -0500, jglisse@redhat.com wrote:
>>> From: Jerome Glisse <jglisse@redhat.com>
>>>
>>> Forbid allocating buffer bigger than visible VRAM or GTT, also
>>> properly set lpfn field.
>>>
>>> v2 - use max macro
>>>    - silence warning
>>> v3 - don't explicitly set range limit
>>>    - use min macro
>>>
>>> Cc: stable <stable@kernel.org>
>>>
>>> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
>>> ---
>>>  drivers/gpu/drm/radeon/radeon_object.c |   13 +++++++++++--
>>>  1 files changed, 11 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
>>> index 1d06774..a598d00 100644
>>> --- a/drivers/gpu/drm/radeon/radeon_object.c
>>> +++ b/drivers/gpu/drm/radeon/radeon_object.c
>>> @@ -91,7 +91,8 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
>>>  {
>>>       struct radeon_bo *bo;
>>>       enum ttm_bo_type type;
>>> -     int page_align = roundup(byte_align, PAGE_SIZE) >> PAGE_SHIFT;
>>> +     unsigned long page_align = roundup(byte_align, PAGE_SIZE) >> PAGE_SHIFT;
>>> +     unsigned long max_size = 0;
>>
>> The initialization of max_size is superfluous.
>>
>>
>>> @@ -104,6 +105,14 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
>>>       }
>>>       *bo_ptr = NULL;
>>>
>>> +     /* maximun bo size is the minimun btw visible vram and gtt size */
>>> +     max_size = min(rdev->mc.visible_vram_size, rdev->mc.gtt_size);
>>> +     if ((page_align << PAGE_SHIFT) >= max_size) {
>>> +             printk(KERN_WARNING "%s:%d alloc size %ldM bigger than %ldMb limit\n",
>>> +                     __func__, __LINE__, page_align  >> (20 - PAGE_SHIFT), max_size >> 20);
>>> +             return -ENOMEM;
>>> +     }
>>
>> Still not sure this simple minimum is quite the right solution... e.g.
>> if GTT is larger than visible VRAM, what's the problem with having a BO
>> that fits in GTT but not in visible VRAM? On systems with 8 MB of VRAM,
>> this will effectively limit the maximum texture size to 2048x1024.
>
> Just wondering if such a card exists, the only 8MB cards I know are
> pre-r100, I think a 16MB M6 is the lowest one I can find.
>

I have an 8 MB M6.

Alex


> and yeah no cc'ing just leave it in the patch, though Itihnk git send
> email can do it automagically.
>
> Dave.
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

      parent reply	other threads:[~2010-12-09 12:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 21:38 [PATCH] drm/radeon/kms: forbid big bo allocation (fdo 31708) v3 jglisse
2010-12-09  9:43 ` Michel Dänzer
2010-12-09 10:19   ` Dave Airlie
2010-12-09 10:26     ` Michel Dänzer
2010-12-09 12:57     ` Alex Deucher [this message]

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=AANLkTikge-4VusJH_AXD+SSpcwN-3kGpwX+PqV9Lcib+@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jglisse@redhat.com \
    --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 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.