#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/dma-resv.h>
#include <drm/gpu_scheduler.h>
#include <drm/panfrost_drm.h>
#include "panfrost_device.h"
#include "panfrost_devfreq.h"
#include "panfrost_job.h"
#include "panfrost_features.h"
#include "panfrost_issues.h"
#include "panfrost_gem.h"
#include "panfrost_regs.h"
#include "panfrost_gpu.h"
#include "panfrost_mmu.h"
#include "panfrost_dump.h"
#define JOB_TIMEOUT_MS …
#define job_write(dev, reg, data) …
#define job_read(dev, reg) …
struct panfrost_queue_state { … };
struct panfrost_job_slot { … };
static struct panfrost_job *
to_panfrost_job(struct drm_sched_job *sched_job)
{ … }
struct panfrost_fence { … };
static inline struct panfrost_fence *
to_panfrost_fence(struct dma_fence *fence)
{ … }
static const char *panfrost_fence_get_driver_name(struct dma_fence *fence)
{ … }
static const char *panfrost_fence_get_timeline_name(struct dma_fence *fence)
{ … }
static const struct dma_fence_ops panfrost_fence_ops = …;
static struct dma_fence *panfrost_fence_create(struct panfrost_device *pfdev, int js_num)
{ … }
int panfrost_job_get_slot(struct panfrost_job *job)
{ … }
static void panfrost_job_write_affinity(struct panfrost_device *pfdev,
u32 requirements,
int js)
{ … }
static u32
panfrost_get_job_chain_flag(const struct panfrost_job *job)
{ … }
static struct panfrost_job *
panfrost_dequeue_job(struct panfrost_device *pfdev, int slot)
{ … }
static unsigned int
panfrost_enqueue_job(struct panfrost_device *pfdev, int slot,
struct panfrost_job *job)
{ … }
static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
{ … }
static int panfrost_acquire_object_fences(struct drm_gem_object **bos,
int bo_count,
struct drm_sched_job *job)
{ … }
static void panfrost_attach_object_fences(struct drm_gem_object **bos,
int bo_count,
struct dma_fence *fence)
{ … }
int panfrost_job_push(struct panfrost_job *job)
{ … }
static void panfrost_job_cleanup(struct kref *ref)
{ … }
void panfrost_job_put(struct panfrost_job *job)
{ … }
static void panfrost_job_free(struct drm_sched_job *sched_job)
{ … }
static struct dma_fence *panfrost_job_run(struct drm_sched_job *sched_job)
{ … }
void panfrost_job_enable_interrupts(struct panfrost_device *pfdev)
{ … }
void panfrost_job_suspend_irq(struct panfrost_device *pfdev)
{ … }
static void panfrost_job_handle_err(struct panfrost_device *pfdev,
struct panfrost_job *job,
unsigned int js)
{ … }
static void panfrost_job_handle_done(struct panfrost_device *pfdev,
struct panfrost_job *job)
{ … }
static void panfrost_job_handle_irq(struct panfrost_device *pfdev, u32 status)
{ … }
static void panfrost_job_handle_irqs(struct panfrost_device *pfdev)
{ … }
static u32 panfrost_active_slots(struct panfrost_device *pfdev,
u32 *js_state_mask, u32 js_state)
{ … }
static void
panfrost_reset(struct panfrost_device *pfdev,
struct drm_sched_job *bad)
{ … }
static enum drm_gpu_sched_stat panfrost_job_timedout(struct drm_sched_job
*sched_job)
{ … }
static void panfrost_reset_work(struct work_struct *work)
{ … }
static const struct drm_sched_backend_ops panfrost_sched_ops = …;
static irqreturn_t panfrost_job_irq_handler_thread(int irq, void *data)
{ … }
static irqreturn_t panfrost_job_irq_handler(int irq, void *data)
{ … }
int panfrost_job_init(struct panfrost_device *pfdev)
{ … }
void panfrost_job_fini(struct panfrost_device *pfdev)
{ … }
int panfrost_job_open(struct panfrost_file_priv *panfrost_priv)
{ … }
void panfrost_job_close(struct panfrost_file_priv *panfrost_priv)
{ … }
int panfrost_job_is_idle(struct panfrost_device *pfdev)
{ … }