ivpu_fw_log.h 925 B

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