diff --git a/src/asahi/libagx/libagx_dgc.h b/src/asahi/libagx/libagx_dgc.h index 9595cb4268b..a7a8f5d42e4 100644 --- a/src/asahi/libagx/libagx_dgc.h +++ b/src/asahi/libagx/libagx_dgc.h @@ -230,6 +230,12 @@ agx_vdm_jump(global_ uint32_t *out, uint64_t target) return out; } +static inline global_ uint32_t * +agx_cs_jump(global_ uint32_t *out, uint64_t target, bool vdm) +{ + return vdm ? agx_vdm_jump(out, target) : agx_cdm_jump(out, target); +} + static inline global_ uint32_t * agx_cdm_call(global_ uint32_t *out, uint64_t target) { diff --git a/src/asahi/vulkan/hk_cmd_buffer.c b/src/asahi/vulkan/hk_cmd_buffer.c index c2abbb90b36..3b334ec11d7 100644 --- a/src/asahi/vulkan/hk_cmd_buffer.c +++ b/src/asahi/vulkan/hk_cmd_buffer.c @@ -812,11 +812,7 @@ hk_ensure_cs_has_space(struct hk_cmd_buffer *cmd, struct hk_cs *cs, struct agx_ptr T = hk_pool_alloc(cmd, size, 256); /* Jump from the old control stream to the new control stream */ - if (vdm) { - agx_vdm_jump(cs->current, T.gpu); - } else { - agx_cdm_jump(cs->current, T.gpu); - } + agx_cs_jump(cs->current, T.gpu, vdm); /* Swap out the control stream */ cs->current = T.cpu; diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 71e139976f4..eaa6950fe39 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -3869,17 +3869,7 @@ agx_ensure_cmdbuf_has_space(struct agx_batch *batch, struct agx_encoder *enc, struct agx_ptr T = agx_pool_alloc_aligned(&batch->pool, size, 256); /* Jump from the old command buffer to the new command buffer */ - if (vdm) { - agx_pack(enc->current, VDM_STREAM_LINK, cfg) { - cfg.target_lo = T.gpu & BITFIELD_MASK(32); - cfg.target_hi = T.gpu >> 32; - } - } else { - agx_pack(enc->current, CDM_STREAM_LINK, cfg) { - cfg.target_lo = T.gpu & BITFIELD_MASK(32); - cfg.target_hi = T.gpu >> 32; - } - } + agx_cs_jump((uint32_t *)enc->current, T.gpu, vdm); /* Swap out the command buffer */ enc->current = T.cpu;