panfrost_job.h (1286B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* Copyright 2019 Collabora ltd. */ 3 4#ifndef __PANFROST_JOB_H__ 5#define __PANFROST_JOB_H__ 6 7#include <uapi/drm/panfrost_drm.h> 8#include <drm/gpu_scheduler.h> 9 10struct panfrost_device; 11struct panfrost_gem_object; 12struct panfrost_file_priv; 13 14struct panfrost_job { 15 struct drm_sched_job base; 16 17 struct kref refcount; 18 19 struct panfrost_device *pfdev; 20 struct panfrost_mmu *mmu; 21 22 /* Fence to be signaled by IRQ handler when the job is complete. */ 23 struct dma_fence *done_fence; 24 25 __u64 jc; 26 __u32 requirements; 27 __u32 flush_id; 28 29 struct panfrost_gem_mapping **mappings; 30 struct drm_gem_object **bos; 31 u32 bo_count; 32 33 /* Fence to be signaled by drm-sched once its done with the job */ 34 struct dma_fence *render_done_fence; 35}; 36 37int panfrost_job_init(struct panfrost_device *pfdev); 38void panfrost_job_fini(struct panfrost_device *pfdev); 39int panfrost_job_open(struct panfrost_file_priv *panfrost_priv); 40void panfrost_job_close(struct panfrost_file_priv *panfrost_priv); 41int panfrost_job_get_slot(struct panfrost_job *job); 42int panfrost_job_push(struct panfrost_job *job); 43void panfrost_job_put(struct panfrost_job *job); 44void panfrost_job_enable_interrupts(struct panfrost_device *pfdev); 45int panfrost_job_is_idle(struct panfrost_device *pfdev); 46 47#endif