diff mbox series

[2/2] drm/v3d: Remove `v3d->cpu_job`

Message ID 20250113154741.67520-2-mcanal@igalia.com (mailing list archive)
State New
Headers show
Series [1/2] drm/v3d: Ensure job pointer is set to NULL after job completion | expand

Commit Message

Maíra Canal Jan. 13, 2025, 3:47 p.m. UTC
CPU jobs, like Clean Cache jobs, execute synchronously once the DRM
scheduler starts running them. Consequently, a global `v3d->cpu_job`
variable is unnecessary, as everything is managed within the
`v3d_cpu_job_run()` function.

This commit removes the `v3d->cpu_job` pointer, as it is not needed.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
---
 drivers/gpu/drm/v3d/v3d_drv.h   | 1 -
 drivers/gpu/drm/v3d/v3d_sched.c | 2 --
 2 files changed, 3 deletions(-)

Comments

Chema Casanova Jan. 13, 2025, 7:27 p.m. UTC | #1
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>

El 13/1/25 a las 16:47, Maíra Canal escribió:
> CPU jobs, like Clean Cache jobs, execute synchronously once the DRM
> scheduler starts running them. Consequently, a global `v3d->cpu_job`
> variable is unnecessary, as everything is managed within the
> `v3d_cpu_job_run()` function.
>
> This commit removes the `v3d->cpu_job` pointer, as it is not needed.
>
> Signed-off-by: Maíra Canal <mcanal@igalia.com>
> ---
>   drivers/gpu/drm/v3d/v3d_drv.h   | 1 -
>   drivers/gpu/drm/v3d/v3d_sched.c | 2 --
>   2 files changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h
> index dc1cfe2e14be..9deaefa0f95b 100644
> --- a/drivers/gpu/drm/v3d/v3d_drv.h
> +++ b/drivers/gpu/drm/v3d/v3d_drv.h
> @@ -147,7 +147,6 @@ struct v3d_dev {
>   	struct v3d_render_job *render_job;
>   	struct v3d_tfu_job *tfu_job;
>   	struct v3d_csd_job *csd_job;
> -	struct v3d_cpu_job *cpu_job;
>   
>   	struct v3d_queue_state queue[V3D_MAX_QUEUES];
>   
> diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c
> index da08ddb01d21..961465128d80 100644
> --- a/drivers/gpu/drm/v3d/v3d_sched.c
> +++ b/drivers/gpu/drm/v3d/v3d_sched.c
> @@ -656,8 +656,6 @@ v3d_cpu_job_run(struct drm_sched_job *sched_job)
>   	struct v3d_cpu_job *job = to_cpu_job(sched_job);
>   	struct v3d_dev *v3d = job->base.v3d;
>   
> -	v3d->cpu_job = job;
> -
>   	if (job->job_type >= ARRAY_SIZE(cpu_job_function)) {
>   		DRM_DEBUG_DRIVER("Unknown CPU job: %d\n", job->job_type);
>   		return NULL;
Maíra Canal Jan. 14, 2025, 6:38 p.m. UTC | #2
Hi Chema,

On 13/01/25 16:27, Chema Casanova wrote:
> Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>

Thanks for the review! Applied to misc/kernel.git (drm-misc-next).

Best Regards,
- Maíra

> 
> El 13/1/25 a las 16:47, Maíra Canal escribió:
>> CPU jobs, like Clean Cache jobs, execute synchronously once the DRM
>> scheduler starts running them. Consequently, a global `v3d->cpu_job`
>> variable is unnecessary, as everything is managed within the
>> `v3d_cpu_job_run()` function.
>>
>> This commit removes the `v3d->cpu_job` pointer, as it is not needed.
>>
>> Signed-off-by: Maíra Canal <mcanal@igalia.com>
>> ---
>>   drivers/gpu/drm/v3d/v3d_drv.h   | 1 -
>>   drivers/gpu/drm/v3d/v3d_sched.c | 2 --
>>   2 files changed, 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/ 
>> v3d_drv.h
>> index dc1cfe2e14be..9deaefa0f95b 100644
>> --- a/drivers/gpu/drm/v3d/v3d_drv.h
>> +++ b/drivers/gpu/drm/v3d/v3d_drv.h
>> @@ -147,7 +147,6 @@ struct v3d_dev {
>>       struct v3d_render_job *render_job;
>>       struct v3d_tfu_job *tfu_job;
>>       struct v3d_csd_job *csd_job;
>> -    struct v3d_cpu_job *cpu_job;
>>       struct v3d_queue_state queue[V3D_MAX_QUEUES];
>> diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/ 
>> v3d_sched.c
>> index da08ddb01d21..961465128d80 100644
>> --- a/drivers/gpu/drm/v3d/v3d_sched.c
>> +++ b/drivers/gpu/drm/v3d/v3d_sched.c
>> @@ -656,8 +656,6 @@ v3d_cpu_job_run(struct drm_sched_job *sched_job)
>>       struct v3d_cpu_job *job = to_cpu_job(sched_job);
>>       struct v3d_dev *v3d = job->base.v3d;
>> -    v3d->cpu_job = job;
>> -
>>       if (job->job_type >= ARRAY_SIZE(cpu_job_function)) {
>>           DRM_DEBUG_DRIVER("Unknown CPU job: %d\n", job->job_type);
>>           return NULL;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h
index dc1cfe2e14be..9deaefa0f95b 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.h
+++ b/drivers/gpu/drm/v3d/v3d_drv.h
@@ -147,7 +147,6 @@  struct v3d_dev {
 	struct v3d_render_job *render_job;
 	struct v3d_tfu_job *tfu_job;
 	struct v3d_csd_job *csd_job;
-	struct v3d_cpu_job *cpu_job;
 
 	struct v3d_queue_state queue[V3D_MAX_QUEUES];
 
diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c
index da08ddb01d21..961465128d80 100644
--- a/drivers/gpu/drm/v3d/v3d_sched.c
+++ b/drivers/gpu/drm/v3d/v3d_sched.c
@@ -656,8 +656,6 @@  v3d_cpu_job_run(struct drm_sched_job *sched_job)
 	struct v3d_cpu_job *job = to_cpu_job(sched_job);
 	struct v3d_dev *v3d = job->base.v3d;
 
-	v3d->cpu_job = job;
-
 	if (job->job_type >= ARRAY_SIZE(cpu_job_function)) {
 		DRM_DEBUG_DRIVER("Unknown CPU job: %d\n", job->job_type);
 		return NULL;