[AMD Official Use Only - General] >Patch 3 assigns preempt_ib in gfx_v9_0_sw_ring_funcs_gfx, but not in gfx_v9_0_ring_funcs_gfx. mux->real_ring in amdgpu_mcbp_trigger_preempt presumably uses the latter, which would explain why amdgpu_ring_preempt_ib ends up dereferencing a NULL pointer. It's weird the assignment should be in gfx_v9_0_ring_funcs_gfx instead of gfx_v9_0_sw_ring_funcs_gfx. [PATCH 3/5] drm/amdgpu: Modify unmap_queue format for gfx9 (v4): @@ -6925,6 +7047,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = { .emit_cntxcntl = gfx_v9_ring_emit_cntxcntl, .init_cond_exec = gfx_v9_0_ring_emit_init_cond_exec, .patch_cond_exec = gfx_v9_0_ring_emit_patch_cond_exec, + .preempt_ib = gfx_v9_0_ring_preempt_ib, .emit_frame_cntl = gfx_v9_0_ring_emit_frame_cntl, .emit_wreg = gfx_v9_0_ring_emit_wreg, .emit_reg_wait = gfx_v9_0_ring_emit_reg_wait, diff --git a/drivers/gpu/drm/amd/amdgpu/soc15d.h b/drivers/gpu/drm/amd/amdgpu/soc15d.h Thanks, Jiadong -----Original Message----- From: Michel Dänzer <michel@xxxxxxxxxxx> Sent: Tuesday, November 1, 2022 5:11 PM To: Zhu, Jiadong <Jiadong.Zhu@xxxxxxx> Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Andrey Grodzovsky <Andrey.Grodzovsky@xxxxxxx>; Huang, Ray <Ray.Huang@xxxxxxx>; Koenig, Christian <Christian.Koenig@xxxxxxx>; Tuikov, Luben <Luben.Tuikov@xxxxxxx> Subject: Re: [PATCH 4/5] drm/amdgpu: MCBP based on DRM scheduler (v8) [ Please don't top-post ] On 2022-11-01 02:04, Zhu, Jiadong wrote: > > It is a macro defined in amdgpu_ring.h, calling function pointer preempt_ib directly: > #define amdgpu_ring_preempt_ib(r) (r)->funcs->preempt_ib(r) > > The real ring's hook is assigned in gfx_v9_0.c: > static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = { ... > .preempt_ib = gfx_v9_0_ring_preempt_ib, //please have a check this line existed. > ... > } Patch 3 assigns preempt_ib in gfx_v9_0_sw_ring_funcs_gfx, but not in gfx_v9_0_ring_funcs_gfx. mux->real_ring in amdgpu_mcbp_trigger_preempt presumably uses the latter, which would explain why amdgpu_ring_preempt_ib ends up dereferencing a NULL pointer. > Here is the eglinfo on my board, I have once built mesa component > (22.3.0-devel), which may update the libEGL_mesa.so Looks like EGL_IMG_context_priority is supported (it would be interesting to see if it's listed for the Device Platform as well, but there's probably no reason to assume otherwise). Strange that you can't reproduce then. -- Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=05%7C01%7CJiadong.Zhu%40amd.com%7C89dc4843c4674e7c706a08dabbe91326%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C638028906976834499%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8Ow2Lx890iYmhsih0ZFqgOYg9ciGz%2FjJLF3p7hhAtc4%3D&reserved=0 Libre software enthusiast | Mesa and Xwayland developer