[Mesa-dev] [PATCH] i965: Allow 48-bit addressing on Gen8+.
Kenneth Graunke
kenneth at whitecape.org
Thu Mar 1 01:17:26 UTC 2018
On Wednesday, February 28, 2018 2:21:24 PM PST Emil Velikov wrote:
> On 27 February 2018 at 00:05, Kenneth Graunke <kenneth at whitecape.org> wrote:
>
> > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> > @@ -203,12 +203,23 @@ brw_emit_surface_state(struct brw_context *brw,
> > * FIXME: move to the point of assignment.
> > */
> > assert((aux_offset & 0xfff) == 0);
> > - uint32_t *aux_addr = state + brw->isl_dev.ss.aux_addr_offset;
> > - *aux_addr = brw_state_reloc(&brw->batch,
> > - *surf_offset +
> > - brw->isl_dev.ss.aux_addr_offset,
> > - aux_bo, *aux_addr,
> > - reloc_flags);
> > +
> > + if (devinfo->gen >= 8) {
> > + uint64_t *aux_addr = state + brw->isl_dev.ss.aux_addr_offset;
> > + *aux_addr = brw_state_reloc(&brw->batch,
> > + *surf_offset +
> > + brw->isl_dev.ss.aux_addr_offset,
> > + aux_bo, *aux_addr,
> > + reloc_flags);
> > + } else {
> > + uint32_t *aux_addr = state + brw->isl_dev.ss.aux_addr_offset;
> > + *aux_addr = brw_state_reloc(&brw->batch,
> > + *surf_offset +
> > + brw->isl_dev.ss.aux_addr_offset,
> > + aux_bo, *aux_addr,
> > + reloc_flags);
> > +
> Hmm something looks funky here - is there another patch for
> brw_state_reloc somewhere?
> Currently it's declared as
>
> uint64_t
> brw_state_reloc(struct intel_batchbuffer *batch, uint32_t
> state_offset,
> struct brw_bo *target, uint32_t target_offset,
> unsigned int reloc_flags);
>
> So the new hunk a) caters for *aux_addr hitting an arithmetic
> overflow, or b) stores the full 64bit return value of the function
> only to discard it.
> If a) is the intended behaviour an explicit note might be a good idea.
>
> HTH
> Emil
Pointers are 32-bit on Gen4-7.5 and 64-bit on Gen8+. We changed
brw_state_reloc to return a uint64_t a while back, to handle the new
large size on new platforms. On old platforms we need to write a 32-bit
value, and the high 32-bits of the value returned is 0.
-------------- 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/20180228/58f29171/attachment.sig>
More information about the mesa-dev
mailing list