xref: /linux/drivers/gpu/drm/xe/xe_guc_capture.h (revision 8bfc496327ce0f3bd02445048e3a70cc97accc6d)
19c8c7a7eSZhanjun Dong /* SPDX-License-Identifier: MIT */
29c8c7a7eSZhanjun Dong /*
39c8c7a7eSZhanjun Dong  * Copyright © 2021-2024 Intel Corporation
49c8c7a7eSZhanjun Dong  */
59c8c7a7eSZhanjun Dong 
69c8c7a7eSZhanjun Dong #ifndef _XE_GUC_CAPTURE_H
79c8c7a7eSZhanjun Dong #define _XE_GUC_CAPTURE_H
89c8c7a7eSZhanjun Dong 
99c8c7a7eSZhanjun Dong #include <linux/types.h>
109c8c7a7eSZhanjun Dong #include "abi/guc_capture_abi.h"
119c8c7a7eSZhanjun Dong #include "xe_guc.h"
129c8c7a7eSZhanjun Dong #include "xe_guc_fwif.h"
139c8c7a7eSZhanjun Dong 
149c8c7a7eSZhanjun Dong struct xe_guc;
159c8c7a7eSZhanjun Dong 
169c8c7a7eSZhanjun Dong static inline enum guc_capture_list_class_type xe_guc_class_to_capture_class(u16 class)
179c8c7a7eSZhanjun Dong {
189c8c7a7eSZhanjun Dong 	switch (class) {
199c8c7a7eSZhanjun Dong 	case GUC_RENDER_CLASS:
209c8c7a7eSZhanjun Dong 	case GUC_COMPUTE_CLASS:
219c8c7a7eSZhanjun Dong 		return GUC_CAPTURE_LIST_CLASS_RENDER_COMPUTE;
229c8c7a7eSZhanjun Dong 	case GUC_GSC_OTHER_CLASS:
239c8c7a7eSZhanjun Dong 		return GUC_CAPTURE_LIST_CLASS_GSC_OTHER;
249c8c7a7eSZhanjun Dong 	case GUC_VIDEO_CLASS:
259c8c7a7eSZhanjun Dong 	case GUC_VIDEOENHANCE_CLASS:
269c8c7a7eSZhanjun Dong 	case GUC_BLITTER_CLASS:
279c8c7a7eSZhanjun Dong 		return class;
289c8c7a7eSZhanjun Dong 	default:
299c8c7a7eSZhanjun Dong 		XE_WARN_ON(class);
309c8c7a7eSZhanjun Dong 		return GUC_CAPTURE_LIST_CLASS_MAX;
319c8c7a7eSZhanjun Dong 	}
329c8c7a7eSZhanjun Dong }
339c8c7a7eSZhanjun Dong 
349c8c7a7eSZhanjun Dong static inline enum guc_capture_list_class_type
359c8c7a7eSZhanjun Dong xe_engine_class_to_guc_capture_class(enum xe_engine_class class)
369c8c7a7eSZhanjun Dong {
379c8c7a7eSZhanjun Dong 	return xe_guc_class_to_capture_class(xe_engine_class_to_guc_class(class));
389c8c7a7eSZhanjun Dong }
399c8c7a7eSZhanjun Dong 
40*8bfc4963SZhanjun Dong void xe_guc_capture_process(struct xe_guc *guc);
419c8c7a7eSZhanjun Dong int xe_guc_capture_getlist(struct xe_guc *guc, u32 owner, u32 type,
429c8c7a7eSZhanjun Dong 			   enum guc_capture_list_class_type capture_class, void **outptr);
439c8c7a7eSZhanjun Dong int xe_guc_capture_getlistsize(struct xe_guc *guc, u32 owner, u32 type,
449c8c7a7eSZhanjun Dong 			       enum guc_capture_list_class_type capture_class, size_t *size);
459c8c7a7eSZhanjun Dong int xe_guc_capture_getnullheader(struct xe_guc *guc, void **outptr, size_t *size);
469c8c7a7eSZhanjun Dong size_t xe_guc_capture_ads_input_worst_size(struct xe_guc *guc);
47b170d696SZhanjun Dong void xe_guc_capture_steered_list_init(struct xe_guc *guc);
489c8c7a7eSZhanjun Dong int xe_guc_capture_init(struct xe_guc *guc);
499c8c7a7eSZhanjun Dong 
509c8c7a7eSZhanjun Dong #endif
51