From: Jordan Justen Date: Mon, 12 Nov 2018 01:46:33 +0000 (-0800) Subject: i965/genX_state: Add register access functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b85c605a60a80975460a04c8a15af88866ade1b;p=mesa.git i965/genX_state: Add register access functions Signed-off-by: Jordan Justen Reviewed-by: Jason Ekstrand --- diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index 8e3fcbf12ec..6ccf0530342 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -197,6 +197,37 @@ KSP(UNUSED struct brw_context *brw, uint32_t offset) _brw_cmd_pack(cmd)(brw, (void *)_dst, &name), \ _dst = NULL) +#if GEN_GEN >= 7 +MAYBE_UNUSED static void +emit_lrm(struct brw_context *brw, uint32_t reg, struct brw_address addr) +{ + brw_batch_emit(brw, GENX(MI_LOAD_REGISTER_MEM), lrm) { + lrm.RegisterAddress = reg; + lrm.MemoryAddress = addr; + } +} +#endif + +MAYBE_UNUSED static void +emit_lri(struct brw_context *brw, uint32_t reg, uint32_t imm) +{ + brw_batch_emit(brw, GENX(MI_LOAD_REGISTER_IMM), lri) { + lri.RegisterOffset = reg; + lri.DataDWord = imm; + } +} + +#if GEN_IS_HASWELL || GEN_GEN >= 8 +MAYBE_UNUSED static void +emit_lrr(struct brw_context *brw, uint32_t dst, uint32_t src) +{ + brw_batch_emit(brw, GENX(MI_LOAD_REGISTER_REG), lrr) { + lrr.SourceRegisterAddress = src; + lrr.DestinationRegisterAddress = dst; + } +} +#endif + /** * Polygon stipple packet */