public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v2 2/4] lib/intel_batchbuffer: add bb reset
Date: Fri, 5 Jun 2020 07:40:50 +0200	[thread overview]
Message-ID: <20200605054050.GA3845@zkempczy-mobl2> (raw)
In-Reply-To: <159128326923.22562.7110812910455946075@build.alporthouse.com>

On Thu, Jun 04, 2020 at 04:07:49PM +0100, Chris Wilson wrote:
> Quoting Zbigniew Kempczyński (2020-06-04 11:03:51)
> > +/**
> > + * intel_bb_object_offset_to_buf:
> > + * @ibb: pointer to intel_bb
> > + * @buf: buffer we want to store last exec offset and context id
> > + *
> > + * Copy object offset used in the batch to intel_buf to allow caller prepare
> > + * other batch likely without relocations.
> > + */
> > +bool intel_bb_object_offset_to_buf(struct intel_bb *ibb, struct intel_buf *buf)
> > +{
> > +       struct drm_i915_gem_exec_object2 object = { .handle = buf->handle };
> > +       struct drm_i915_gem_exec_object2 **found;
> > +
> > +       igt_assert(ibb);
> > +       igt_assert(buf);
> > +
> > +       found = tfind((void *) &object, &ibb->root, __compare_objects);
> > +       if (!found) {
> > +               buf->addr.offset = 0;
> > +               buf->addr.ctx = 0;
> > +
> > +               return false;
> > +       }
> > +
> > +       buf->addr.offset = (*found)->offset;
> > +       buf->addr.ctx = ibb->ctx;
> 
> Ok, so it's tracking ctx so that we can return the right offset when the
> buffer is used by multiple contexts. But ctx is never compared in the
> lookup?

Do you think should I add such multictx tracking to the intel_bb? It will
require additional collecting tree (current one is an index tree over 
objects allocated, so for caching ctx/address new one is necessary).
I assumed intel_bb_objects_offset_to_buf() is enough to provide the user
ability to collect the addresses on its own (if it really requires that).

--
Zbigniew
 
> 
> [There's also the problem of uint32_t ctx reuse, except there it can
> probably happily inherit the old addr.]
> -Chris

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-06-05  5:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 10:03 [igt-dev] [PATCH i-g-t v2 0/4] Remove libdrm from media_spin Zbigniew Kempczyński
2020-06-04 10:03 ` [igt-dev] [PATCH i-g-t v2 1/4] lib/intel_bufops: add fields for keeping offset and context Zbigniew Kempczyński
2020-06-04 10:03 ` [igt-dev] [PATCH i-g-t v2 2/4] lib/intel_batchbuffer: add bb reset Zbigniew Kempczyński
2020-06-04 15:07   ` Chris Wilson
2020-06-05  5:40     ` Zbigniew Kempczyński [this message]
2020-06-05 14:17       ` Chris Wilson
2020-06-04 10:10 ` [igt-dev] [PATCH i-g-t v2 3/4] tests/i915_pm_sseu: remove libdrm dependency Zbigniew Kempczyński
2020-06-04 10:10 ` [igt-dev] [PATCH i-g-t v2 4/4] HAX: run gpgpu|media_fill and i915_pm_sseu in BAT only Zbigniew Kempczyński
2020-06-04 11:04 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove libdrm from media_spin Patchwork
2020-06-04 14:56 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-06-04 18:17 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove libdrm from media_spin (rev2) Patchwork
2020-06-04 21:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-06-04  9:16 [igt-dev] [PATCH i-g-t v2 0/4] Remove libdrm from media_spin Zbigniew Kempczyński
2020-06-04  9:16 ` [igt-dev] [PATCH i-g-t v2 2/4] lib/intel_batchbuffer: add bb reset Zbigniew Kempczyński
2020-06-04  9:13 [igt-dev] [PATCH i-g-t v2 0/4] Remove libdrm from media_spin Zbigniew Kempczyński
2020-06-04  9:13 ` [igt-dev] [PATCH i-g-t v2 2/4] lib/intel_batchbuffer: add bb reset Zbigniew Kempczyński

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=20200605054050.GA3845@zkempczy-mobl2 \
    --to=zbigniew.kempczynski@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox