mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-17 10:10:30 -05:00
Using the DRM GPU scheduler infrastructure, with a scheduler for each core. Userspace can decide for a series of tasks to be executed sequentially in the same core, so SRAM locality can be taken advantage of. The job submission code was initially based on Panfrost. v2: - Remove hardcoded number of cores - Misc. style fixes (Jeffrey Hugo) - Repack IOCTL struct (Jeffrey Hugo) v3: - Adapt to a split of the register block in the DT bindings (Nicolas Frattaroli) - Make use of GPL-2.0-only for the copyright notice (Jeff Hugo) - Use drm_* logging functions (Thomas Zimmermann) - Rename reg i/o macros (Thomas Zimmermann) - Add padding to ioctls and check for zero (Jeff Hugo) - Improve error handling (Nicolas Frattaroli) v6: - Use mutexes guard (Markus Elfring) - Use u64_to_user_ptr (Jeff Hugo) - Drop rocket_fence (Rob Herring) v7: - Assign its own IOMMU domain to each client, for isolation (Daniel Stone and Robin Murphy) v8: - Use reset lines to reset the cores (Robin Murphy) - Use the macros to compute the values for the bitfields (Robin Murphy) - More descriptive name for the IRQ (Robin Murphy) - Simplify job interrupt handing (Robin Murphy) - Correctly acquire a reference to the IOMMU (Robin Murphy) - Specify the size of the embedded structs in the IOCTLs for future extensibility (Rob Herring) - Expose only 32 bits for the address of the regcmd BO (Robin Murphy) Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net> Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250721-6-10-rocket-v9-4-77ebd484941e@tomeuvizoso.net
53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/* Copyright 2024-2025 Tomeu Vizoso <tomeu@tomeuvizoso.net> */
|
|
|
|
#ifndef __ROCKET_JOB_H__
|
|
#define __ROCKET_JOB_H__
|
|
|
|
#include <drm/drm_drv.h>
|
|
#include <drm/gpu_scheduler.h>
|
|
|
|
#include "rocket_core.h"
|
|
#include "rocket_drv.h"
|
|
|
|
struct rocket_task {
|
|
u64 regcmd;
|
|
u32 regcmd_count;
|
|
};
|
|
|
|
struct rocket_job {
|
|
struct drm_sched_job base;
|
|
|
|
struct rocket_device *rdev;
|
|
|
|
struct drm_gem_object **in_bos;
|
|
struct drm_gem_object **out_bos;
|
|
|
|
u32 in_bo_count;
|
|
u32 out_bo_count;
|
|
|
|
struct rocket_task *tasks;
|
|
u32 task_count;
|
|
u32 next_task_idx;
|
|
|
|
/* Fence to be signaled by drm-sched once its done with the job */
|
|
struct dma_fence *inference_done_fence;
|
|
|
|
/* Fence to be signaled by IRQ handler when the job is complete. */
|
|
struct dma_fence *done_fence;
|
|
|
|
struct rocket_iommu_domain *domain;
|
|
|
|
struct kref refcount;
|
|
};
|
|
|
|
int rocket_ioctl_submit(struct drm_device *dev, void *data, struct drm_file *file);
|
|
|
|
int rocket_job_init(struct rocket_core *core);
|
|
void rocket_job_fini(struct rocket_core *core);
|
|
int rocket_job_open(struct rocket_file_priv *rocket_priv);
|
|
void rocket_job_close(struct rocket_file_priv *rocket_priv);
|
|
int rocket_job_is_idle(struct rocket_core *core);
|
|
|
|
#endif
|