[PATCH 08/10] drm/xe/kunit: Allow to replace xe_guc_ct_send_recv() with stub

Piotr Piórkowski piotr.piorkowski at intel.com
Fri Dec 29 21:15:28 UTC 2023


Michal Wajdeczko <michal.wajdeczko at intel.com> wrote on czw [2023-gru-28 00:58:36 +0100]:
> We want to use replacement functions in upcoming kunit tests.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_guc_ct.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index 4cde93c18a2d..8f208267ffc6 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -9,6 +9,8 @@
>  #include <linux/circ_buf.h>
>  #include <linux/delay.h>
>  
> +#include <kunit/static_stub.h>
> +
>  #include <drm/drm_managed.h>
>  
>  #include "abi/guc_actions_abi.h"
> @@ -782,6 +784,7 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
>  int xe_guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
>  			u32 *response_buffer)
>  {
> +	KUNIT_STATIC_STUB_REDIRECT(xe_guc_ct_send_recv, ct, action, len, response_buffer);
>  	return guc_ct_send_recv(ct, action, len, response_buffer, false);
>  }
>  
> -- 
> 2.25.1
> 

-- 


More information about the Intel-xe mailing list