linux/drivers/accel/ivpu/ivpu_job.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2020-2024 Intel Corporation
 */

#include <drm/drm_file.h>

#include <linux/bitfield.h>
#include <linux/highmem.h>
#include <linux/pci.h>
#include <linux/module.h>
#include <uapi/drm/ivpu_accel.h>

#include "ivpu_drv.h"
#include "ivpu_fw.h"
#include "ivpu_hw.h"
#include "ivpu_ipc.h"
#include "ivpu_job.h"
#include "ivpu_jsm_msg.h"
#include "ivpu_pm.h"
#include "vpu_boot_api.h"

#define CMD_BUF_IDX
#define JOB_ID_JOB_MASK
#define JOB_ID_CONTEXT_MASK
#define JOB_MAX_BUFFER_COUNT

static void ivpu_cmdq_ring_db(struct ivpu_device *vdev, struct ivpu_cmdq *cmdq)
{}

static int ivpu_preemption_buffers_create(struct ivpu_device *vdev,
					  struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq)
{}

static void ivpu_preemption_buffers_free(struct ivpu_device *vdev,
					 struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq)
{}

static struct ivpu_cmdq *ivpu_cmdq_alloc(struct ivpu_file_priv *file_priv)
{}

static void ivpu_cmdq_free(struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq)
{}

static int ivpu_hws_cmdq_init(struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq, u16 engine,
			      u8 priority)
{}

static int ivpu_register_db(struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq)
{}

static int
ivpu_cmdq_init(struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq, u16 engine, u8 priority)
{}

static int ivpu_cmdq_fini(struct ivpu_file_priv *file_priv, struct ivpu_cmdq *cmdq)
{}

static struct ivpu_cmdq *ivpu_cmdq_acquire(struct ivpu_file_priv *file_priv, u16 engine,
					   u8 priority)
{}

static void ivpu_cmdq_release_locked(struct ivpu_file_priv *file_priv, u16 engine, u8 priority)
{}

void ivpu_cmdq_release_all_locked(struct ivpu_file_priv *file_priv)
{}

/*
 * Mark the doorbell as unregistered
 * This function needs to be called when the VPU hardware is restarted
 * and FW loses job queue state. The next time job queue is used it
 * will be registered again.
 */
static void ivpu_cmdq_reset(struct ivpu_file_priv *file_priv)
{}

void ivpu_cmdq_reset_all_contexts(struct ivpu_device *vdev)
{}

static void ivpu_cmdq_fini_all(struct ivpu_file_priv *file_priv)
{}

void ivpu_context_abort_locked(struct ivpu_file_priv *file_priv)
{}

static int ivpu_cmdq_push_job(struct ivpu_cmdq *cmdq, struct ivpu_job *job)
{}

struct ivpu_fence {};

static inline struct ivpu_fence *to_vpu_fence(struct dma_fence *fence)
{}

static const char *ivpu_fence_get_driver_name(struct dma_fence *fence)
{}

static const char *ivpu_fence_get_timeline_name(struct dma_fence *fence)
{}

static const struct dma_fence_ops ivpu_fence_ops =;

static struct dma_fence *ivpu_fence_create(struct ivpu_device *vdev)
{}

static void ivpu_job_destroy(struct ivpu_job *job)
{}

static struct ivpu_job *
ivpu_job_create(struct ivpu_file_priv *file_priv, u32 engine_idx, u32 bo_count)
{}

static struct ivpu_job *ivpu_job_remove_from_submitted_jobs(struct ivpu_device *vdev, u32 job_id)
{}

static int ivpu_job_signal_and_destroy(struct ivpu_device *vdev, u32 job_id, u32 job_status)
{}

void ivpu_jobs_abort_all(struct ivpu_device *vdev)
{}

static int ivpu_job_submit(struct ivpu_job *job, u8 priority)
{}

static int
ivpu_job_prepare_bos_for_submit(struct drm_file *file, struct ivpu_job *job, u32 *buf_handles,
				u32 buf_count, u32 commands_offset)
{}

static inline u8 ivpu_job_to_hws_priority(struct ivpu_file_priv *file_priv, u8 priority)
{}

int ivpu_submit_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
{}

static void
ivpu_job_done_callback(struct ivpu_device *vdev, struct ivpu_ipc_hdr *ipc_hdr,
		       struct vpu_jsm_msg *jsm_msg)
{}

void ivpu_job_done_consumer_init(struct ivpu_device *vdev)
{}

void ivpu_job_done_consumer_fini(struct ivpu_device *vdev)
{}