<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 11, 2017 at 12:59 PM, Daniel Vetter <span dir="ltr"><<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Apr 11, 2017 at 07:59:18PM +0100, Chris Wilson wrote:<br>
> On Tue, Apr 11, 2017 at 09:02:51AM -0700, Kenneth Graunke wrote:<br>
> > If we have buffers larger than 4GB, then target_offset will need to<br>
> > become a 64-bit value. Delta is only a __u32 though, so we downcast.<br>
> ><br>
> > Suggested by Chris Wilson.<br>
> > ---<br>
> > src/mesa/drivers/dri/i965/<wbr>intel_batchbuffer.c | 4 ++--<br>
> > src/mesa/drivers/dri/i965/<wbr>intel_batchbuffer.h | 2 +-<br>
> > 2 files changed, 3 insertions(+), 3 deletions(-)<br>
> ><br>
> > diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_batchbuffer.c b/src/mesa/drivers/dri/i965/<wbr>intel_batchbuffer.c<br>
> > index 6e4b55cf9ec..abaeb6bcbfe 100644<br>
> > --- a/src/mesa/drivers/dri/i965/<wbr>intel_batchbuffer.c<br>
> > +++ b/src/mesa/drivers/dri/i965/<wbr>intel_batchbuffer.c<br>
> > @@ -734,7 +734,7 @@ brw_batch_references(struct intel_batchbuffer *batch, struct brw_bo *bo)<br>
> > */<br>
> > uint64_t<br>
> > brw_emit_reloc(struct intel_batchbuffer *batch, uint32_t batch_offset,<br>
><br>
> It's batch_offset that's u64 (to match the u64 size). Just delta<br>
> (target_offset) is the oddity being s32 into a potential u64 object. :|<br>
<br>
</span>I think originally (back when we had the userspace mm inspired tree of<br>
objects model) delta was meant for the various flags in the lower 12 bits,<br>
since we never did buffer suballocation. A shame we didn't fix this in<br>
execbuf2, but oh well.</blockquote><div><br></div><div>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. :-)<br></div></div></div></div>