WIP FPC-III support
[linux/fpc-iii.git] / drivers / gpu / drm / panfrost / panfrost_job.h
blobbbd3ba97ff6779c64f02adf9115f2e94860ea51c
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright 2019 Collabora ltd. */
4 #ifndef __PANFROST_JOB_H__
5 #define __PANFROST_JOB_H__
7 #include <uapi/drm/panfrost_drm.h>
8 #include <drm/gpu_scheduler.h>
10 struct panfrost_device;
11 struct panfrost_gem_object;
12 struct panfrost_file_priv;
14 struct panfrost_job {
15 struct drm_sched_job base;
17 struct kref refcount;
19 struct panfrost_device *pfdev;
20 struct panfrost_file_priv *file_priv;
22 /* Optional fences userspace can pass in for the job to depend on. */
23 struct dma_fence **in_fences;
24 u32 in_fence_count;
26 /* Fence to be signaled by IRQ handler when the job is complete. */
27 struct dma_fence *done_fence;
29 __u64 jc;
30 __u32 requirements;
31 __u32 flush_id;
33 /* Exclusive fences we have taken from the BOs to wait for */
34 struct dma_fence **implicit_fences;
35 struct panfrost_gem_mapping **mappings;
36 struct drm_gem_object **bos;
37 u32 bo_count;
39 /* Fence to be signaled by drm-sched once its done with the job */
40 struct dma_fence *render_done_fence;
43 int panfrost_job_init(struct panfrost_device *pfdev);
44 void panfrost_job_fini(struct panfrost_device *pfdev);
45 int panfrost_job_open(struct panfrost_file_priv *panfrost_priv);
46 void panfrost_job_close(struct panfrost_file_priv *panfrost_priv);
47 int panfrost_job_push(struct panfrost_job *job);
48 void panfrost_job_put(struct panfrost_job *job);
49 void panfrost_job_enable_interrupts(struct panfrost_device *pfdev);
50 int panfrost_job_is_idle(struct panfrost_device *pfdev);
52 #endif