[Mesa-dev] [PATCH] i965: Allow 48-bit addressing on Gen8+.
Emil Velikov
emil.l.velikov at gmail.com
Wed Feb 28 22:21:24 UTC 2018
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
More information about the mesa-dev
mailing list