Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-05-05 Thread Nieto, David M
[AMD Official Use Only - Internal Distribution Only]

Thanks,

Do we know when those changes will make it back to amd-staging-drm-next ?

From: Christian König 
Sent: Wednesday, May 5, 2021 12:27 AM
To: Alex Deucher 
Cc: Deng, Emily ; Deucher, Alexander 
; amd-gfx list ; Sun, 
Roy ; Nieto, David M 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

I had to rebase them and was on sick leave last week.

Changed a few things on patch #1 and pushed the result a minute ago.

Christian.

Am 04.05.21 um 22:23 schrieb Alex Deucher:
> Did you push this yet?  I don't see it in drm-misc.
>
> Thanks,
>
> Alex
>
> On Wed, Apr 28, 2021 at 5:06 AM Christian König
>  wrote:
>> Well none. As I said I will push this upstream through drm-misc-next.
>>
>> Christian.
>>
>> Am 28.04.21 um 10:32 schrieb Deng, Emily:
>>
>> [AMD Official Use Only - Internal Distribution Only]
>>
>>
>> Hi Alex and Christian,
>>
>> What extra work Roy need to do about this patch? And fdinfo?
>>
>>
>>
>> Best wishes
>>
>> Emily Deng
>>
>> From: amd-gfx  On Behalf Of Deucher, 
>> Alexander
>> Sent: Tuesday, April 27, 2021 3:52 AM
>> To: Christian König 
>> Cc: Sun, Roy ; amd-gfx list 
>> ; Nieto, David M 
>> Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
>>
>>
>>
>> [AMD Official Use Only - Internal Distribution Only]
>>
>>
>>
>> [AMD Official Use Only - Internal Distribution Only]
>>
>>
>>
>> Fair point.  Either way works for me.
>>
>>
>>
>> Alex
>>
>> 
>>
>> From: Christian König 
>> Sent: Monday, April 26, 2021 3:48 PM
>> To: Deucher, Alexander 
>> Cc: amd-gfx list ; Sun, Roy 
>> ; Nieto, David M 
>> Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
>>
>>
>>
>> My concern is more to get this tested from more people than just AMD.
>>
>> Christian.
>>
>> Am 26.04.21 um 21:40 schrieb Deucher, Alexander:
>>
>> [AMD Official Use Only - Internal Distribution Only]
>>
>>
>>
>> That said, it would be easier for me to merge through the AMD tree since a 
>> relatively big AMD feature depends on it.  Not sure how much conflict 
>> potential there is if this goes through the AMD tree.
>>
>>
>>
>> Alex
>>
>>
>>
>> 
>>
>> From: amd-gfx  on behalf of Deucher, 
>> Alexander 
>> Sent: Monday, April 26, 2021 3:24 PM
>> To: Christian König 
>> Cc: amd-gfx list ; Sun, Roy 
>> ; Nieto, David M 
>> Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
>>
>>
>>
>> [AMD Official Use Only - Internal Distribution Only]
>>
>>
>>
>> [AMD Official Use Only - Internal Distribution Only]
>>
>>
>>
>> No objections from me.
>>
>>
>>
>> Thanks!
>>
>>
>>
>> Alex
>>
>>
>>
>> 
>>
>> From: Christian König 
>> Sent: Monday, April 26, 2021 2:49 AM
>> To: Deucher, Alexander 
>> Cc: Nieto, David M ; Sun, Roy ; 
>> amd-gfx list 
>> Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
>>
>>
>>
>> Hey Alex,
>>
>> any objections that we merge those two patches through drm-misc-next?
>>
>> Thanks,
>> Christian.
>>
>> Am 26.04.21 um 08:27 schrieb Roy Sun:
>>> Update the timestamp of scheduled fence on HW
>>> completion of the previous fences
>>>
>>> This allow more accurate tracking of the fence
>>> execution in HW
>>>
>>> Signed-off-by: David M Nieto 
>>> Signed-off-by: Roy Sun 
>>> ---
>>>drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
>>>1 file changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
>>> b/drivers/gpu/drm/scheduler/sched_main.c
>>> index 92d8de24d0a1..f8e39ab0c41b 100644
>>> --- a/drivers/gpu/drm/scheduler/sched_main.c
>>> +++ b/drivers/gpu/drm/scheduler/sched_main.c
>>> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
>>> *sched)
>>>EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>>>
>>>/**
>>> - * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs 
>>> from mirror rin

Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-05-05 Thread Christian König

I had to rebase them and was on sick leave last week.

Changed a few things on patch #1 and pushed the result a minute ago.

Christian.

Am 04.05.21 um 22:23 schrieb Alex Deucher:

Did you push this yet?  I don't see it in drm-misc.

Thanks,

Alex

On Wed, Apr 28, 2021 at 5:06 AM Christian König
 wrote:

Well none. As I said I will push this upstream through drm-misc-next.

Christian.

Am 28.04.21 um 10:32 schrieb Deng, Emily:

[AMD Official Use Only - Internal Distribution Only]


Hi Alex and Christian,

What extra work Roy need to do about this patch? And fdinfo?



Best wishes

Emily Deng

From: amd-gfx  On Behalf Of Deucher, 
Alexander
Sent: Tuesday, April 27, 2021 3:52 AM
To: Christian König 
Cc: Sun, Roy ; amd-gfx list ; Nieto, 
David M 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track



[AMD Official Use Only - Internal Distribution Only]



[AMD Official Use Only - Internal Distribution Only]



Fair point.  Either way works for me.



Alex



From: Christian König 
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander 
Cc: amd-gfx list ; Sun, Roy ; Nieto, 
David M 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track



My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]



That said, it would be easier for me to merge through the AMD tree since a 
relatively big AMD feature depends on it.  Not sure how much conflict potential 
there is if this goes through the AMD tree.



Alex





From: amd-gfx  on behalf of Deucher, Alexander 

Sent: Monday, April 26, 2021 3:24 PM
To: Christian König 
Cc: amd-gfx list ; Sun, Roy ; Nieto, 
David M 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track



[AMD Official Use Only - Internal Distribution Only]



[AMD Official Use Only - Internal Distribution Only]



No objections from me.



Thanks!



Alex





From: Christian König 
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander 
Cc: Nieto, David M ; Sun, Roy ; amd-gfx list 

Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track



Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
   drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
   1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..f8e39ab0c41b 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
   EXPORT_SYMBOL(drm_sched_resubmit_jobs);

   /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
*
* @sched: scheduler instance
* @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
   static struct drm_sched_job *
   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
   {
- struct drm_sched_job *job;
+ struct drm_sched_job *job, *next;

/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
We just need to record the scheduled time of the next job. So we
need not to check the rest job.
+ /* account for the next fence in the queue */
+ next = list_first_entry_or_null(>pending_list,
+ struct drm_sched_job, list);
+ if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+ >s_fence->finished.flags)) {
+ next->s_fence->scheduled.timestamp =
+ job->s_fence->finished.timestamp;
+ }
} else {
job = NULL;
/* queue timeout for next job */




___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-05-04 Thread Alex Deucher
Did you push this yet?  I don't see it in drm-misc.

Thanks,

Alex

On Wed, Apr 28, 2021 at 5:06 AM Christian König
 wrote:
>
> Well none. As I said I will push this upstream through drm-misc-next.
>
> Christian.
>
> Am 28.04.21 um 10:32 schrieb Deng, Emily:
>
> [AMD Official Use Only - Internal Distribution Only]
>
>
> Hi Alex and Christian,
>
> What extra work Roy need to do about this patch? And fdinfo?
>
>
>
> Best wishes
>
> Emily Deng
>
> From: amd-gfx  On Behalf Of Deucher, 
> Alexander
> Sent: Tuesday, April 27, 2021 3:52 AM
> To: Christian König 
> Cc: Sun, Roy ; amd-gfx list ; 
> Nieto, David M 
> Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
>
>
>
> [AMD Official Use Only - Internal Distribution Only]
>
>
>
> [AMD Official Use Only - Internal Distribution Only]
>
>
>
> Fair point.  Either way works for me.
>
>
>
> Alex
>
> 
>
> From: Christian König 
> Sent: Monday, April 26, 2021 3:48 PM
> To: Deucher, Alexander 
> Cc: amd-gfx list ; Sun, Roy ; 
> Nieto, David M 
> Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
>
>
>
> My concern is more to get this tested from more people than just AMD.
>
> Christian.
>
> Am 26.04.21 um 21:40 schrieb Deucher, Alexander:
>
> [AMD Official Use Only - Internal Distribution Only]
>
>
>
> That said, it would be easier for me to merge through the AMD tree since a 
> relatively big AMD feature depends on it.  Not sure how much conflict 
> potential there is if this goes through the AMD tree.
>
>
>
> Alex
>
>
>
> ____________
>
> From: amd-gfx  on behalf of Deucher, 
> Alexander 
> Sent: Monday, April 26, 2021 3:24 PM
> To: Christian König 
> Cc: amd-gfx list ; Sun, Roy ; 
> Nieto, David M 
> Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
>
>
>
> [AMD Official Use Only - Internal Distribution Only]
>
>
>
> [AMD Official Use Only - Internal Distribution Only]
>
>
>
> No objections from me.
>
>
>
> Thanks!
>
>
>
> Alex
>
>
>
> 
>
> From: Christian König 
> Sent: Monday, April 26, 2021 2:49 AM
> To: Deucher, Alexander 
> Cc: Nieto, David M ; Sun, Roy ; amd-gfx 
> list 
> Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
>
>
>
> Hey Alex,
>
> any objections that we merge those two patches through drm-misc-next?
>
> Thanks,
> Christian.
>
> Am 26.04.21 um 08:27 schrieb Roy Sun:
> > Update the timestamp of scheduled fence on HW
> > completion of the previous fences
> >
> > This allow more accurate tracking of the fence
> > execution in HW
> >
> > Signed-off-by: David M Nieto 
> > Signed-off-by: Roy Sun 
> > ---
> >   drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
> >   1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
> > b/drivers/gpu/drm/scheduler/sched_main.c
> > index 92d8de24d0a1..f8e39ab0c41b 100644
> > --- a/drivers/gpu/drm/scheduler/sched_main.c
> > +++ b/drivers/gpu/drm/scheduler/sched_main.c
> > @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
> > *sched)
> >   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
> >
> >   /**
> > - * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs 
> > from mirror ring list
> > + * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
> > from pending list
> >*
> >* @sched: scheduler instance
> >* @max: job numbers to relaunch
> > @@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
> >   static struct drm_sched_job *
> >   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
> >   {
> > - struct drm_sched_job *job;
> > + struct drm_sched_job *job, *next;
> >
> >/*
> > * Don't destroy jobs while the timeout worker is running  OR thread
> > @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler 
> > *sched)
> >if (job && dma_fence_is_signaled(>s_fence->finished)) {
> >/* remove job from pending_list */
> >list_del_init(>list);
> > We just need to record the scheduled time of the next job. So we
> > need not to check the rest job.
> > + /* account for the next fence in the queue */
> > + next = list_first_entry_or_null(>pending_

RE: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-28 Thread Deng, Emily
[AMD Official Use Only - Internal Distribution Only]

Hi Christian,
Good to know, thanks very much.

Best wishes
Emily Deng
From: Christian König 
Sent: Wednesday, April 28, 2021 5:07 PM
To: Deng, Emily ; Deucher, Alexander 

Cc: Sun, Roy ; amd-gfx list ; 
Nieto, David M 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Well none. As I said I will push this upstream through drm-misc-next.

Christian.
Am 28.04.21 um 10:32 schrieb Deng, Emily:

[AMD Official Use Only - Internal Distribution Only]

Hi Alex and Christian,
What extra work Roy need to do about this patch? And fdinfo?

Best wishes
Emily Deng
From: amd-gfx 
<mailto:amd-gfx-boun...@lists.freedesktop.org>
 On Behalf Of Deucher, Alexander
Sent: Tuesday, April 27, 2021 3:52 AM
To: Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
Cc: Sun, Roy <mailto:roy@amd.com>; amd-gfx list 
<mailto:amd-gfx@lists.freedesktop.org>; Nieto, 
David M <mailto:david.ni...@amd.com>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track


[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]

Fair point.  Either way works for me.

Alex

From: Christian König 
mailto:ckoenig.leichtzumer...@gmail.com>>
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander 
mailto:alexander.deuc...@amd.com>>
Cc: amd-gfx list 
mailto:amd-gfx@lists.freedesktop.org>>; Sun, Roy 
mailto:roy@amd.com>>; Nieto, David M 
mailto:david.ni...@amd.com>>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.
Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a 
relatively big AMD feature depends on it.  Not sure how much conflict potential 
there is if this goes through the AMD tree.

Alex


From: amd-gfx 
<mailto:amd-gfx-boun...@lists.freedesktop.org>
 on behalf of Deucher, Alexander 
<mailto:alexander.deuc...@amd.com>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
Cc: amd-gfx list 
<mailto:amd-gfx@lists.freedesktop.org>; Sun, Roy 
<mailto:roy....@amd.com>; Nieto, David M 
<mailto:david.ni...@amd.com>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track


[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex


From: Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander 
<mailto:alexander.deuc...@amd.com>
Cc: Nieto, David M <mailto:david.ni...@amd.com>; Sun, Roy 
<mailto:roy@amd.com>; amd-gfx list 
<mailto:amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:
> Update the timestamp of scheduled fence on HW
> completion of the previous fences
>
> This allow more accurate tracking of the fence
> execution in HW
>
> Signed-off-by: David M Nieto <mailto:david.ni...@amd.com>
> Signed-off-by: Roy Sun <mailto:roy@amd.com>
> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
> b/drivers/gpu/drm/scheduler/sched_main.c
> index 92d8de24d0a1..f8e39ab0c41b 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
> *sched)
>   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>
>   /**
> - * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs 
> from mirror ring list
> + * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
> from pending list
>*
>* @sched: scheduler instance
>* @max: job numbers to relaunch
> @@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
>   static struct drm_sched_job *
>   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
>   {
> - struct drm_sched_job *job;
> + struct drm_sched_job *job, *next;
>
>/*
> * Don't destroy jobs while the timeout worker is running  OR thread
> @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler 
> *sched)
>if (job && dma_fence_is_signaled(>s_fence->finished)) {
>/* rem

Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-28 Thread Christian König

Well none. As I said I will push this upstream through drm-misc-next.

Christian.

Am 28.04.21 um 10:32 schrieb Deng, Emily:


[AMD Official Use Only - Internal Distribution Only]


Hi Alex and Christian,

What extra work Roy need to do about this patch? And fdinfo?

Best wishes

Emily Deng

*From:* amd-gfx  *On Behalf Of 
*Deucher, Alexander

*Sent:* Tuesday, April 27, 2021 3:52 AM
*To:* Christian König 
*Cc:* Sun, Roy ; amd-gfx list 
; Nieto, David M 

*Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

Fair point. Either way works for me.

Alex



*From:*Christian König <mailto:ckoenig.leichtzumer...@gmail.com>>

*Sent:* Monday, April 26, 2021 3:48 PM
*To:* Deucher, Alexander <mailto:alexander.deuc...@amd.com>>
*Cc:* amd-gfx list <mailto:amd-gfx@lists.freedesktop.org>>; Sun, Roy <mailto:roy@amd.com>>; Nieto, David M <mailto:david.ni...@amd.com>>

*Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree
since a relatively big AMD feature depends on it.  Not sure how
much conflict potential there is if this goes through the AMD tree.

Alex



*From:*amd-gfx 
<mailto:amd-gfx-boun...@lists.freedesktop.org> on behalf of
Deucher, Alexander 
<mailto:alexander.deuc...@amd.com>
*Sent:* Monday, April 26, 2021 3:24 PM
*To:* Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
*Cc:* amd-gfx list 
<mailto:amd-gfx@lists.freedesktop.org>; Sun, Roy 
<mailto:roy@amd.com>; Nieto, David M 
    <mailto:david.ni...@amd.com>
*Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence
track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex



*From:*Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
*Sent:* Monday, April 26, 2021 2:49 AM
*To:* Deucher, Alexander 
<mailto:alexander.deuc...@amd.com>
*Cc:* Nieto, David M 
<mailto:david.ni...@amd.com>; Sun, Roy 
<mailto:roy....@amd.com>; amd-gfx list
     <mailto:amd-gfx@lists.freedesktop.org>
*Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence
track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:
> Update the timestamp of scheduled fence on HW
> completion of the previous fences
>
> This allow more accurate tracking of the fence
> execution in HW
>
> Signed-off-by: David M Nieto 
<mailto:david.ni...@amd.com>
> Signed-off-by: Roy Sun  <mailto:roy@amd.com>
> ---
> drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c
b/drivers/gpu/drm/scheduler/sched_main.c
> index 92d8de24d0a1..f8e39ab0c41b 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct
drm_gpu_scheduler *sched)
> EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>
>   /**
> - * drm_sched_resubmit_jobs_ext - helper to relunch certain
number of jobs from mirror ring list
> + * drm_sched_resubmit_jobs_ext - helper to relaunch certain
number of jobs from pending list
>    *
>    * @sched: scheduler instance
>    * @max: job numbers to relaunch
> @@ -671,7 +671,7 @@ drm_sched_select_entity(struct
drm_gpu_scheduler *sched)
>   static struct drm_sched_job *
> drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
>   {
> - struct drm_sched_job *job;
> + struct drm_sched_job *job, *next;
>
>    /*
> * Don't destroy jobs while the timeout worker is running
OR thread
> @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct
drm_gpu_scheduler *sched)
>    if (job && dma_fence_is_signaled(>s_fence->finished)) {
>    /* remove job from pending_list */
> list_del_init(>list);
  

RE: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-28 Thread Deng, Emily
[AMD Official Use Only - Internal Distribution Only]

Hi Alex and Christian,
What extra work Roy need to do about this patch? And fdinfo?

Best wishes
Emily Deng
From: amd-gfx  On Behalf Of Deucher, 
Alexander
Sent: Tuesday, April 27, 2021 3:52 AM
To: Christian König 
Cc: Sun, Roy ; amd-gfx list ; 
Nieto, David M 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track


[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]

Fair point.  Either way works for me.

Alex

From: Christian König 
mailto:ckoenig.leichtzumer...@gmail.com>>
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander 
mailto:alexander.deuc...@amd.com>>
Cc: amd-gfx list 
mailto:amd-gfx@lists.freedesktop.org>>; Sun, Roy 
mailto:roy@amd.com>>; Nieto, David M 
mailto:david.ni...@amd.com>>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.
Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a 
relatively big AMD feature depends on it.  Not sure how much conflict potential 
there is if this goes through the AMD tree.

Alex


From: amd-gfx 
<mailto:amd-gfx-boun...@lists.freedesktop.org>
 on behalf of Deucher, Alexander 
<mailto:alexander.deuc...@amd.com>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
Cc: amd-gfx list 
<mailto:amd-gfx@lists.freedesktop.org>; Sun, Roy 
<mailto:roy@amd.com>; Nieto, David M 
<mailto:david.ni...@amd.com>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track


[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex


From: Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander 
<mailto:alexander.deuc...@amd.com>
Cc: Nieto, David M <mailto:david.ni...@amd.com>; Sun, Roy 
<mailto:roy....@amd.com>; amd-gfx list 
<mailto:amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:
> Update the timestamp of scheduled fence on HW
> completion of the previous fences
>
> This allow more accurate tracking of the fence
> execution in HW
>
> Signed-off-by: David M Nieto <mailto:david.ni...@amd.com>
> Signed-off-by: Roy Sun <mailto:roy@amd.com>
> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
> b/drivers/gpu/drm/scheduler/sched_main.c
> index 92d8de24d0a1..f8e39ab0c41b 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
> *sched)
>   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>
>   /**
> - * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs 
> from mirror ring list
> + * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
> from pending list
>*
>* @sched: scheduler instance
>* @max: job numbers to relaunch
> @@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
>   static struct drm_sched_job *
>   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
>   {
> - struct drm_sched_job *job;
> + struct drm_sched_job *job, *next;
>
>/*
> * Don't destroy jobs while the timeout worker is running  OR thread
> @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler 
> *sched)
>if (job && dma_fence_is_signaled(>s_fence->finished)) {
>/* remove job from pending_list */
>list_del_init(>list);
> We just need to record the scheduled time of the next job. So we
> need not to check the rest job.
> + /* account for the next fence in the queue */
> + next = list_first_entry_or_null(>pending_list,
> + struct drm_sched_job, list);
> + if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
> + >s_fence->finished.flags)) {
> + next->s_fence->scheduled.timestamp =
> + job->s_fence->finished.timestamp;
> + }
>} else {
>job = NULL;
>/* queue timeout for next job */

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-26 Thread Deucher, Alexander
[AMD Official Use Only - Internal Distribution Only]

Fair point.  Either way works for me.

Alex

From: Christian König 
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander 
Cc: amd-gfx list ; Sun, Roy ; 
Nieto, David M 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a 
relatively big AMD feature depends on it.  Not sure how much conflict potential 
there is if this goes through the AMD tree.

Alex


From: amd-gfx 
<mailto:amd-gfx-boun...@lists.freedesktop.org>
 on behalf of Deucher, Alexander 
<mailto:alexander.deuc...@amd.com>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
Cc: amd-gfx list 
<mailto:amd-gfx@lists.freedesktop.org>; Sun, Roy 
<mailto:roy@amd.com>; Nieto, David M 
<mailto:david.ni...@amd.com>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track


[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex


From: Christian König 
<mailto:ckoenig.leichtzumer...@gmail.com>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander 
<mailto:alexander.deuc...@amd.com>
Cc: Nieto, David M <mailto:david.ni...@amd.com>; Sun, Roy 
<mailto:roy@amd.com>; amd-gfx list 
<mailto:amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:
> Update the timestamp of scheduled fence on HW
> completion of the previous fences
>
> This allow more accurate tracking of the fence
> execution in HW
>
> Signed-off-by: David M Nieto <mailto:david.ni...@amd.com>
> Signed-off-by: Roy Sun <mailto:roy@amd.com>
> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
> b/drivers/gpu/drm/scheduler/sched_main.c
> index 92d8de24d0a1..f8e39ab0c41b 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
> *sched)
>   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>
>   /**
> - * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs 
> from mirror ring list
> + * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
> from pending list
>*
>* @sched: scheduler instance
>* @max: job numbers to relaunch
> @@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
>   static struct drm_sched_job *
>   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
>   {
> - struct drm_sched_job *job;
> + struct drm_sched_job *job, *next;
>
>/*
> * Don't destroy jobs while the timeout worker is running  OR thread
> @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler 
> *sched)
>if (job && dma_fence_is_signaled(>s_fence->finished)) {
>/* remove job from pending_list */
>list_del_init(>list);
> We just need to record the scheduled time of the next job. So we
> need not to check the rest job.
> + /* account for the next fence in the queue */
> + next = list_first_entry_or_null(>pending_list,
> + struct drm_sched_job, list);
> + if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
> + >s_fence->finished.flags)) {
> + next->s_fence->scheduled.timestamp =
> + job->s_fence->finished.timestamp;
> + }
>} else {
>job = NULL;
>/* queue timeout for next job */


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-26 Thread Christian König

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:


[AMD Official Use Only - Internal Distribution Only]


That said, it would be easier for me to merge through the AMD tree 
since a relatively big AMD feature depends on it.  Not sure how much 
conflict potential there is if this goes through the AMD tree.


Alex


*From:* amd-gfx  on behalf of 
Deucher, Alexander 

*Sent:* Monday, April 26, 2021 3:24 PM
*To:* Christian König 
*Cc:* amd-gfx list ; Sun, Roy 
; Nieto, David M 

*Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]


