[igt-dev] [PATCH i-g-t v8 1/4] lib/intel_batchbuffer: Extend intel_bb

Chris Wilson chris at chris-wilson.co.uk
Mon Jun 29 17:42:32 UTC 2020


Quoting Zbigniew Kempczyński (2020-06-29 11:57:32)
> +#define CMD_POLY_STIPPLE_OFFSET       0x7906
> +uint32_t intel_bb_out_flush(struct intel_bb *ibb)
> +{
> +       if (intel_bb_offset(ibb) == 0)
> +               return 0;
> +
> +       if (ibb->gen == 5) {
> +               intel_bb_out(ibb, CMD_POLY_STIPPLE_OFFSET << 16);
> +               intel_bb_out(ibb, 0);
> +       }
> +
> +       /* Round batchbuffer usage to 2 DWORDs. */
> +       intel_bb_ptr_align(ibb, 8);
> +
> +       if (ibb->gen <= 4) {
> +               intel_bb_out(ibb, MI_FLUSH);
> +       } else {
> +               intel_bb_out(ibb, MI_FLUSH_DW | 2);
> +               intel_bb_out(ibb, 0);
> +               intel_bb_out(ibb, 0);
> +               intel_bb_out(ibb, 0);
> +       }

You don't need to flush before the end of the batch, just if we are
going to read back the writes within the same batch.

And fwiw,
MI_FLUSH_DW is gen6+, [has to be on blt].
Length (3 - 2) on gen6+, (4 - 2) on gen8+.
-Chris


More information about the igt-dev mailing list