ethosu_job.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
  2. /* Copyright 2024-2025 Tomeu Vizoso <tomeu@tomeuvizoso.net> */
  3. /* Copyright 2025 Arm, Ltd. */
  4. #ifndef __ETHOSU_JOB_H__
  5. #define __ETHOSU_JOB_H__
  6. #include <linux/kref.h>
  7. #include <drm/gpu_scheduler.h>
  8. struct ethosu_device;
  9. struct ethosu_file_priv;
  10. struct ethosu_job {
  11. struct drm_sched_job base;
  12. struct ethosu_device *dev;
  13. struct drm_gem_object *cmd_bo;
  14. struct drm_gem_object *region_bo[NPU_BASEP_REGION_MAX];
  15. u8 region_bo_num[NPU_BASEP_REGION_MAX];
  16. u8 region_cnt;
  17. u32 sram_size;
  18. /* Fence to be signaled by drm-sched once its done with the job */
  19. struct dma_fence *inference_done_fence;
  20. /* Fence to be signaled by IRQ handler when the job is complete. */
  21. struct dma_fence *done_fence;
  22. struct kref refcount;
  23. };
  24. int ethosu_ioctl_submit(struct drm_device *dev, void *data, struct drm_file *file);
  25. int ethosu_job_init(struct ethosu_device *dev);
  26. void ethosu_job_fini(struct ethosu_device *dev);
  27. int ethosu_job_open(struct ethosu_file_priv *ethosu_priv);
  28. void ethosu_job_close(struct ethosu_file_priv *ethosu_priv);
  29. #endif