No objections from me.

Thanks!

Alex


*From:* Christian König 
*Sent:* Monday, April 26, 2021 2:49 AM
*To:* Deucher, Alexander 
*Cc:* Nieto, David M ; Sun, Roy 
; amd-gfx list 

*Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:
> Update the timestamp of scheduled fence on HW
> completion of the previous fences
>
> This allow more accurate tracking of the fence
> execution in HW
>
> Signed-off-by: David M Nieto 
> Signed-off-by: Roy Sun 
> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c

> index 92d8de24d0a1..f8e39ab0c41b 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct 
drm_gpu_scheduler *sched)

>   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>
>   /**
> - * drm_sched_resubmit_jobs_ext - helper to relunch certain number 
of jobs from mirror ring list
> + * drm_sched_resubmit_jobs_ext - helper to relaunch certain number 
of jobs from pending list

>    *
>    * @sched: scheduler instance
>    * @max: job numbers to relaunch
> @@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler 
*sched)

>   static struct drm_sched_job *
>   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
>   {
> - struct drm_sched_job *job;
> + struct drm_sched_job *job, *next;
>
>    /*
> * Don't destroy jobs while the timeout worker is running  OR 
thread
> @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct 
drm_gpu_scheduler *sched)

>    if (job && dma_fence_is_signaled(>s_fence->finished)) {
>    /* remove job from pending_list */
> list_del_init(>list);
> We just need to record the scheduled time of the next job. So we
> need not to check the rest job.
> + /* account for the next fence in the queue */
> + next = list_first_entry_or_null(>pending_list,
> + struct drm_sched_job, list);
> + if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
> + >s_fence->finished.flags)) {
> + next->s_fence->scheduled.timestamp =
> + job->s_fence->finished.timestamp;
> + }
>    } else {
>    job = NULL;
>    /* queue timeout for next job */



___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-26 Thread Deucher, Alexander
[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a 
relatively big AMD feature depends on it.  Not sure how much conflict potential 
there is if this goes through the AMD tree.

Alex


From: amd-gfx  on behalf of Deucher, 
Alexander 
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König 
Cc: amd-gfx list ; Sun, Roy ; 
Nieto, David M 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track


[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex


From: Christian König 
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander 
Cc: Nieto, David M ; Sun, Roy ; amd-gfx 
list 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:
> Update the timestamp of scheduled fence on HW
> completion of the previous fences
>
> This allow more accurate tracking of the fence
> execution in HW
>
> Signed-off-by: David M Nieto 
> Signed-off-by: Roy Sun 
> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
> b/drivers/gpu/drm/scheduler/sched_main.c
> index 92d8de24d0a1..f8e39ab0c41b 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
> *sched)
>   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>
>   /**
> - * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs 
> from mirror ring list
> + * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
> from pending list
>*
>* @sched: scheduler instance
>* @max: job numbers to relaunch
> @@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
>   static struct drm_sched_job *
>   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
>   {
> - struct drm_sched_job *job;
> + struct drm_sched_job *job, *next;
>
>/*
> * Don't destroy jobs while the timeout worker is running  OR thread
> @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler 
> *sched)
>if (job && dma_fence_is_signaled(>s_fence->finished)) {
>/* remove job from pending_list */
>list_del_init(>list);
> We just need to record the scheduled time of the next job. So we
> need not to check the rest job.
> + /* account for the next fence in the queue */
> + next = list_first_entry_or_null(>pending_list,
> + struct drm_sched_job, list);
> + if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
> + >s_fence->finished.flags)) {
> + next->s_fence->scheduled.timestamp =
> + job->s_fence->finished.timestamp;
> + }
>} else {
>job = NULL;
>/* queue timeout for next job */

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-26 Thread Deucher, Alexander
[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex


From: Christian König 
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander 
Cc: Nieto, David M ; Sun, Roy ; amd-gfx 
list 
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:
> Update the timestamp of scheduled fence on HW
> completion of the previous fences
>
> This allow more accurate tracking of the fence
> execution in HW
>
> Signed-off-by: David M Nieto 
> Signed-off-by: Roy Sun 
> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
> b/drivers/gpu/drm/scheduler/sched_main.c
> index 92d8de24d0a1..f8e39ab0c41b 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
> *sched)
>   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>
>   /**
> - * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs 
> from mirror ring list
> + * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
> from pending list
>*
>* @sched: scheduler instance
>* @max: job numbers to relaunch
> @@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
>   static struct drm_sched_job *
>   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
>   {
> - struct drm_sched_job *job;
> + struct drm_sched_job *job, *next;
>
>/*
> * Don't destroy jobs while the timeout worker is running  OR thread
> @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler 
> *sched)
>if (job && dma_fence_is_signaled(>s_fence->finished)) {
>/* remove job from pending_list */
>list_del_init(>list);
> We just need to record the scheduled time of the next job. So we
> need not to check the rest job.
> + /* account for the next fence in the queue */
> + next = list_first_entry_or_null(>pending_list,
> + struct drm_sched_job, list);
> + if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
> + >s_fence->finished.flags)) {
> + next->s_fence->scheduled.timestamp =
> + job->s_fence->finished.timestamp;
> + }
>} else {
>job = NULL;
>/* queue timeout for next job */

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-26 Thread Christian König



Am 26.04.21 um 17:30 schrieb Wang, Kevin(Yang):


[AMD Official Use Only - Internal Distribution Only]





*From:* amd-gfx  on behalf of 
Roy Sun 

*Sent:* Monday, April 26, 2021 2:27 PM
*To:* amd-gfx@lists.freedesktop.org 
*Cc:* Sun, Roy ; Nieto, David M 
*Subject:* [PATCH 1/2] drm/scheduler: Change scheduled fence track
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c

index 92d8de24d0a1..f8e39ab0c41b 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct 
drm_gpu_scheduler *sched)

 EXPORT_SYMBOL(drm_sched_resubmit_jobs);

 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of 
jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of 
jobs from pending list

  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler 
*sched)

 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;

 /*
  * Don't destroy jobs while the timeout worker is running  OR 
thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct 
drm_gpu_scheduler *sched)

 if (job && dma_fence_is_signaled(>s_fence->finished)) {
 /* remove job from pending_list */
 list_del_init(>list);
We just need to record the scheduled time of the next job. So we
need not to check the rest job.

[kevin]:
ok, it is fine for me with the timestamp flag check.
Reviewed-by: Kevin Wang 


Actually please drop that extra check.

The timestamp is guaranteed to be set on the next job or otherwise we 
wouldn't got here in the first place.


I've considered dropping the flag for quite a while and don't want any 
new users of this.


Christian.



+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+ >s_fence->finished.flags)) {
+ next->s_fence->scheduled.timestamp =
+ job->s_fence->finished.timestamp;
+   }
 } else {
 job = NULL;
 /* queue timeout for next job */
--
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfxdata=04%7C01%7CKevin1.Wang%40amd.com%7C0cebaf8d37e144c6b82108d9087c502e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637550152295564379%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Hdiil9BC2sp2pUI1121yZWELoCQqhDqTnbr7E9oVutw%3Dreserved=0 
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfxdata=04%7C01%7CKevin1.Wang%40amd.com%7C0cebaf8d37e144c6b82108d9087c502e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637550152295564379%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Hdiil9BC2sp2pUI1121yZWELoCQqhDqTnbr7E9oVutw%3Dreserved=0>


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-26 Thread Wang, Kevin(Yang)
[AMD Official Use Only - Internal Distribution Only]




From: amd-gfx  on behalf of Roy Sun 

Sent: Monday, April 26, 2021 2:27 PM
To: amd-gfx@lists.freedesktop.org 
Cc: Sun, Roy ; Nieto, David M 
Subject: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..f8e39ab0c41b 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);

 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;

 /*
  * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 if (job && dma_fence_is_signaled(>s_fence->finished)) {
 /* remove job from pending_list */
 list_del_init(>list);
