1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2020-2023 Intel Corporation
6 #ifndef __IVPU_FW_LOG_H__
7 #define __IVPU_FW_LOG_H__
9 #include <linux/types.h>
11 #include <drm/drm_print.h>
15 #define IVPU_FW_LOG_DEFAULT 0
16 #define IVPU_FW_LOG_DEBUG 1
17 #define IVPU_FW_LOG_INFO 2
18 #define IVPU_FW_LOG_WARN 3
19 #define IVPU_FW_LOG_ERROR 4
20 #define IVPU_FW_LOG_FATAL 5
22 extern unsigned int ivpu_log_level
;
24 #define IVPU_FW_VERBOSE_BUFFER_SMALL_SIZE SZ_1M
25 #define IVPU_FW_VERBOSE_BUFFER_LARGE_SIZE SZ_8M
26 #define IVPU_FW_CRITICAL_BUFFER_SIZE SZ_512K
28 void ivpu_fw_log_print(struct ivpu_device
*vdev
, bool only_new_msgs
, struct drm_printer
*p
);
29 void ivpu_fw_log_clear(struct ivpu_device
*vdev
);
31 static inline void ivpu_fw_log_dump(struct ivpu_device
*vdev
)
33 struct drm_printer p
= drm_info_printer(vdev
->drm
.dev
);
35 ivpu_fw_log_print(vdev
, false, &p
);
38 #endif /* __IVPU_FW_LOG_H__ */