linux/drivers/gpu/drm/lima/lima_sched.h

/* SPDX-License-Identifier: GPL-2.0 OR MIT */
/* Copyright 2017-2019 Qiang Yu <[email protected]> */

#ifndef __LIMA_SCHED_H__
#define __LIMA_SCHED_H__

#include <drm/gpu_scheduler.h>
#include <linux/list.h>
#include <linux/xarray.h>

struct lima_device;
struct lima_vm;

struct lima_sched_error_task {};

struct lima_sched_task {};

struct lima_sched_context {};

#define LIMA_SCHED_PIPE_MAX_MMU
#define LIMA_SCHED_PIPE_MAX_L2_CACHE
#define LIMA_SCHED_PIPE_MAX_PROCESSOR

struct lima_ip;

struct lima_sched_pipe {};

int lima_sched_task_init(struct lima_sched_task *task,
			 struct lima_sched_context *context,
			 struct lima_bo **bos, int num_bos,
			 struct lima_vm *vm);
void lima_sched_task_fini(struct lima_sched_task *task);

int lima_sched_context_init(struct lima_sched_pipe *pipe,
			    struct lima_sched_context *context);
void lima_sched_context_fini(struct lima_sched_pipe *pipe,
			     struct lima_sched_context *context);
struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task);

int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name);
void lima_sched_pipe_fini(struct lima_sched_pipe *pipe);
void lima_sched_pipe_task_done(struct lima_sched_pipe *pipe);

static inline void lima_sched_pipe_mmu_error(struct lima_sched_pipe *pipe)
{}

int lima_sched_slab_init(void);
void lima_sched_slab_fini(void);

#endif