We just need to record the scheduled time of the next job. So we
need not to check the rest job.

[kevin]:
ok, it is fine for me with the timestamp flag check.
Reviewed-by: Kevin Wang 

+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+   >s_fence->finished.flags)) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
 } else {
 job = NULL;
 /* queue timeout for next job */
--
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfxdata=04%7C01%7CKevin1.Wang%40amd.com%7C0cebaf8d37e144c6b82108d9087c502e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637550152295564379%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Hdiil9BC2sp2pUI1121yZWELoCQqhDqTnbr7E9oVutw%3Dreserved=0
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-26 Thread Christian König

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
  drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
  1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..f8e39ab0c41b 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
  
  /**

- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
  
  	/*

 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
We just need to record the scheduled time of the next job. So we
need not to check the rest job.
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+   >s_fence->finished.flags)) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-26 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..f8e39ab0c41b 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
We just need to record the scheduled time of the next job. So we 
need not to check the rest job.
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+   >s_fence->finished.flags)) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-23 Thread Wang, Kevin(Yang)
[AMD Official Use Only - Internal Distribution Only]




From: amd-gfx  on behalf of Roy Sun 

Sent: Friday, April 23, 2021 6:55 PM
To: amd-gfx@lists.freedesktop.org 
Cc: Sun, Roy ; Nieto, David M 
Subject: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..dc05a20a8ef2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);

 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;

 /*
  * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 if (job && dma_fence_is_signaled(>s_fence->finished)) {
 /* remove job from pending_list */
 list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }

  1.  the timestamp maybe is invalid, we'd better check 
