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

Daniel Vetter daniel at ffwll.ch
Tue Apr 11 19:59:16 UTC 2017


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.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the mesa-dev mailing list