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

Kenneth Graunke kenneth at whitecape.org
Tue Apr 11 21:30:20 UTC 2017


On Tuesday, April 11, 2017 11:59:18 AM PDT 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. :|
> -Chris

Ah.  There's no point in expanding batch_offset, though, since
the batchbuffer is only 32K, and would certainly never be >= 4G :)

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170411/711690d5/attachment.sig>


More information about the mesa-dev mailing list