Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62250a91 authored by Nils Wallménius's avatar Nils Wallménius Committed by Alex Deucher
Browse files

drm/amd/scheduler: Mark amdgpu_sched_ops const



This marks the struct amdgpu_sched_ops const and
adjusts amd_sched_init to take a const pointer
for the ops param. The ops member of
struct amd_gpu_scheduler is also changed to const.

Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarNils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f498d9ed
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -748,7 +748,7 @@ enum amdgpu_ring_type {
	AMDGPU_RING_TYPE_VCE
};

extern struct amd_sched_backend_ops amdgpu_sched_ops;
extern const struct amd_sched_backend_ops amdgpu_sched_ops;

int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,
		     struct amdgpu_job **job);
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ static struct fence *amdgpu_job_run(struct amd_sched_job *sched_job)
	return fence;
}

struct amd_sched_backend_ops amdgpu_sched_ops = {
const struct amd_sched_backend_ops amdgpu_sched_ops = {
	.dependency = amdgpu_job_dependency,
	.run_job = amdgpu_job_run,
	.begin_job = amd_sched_job_begin,
+1 −1
Original line number Diff line number Diff line
@@ -530,7 +530,7 @@ static int amd_sched_main(void *param)
 * Return 0 on success, otherwise error code.
*/
int amd_sched_init(struct amd_gpu_scheduler *sched,
		   struct amd_sched_backend_ops *ops,
		   const struct amd_sched_backend_ops *ops,
		   unsigned hw_submission, long timeout, const char *name)
{
	int i;
+2 −2
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ enum amd_sched_priority {
 * One scheduler is implemented for each hardware ring
*/
struct amd_gpu_scheduler {
	struct amd_sched_backend_ops	*ops;
	const struct amd_sched_backend_ops	*ops;
	uint32_t			hw_submission_limit;
	long				timeout;
	const char			*name;
@@ -137,7 +137,7 @@ struct amd_gpu_scheduler {
};

int amd_sched_init(struct amd_gpu_scheduler *sched,
		   struct amd_sched_backend_ops *ops,
		   const struct amd_sched_backend_ops *ops,
		   uint32_t hw_submission, long timeout, const char *name);
void amd_sched_fini(struct amd_gpu_scheduler *sched);