DMA_FENCE_FLAG_TIMESTAMP_BIT before use it .
  2.  when hw_submission > 2, do we need to check rest jobs? not only next.

Thanks,
Kevin.

 } else {
 job = NULL;
 /* queue timeout for next job */
--
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfxdata=04%7C01%7CKevin1.Wang%40amd.com%7C3ac81f3f5c0346115dce08d906464b5e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637547721248267412%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=XZTXlwgkQuEn%2BflY%2FOuUNUymOMjyOZ5lv7%2BiJR7Wjjk%3Dreserved=0
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-23 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..dc05a20a8ef2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-23 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---

This is the patch that just return the memory size.

 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..dc05a20a8ef2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-22 Thread Christian König



Am 21.04.21 um 05:46 schrieb Roy Sun:

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 


Reviewed-by: Christian König  for the series.


---
  drivers/gpu/drm/scheduler/sched_main.c | 11 +--
  1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..dc05a20a8ef2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
  
  /**

- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
  
  	/*

 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-21 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..dc05a20a8ef2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-20 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..dc05a20a8ef2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-20 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..dc05a20a8ef2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-19 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..dc05a20a8ef2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs 
from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-16 Thread Nirmoy


On 4/16/21 1:26 PM, Christian König wrote:

Am 16.04.21 um 07:04 schrieb Roy Sun:

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 


Reviewed-by: Christian König  for the series.

Nirmoy if you are idle again could you give that a testing round? I 
don't expect it to cause trouble, just want to double check that we 
haven't forgotten taking a lock or stuff like that.




Looks good, Tested-by: Nirmoy Das . One minor typo 
below:




Thanks,
Christian.


---
  drivers/gpu/drm/scheduler/sched_main.c | 11 +--
  1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c

index 92d8de24d0a1..4e5d8d4af010 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct 
drm_gpu_scheduler *sched)

  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
    /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of 
jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relunch certain number of 
jobs from pending list



relunch -> relaunch


Regards,

Nirmoy



   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler 
*sched)

  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-    struct drm_sched_job *job;
+    struct drm_sched_job *job, *next;
    /*
   * Don't destroy jobs while the timeout worker is running OR 
thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct 
drm_gpu_scheduler *sched)

  if (job && dma_fence_is_signaled(>s_fence->finished)) {
  /* remove job from pending_list */
  list_del_init(>list);
+    /* account for the next fence in the queue */
+    next = list_first_entry_or_null(>pending_list,
+    struct drm_sched_job, list);
+    if (next) {
+    next->s_fence->scheduled.timestamp =
+    job->s_fence->finished.timestamp;
+    }
  } else {
  job = NULL;
  /* queue timeout for next job */



___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-16 Thread Christian König

Am 16.04.21 um 07:04 schrieb Roy Sun:

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 


Reviewed-by: Christian König  for the series.

Nirmoy if you are idle again could you give that a testing round? I 
don't expect it to cause trouble, just want to double check that we 
haven't forgotten taking a lock or stuff like that.


Thanks,
Christian.


---
  drivers/gpu/drm/scheduler/sched_main.c | 11 +--
  1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..4e5d8d4af010 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
  
  /**

- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
  
  	/*

 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-15 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..4e5d8d4af010 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-14 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..4e5d8d4af010 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-13 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..4e5d8d4af010 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/scheduler: Change scheduled fence track

2021-04-12 Thread Roy Sun
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Signed-off-by: David M Nieto 
Signed-off-by: Roy Sun 
---
 drivers/gpu/drm/scheduler/sched_main.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 92d8de24d0a1..4e5d8d4af010 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler 
*sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from 
pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-   struct drm_sched_job *job;
+   struct drm_sched_job *job, *next;
 
/*
 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
+   /* account for the next fence in the queue */
+   next = list_first_entry_or_null(>pending_list,
+   struct drm_sched_job, list);
+   if (next) {
+   next->s_fence->scheduled.timestamp =
+   job->s_fence->finished.timestamp;
+   }
} else {
job = NULL;
/* queue timeout for next job */
-- 
2.31.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx