Re: [PATCH v5 1/6] drm/xe/guc: Allow to replace xe_guc_mmio_send_recv() with KUNIT stub
Michal Wajdeczko <[email protected]>
| Newsgroups | org.freedesktop.lists.intel-xe |
|---|---|
| Message-ID | <[email protected]> |
On 8/10/2026 12:14 PM, Satyanarayana K V P wrote: > Allow to replace xe_guc_mmio_send_recv() with the stub so we can > exercise more code paths on the fake xe device during kunit tests. > > Signed-off-by: Satyanarayana K V P <[email protected]> > Cc: Michal Wajdeczko <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> > --- > V4 -> V5: > - Fixed review comments (Michal W). > --- > drivers/gpu/drm/xe/xe_guc.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c > index 4286bd05c686..82e67e9219bd 100644 > --- a/drivers/gpu/drm/xe/xe_guc.c > +++ b/drivers/gpu/drm/xe/xe_guc.c > @@ -6,6 +6,8 @@ > #include "xe_guc.h" > > #include <linux/iopoll.h> > +#include <kunit/static_stub.h> > + > #include <drm/drm_managed.h> > > #include <generated/xe_wa_oob.h> > @@ -1509,6 +1511,9 @@ int xe_guc_mmio_send_recv(struct xe_guc *guc, const u32 *request, > int ret; > int i; > > + KUNIT_STATIC_STUB_REDIRECT(xe_guc_mmio_send_recv, guc, request, len, > + response_buf); > + > BUILD_BUG_ON(VF_SW_FLAG_COUNT != MED_VF_SW_FLAG_COUNT); > > xe_assert(xe, len);