All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anuj Phogat <anuj.phogat@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Ben Widawsky <ben@bwidawsk.net>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] Set alignment value in drm_intel_add_validate_buffer()
Date: Tue, 23 Jun 2015 16:37:19 -0700	[thread overview]
Message-ID: <CAP5d04H9zX06Jpz8rhnYebL9zC8-RYXZGe_Uo9UtjFngx4pT6w@mail.gmail.com> (raw)
In-Reply-To: <20150622194926.GH25769@phenom.ffwll.local>

On Mon, Jun 22, 2015 at 12:49 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Mon, Jun 22, 2015 at 10:21:46AM -0700, Ben Widawsky wrote:
>> On Fri, Jun 19, 2015 at 03:52:01PM -0700, Anuj Phogat wrote:
>> > +Ben
>> >
>> > On Fri, Apr 10, 2015 at 5:20 PM, Anuj Phogat <anuj.phogat@gmail.com> wrote:
>> > > Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
>> > > ---
>> > >  intel/intel_bufmgr_gem.c | 4 ++--
>> > >  1 file changed, 2 insertions(+), 2 deletions(-)
>> > >
>> > > diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
>> > > index 51d87ae..92701a5 100644
>> > > --- a/intel/intel_bufmgr_gem.c
>> > > +++ b/intel/intel_bufmgr_gem.c
>> > > @@ -459,7 +459,7 @@ drm_intel_add_validate_buffer(drm_intel_bo *bo)
>> > >         bufmgr_gem->exec_objects[index].handle = bo_gem->gem_handle;
>> > >         bufmgr_gem->exec_objects[index].relocation_count = bo_gem->reloc_count;
>> > >         bufmgr_gem->exec_objects[index].relocs_ptr = (uintptr_t) bo_gem->relocs;
>> > > -       bufmgr_gem->exec_objects[index].alignment = 0;
>> > > +       bufmgr_gem->exec_objects[index].alignment = bo->align;
>> > >         bufmgr_gem->exec_objects[index].offset = 0;
>> > >         bufmgr_gem->exec_bos[index] = bo;
>> > >         bufmgr_gem->exec_count++;
>>
>> I'm a bit hesitant about this hunk. We're never going to use this from a mesa
>> that supports Yf/Ys - and going this path wouldn't be expected. Maybe add a
>> warning if bo->align? (From your other patch I don't think it can ever happen,
>> but just to future proof it.
>>
>> > > @@ -501,7 +501,7 @@ drm_intel_add_validate_buffer2(drm_intel_bo *bo, int need_fence)
>> > >         bufmgr_gem->exec2_objects[index].handle = bo_gem->gem_handle;
>> > >         bufmgr_gem->exec2_objects[index].relocation_count = bo_gem->reloc_count;
>> > >         bufmgr_gem->exec2_objects[index].relocs_ptr = (uintptr_t)bo_gem->relocs;
>> > > -       bufmgr_gem->exec2_objects[index].alignment = 0;
>> > > +       bufmgr_gem->exec2_objects[index].alignment = bo->align;
>> > >         bufmgr_gem->exec2_objects[index].offset = 0;
>> > >         bufmgr_gem->exec_bos[index] = bo;
>> > >         bufmgr_gem->exec2_objects[index].flags = 0;
>>
>> I was about to argue this should be part of patch 1, but nope, it should be a
>> separate patch :-)
>>
>> I started digging into whether we have a reasonable way to determine if a bo
>> alignment failed, and fall back to a softer restriction. It didn't seem doable
>> with the current interfaces, but it's something to think about.
>
> On gen2/3 we have a lot more severe alignment problems and there the only
> thing we've done is to take worst-case space loss for alignment into
> account for the execbuf space estimation. But if that failed (and it did
> every now and then) userspace just died. I don't think we need any of this
> for new tiling layouts since they're all uniformly using a 64kb alignment.
> The kernel should be able to pack this very well.
Daniel, I don't know much about how kernel is handling the alignment
constraints for new tiling layouts during relocation. I'm here mostly
relying on the advice from kernel guys. These two patches are based on
your comment on an earlier patch on intel-gfx:
"[PATCH 4/5] Align YS tile base address to 64KB"

Even if the kernel is already packing the new tiling layouts correctly, these
patches are passing some valid alignment value in place of always zero.
Isn't it a harmless change?

> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-06-23 23:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-11  0:20 [PATCH 1/2] i965/gen9: Pass alignment as function parameter in drm_intel_gem_bo_alloc_internal() Anuj Phogat
2015-04-11  0:20 ` [PATCH 2/2] Set alignment value in drm_intel_add_validate_buffer() Anuj Phogat
2015-05-20 21:01   ` Anuj Phogat
2015-06-09 22:00     ` Anuj Phogat
2015-06-19 22:52   ` Anuj Phogat
2015-06-22 17:21     ` Ben Widawsky
2015-06-22 19:49       ` Daniel Vetter
2015-06-23 23:37         ` Anuj Phogat [this message]
2015-06-24  7:33           ` Chris Wilson
2015-06-24  8:22             ` Daniel Vetter
2015-05-20 21:01 ` [PATCH 1/2] i965/gen9: Pass alignment as function parameter in drm_intel_gem_bo_alloc_internal() Anuj Phogat
2015-06-09 21:59   ` Anuj Phogat
2015-06-10  8:47     ` Damien Lespiau
2015-06-19 22:10       ` Anuj Phogat
2015-06-22 11:53         ` Daniel Vetter
2015-06-19 22:50 ` Anuj Phogat
2015-06-22 17:01   ` Ben Widawsky
2015-06-22 18:39     ` Anuj Phogat
2015-06-22 18:47 ` [PATCH v2 " Anuj Phogat
2015-06-22 19:51   ` Daniel Vetter
2015-06-22 20:04     ` Chris Wilson
2015-06-23 23:44       ` Anuj Phogat
2015-06-24  7:28         ` Chris Wilson
2015-06-24  8:24           ` Daniel Vetter
2015-06-25 18:01           ` Ben Widawsky
2015-06-25 18:11             ` Chris Wilson
2015-06-25 19:17               ` Ben Widawsky
2015-06-26 20:43                 ` Anuj Phogat
2015-07-02 19:00 ` [PATCH v3 " Anuj Phogat
2015-07-02 19:21   ` Chris Wilson
2015-07-02 21:44 ` [PATCH v4 " Anuj Phogat
2015-07-03 10:21   ` Chris Wilson

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=CAP5d04H9zX06Jpz8rhnYebL9zC8-RYXZGe_Uo9UtjFngx4pT6w@mail.gmail.com \
    --to=anuj.phogat@gmail.com \
    --cc=ben@bwidawsk.net \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.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.