From 1b85c605a60a80975460a04c8a15af88866ade1b Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sun, 11 Nov 2018 17:46:33 -0800 Subject: [PATCH] i965/genX_state: Add register access functions Signed-off-by: Jordan Justen Reviewed-by: Jason Ekstrand --- src/mesa/drivers/dri/i965/genX_state_upload.c | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) 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 */ -- 2.30.2