[Mesa-dev] [PATCH 8/8] i965/drm: Make brw_emit_reloc take a uint64_t target_offset.

Jason Ekstrand jason at jlekstrand.net
Tue Apr 11 21:57:57 UTC 2017


On Tue, Apr 11, 2017 at 12:59 PM, Daniel Vetter <daniel at ffwll.ch> wrote:

> On Tue, Apr 11, 2017 at 07:59:18PM +0100, Chris Wilson wrote:
> > On Tue, Apr 11, 2017 at 09:02:51AM -0700, Kenneth Graunke wrote:
> > > If we have buffers larger than 4GB, then target_offset will need to
> > > become a 64-bit value.  Delta is only a __u32 though, so we downcast.
> > >
> > > Suggested by Chris Wilson.
> > > ---
> > >  src/mesa/drivers/dri/i965/intel_batchbuffer.c | 4 ++--
> > >  src/mesa/drivers/dri/i965/intel_batchbuffer.h | 2 +-
> > >  2 files changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> > > index 6e4b55cf9ec..abaeb6bcbfe 100644
> > > --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> > > +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> > > @@ -734,7 +734,7 @@ brw_batch_references(struct intel_batchbuffer
> *batch, struct brw_bo *bo)
> > >   */
> > >  uint64_t
> > >  brw_emit_reloc(struct intel_batchbuffer *batch, uint32_t batch_offset,
> >
> > It's batch_offset that's u64 (to match the u64 size). Just delta
> > (target_offset) is the oddity being s32 into a potential u64 object. :|
>
> I think originally (back when we had the userspace mm inspired tree of
> objects model) delta was meant for the various flags in the lower 12 bits,
> since we never did buffer suballocation. A shame we didn't fix this in
> execbuf2, but oh well.


Yeah, it's a bit unfortunate.  See also the Vulkan patch I sent out today.
I'm not sure if it's actually worth trying to fix or if we're better off
just doing the work in userspace to stop doing relocations all together.
I'm inclined towards that option. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170411/c8dbf737/attachment.html>


More information about the mesa-dev mailing list