On Wednesday, February 28, 2018 2:21:24 PM PST Emil Velikov wrote: > On 27 February 2018 at 00:05, Kenneth Graunke <kenn...@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.
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev