RE: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

2018-12-10 Thread Lou, Wentao
Sriov should not call amdgpu_amdkfd_pre_reset inside amdgpu_device_lock_adev,
either amdgpu_amdkfd_post_reset inside amdgpu_device_unlock_adev.
In branch amd-staging-dkms-4.18, sriov already called amdgpu_amdkfd_pre_reset 
and amdgpu_amdkfd_post_reset inside amdgpu_device_reset_sriov.
There 2 functions needed to be inside sriov's amdgpu_virt_request_full_gpu, or 
it would cause sriov hang.
amdgpu_amdkfd_pre_reset inside amdgpu_device_lock_adev was duplicated for 
sriov, and caused  cause sriov hang when entering amdgpu_device_lock_adev.
That's the reason to add " if (!amdgpu_sriov_vf(adev))" based on branch 
amd-staging-dkms-4.18.

BR,
Wentao

-Original Message-
From: Liu, Shaoyun  
Sent: Tuesday, December 11, 2018 12:10 AM
To: Lou, Wentao ; amd-gfx@lists.freedesktop.org; 
Grodzovsky, Andrey ; Kuehling, Felix 

Cc: Lou, Wentao 
Subject: RE: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov 
hang

But KFD still need to be notified during reset , the  pre_reset call to KFD 
will let KFD have  a chance to suspend all the  running process queues.  Was 
the reset works normally on SRIOV before the refactor change for  XGMI support 
?  We shouldn't change the logic . 

Regards
shaoyun.liu

-Original Message-
From: amd-gfx  On Behalf Of wentalou
Sent: Friday, December 7, 2018 1:09 AM
To: amd-gfx@lists.freedesktop.org
Cc: Lou, Wentao 
Subject: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

XGMI hive put kfd_pre_reset into amdgpu_device_lock_adev, but outside 
req_full_gpu of sriov.
It would make sriov hang during reset.

Change-Id: I5b3e2a42c77b3b9635419df4470d021df7be34d1
Signed-off-by: Wentao Lou 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index ef36cc5..659dd40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3474,14 +3474,16 @@ static void amdgpu_device_lock_adev(struct 
amdgpu_device *adev)
mutex_lock(&adev->lock_reset);
atomic_inc(&adev->gpu_reset_counter);
adev->in_gpu_reset = 1;
-   /* Block kfd */
-   amdgpu_amdkfd_pre_reset(adev);
+   /* Block kfd: SRIOV would do it separately */
+   if (!amdgpu_sriov_vf(adev))
+amdgpu_amdkfd_pre_reset(adev);
 }
 
 static void amdgpu_device_unlock_adev(struct amdgpu_device *adev)  {
-   /*unlock kfd */
-   amdgpu_amdkfd_post_reset(adev);
+   /*unlock kfd: SRIOV would do it separately */
+   if (!amdgpu_sriov_vf(adev))
+amdgpu_amdkfd_post_reset(adev);
amdgpu_vf_error_trans_all(adev);
adev->in_gpu_reset = 0;
mutex_unlock(&adev->lock_reset);
--
2.7.4

___
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 v3 2/2] drm/sched: Rework HW fence processing.

2018-12-10 Thread Zhou, David(ChunMing)
I don't think adding cb to sched job would work as soon as their lifetime is 
different with fence.
Unless you make the sched job reference, otherwise we will get trouble sooner 
or later.

-David

> -Original Message-
> From: amd-gfx  On Behalf Of
> Andrey Grodzovsky
> Sent: Tuesday, December 11, 2018 5:44 AM
> To: dri-de...@lists.freedesktop.org; amd-gfx@lists.freedesktop.org;
> ckoenig.leichtzumer...@gmail.com; e...@anholt.net;
> etna...@lists.freedesktop.org
> Cc: Zhou, David(ChunMing) ; Liu, Monk
> ; Grodzovsky, Andrey
> 
> Subject: [PATCH v3 2/2] drm/sched: Rework HW fence processing.
> 
> Expedite job deletion from ring mirror list to the HW fence signal callback
> instead from finish_work, together with waiting for all such fences to signal 
> in
> drm_sched_stop we garantee that already signaled job will not be processed
> twice.
> Remove the sched finish fence callback and just submit finish_work directly
> from the HW fence callback.
> 
> v2: Fix comments.
> 
> v3: Attach  hw fence cb to sched_job
> 
> Suggested-by: Christian Koenig 
> Signed-off-by: Andrey Grodzovsky 
> ---
>  drivers/gpu/drm/scheduler/sched_main.c | 58 --
> 
>  include/drm/gpu_scheduler.h|  6 ++--
>  2 files changed, 30 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c
> b/drivers/gpu/drm/scheduler/sched_main.c
> index cdf95e2..f0c1f32 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -284,8 +284,6 @@ static void drm_sched_job_finish(struct work_struct
> *work)
>   cancel_delayed_work_sync(&sched->work_tdr);
> 
>   spin_lock_irqsave(&sched->job_list_lock, flags);
> - /* remove job from ring_mirror_list */
> - list_del_init(&s_job->node);
>   /* queue TDR for next job */
>   drm_sched_start_timeout(sched);
>   spin_unlock_irqrestore(&sched->job_list_lock, flags); @@ -293,22
> +291,11 @@ static void drm_sched_job_finish(struct work_struct *work)
>   sched->ops->free_job(s_job);
>  }
> 
> -static void drm_sched_job_finish_cb(struct dma_fence *f,
> - struct dma_fence_cb *cb)
> -{
> - struct drm_sched_job *job = container_of(cb, struct drm_sched_job,
> -  finish_cb);
> - schedule_work(&job->finish_work);
> -}
> -
>  static void drm_sched_job_begin(struct drm_sched_job *s_job)  {
>   struct drm_gpu_scheduler *sched = s_job->sched;
>   unsigned long flags;
> 
> - dma_fence_add_callback(&s_job->s_fence->finished, &s_job-
> >finish_cb,
> -drm_sched_job_finish_cb);
> -
>   spin_lock_irqsave(&sched->job_list_lock, flags);
>   list_add_tail(&s_job->node, &sched->ring_mirror_list);
>   drm_sched_start_timeout(sched);
> @@ -359,12 +346,11 @@ void drm_sched_stop(struct drm_gpu_scheduler
> *sched, struct drm_sched_job *bad,
>   list_for_each_entry_reverse(s_job, &sched->ring_mirror_list, node)
> {
>   if (s_job->s_fence->parent &&
>   dma_fence_remove_callback(s_job->s_fence->parent,
> -   &s_job->s_fence->cb)) {
> +   &s_job->cb)) {
>   dma_fence_put(s_job->s_fence->parent);
>   s_job->s_fence->parent = NULL;
>   atomic_dec(&sched->hw_rq_count);
> - }
> - else {
> + } else {
>   /* TODO Is it get/put neccessey here ? */
>   dma_fence_get(&s_job->s_fence->finished);
>   list_add(&s_job->finish_node, &wait_list); @@ -
> 417,31 +403,34 @@ EXPORT_SYMBOL(drm_sched_stop);  void
> drm_sched_start(struct drm_gpu_scheduler *sched, bool unpark_only)  {
>   struct drm_sched_job *s_job, *tmp;
> - unsigned long flags;
>   int r;
> 
>   if (unpark_only)
>   goto unpark;
> 
> - spin_lock_irqsave(&sched->job_list_lock, flags);
> + /*
> +  * Locking the list is not required here as the sched thread is parked
> +  * so no new jobs are being pushed in to HW and in drm_sched_stop
> we
> +  * flushed all the jobs who were still in mirror list but who already
> +  * signaled and removed them self from the list. Also concurrent
> +  * GPU recovers can't run in parallel.
> +  */
>   list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list,
> node) {
> - struct drm_sched_fence *s_fence = s_job->s_fence;
>   struct dma_fence *fence = s_job->s_fence->parent;
> 
>   if (fence) {
> - r = dma_fence_add_callback(fence, &s_fence->cb,
> + r = dma_fence_add_callback(fence, &s_job->cb,
>  drm_sched_process_job);
>   if (r == -ENOENT)
> - drm_sched_process_job(fence, &s

Re: [PATCH 2/2] drm/amdgpu: update MC firmware image for polaris10 variants

2018-12-10 Thread Zhang, Jerry(Junwei)

On 12/11/18 4:06 AM, Alex Deucher wrote:

On Fri, Dec 7, 2018 at 3:40 AM Zhang, Jerry(Junwei)  wrote:

we can drop MC update patch, since a new fw could fix that.

Shouldn't we apply this as well for consistency?


I did apply it for simple test.
That looks no harm.

But confirmed the MC firmware version table, it shares the same MC as P10.
So I drop this patch now.

That means not every variant uses a newer MC firmware, as I could see now.

Regards,
Jerry



Alex


Regards,
Jerry

On 12/7/18 3:19 PM, Junwei Zhang wrote:

Some new variants require different firmwares.

Signed-off-by: Junwei Zhang 
---
   drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 5 -
   1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
index 1ad7e6b8ed1d..0edb8622f666 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
@@ -244,7 +244,10 @@ static int gmc_v8_0_init_microcode(struct amdgpu_device 
*adev)
   case CHIP_POLARIS10:
   if ((adev->pdev->device == 0x67df) &&
   ((adev->pdev->revision == 0xe1) ||
-  (adev->pdev->revision == 0xf7)))
+  (adev->pdev->revision == 0xf7)) ||
+ ((adev->pdev->device == 0x6fdf) &&
+  ((adev->pdev->revision == 0xef) ||
+   (adev->pdev->revision == 0xff
   chip_name = "polaris10_k";
   else
   chip_name = "polaris10";

___
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


答复: 答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

2018-12-10 Thread Qu, Jim
Yeah, the asic need to be POST in S4/resume and runtime resume.

Thanks
JimQu


发件人: Xu, Feifei
发送时间: 2018年12月10日 18:42
收件人: Qu, Jim
抄送: Quan, Evan; amd-gfx@lists.freedesktop.org
主题: Re: 答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

Agree that if also need to skip ASIC_INIT in s3/s4 in driver, should do the 
similar change as you mentioned. I am not quite sure the s3/s4 situation for 
now. Though from test, it might be the same case.
Will get back from vbios and have corresponding change. Thanks.

发自我的 iPhone

> 在 2018年12月10日,下午6:28,Qu, Jim  写道:
>
> Hi Feifei,
>
> When PSP perform ASIC_INIT during the whole boot up period?
>
> In S4,  the asic will be reset, and it need be posted at the beginning of 
> resume. So it is better move the logic into amdgpu_device_need_post() if 
> ASIC_INIT is automatic performed by PSP during S4.
>
> Thanks
> JimQu
>
> 
> 发件人: Xu, Feifei
> 发送时间: 2018年12月10日 18:09
> 收件人: Qu, Jim; Quan, Evan; amd-gfx@lists.freedesktop.org
> 主题: RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
>
> In fact, in multigpu cases, the original logical in 
> amdgpu_device_need_post()->amdgpu_atombios_scratch_need_asic_init() return 
> TRUE.
> The logical is to: read ATOM_S7_ASIC_INIT_COMPLETE_MASK bit which is notified 
> by BIOS to driver that if post is needed.
>
> After the ASIC_INIT table moved to psp, though post is needed (the 
> ATOM_S7_ASIC_INIT_COMPLETE_MASK is unset), we still need to skip the post in 
> driver.
>
> Regards,
> Feifei
>
> -Original Message-
> From: Qu, Jim 
> Sent: 2018年12月10日 17:42
> To: Quan, Evan ; Xu, Feifei ; 
> amd-gfx@lists.freedesktop.org
> Subject: 答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
>
> I think it is better move it into amdgpu_device_need_post() as a negative 
> condition.
>
> Thanks
> JimQu
>
> 
> 发件人: amd-gfx  代表 Quan, Evan 
> 
> 发送时间: 2018年12月10日 14:33:58
> 收件人: Xu, Feifei; amd-gfx@lists.freedesktop.org
> 抄送: Xu, Feifei
> 主题: RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
>
> Reviewed-by: Evan Quan 
>
>> -Original Message-
>> From: amd-gfx  On Behalf Of
>> Feifei Xu
>> Sent: 2018年12月10日 14:17
>> To: amd-gfx@lists.freedesktop.org
>> Cc: Xu, Feifei ; Quan, Evan 
>> Subject: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
>>
>> On vega20, the job of executing the ASIC_INIT table when posting card
>> is moved to psp. Skip the atombios's ASIC_INIT on vega20 when posting card.
>>
>> Change-Id: Id1d3c0a0d19296d5ed804de7edf5b09b8d38c0a5
>> Signed-off-by: Feifei Xu 
>> Tested-by: Candice Li 
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index ef36cc595985..a375d2ac112f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -2547,7 +2547,7 @@ int amdgpu_device_init(struct amdgpu_device
>> *adev,
>>  amdgpu_device_detect_sriov_bios(adev);
>>
>>  /* Post card if necessary */
>> - if (amdgpu_device_need_post(adev)) {
>> + if ((adev->asic_type != CHIP_VEGA20) &&
>> amdgpu_device_need_post(adev))
>> +{
>>  if (!adev->bios) {
>>  dev_err(adev->dev, "no vBIOS found\n");
>>  r = -EINVAL;
>> --
>> 2.17.1
>>
>> ___
>> 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
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


RE: [PATCH] amd/amdgpu: fix typo about amdgpu_sriov_vf

2018-12-10 Thread Zhou, Tiecheng
Reviewed-by: Tiecheng Zhou 

-Original Message-
From: amd-gfx  On Behalf Of Gui, Jack
Sent: Monday, December 10, 2018 4:05 PM
To: amd-gfx@lists.freedesktop.org
Cc: Gui, Jack 
Subject: [PATCH] amd/amdgpu: fix typo about amdgpu_sriov_vf

Signed-off-by: Chengming Gui 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index a9c853a..08f443f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4068,7 +4068,7 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device *adev)
 
 static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)  {
-   if (amdgpu_sriov(adev)) {
+   if (amdgpu_sriov_vf(adev)) {
gfx_v8_0_init_csb(adev);
return 0;
}
--
2.7.4

___
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: build broken on drm-next

2018-12-10 Thread Zhou, Tiecheng
Thanks to Jack and Ray,

I'll pay more attention.

Tiecheng

-Original Message-
From: Huang, Ray  
Sent: Monday, December 10, 2018 8:15 PM
To: StDenis, Tom ; Zhou, Tiecheng ; 
amd-gfx mailing list 
Cc: Deucher, Alexander ; Gui, Jack 
Subject: RE: build broken on drm-next

Jack already have a patch to fix this issue. 

Thanks,
Ray

> -Original Message-
> From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf 
> Of StDenis, Tom
> Sent: Monday, December 10, 2018 8:07 PM
> To: Zhou, Tiecheng ; amd-gfx mailing list  g...@lists.freedesktop.org>
> Cc: Deucher, Alexander 
> Subject: build broken on drm-next
> 
> Hi,
> 
> This commit
> 
> commit e421c656beefa1044f65cf50d7a7455df60cd703
> 
> Refs: v4.20-rc3-530-ge421c656beef
> 
> Author: Tiecheng Zhou 
> 
> AuthorDate: Fri Dec 7 09:11:35 2018 +0800
> 
> Commit: Tiecheng Zhou 
> 
> CommitDate: Mon Dec 10 11:14:27 2018 +0800
> 
> 
>  drm/amdgpu: bypass RLC init under sriov for Tonga
> 
>  RLC will go wrong in soft_reset under sriov
> 
>  Workaroound: only need to init RLC csb, and skip RLC stop, reset, start
>  this is because host-driver has already done full 
> initialization on RLC
> 
>  Signed-off-by: Tiecehng Zhou 
> 
>  Acked-by: Alex Deucher 
> 
> 
> Causes a build error on amd-staging-drm-next:
> 
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function
> ‘gfx_v8_0_rlc_resume’:
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:4071:6: error: implicit 
> declaration of function ‘amdgpu_sriov’; did you mean ‘amdgpu_sriov_vf’?
> [-Werror=implicit-function-declaration]
>if (amdgpu_sriov(adev)) {
>^~~~
>amdgpu_sriov_vf
>CC [M]  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.o
>CC [M]  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.o
>CC [M]  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.o
> cc1: some warnings being treated as errors
> make[4]: *** [scripts/Makefile.build:293:
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.o] Error 1
> make[4]: *** Waiting for unfinished jobs
> make[3]: *** [scripts/Makefile.build:518: drivers/gpu/drm/amd/amdgpu] 
> Error 2
> make[2]: *** [scripts/Makefile.build:518: drivers/gpu/drm] Error 2
> make[1]: *** [scripts/Makefile.build:518: drivers/gpu] Error 2
> make: *** [Makefile:1060: drivers] Error 2
> 
> 
> Tom
> ___
> 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 3/3] drm/amdgpu: replace get_user_pages with HMM address mirror helpers v3

2018-12-10 Thread Kuehling, Felix
This is a nice improvement from the last version. I still see some
potential problems. See inline ...

I'm skipping over the CS and GEM parts. I hope Christian can review
those parts.

On 2018-12-06 4:02 p.m., Yang, Philip wrote:
> Use HMM helper function hmm_vma_fault() to get physical pages backing
> userptr and start CPU page table update track of those pages. Then use
> hmm_vma_range_done() to check if those pages are updated before
> amdgpu_cs_submit for gfx or before user queues are resumed for kfd.
>
> If userptr pages are updated, for gfx, amdgpu_cs_ioctl will restart
> from scratch, for kfd, restore worker is rescheduled to retry.
>
> HMM simplify the CPU page table concurrent update check, so remove
> guptasklock, mmu_invalidations, last_set_pages fields from
> amdgpu_ttm_tt struct.
>
> HMM does not pin the page (increase page ref count), so remove related
> operations like release_pages(), put_page(), mark_page_dirty().
>
> Change-Id: Id2d3130378b44a774e0d77156102a20a203b5036
> Signed-off-by: Philip Yang 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h|   1 -
>  .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  81 ++--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c   |   2 -
>  drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h   |   3 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 188 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c   |  14 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c|  34 +++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h|   7 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c   | 160 ++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h   |   4 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c|   1 -
>  11 files changed, 206 insertions(+), 289 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> index bcf587b4ba98..b492dd9e541a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> @@ -62,7 +62,6 @@ struct kgd_mem {
>  
>   atomic_t invalid;
>   struct amdkfd_process_info *process_info;
> - struct page **user_pages;
>  
>   struct amdgpu_sync sync;
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index b29ef088fa14..75833b40507b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -580,28 +580,12 @@ static int init_user_pages(struct kgd_mem *mem, struct 
> mm_struct *mm,
>   goto out;
>   }
>  
> - /* If no restore worker is running concurrently, user_pages
> -  * should not be allocated
> -  */
> - WARN(mem->user_pages, "Leaking user_pages array");
> -
> - mem->user_pages = kvmalloc_array(bo->tbo.ttm->num_pages,
> -sizeof(struct page *),
> -GFP_KERNEL | __GFP_ZERO);
> - if (!mem->user_pages) {
> - pr_err("%s: Failed to allocate pages array\n", __func__);
> - ret = -ENOMEM;
> - goto unregister_out;
> - }
> -
> - ret = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm, mem->user_pages);
> + ret = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm, bo->tbo.ttm->pages);
>   if (ret) {
>   pr_err("%s: Failed to get user pages: %d\n", __func__, ret);
> - goto free_out;
> + goto unregister_out;
>   }
>  
> - amdgpu_ttm_tt_set_user_pages(bo->tbo.ttm, mem->user_pages);
> -
>   ret = amdgpu_bo_reserve(bo, true);
>   if (ret) {
>   pr_err("%s: Failed to reserve BO\n", __func__);
> @@ -614,11 +598,7 @@ static int init_user_pages(struct kgd_mem *mem, struct 
> mm_struct *mm,
>   amdgpu_bo_unreserve(bo);
>  
>  release_out:
> - if (ret)
> - release_pages(mem->user_pages, bo->tbo.ttm->num_pages);
> -free_out:
> - kvfree(mem->user_pages);
> - mem->user_pages = NULL;
> + amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
>  unregister_out:
>   if (ret)
>   amdgpu_mn_unregister(bo);
> @@ -677,7 +657,6 @@ static int reserve_bo_and_vm(struct kgd_mem *mem,
>   ctx->kfd_bo.priority = 0;
>   ctx->kfd_bo.tv.bo = &bo->tbo;
>   ctx->kfd_bo.tv.num_shared = 1;
> - ctx->kfd_bo.user_pages = NULL;
>   list_add(&ctx->kfd_bo.tv.head, &ctx->list);
>  
>   amdgpu_vm_get_pd_bo(vm, &ctx->list, &ctx->vm_pd[0]);
> @@ -741,7 +720,6 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem,
>   ctx->kfd_bo.priority = 0;
>   ctx->kfd_bo.tv.bo = &bo->tbo;
>   ctx->kfd_bo.tv.num_shared = 1;
> - ctx->kfd_bo.user_pages = NULL;
>   list_add(&ctx->kfd_bo.tv.head, &ctx->list);
>  
>   i = 0;
> @@ -1329,15 +1307,6 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
>   list_del(&bo_list_entry->head);
>   mutex_unlock(&process_info->lock);
>  
> - /* Free user pages if necessary 

Re: [PATCH 1/1] drm/amdgpu: Fix stub function name

2018-12-10 Thread Grodzovsky, Andrey
Acked-by: Andrey Grodzovsky 

Andrey


On 12/10/2018 04:29 PM, Kuehling, Felix wrote:
> This function was renamed in a previous commit. Update the stub
> function name for builds with CONFIG_HSA_AMD disabled.
>
> Fixes: 62f65d3cb34a ("drm/amdgpu: Add KFD VRAM limit checking")
> Signed-off-by: Felix Kuehling 
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> index 39f7c8c..2dfaf15 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> @@ -586,7 +586,7 @@ bool amdkfd_fence_check_mm(struct dma_fence *f, struct 
> mm_struct *mm)
>   return false;
>   }
>   
> -void amdgpu_amdkfd_unreserve_system_memory_limit(struct amdgpu_bo *bo)
> +void amdgpu_amdkfd_unreserve_memory_limit(struct amdgpu_bo *bo)
>   {
>   }
>   

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


[PATCH v3 2/2] drm/sched: Rework HW fence processing.

2018-12-10 Thread Andrey Grodzovsky
Expedite job deletion from ring mirror list to the HW fence signal
callback instead from finish_work, together with waiting for all
such fences to signal in drm_sched_stop we garantee that
already signaled job will not be processed twice.
Remove the sched finish fence callback and just submit finish_work
directly from the HW fence callback.

v2: Fix comments.

v3: Attach  hw fence cb to sched_job

Suggested-by: Christian Koenig 
Signed-off-by: Andrey Grodzovsky 
---
 drivers/gpu/drm/scheduler/sched_main.c | 58 --
 include/drm/gpu_scheduler.h|  6 ++--
 2 files changed, 30 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index cdf95e2..f0c1f32 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -284,8 +284,6 @@ static void drm_sched_job_finish(struct work_struct *work)
cancel_delayed_work_sync(&sched->work_tdr);
 
spin_lock_irqsave(&sched->job_list_lock, flags);
-   /* remove job from ring_mirror_list */
-   list_del_init(&s_job->node);
/* queue TDR for next job */
drm_sched_start_timeout(sched);
spin_unlock_irqrestore(&sched->job_list_lock, flags);
@@ -293,22 +291,11 @@ static void drm_sched_job_finish(struct work_struct *work)
sched->ops->free_job(s_job);
 }
 
-static void drm_sched_job_finish_cb(struct dma_fence *f,
-   struct dma_fence_cb *cb)
-{
-   struct drm_sched_job *job = container_of(cb, struct drm_sched_job,
-finish_cb);
-   schedule_work(&job->finish_work);
-}
-
 static void drm_sched_job_begin(struct drm_sched_job *s_job)
 {
struct drm_gpu_scheduler *sched = s_job->sched;
unsigned long flags;
 
-   dma_fence_add_callback(&s_job->s_fence->finished, &s_job->finish_cb,
-  drm_sched_job_finish_cb);
-
spin_lock_irqsave(&sched->job_list_lock, flags);
list_add_tail(&s_job->node, &sched->ring_mirror_list);
drm_sched_start_timeout(sched);
@@ -359,12 +346,11 @@ void drm_sched_stop(struct drm_gpu_scheduler *sched, 
struct drm_sched_job *bad,
list_for_each_entry_reverse(s_job, &sched->ring_mirror_list, node) {
if (s_job->s_fence->parent &&
dma_fence_remove_callback(s_job->s_fence->parent,
- &s_job->s_fence->cb)) {
+ &s_job->cb)) {
dma_fence_put(s_job->s_fence->parent);
s_job->s_fence->parent = NULL;
atomic_dec(&sched->hw_rq_count);
-   }
-   else {
+   } else {
/* TODO Is it get/put neccessey here ? */
dma_fence_get(&s_job->s_fence->finished);
list_add(&s_job->finish_node, &wait_list);
@@ -417,31 +403,34 @@ EXPORT_SYMBOL(drm_sched_stop);
 void drm_sched_start(struct drm_gpu_scheduler *sched, bool unpark_only)
 {
struct drm_sched_job *s_job, *tmp;
-   unsigned long flags;
int r;
 
if (unpark_only)
goto unpark;
 
-   spin_lock_irqsave(&sched->job_list_lock, flags);
+   /*
+* Locking the list is not required here as the sched thread is parked
+* so no new jobs are being pushed in to HW and in drm_sched_stop we
+* flushed all the jobs who were still in mirror list but who already
+* signaled and removed them self from the list. Also concurrent
+* GPU recovers can't run in parallel.
+*/
list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list, node) {
-   struct drm_sched_fence *s_fence = s_job->s_fence;
struct dma_fence *fence = s_job->s_fence->parent;
 
if (fence) {
-   r = dma_fence_add_callback(fence, &s_fence->cb,
+   r = dma_fence_add_callback(fence, &s_job->cb,
   drm_sched_process_job);
if (r == -ENOENT)
-   drm_sched_process_job(fence, &s_fence->cb);
+   drm_sched_process_job(fence, &s_job->cb);
else if (r)
DRM_ERROR("fence add callback failed (%d)\n",
  r);
} else
-   drm_sched_process_job(NULL, &s_fence->cb);
+   drm_sched_process_job(NULL, &s_job->cb);
}
 
drm_sched_start_timeout(sched);
-   spin_unlock_irqrestore(&sched->job_list_lock, flags);
 
 unpark:
kthread_unpark(sched->thread);
@@ -590,18 +579,27 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  */
 static void drm_sched_process_job(struct dma

[PATCH v3 1/2] drm/sched: Refactor ring mirror list handling.

2018-12-10 Thread Andrey Grodzovsky
Decauple sched threads stop and start and ring mirror
list handling from the policy of what to do about the
guilty jobs.
When stoppping the sched thread and detaching sched fences
from non signaled HW fenes wait for all signaled HW fences
to complete before rerunning the jobs.

v2: Fix resubmission of guilty job into HW after refactoring.

Suggested-by: Christian Koenig 
Signed-off-by: Andrey Grodzovsky 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  17 +++--
 drivers/gpu/drm/etnaviv/etnaviv_sched.c|   8 +--
 drivers/gpu/drm/scheduler/sched_main.c | 110 ++---
 drivers/gpu/drm/v3d/v3d_sched.c|  11 +--
 include/drm/gpu_scheduler.h|  10 ++-
 5 files changed, 95 insertions(+), 61 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index ef36cc5..42111d5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3292,17 +3292,16 @@ static int amdgpu_device_pre_asic_reset(struct 
amdgpu_device *adev,
/* block all schedulers and reset given job's ring */
for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
struct amdgpu_ring *ring = adev->rings[i];
+   bool park_only = job && job->base.sched != &ring->sched;
 
if (!ring || !ring->sched.thread)
continue;
 
-   kthread_park(ring->sched.thread);
+   drm_sched_stop(&ring->sched, job ? &job->base : NULL, 
park_only);
 
-   if (job && job->base.sched != &ring->sched)
+   if (park_only)
continue;
 
-   drm_sched_hw_job_reset(&ring->sched, job ? &job->base : NULL);
-
/* after all hw jobs are reset, hw fence is meaningless, so 
force_completion */
amdgpu_fence_driver_force_completion(ring);
}
@@ -3445,6 +3444,7 @@ static void amdgpu_device_post_asic_reset(struct 
amdgpu_device *adev,
  struct amdgpu_job *job)
 {
int i;
+   bool unpark_only;
 
for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
struct amdgpu_ring *ring = adev->rings[i];
@@ -3456,10 +3456,13 @@ static void amdgpu_device_post_asic_reset(struct 
amdgpu_device *adev,
 * or all rings (in the case @job is NULL)
 * after above amdgpu_reset accomplished
 */
-   if ((!job || job->base.sched == &ring->sched) && 
!adev->asic_reset_res)
-   drm_sched_job_recovery(&ring->sched);
+   unpark_only = (job && job->base.sched != &ring->sched) ||
+  adev->asic_reset_res;
+
+   if (!unpark_only)
+   drm_sched_resubmit_jobs(&ring->sched);
 
-   kthread_unpark(ring->sched.thread);
+   drm_sched_start(&ring->sched, unpark_only);
}
 
if (!amdgpu_device_has_dc_support(adev)) {
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_sched.c 
b/drivers/gpu/drm/etnaviv/etnaviv_sched.c
index 49a6763..fab3b51 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_sched.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_sched.c
@@ -109,16 +109,16 @@ static void etnaviv_sched_timedout_job(struct 
drm_sched_job *sched_job)
}
 
/* block scheduler */
-   kthread_park(gpu->sched.thread);
-   drm_sched_hw_job_reset(&gpu->sched, sched_job);
+   drm_sched_stop(&gpu->sched, sched_job, false);
 
/* get the GPU back into the init state */
etnaviv_core_dump(gpu);
etnaviv_gpu_recover_hang(gpu);
 
+   drm_sched_resubmit_jobs(&gpu->sched);
+
/* restart scheduler after GPU is usable again */
-   drm_sched_job_recovery(&gpu->sched);
-   kthread_unpark(gpu->sched.thread);
+   drm_sched_start(&gpu->sched);
 }
 
 static void etnaviv_sched_free_job(struct drm_sched_job *sched_job)
diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index dbb6906..cdf95e2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -60,8 +60,6 @@
 
 static void drm_sched_process_job(struct dma_fence *f, struct dma_fence_cb 
*cb);
 
-static void drm_sched_expel_job_unlocked(struct drm_sched_job *s_job);
-
 /**
  * drm_sched_rq_init - initialize a given run queue struct
  *
@@ -342,13 +340,21 @@ static void drm_sched_job_timedout(struct work_struct 
*work)
  * @bad: bad scheduler job
  *
  */
-void drm_sched_hw_job_reset(struct drm_gpu_scheduler *sched, struct 
drm_sched_job *bad)
+void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad,
+   bool park_only)
 {
struct drm_sched_job *s_job;
struct drm_sched_entity *entity, *tmp;
unsigned long flags;
+   struct list_head wait_list;
int i;
 
+   kthread_park(sched->thread);
+   if (park_only)
+   

[PATCH 1/1] drm/amdgpu: Fix stub function name

2018-12-10 Thread Kuehling, Felix
This function was renamed in a previous commit. Update the stub
function name for builds with CONFIG_HSA_AMD disabled.

Fixes: 62f65d3cb34a ("drm/amdgpu: Add KFD VRAM limit checking")
Signed-off-by: Felix Kuehling 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index 39f7c8c..2dfaf15 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -586,7 +586,7 @@ bool amdkfd_fence_check_mm(struct dma_fence *f, struct 
mm_struct *mm)
return false;
 }
 
-void amdgpu_amdkfd_unreserve_system_memory_limit(struct amdgpu_bo *bo)
+void amdgpu_amdkfd_unreserve_memory_limit(struct amdgpu_bo *bo)
 {
 }
 
-- 
2.7.4

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


[PATCH] drm/amdgpu: expose sclk and mclk via hwmon

2018-12-10 Thread Alex Deucher
Expose sclk (gfx clock) and mclk (memory clock) via
hwmon compatible interface.  hwmon does not actually
formally specify a frequency type attribute, but these
are compatible with the format of the other attributes
exposed via hwmon.  Units are hertz.

freq1_input - GPU gfx/compute clock in hertz
freq2_input - GPU memory clock in hertz (dGPU only)

Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 93 ++
 1 file changed, 93 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 1f61ed95727c..6d52428fc45b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1516,6 +1516,75 @@ static ssize_t amdgpu_hwmon_set_power_cap(struct device 
*dev,
return count;
 }
 
+static ssize_t amdgpu_hwmon_show_sclk(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+   struct amdgpu_device *adev = dev_get_drvdata(dev);
+   struct drm_device *ddev = adev->ddev;
+   uint32_t sclk;
+   int r, size = sizeof(sclk);
+
+   /* Can't get voltage when the card is off */
+   if  ((adev->flags & AMD_IS_PX) &&
+(ddev->switch_power_state != DRM_SWITCH_POWER_ON))
+   return -EINVAL;
+
+   /* sanity check PP is enabled */
+   if (!(adev->powerplay.pp_funcs &&
+ adev->powerplay.pp_funcs->read_sensor))
+ return -EINVAL;
+
+   /* get the sclk */
+   r = amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GFX_SCLK,
+  (void *)&sclk, &size);
+   if (r)
+   return r;
+
+   return snprintf(buf, PAGE_SIZE, "%d\n", sclk * 10 * 1000);
+}
+
+static ssize_t amdgpu_hwmon_show_sclk_label(struct device *dev,
+   struct device_attribute *attr,
+   char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, "sclk\n");
+}
+
+static ssize_t amdgpu_hwmon_show_mclk(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+   struct amdgpu_device *adev = dev_get_drvdata(dev);
+   struct drm_device *ddev = adev->ddev;
+   uint32_t mclk;
+   int r, size = sizeof(mclk);
+
+   /* Can't get voltage when the card is off */
+   if  ((adev->flags & AMD_IS_PX) &&
+(ddev->switch_power_state != DRM_SWITCH_POWER_ON))
+   return -EINVAL;
+
+   /* sanity check PP is enabled */
+   if (!(adev->powerplay.pp_funcs &&
+ adev->powerplay.pp_funcs->read_sensor))
+ return -EINVAL;
+
+   /* get the sclk */
+   r = amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GFX_MCLK,
+  (void *)&mclk, &size);
+   if (r)
+   return r;
+
+   return snprintf(buf, PAGE_SIZE, "%d\n", mclk * 10 * 1000);
+}
+
+static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev,
+   struct device_attribute *attr,
+   char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, "mclk\n");
+}
 
 /**
  * DOC: hwmon
@@ -1532,6 +1601,10 @@ static ssize_t amdgpu_hwmon_set_power_cap(struct device 
*dev,
  *
  * - GPU fan
  *
+ * - GPU gfx/compute engine clock
+ *
+ * - GPU memory clock (dGPU only)
+ *
  * hwmon interfaces for GPU temperature:
  *
  * - temp1_input: the on die GPU temperature in millidegrees Celsius
@@ -1576,6 +1649,12 @@ static ssize_t amdgpu_hwmon_set_power_cap(struct device 
*dev,
  *
  * - fan[1-*]_enable: Enable or disable the sensors.1: Enable 0: Disable
  *
+ * hwmon interfaces for GPU clocks:
+ *
+ * - freq1_input: the gfx/compute clock in hertz
+ *
+ * - freq2_input: the memory clock in hertz
+ *
  * You can use hwmon tools like sensors to view this information on your 
system.
  *
  */
@@ -1600,6 +1679,10 @@ static SENSOR_DEVICE_ATTR(power1_average, S_IRUGO, 
amdgpu_hwmon_show_power_avg,
 static SENSOR_DEVICE_ATTR(power1_cap_max, S_IRUGO, 
amdgpu_hwmon_show_power_cap_max, NULL, 0);
 static SENSOR_DEVICE_ATTR(power1_cap_min, S_IRUGO, 
amdgpu_hwmon_show_power_cap_min, NULL, 0);
 static SENSOR_DEVICE_ATTR(power1_cap, S_IRUGO | S_IWUSR, 
amdgpu_hwmon_show_power_cap, amdgpu_hwmon_set_power_cap, 0);
+static SENSOR_DEVICE_ATTR(freq1_input, S_IRUGO, amdgpu_hwmon_show_sclk, NULL, 
0);
+static SENSOR_DEVICE_ATTR(freq1_label, S_IRUGO, amdgpu_hwmon_show_sclk_label, 
NULL, 0);
+static SENSOR_DEVICE_ATTR(freq2_input, S_IRUGO, amdgpu_hwmon_show_mclk, NULL, 
0);
+static SENSOR_DEVICE_ATTR(freq2_label, S_IRUGO, amdgpu_hwmon_show_mclk_label, 
NULL, 0);
 
 static struct attribute *hwmon_attributes[] = {
&sensor_dev_attr_temp1_input.dev_attr.attr,
@@ -1622,6 +1705,10 @@ static struct attribute *hwmon_attributes[] = {
&sensor_dev_attr_power1_cap_max

Re: amdkfd build regression if HSA_AMD is disabled

2018-12-10 Thread Kuehling, Felix
KFD only works with x86_64. So we still need the switch to disable KFD
on i386 and other architectures that are not (yet) supported.


I'll look into a fix as soon as I can. Thanks for the heads up.


Regards,
  Felix


On 2018-12-10 11:25 a.m., Bridgman, John wrote:
>
> Do we still need the HSA_AMD option ?
>
>
> Seems to me that KFD stopped being "something we only sometimes
> include" a long time ago.
>
>
> Thanks,
> John
>
>
> 
> *From:* amd-gfx  on behalf of
> StDenis, Tom 
> *Sent:* December 10, 2018 10:02 AM
> *To:* Kuehling, Felix
> *Cc:* Huang, JinHuiEric; Deucher, Alexander; amd-gfx mailing list
> *Subject:* amdkfd build regression if HSA_AMD is disabled
>  
> Hi All,
>
> The commit:
>
> commit 62f65d3cb34a8300bf1e07fc478e03c3c02634d4
> Refs: v4.20-rc3-524-g62f65d3cb34a
> Author: Felix Kuehling 
> AuthorDate: Mon Nov 19 20:05:54 2018 -0500
> Commit: Felix Kuehling 
> CommitDate: Fri Dec 7 17:17:11 2018 -0500
>
>  drm/amdgpu: Add KFD VRAM limit checking
>
>  We don't want KFD processes evicting each other over VRAM usage.
>  Therefore prevent overcommitting VRAM among KFD applications with
>  a per-GPU limit. Also leave enough room for page tables on top
>  of the application memory usage.
>
>  Signed-off-by: Felix Kuehling 
>  Reviewed-by: Eric Huang 
>  Acked-by: Alex Deucher 
>
> Breaks the build if HSA_AMD is not enabled:
>
> scripts/kconfig/conf  --syncconfig Kconfig
>    DESCEND  objtool
>    CALL    scripts/checksyscalls.sh
>    CHK include/generated/compile.h
>    Building modules, stage 2.
>    MODPOST 63 modules
> Kernel: arch/x86/boot/bzImage is ready  (#58)
> ERROR: "amdgpu_amdkfd_unreserve_memory_limit"
> [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
> make: *** [Makefile:1271: modules] Error 2
>
> This is because the function being used is not included in the build
> (the previous function called was part of amdgpu_amdkfd.c which is
> unconditionally built).
>
> Cheers,
> Tom
> ___
> 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 2/2] drm/amdgpu: update MC firmware image for polaris10 variants

2018-12-10 Thread Alex Deucher
On Fri, Dec 7, 2018 at 3:40 AM Zhang, Jerry(Junwei)  wrote:
>
> we can drop MC update patch, since a new fw could fix that.

Shouldn't we apply this as well for consistency?

Alex

>
> Regards,
> Jerry
>
> On 12/7/18 3:19 PM, Junwei Zhang wrote:
> > Some new variants require different firmwares.
> >
> > Signed-off-by: Junwei Zhang 
> > ---
> >   drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 5 -
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c 
> > b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> > index 1ad7e6b8ed1d..0edb8622f666 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> > @@ -244,7 +244,10 @@ static int gmc_v8_0_init_microcode(struct 
> > amdgpu_device *adev)
> >   case CHIP_POLARIS10:
> >   if ((adev->pdev->device == 0x67df) &&
> >   ((adev->pdev->revision == 0xe1) ||
> > -  (adev->pdev->revision == 0xf7)))
> > +  (adev->pdev->revision == 0xf7)) ||
> > + ((adev->pdev->device == 0x6fdf) &&
> > +  ((adev->pdev->revision == 0xef) ||
> > +   (adev->pdev->revision == 0xff
> >   chip_name = "polaris10_k";
> >   else
> >   chip_name = "polaris10";
>
> ___
> 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] drm/amdgpu: bypass RLC init under sriov for Tonga

2018-12-10 Thread Yang, Philip
Never mind, just saw the patch to fix the typo.

On 2018-12-10 1:07 p.m., Yang, Philip wrote:
I got this compilation error message after I rebase this morning, do I miss 
anything?

/home/yangp/git/compute_staging/kernel/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: 
In function ‘gfx_v8_0_rlc_resume’:
/home/yangp/git/compute_staging/kernel/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:4071:6:
 error: implicit declaration of function ‘amdgpu_sriov’; did you mean 
‘amdgpu_sriov_vf’? [-Werror=implicit-function-declaration]
  if (amdgpu_sriov(adev)) {
  ^~~~
  amdgpu_sriov_vf
cc1: some warnings being treated as errors
/home/yangp/git/compute_staging/kernel/scripts/Makefile.build:293: recipe for 
target 'drivers/gpu/drm/amd/amdgpu/gfx_v8_0.o' failed
make[10]: *** [drivers/gpu/drm/amd/amdgpu/gfx_v8_0.o] Error 1

Philip

On 2018-12-07 10:33 a.m., Deucher, Alexander wrote:

Acked-by: Alex Deucher 



From: amd-gfx 

 on behalf of Tiecheng Zhou 

Sent: Thursday, December 6, 2018 9:11:49 PM
To: amd-gfx@lists.freedesktop.org
Cc: Zhou, Tiecheng
Subject: [PATCH] drm/amdgpu: bypass RLC init under sriov for Tonga

SWDEV-173384: vm-mix reboot (4 VMs) fail on Tonga under sriov

Phenomena: there is compute_1.3.1 ring test fail on one VM
   when it starts to do hw_init after it is rebooted

Root cause: RLC will go wrong in soft_reset under sriov

Workaround: init RLC csb, and skip RLC stop, reset, start
this is because GIM has already done
full initialization on RLC

refer to 'commit cfee05bc9057 ("drm/amdgpu:bypass RLC init for SRIOV")'
 and 'commit f840cc5f8447 ("drm/amdgpu/sriov:init csb for gfxv9")'

Signed-off-by: Tiecehng Zhou 

---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 1454fc3..a9c853a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4068,6 +4068,11 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device 
*adev)

 static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
 {
+   if (amdgpu_sriov(adev)) {
+   gfx_v8_0_init_csb(adev);
+   return 0;
+   }
+
 adev->gfx.rlc.funcs->stop(adev);
 adev->gfx.rlc.funcs->reset(adev);
 gfx_v8_0_init_pg(adev);
--
2.7.4

___
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





___
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] drm/amdgpu: bypass RLC init under sriov for Tonga

2018-12-10 Thread Yang, Philip
I got this compilation error message after I rebase this morning, do I miss 
anything?

/home/yangp/git/compute_staging/kernel/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: 
In function ‘gfx_v8_0_rlc_resume’:
/home/yangp/git/compute_staging/kernel/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:4071:6:
 error: implicit declaration of function ‘amdgpu_sriov’; did you mean 
‘amdgpu_sriov_vf’? [-Werror=implicit-function-declaration]
  if (amdgpu_sriov(adev)) {
  ^~~~
  amdgpu_sriov_vf
cc1: some warnings being treated as errors
/home/yangp/git/compute_staging/kernel/scripts/Makefile.build:293: recipe for 
target 'drivers/gpu/drm/amd/amdgpu/gfx_v8_0.o' failed
make[10]: *** [drivers/gpu/drm/amd/amdgpu/gfx_v8_0.o] Error 1

Philip

On 2018-12-07 10:33 a.m., Deucher, Alexander wrote:

Acked-by: Alex Deucher 



From: amd-gfx 

 on behalf of Tiecheng Zhou 

Sent: Thursday, December 6, 2018 9:11:49 PM
To: amd-gfx@lists.freedesktop.org
Cc: Zhou, Tiecheng
Subject: [PATCH] drm/amdgpu: bypass RLC init under sriov for Tonga

SWDEV-173384: vm-mix reboot (4 VMs) fail on Tonga under sriov

Phenomena: there is compute_1.3.1 ring test fail on one VM
   when it starts to do hw_init after it is rebooted

Root cause: RLC will go wrong in soft_reset under sriov

Workaround: init RLC csb, and skip RLC stop, reset, start
this is because GIM has already done
full initialization on RLC

refer to 'commit cfee05bc9057 ("drm/amdgpu:bypass RLC init for SRIOV")'
 and 'commit f840cc5f8447 ("drm/amdgpu/sriov:init csb for gfxv9")'

Signed-off-by: Tiecehng Zhou 

---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 1454fc3..a9c853a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4068,6 +4068,11 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device 
*adev)

 static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
 {
+   if (amdgpu_sriov(adev)) {
+   gfx_v8_0_init_csb(adev);
+   return 0;
+   }
+
 adev->gfx.rlc.funcs->stop(adev);
 adev->gfx.rlc.funcs->reset(adev);
 gfx_v8_0_init_pg(adev);
--
2.7.4

___
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


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


Re: amdkfd build regression if HSA_AMD is disabled

2018-12-10 Thread Bridgman, John
Do we still need the HSA_AMD option ?


Seems to me that KFD stopped being "something we only sometimes include" a long 
time ago.


Thanks,
John


From: amd-gfx  on behalf of StDenis, Tom 

Sent: December 10, 2018 10:02 AM
To: Kuehling, Felix
Cc: Huang, JinHuiEric; Deucher, Alexander; amd-gfx mailing list
Subject: amdkfd build regression if HSA_AMD is disabled

Hi All,

The commit:

commit 62f65d3cb34a8300bf1e07fc478e03c3c02634d4
Refs: v4.20-rc3-524-g62f65d3cb34a
Author: Felix Kuehling 
AuthorDate: Mon Nov 19 20:05:54 2018 -0500
Commit: Felix Kuehling 
CommitDate: Fri Dec 7 17:17:11 2018 -0500

 drm/amdgpu: Add KFD VRAM limit checking

 We don't want KFD processes evicting each other over VRAM usage.
 Therefore prevent overcommitting VRAM among KFD applications with
 a per-GPU limit. Also leave enough room for page tables on top
 of the application memory usage.

 Signed-off-by: Felix Kuehling 
 Reviewed-by: Eric Huang 
 Acked-by: Alex Deucher 

Breaks the build if HSA_AMD is not enabled:

scripts/kconfig/conf  --syncconfig Kconfig
   DESCEND  objtool
   CALLscripts/checksyscalls.sh
   CHK include/generated/compile.h
   Building modules, stage 2.
   MODPOST 63 modules
Kernel: arch/x86/boot/bzImage is ready  (#58)
ERROR: "amdgpu_amdkfd_unreserve_memory_limit"
[drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
make: *** [Makefile:1271: modules] Error 2

This is because the function being used is not included in the build
(the previous function called was part of amdgpu_amdkfd.c which is
unconditionally built).

Cheers,
Tom
___
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] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

2018-12-10 Thread Liu, Shaoyun
But KFD still need to be notified during reset , the  pre_reset call to KFD 
will let KFD have  a chance to suspend all the  running process queues.  Was 
the reset works normally on SRIOV before the refactor change for  XGMI support 
?  We shouldn't change the logic . 

Regards
shaoyun.liu

-Original Message-
From: amd-gfx  On Behalf Of wentalou
Sent: Friday, December 7, 2018 1:09 AM
To: amd-gfx@lists.freedesktop.org
Cc: Lou, Wentao 
Subject: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

XGMI hive put kfd_pre_reset into amdgpu_device_lock_adev, but outside 
req_full_gpu of sriov.
It would make sriov hang during reset.

Change-Id: I5b3e2a42c77b3b9635419df4470d021df7be34d1
Signed-off-by: Wentao Lou 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index ef36cc5..659dd40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3474,14 +3474,16 @@ static void amdgpu_device_lock_adev(struct 
amdgpu_device *adev)
mutex_lock(&adev->lock_reset);
atomic_inc(&adev->gpu_reset_counter);
adev->in_gpu_reset = 1;
-   /* Block kfd */
-   amdgpu_amdkfd_pre_reset(adev);
+   /* Block kfd: SRIOV would do it separately */
+   if (!amdgpu_sriov_vf(adev))
+amdgpu_amdkfd_pre_reset(adev);
 }
 
 static void amdgpu_device_unlock_adev(struct amdgpu_device *adev)  {
-   /*unlock kfd */
-   amdgpu_amdkfd_post_reset(adev);
+   /*unlock kfd: SRIOV would do it separately */
+   if (!amdgpu_sriov_vf(adev))
+amdgpu_amdkfd_post_reset(adev);
amdgpu_vf_error_trans_all(adev);
adev->in_gpu_reset = 0;
mutex_unlock(&adev->lock_reset);
--
2.7.4

___
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 4/7] drm: Move the legacy kms disable_all helper to crtc helpers

2018-12-10 Thread Alex Deucher
On Mon, Dec 10, 2018 at 5:04 AM Daniel Vetter  wrote:
>
> It's not a core function, and the matching atomic functions are also
> not in the core. Plus the suspend/resume helper is also already there.
>
> Needs a tiny bit of open-coding, but less midlayer beats that I think.
>
> Cc: Sam Bobroff 
> Signed-off-by: Daniel Vetter 
> Cc: Maarten Lankhorst 
> Cc: Maxime Ripard 
> Cc: Sean Paul 
> Cc: David Airlie 
> Cc: Ben Skeggs 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: "David (ChunMing) Zhou" 
> Cc: Rex Zhu 
> Cc: Andrey Grodzovsky 
> Cc: Huang Rui 
> Cc: Shaoyun Liu 
> Cc: Monk Liu 
> Cc: nouv...@lists.freedesktop.org
> Cc: amd-gfx@lists.freedesktop.org
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
>  drivers/gpu/drm/drm_crtc.c | 31 ---
>  drivers/gpu/drm/drm_crtc_helper.c  | 35 ++
>  drivers/gpu/drm/nouveau/nouveau_display.c  |  2 +-
>  drivers/gpu/drm/radeon/radeon_display.c|  2 +-
>  include/drm/drm_crtc.h |  2 --
>  include/drm/drm_crtc_helper.h  |  1 +
>  7 files changed, 39 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index c75badfa5c4c..e669297ffefb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2689,7 +2689,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
> amdgpu_irq_disable_all(adev);
> if (adev->mode_info.mode_config_initialized){
> if (!amdgpu_device_has_dc_support(adev))
> -   drm_crtc_force_disable_all(adev->ddev);
> +   drm_helper_force_disable_all(adev->ddev);
> else
> drm_atomic_helper_shutdown(adev->ddev);
> }
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index f660819d406e..7dabbaf033a1 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -104,37 +104,6 @@ int drm_crtc_force_disable(struct drm_crtc *crtc)
> return drm_mode_set_config_internal(&set);
>  }
>
> -/**
> - * drm_crtc_force_disable_all - Forcibly turn off all enabled CRTCs
> - * @dev: DRM device whose CRTCs to turn off
> - *
> - * Drivers may want to call this on unload to ensure that all displays are
> - * unlit and the GPU is in a consistent, low power state. Takes modeset 
> locks.
> - *
> - * Note: This should only be used by non-atomic legacy drivers. For an atomic
> - * version look at drm_atomic_helper_shutdown().
> - *
> - * Returns:
> - * Zero on success, error code on failure.
> - */
> -int drm_crtc_force_disable_all(struct drm_device *dev)
> -{
> -   struct drm_crtc *crtc;
> -   int ret = 0;
> -
> -   drm_modeset_lock_all(dev);
> -   drm_for_each_crtc(crtc, dev)
> -   if (crtc->enabled) {
> -   ret = drm_crtc_force_disable(crtc);
> -   if (ret)
> -   goto out;
> -   }
> -out:
> -   drm_modeset_unlock_all(dev);
> -   return ret;
> -}
> -EXPORT_SYMBOL(drm_crtc_force_disable_all);
> -
>  static unsigned int drm_num_crtcs(struct drm_device *dev)
>  {
> unsigned int num = 0;
> diff --git a/drivers/gpu/drm/drm_crtc_helper.c 
> b/drivers/gpu/drm/drm_crtc_helper.c
> index a3c81850e755..23159eb494f1 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -984,3 +984,38 @@ void drm_helper_resume_force_mode(struct drm_device *dev)
> drm_modeset_unlock_all(dev);
>  }
>  EXPORT_SYMBOL(drm_helper_resume_force_mode);
> +
> +/**
> + * drm_helper_force_disable_all - Forcibly turn off all enabled CRTCs
> + * @dev: DRM device whose CRTCs to turn off
> + *
> + * Drivers may want to call this on unload to ensure that all displays are
> + * unlit and the GPU is in a consistent, low power state. Takes modeset 
> locks.
> + *
> + * Note: This should only be used by non-atomic legacy drivers. For an atomic
> + * version look at drm_atomic_helper_shutdown().
> + *
> + * Returns:
> + * Zero on success, error code on failure.
> + */
> +int drm_helper_force_disable_all(struct drm_device *dev)

Maybe put crtc somewhere in the function name so it's clear what we
are disabling.  With that fixed:
Reviewed-by: Alex Deucher 

> +{
> +   struct drm_crtc *crtc;
> +   int ret = 0;
> +
> +   drm_modeset_lock_all(dev);
> +   drm_for_each_crtc(crtc, dev)
> +   if (crtc->enabled) {
> +   struct drm_mode_set set = {
> +   .crtc = crtc,
> +   };
> +
> +   ret = drm_mode_set_config_internal(&set);
> +   if (ret)
> +   goto out;
> +   }
> +out:
> +   drm_modeset_unlock_all(dev);
> +   return ret;
> +}
> +EXPORT_SYMBOL(drm_helper_force_disable_all);

Re: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

2018-12-10 Thread Deucher, Alexander
vbios asic init will still work.  It will wait on the psp init so I'd suggest 
we just drop this patch to keep the code consistent.  There are also possibly 
some registers that are handled by vbios asic init rather than psp.


Alex


From: amd-gfx  on behalf of Feifei Xu 

Sent: Sunday, December 9, 2018 11:45:52 PM
To: amd-gfx@lists.freedesktop.org
Cc: Xu, Feifei
Subject: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

On vega20, the job of executing the ASIC_INIT table when posting card
is moved to psp. Skip the atombios's ASIC_INIT on vega20 when posting
card.

Change-Id: Id1d3c0a0d19296d5ed804de7edf5b09b8d38c0a5
Signed-off-by: Feifei Xu 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index f2bda76c8e05..310d4eb0536b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2513,8 +2513,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 /* detect if we are with an SRIOV vbios */
 amdgpu_device_detect_sriov_bios(adev);

+DRM_INFO("skip posting card using ASIC INIT table in vbios on vega20\n");
 /* Post card if necessary */
-   if (amdgpu_device_need_post(adev)) {
+   if ((adev->asic_type != CHIP_VEGA20) && amdgpu_device_need_post(adev)) {
 if (!adev->bios) {
 dev_err(adev->dev, "no vBIOS found\n");
 r = -EINVAL;
--
2.17.1

___
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


amdkfd build regression if HSA_AMD is disabled

2018-12-10 Thread StDenis, Tom
Hi All,

The commit:

commit 62f65d3cb34a8300bf1e07fc478e03c3c02634d4
Refs: v4.20-rc3-524-g62f65d3cb34a
Author: Felix Kuehling 
AuthorDate: Mon Nov 19 20:05:54 2018 -0500
Commit: Felix Kuehling 
CommitDate: Fri Dec 7 17:17:11 2018 -0500

 drm/amdgpu: Add KFD VRAM limit checking

 We don't want KFD processes evicting each other over VRAM usage.
 Therefore prevent overcommitting VRAM among KFD applications with
 a per-GPU limit. Also leave enough room for page tables on top
 of the application memory usage.

 Signed-off-by: Felix Kuehling 
 Reviewed-by: Eric Huang 
 Acked-by: Alex Deucher 

Breaks the build if HSA_AMD is not enabled:

scripts/kconfig/conf  --syncconfig Kconfig
   DESCEND  objtool
   CALLscripts/checksyscalls.sh
   CHK include/generated/compile.h
   Building modules, stage 2.
   MODPOST 63 modules
Kernel: arch/x86/boot/bzImage is ready  (#58)
ERROR: "amdgpu_amdkfd_unreserve_memory_limit" 
[drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
make: *** [Makefile:1271: modules] Error 2

This is because the function being used is not included in the build 
(the previous function called was part of amdgpu_amdkfd.c which is 
unconditionally built).

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


Re: [PATCH 7/7] drm: Split out drm_probe_helper.h

2018-12-10 Thread Benjamin Gaignard
Le lun. 10 déc. 2018 à 12:10, Benjamin Gaignard
 a écrit :
>
> Le lun. 10 déc. 2018 à 11:24, Thierry Reding
>  a écrit :
> >
> > On Mon, Dec 10, 2018 at 11:11:33AM +0100, Daniel Vetter wrote:
> > > Having the probe helper stuff (which pretty much everyone needs) in
> > > the drm_crtc_helper.h file (which atomic drivers should never need) is
> > > confusing. Split them out.
> > >
> > > To make sure I actually achieved the goal here I went through all
> > > drivers. And indeed, all atomic drivers are now free of
> > > drm_crtc_helper.h includes.
> > >
>
> I have difficulties to apply this with git on top of drm-misc-next.
> It is because of that I got errors (encoder and connector types not
> found) while compiling adv7511_audio.c and exynos_dp.c ?
>

Nack on this patch because it break compiling at least on sti driver.
drm_probe_helper.h doesn't bring the same includes than drm_crtc_helper.h:
#include 
#include 
#include 
so some types, structures and functions proptotypes are missing while compiling.


> Benjamin
> > > Signed-off-by: Daniel Vetter 
> > > Cc: linux-arm-ker...@lists.infradead.org
> > > Cc: virtualizat...@lists.linux-foundation.org
> > > Cc: etna...@lists.freedesktop.org
> > > Cc: linux-samsung-...@vger.kernel.org
> > > Cc: intel-...@lists.freedesktop.org
> > > Cc: linux-media...@lists.infradead.org
> > > Cc: linux-amlo...@lists.infradead.org
> > > Cc: linux-arm-...@vger.kernel.org
> > > Cc: freedr...@lists.freedesktop.org
> > > Cc: nouv...@lists.freedesktop.org
> > > Cc: spice-de...@lists.freedesktop.org
> > > Cc: amd-gfx@lists.freedesktop.org
> > > Cc: linux-renesas-...@vger.kernel.org
> > > Cc: linux-rockc...@lists.infradead.org
> > > Cc: linux-st...@st-md-mailman.stormreply.com
> > > Cc: linux-te...@vger.kernel.org
> > > Cc: xen-de...@lists.xen.org
> > > ---
> > >  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c|  2 +-
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|  2 +-
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   |  2 +-
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h  |  1 +
> > >  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  2 +-
> > >  .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  |  2 +-
> > >  .../display/amdgpu_dm/amdgpu_dm_services.c|  2 +-
> > >  drivers/gpu/drm/arc/arcpgu_crtc.c |  2 +-
> > >  drivers/gpu/drm/arc/arcpgu_drv.c  |  2 +-
> > >  drivers/gpu/drm/arc/arcpgu_sim.c  |  2 +-
> > >  drivers/gpu/drm/arm/hdlcd_crtc.c  |  2 +-
> > >  drivers/gpu/drm/arm/hdlcd_drv.c   |  2 +-
> > >  drivers/gpu/drm/arm/malidp_crtc.c |  2 +-
> > >  drivers/gpu/drm/arm/malidp_drv.c  |  2 +-
> > >  drivers/gpu/drm/arm/malidp_mw.c   |  2 +-
> > >  drivers/gpu/drm/armada/armada_510.c   |  2 +-
> > >  drivers/gpu/drm/armada/armada_crtc.c  |  2 +-
> > >  drivers/gpu/drm/armada/armada_drv.c   |  2 +-
> > >  drivers/gpu/drm/armada/armada_fb.c|  2 +-
> > >  drivers/gpu/drm/ast/ast_drv.c |  1 +
> > >  drivers/gpu/drm/ast/ast_mode.c|  1 +
> > >  .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c|  2 +-
> > >  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h  |  2 +-
> > >  drivers/gpu/drm/bochs/bochs_drv.c |  1 +
> > >  drivers/gpu/drm/bochs/bochs_kms.c |  1 +
> > >  drivers/gpu/drm/bridge/adv7511/adv7511.h  |  2 +-
> > >  drivers/gpu/drm/bridge/analogix-anx78xx.c |  3 +-
> > >  .../drm/bridge/analogix/analogix_dp_core.c|  2 +-
> > >  drivers/gpu/drm/bridge/cdns-dsi.c |  2 +-
> > >  drivers/gpu/drm/bridge/dumb-vga-dac.c |  2 +-
> > >  .../bridge/megachips-stdp-ge-b850v3-fw.c  |  2 +-
> > >  drivers/gpu/drm/bridge/nxp-ptn3460.c  |  2 +-
> > >  drivers/gpu/drm/bridge/panel.c|  2 +-
> > >  drivers/gpu/drm/bridge/parade-ps8622.c|  2 +-
> > >  drivers/gpu/drm/bridge/sii902x.c  |  2 +-
> > >  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c |  2 +-
> > >  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c |  2 +-
> > >  drivers/gpu/drm/bridge/tc358764.c |  2 +-
> > >  drivers/gpu/drm/bridge/tc358767.c |  2 +-
> > >  drivers/gpu/drm/bridge/ti-sn65dsi86.c |  2 +-
> > >  drivers/gpu/drm/bridge/ti-tfp410.c|  2 +-
> > >  drivers/gpu/drm/cirrus/cirrus_drv.c   |  1 +
> > >  drivers/gpu/drm/cirrus/cirrus_mode.c  |  1 +
> > >  drivers/gpu/drm/drm_atomic_helper.c   |  1 -
> > >  drivers/gpu/drm/drm_dp_mst_topology.c |  2 +-
> > >  drivers/gpu/drm/drm_modeset_helper.c  |  2 +-
> > >  drivers/gpu/drm/drm_probe_helper.c|  2 +-
> > >  drivers/gpu/drm/drm_simple_kms_helper.c   |  2 +-
> > >  drivers/gpu/drm/etnaviv/etnaviv_drv.h |  1 -
> > >  drivers/gpu/drm/exynos/exynos_dp.c|  2 +-
> > >  drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  2 +-
> > >  drivers/gpu/drm/exynos/exynos_drm_dpi.c   |  2 +-
> > >  drivers/gpu/drm/exynos

Re: [PATCH 7/7] drm: Split out drm_probe_helper.h

2018-12-10 Thread Neil Armstrong
On 10/12/2018 11:11, Daniel Vetter wrote:
> Having the probe helper stuff (which pretty much everyone needs) in
> the drm_crtc_helper.h file (which atomic drivers should never need) is
> confusing. Split them out.
> 
> To make sure I actually achieved the goal here I went through all
> drivers. And indeed, all atomic drivers are now free of
> drm_crtc_helper.h includes.
> 
> Signed-off-by: Daniel Vetter 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: virtualizat...@lists.linux-foundation.org
> Cc: etna...@lists.freedesktop.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: intel-...@lists.freedesktop.org
> Cc: linux-media...@lists.infradead.org
> Cc: linux-amlo...@lists.infradead.org
> Cc: linux-arm-...@vger.kernel.org
> Cc: freedr...@lists.freedesktop.org
> Cc: nouv...@lists.freedesktop.org
> Cc: spice-de...@lists.freedesktop.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: linux-renesas-...@vger.kernel.org
> Cc: linux-rockc...@lists.infradead.org
> Cc: linux-st...@st-md-mailman.stormreply.com
> Cc: linux-te...@vger.kernel.org
> Cc: xen-de...@lists.xen.org
> ---
>  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c|  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h  |  1 +
>  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  2 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  |  2 +-
>  .../display/amdgpu_dm/amdgpu_dm_services.c|  2 +-
>  drivers/gpu/drm/arc/arcpgu_crtc.c |  2 +-
>  drivers/gpu/drm/arc/arcpgu_drv.c  |  2 +-
>  drivers/gpu/drm/arc/arcpgu_sim.c  |  2 +-
>  drivers/gpu/drm/arm/hdlcd_crtc.c  |  2 +-
>  drivers/gpu/drm/arm/hdlcd_drv.c   |  2 +-
>  drivers/gpu/drm/arm/malidp_crtc.c |  2 +-
>  drivers/gpu/drm/arm/malidp_drv.c  |  2 +-
>  drivers/gpu/drm/arm/malidp_mw.c   |  2 +-
>  drivers/gpu/drm/armada/armada_510.c   |  2 +-
>  drivers/gpu/drm/armada/armada_crtc.c  |  2 +-
>  drivers/gpu/drm/armada/armada_drv.c   |  2 +-
>  drivers/gpu/drm/armada/armada_fb.c|  2 +-
>  drivers/gpu/drm/ast/ast_drv.c |  1 +
>  drivers/gpu/drm/ast/ast_mode.c|  1 +
>  .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c|  2 +-
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h  |  2 +-
>  drivers/gpu/drm/bochs/bochs_drv.c |  1 +
>  drivers/gpu/drm/bochs/bochs_kms.c |  1 +
>  drivers/gpu/drm/bridge/adv7511/adv7511.h  |  2 +-
>  drivers/gpu/drm/bridge/analogix-anx78xx.c |  3 +-
>  .../drm/bridge/analogix/analogix_dp_core.c|  2 +-
>  drivers/gpu/drm/bridge/cdns-dsi.c |  2 +-
>  drivers/gpu/drm/bridge/dumb-vga-dac.c |  2 +-
>  .../bridge/megachips-stdp-ge-b850v3-fw.c  |  2 +-
>  drivers/gpu/drm/bridge/nxp-ptn3460.c  |  2 +-
>  drivers/gpu/drm/bridge/panel.c|  2 +-
>  drivers/gpu/drm/bridge/parade-ps8622.c|  2 +-
>  drivers/gpu/drm/bridge/sii902x.c  |  2 +-
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c |  2 +-
>  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c |  2 +-
>  drivers/gpu/drm/bridge/tc358764.c |  2 +-
>  drivers/gpu/drm/bridge/tc358767.c |  2 +-
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c |  2 +-
>  drivers/gpu/drm/bridge/ti-tfp410.c|  2 +-
>  drivers/gpu/drm/cirrus/cirrus_drv.c   |  1 +
>  drivers/gpu/drm/cirrus/cirrus_mode.c  |  1 +
>  drivers/gpu/drm/drm_atomic_helper.c   |  1 -
>  drivers/gpu/drm/drm_dp_mst_topology.c |  2 +-
>  drivers/gpu/drm/drm_modeset_helper.c  |  2 +-
>  drivers/gpu/drm/drm_probe_helper.c|  2 +-
>  drivers/gpu/drm/drm_simple_kms_helper.c   |  2 +-
>  drivers/gpu/drm/etnaviv/etnaviv_drv.h |  1 -
>  drivers/gpu/drm/exynos/exynos_dp.c|  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_dpi.c   |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_drv.c   |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_dsi.c   |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c  |  2 +-
>  drivers/gpu/drm/exynos/exynos_hdmi.c  |  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c|  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c |  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c   |  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c |  2 +-
>  drivers/gpu/drm/gma500/psb_intel_drv.h|  1 +
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c|  2 +-
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c   |  2 +-
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c |  2 +-
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c  |  2 +-
>  drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c  |  2 +

RE: build broken on drm-next

2018-12-10 Thread Huang, Ray
Jack already have a patch to fix this issue. 

Thanks,
Ray

> -Original Message-
> From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf
> Of StDenis, Tom
> Sent: Monday, December 10, 2018 8:07 PM
> To: Zhou, Tiecheng ; amd-gfx mailing list  g...@lists.freedesktop.org>
> Cc: Deucher, Alexander 
> Subject: build broken on drm-next
> 
> Hi,
> 
> This commit
> 
> commit e421c656beefa1044f65cf50d7a7455df60cd703
> 
> Refs: v4.20-rc3-530-ge421c656beef
> 
> Author: Tiecheng Zhou 
> 
> AuthorDate: Fri Dec 7 09:11:35 2018 +0800
> 
> Commit: Tiecheng Zhou 
> 
> CommitDate: Mon Dec 10 11:14:27 2018 +0800
> 
> 
>  drm/amdgpu: bypass RLC init under sriov for Tonga
> 
>  RLC will go wrong in soft_reset under sriov
> 
>  Workaroound: only need to init RLC csb, and skip RLC stop, reset, start
>  this is because host-driver has already done full initialization on 
> RLC
> 
>  Signed-off-by: Tiecehng Zhou 
> 
>  Acked-by: Alex Deucher 
> 
> 
> Causes a build error on amd-staging-drm-next:
> 
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function
> ‘gfx_v8_0_rlc_resume’:
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:4071:6: error: implicit declaration
> of function ‘amdgpu_sriov’; did you mean ‘amdgpu_sriov_vf’?
> [-Werror=implicit-function-declaration]
>if (amdgpu_sriov(adev)) {
>^~~~
>amdgpu_sriov_vf
>CC [M]  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.o
>CC [M]  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.o
>CC [M]  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.o
> cc1: some warnings being treated as errors
> make[4]: *** [scripts/Makefile.build:293:
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.o] Error 1
> make[4]: *** Waiting for unfinished jobs
> make[3]: *** [scripts/Makefile.build:518: drivers/gpu/drm/amd/amdgpu]
> Error 2
> make[2]: *** [scripts/Makefile.build:518: drivers/gpu/drm] Error 2
> make[1]: *** [scripts/Makefile.build:518: drivers/gpu] Error 2
> make: *** [Makefile:1060: drivers] Error 2
> 
> 
> Tom
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
--- Begin Message ---
Signed-off-by: Chengming Gui 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index a9c853a..08f443f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4068,7 +4068,7 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device *adev)

 static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
 {
-   if (amdgpu_sriov(adev)) {
+   if (amdgpu_sriov_vf(adev)) {
gfx_v8_0_init_csb(adev);
return 0;
}
--
2.7.4

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


build broken on drm-next

2018-12-10 Thread StDenis, Tom
Hi,

This commit

commit e421c656beefa1044f65cf50d7a7455df60cd703 

Refs: v4.20-rc3-530-ge421c656beef 

Author: Tiecheng Zhou  

AuthorDate: Fri Dec 7 09:11:35 2018 +0800 

Commit: Tiecheng Zhou  

CommitDate: Mon Dec 10 11:14:27 2018 +0800 


 drm/amdgpu: bypass RLC init under sriov for Tonga

 RLC will go wrong in soft_reset under sriov

 Workaroound: only need to init RLC csb, and skip RLC stop, reset, start
 this is because host-driver has already done full 
initialization on RLC

 Signed-off-by: Tiecehng Zhou  

 Acked-by: Alex Deucher  


Causes a build error on amd-staging-drm-next:

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function ‘gfx_v8_0_rlc_resume’:
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:4071:6: error: implicit 
declaration of function ‘amdgpu_sriov’; did you mean ‘amdgpu_sriov_vf’? 
[-Werror=implicit-function-declaration]
   if (amdgpu_sriov(adev)) {
   ^~~~
   amdgpu_sriov_vf
   CC [M]  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.o
   CC [M]  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.o
   CC [M]  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.o
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:293: 
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.o] Error 1
make[4]: *** Waiting for unfinished jobs
make[3]: *** [scripts/Makefile.build:518: drivers/gpu/drm/amd/amdgpu] 
Error 2
make[2]: *** [scripts/Makefile.build:518: drivers/gpu/drm] Error 2
make[1]: *** [scripts/Makefile.build:518: drivers/gpu] Error 2
make: *** [Makefile:1060: drivers] Error 2


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


Re: [PATCH 7/7] drm: Split out drm_probe_helper.h

2018-12-10 Thread Benjamin Gaignard
Le lun. 10 déc. 2018 à 11:24, Thierry Reding
 a écrit :
>
> On Mon, Dec 10, 2018 at 11:11:33AM +0100, Daniel Vetter wrote:
> > Having the probe helper stuff (which pretty much everyone needs) in
> > the drm_crtc_helper.h file (which atomic drivers should never need) is
> > confusing. Split them out.
> >
> > To make sure I actually achieved the goal here I went through all
> > drivers. And indeed, all atomic drivers are now free of
> > drm_crtc_helper.h includes.
> >

I have difficulties to apply this with git on top of drm-misc-next.
It is because of that I got errors (encoder and connector types not
found) while compiling adv7511_audio.c and exynos_dp.c ?

Benjamin
> > Signed-off-by: Daniel Vetter 
> > Cc: linux-arm-ker...@lists.infradead.org
> > Cc: virtualizat...@lists.linux-foundation.org
> > Cc: etna...@lists.freedesktop.org
> > Cc: linux-samsung-...@vger.kernel.org
> > Cc: intel-...@lists.freedesktop.org
> > Cc: linux-media...@lists.infradead.org
> > Cc: linux-amlo...@lists.infradead.org
> > Cc: linux-arm-...@vger.kernel.org
> > Cc: freedr...@lists.freedesktop.org
> > Cc: nouv...@lists.freedesktop.org
> > Cc: spice-de...@lists.freedesktop.org
> > Cc: amd-gfx@lists.freedesktop.org
> > Cc: linux-renesas-...@vger.kernel.org
> > Cc: linux-rockc...@lists.infradead.org
> > Cc: linux-st...@st-md-mailman.stormreply.com
> > Cc: linux-te...@vger.kernel.org
> > Cc: xen-de...@lists.xen.org
> > ---
> >  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c|  2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|  2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   |  2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h  |  1 +
> >  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  2 +-
> >  .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  |  2 +-
> >  .../display/amdgpu_dm/amdgpu_dm_services.c|  2 +-
> >  drivers/gpu/drm/arc/arcpgu_crtc.c |  2 +-
> >  drivers/gpu/drm/arc/arcpgu_drv.c  |  2 +-
> >  drivers/gpu/drm/arc/arcpgu_sim.c  |  2 +-
> >  drivers/gpu/drm/arm/hdlcd_crtc.c  |  2 +-
> >  drivers/gpu/drm/arm/hdlcd_drv.c   |  2 +-
> >  drivers/gpu/drm/arm/malidp_crtc.c |  2 +-
> >  drivers/gpu/drm/arm/malidp_drv.c  |  2 +-
> >  drivers/gpu/drm/arm/malidp_mw.c   |  2 +-
> >  drivers/gpu/drm/armada/armada_510.c   |  2 +-
> >  drivers/gpu/drm/armada/armada_crtc.c  |  2 +-
> >  drivers/gpu/drm/armada/armada_drv.c   |  2 +-
> >  drivers/gpu/drm/armada/armada_fb.c|  2 +-
> >  drivers/gpu/drm/ast/ast_drv.c |  1 +
> >  drivers/gpu/drm/ast/ast_mode.c|  1 +
> >  .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c|  2 +-
> >  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h  |  2 +-
> >  drivers/gpu/drm/bochs/bochs_drv.c |  1 +
> >  drivers/gpu/drm/bochs/bochs_kms.c |  1 +
> >  drivers/gpu/drm/bridge/adv7511/adv7511.h  |  2 +-
> >  drivers/gpu/drm/bridge/analogix-anx78xx.c |  3 +-
> >  .../drm/bridge/analogix/analogix_dp_core.c|  2 +-
> >  drivers/gpu/drm/bridge/cdns-dsi.c |  2 +-
> >  drivers/gpu/drm/bridge/dumb-vga-dac.c |  2 +-
> >  .../bridge/megachips-stdp-ge-b850v3-fw.c  |  2 +-
> >  drivers/gpu/drm/bridge/nxp-ptn3460.c  |  2 +-
> >  drivers/gpu/drm/bridge/panel.c|  2 +-
> >  drivers/gpu/drm/bridge/parade-ps8622.c|  2 +-
> >  drivers/gpu/drm/bridge/sii902x.c  |  2 +-
> >  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c |  2 +-
> >  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c |  2 +-
> >  drivers/gpu/drm/bridge/tc358764.c |  2 +-
> >  drivers/gpu/drm/bridge/tc358767.c |  2 +-
> >  drivers/gpu/drm/bridge/ti-sn65dsi86.c |  2 +-
> >  drivers/gpu/drm/bridge/ti-tfp410.c|  2 +-
> >  drivers/gpu/drm/cirrus/cirrus_drv.c   |  1 +
> >  drivers/gpu/drm/cirrus/cirrus_mode.c  |  1 +
> >  drivers/gpu/drm/drm_atomic_helper.c   |  1 -
> >  drivers/gpu/drm/drm_dp_mst_topology.c |  2 +-
> >  drivers/gpu/drm/drm_modeset_helper.c  |  2 +-
> >  drivers/gpu/drm/drm_probe_helper.c|  2 +-
> >  drivers/gpu/drm/drm_simple_kms_helper.c   |  2 +-
> >  drivers/gpu/drm/etnaviv/etnaviv_drv.h |  1 -
> >  drivers/gpu/drm/exynos/exynos_dp.c|  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_dpi.c   |  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_drv.c   |  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_dsi.c   |  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_vidi.c  |  2 +-
> >  drivers/gpu/drm/exynos/exynos_hdmi.c  |  2 +-
> >  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c|  2 +-
> >  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |  2 +-
> >  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 

RE: [PATCH] amd/amdgpu: fix typo about amdgpu_sriov_vf

2018-12-10 Thread Huang, Ray
> -Original Message-
> From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf
> Of Chengming Gui
> Sent: Monday, December 10, 2018 4:05 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Gui, Jack 
> Subject: [PATCH] amd/amdgpu: fix typo about amdgpu_sriov_vf
> 

Please add description (fix build error) to for the commit. 

With that fixed, please add
Reviewed-by: Huang Rui 


> Signed-off-by: Chengming Gui 
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index a9c853a..08f443f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -4068,7 +4068,7 @@ static void gfx_v8_0_rlc_start(struct
> amdgpu_device *adev)
> 
>  static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)  {
> - if (amdgpu_sriov(adev)) {
> + if (amdgpu_sriov_vf(adev)) {
>   gfx_v8_0_init_csb(adev);
>   return 0;
>   }
> --
> 2.7.4
> 
> ___
> 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 i-g-t] igt: add timeline test cases

2018-12-10 Thread Michel Dänzer
On 2018-12-07 11:01 a.m., Chunming Zhou wrote:
> Signed-off-by: Chunming Zhou 
> ---
>  include/drm-uapi/drm.h   |   33 ++
>  lib/igt_syncobj.c|  204 +++
>  lib/igt_syncobj.h|   19 +
>  tests/gem_ctx_bad_exec   |  Bin 0 -> 1284384 bytes

Please run

 git rm tests/gem_ctx_bad_exec

and re-send the patch.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: 答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

2018-12-10 Thread Xu, Feifei
Agree that if also need to skip ASIC_INIT in s3/s4 in driver, should do the 
similar change as you mentioned. I am not quite sure the s3/s4 situation for 
now. Though from test, it might be the same case.
Will get back from vbios and have corresponding change. Thanks.

发自我的 iPhone

> 在 2018年12月10日,下午6:28,Qu, Jim  写道:
> 
> Hi Feifei,
> 
> When PSP perform ASIC_INIT during the whole boot up period?
> 
> In S4,  the asic will be reset, and it need be posted at the beginning of 
> resume. So it is better move the logic into amdgpu_device_need_post() if 
> ASIC_INIT is automatic performed by PSP during S4.
> 
> Thanks
> JimQu
> 
> 
> 发件人: Xu, Feifei
> 发送时间: 2018年12月10日 18:09
> 收件人: Qu, Jim; Quan, Evan; amd-gfx@lists.freedesktop.org
> 主题: RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
> 
> In fact, in multigpu cases, the original logical in 
> amdgpu_device_need_post()->amdgpu_atombios_scratch_need_asic_init() return 
> TRUE.
> The logical is to: read ATOM_S7_ASIC_INIT_COMPLETE_MASK bit which is notified 
> by BIOS to driver that if post is needed.
> 
> After the ASIC_INIT table moved to psp, though post is needed (the 
> ATOM_S7_ASIC_INIT_COMPLETE_MASK is unset), we still need to skip the post in 
> driver.
> 
> Regards,
> Feifei
> 
> -Original Message-
> From: Qu, Jim 
> Sent: 2018年12月10日 17:42
> To: Quan, Evan ; Xu, Feifei ; 
> amd-gfx@lists.freedesktop.org
> Subject: 答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
> 
> I think it is better move it into amdgpu_device_need_post() as a negative 
> condition.
> 
> Thanks
> JimQu
> 
> 
> 发件人: amd-gfx  代表 Quan, Evan 
> 
> 发送时间: 2018年12月10日 14:33:58
> 收件人: Xu, Feifei; amd-gfx@lists.freedesktop.org
> 抄送: Xu, Feifei
> 主题: RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
> 
> Reviewed-by: Evan Quan 
> 
>> -Original Message-
>> From: amd-gfx  On Behalf Of
>> Feifei Xu
>> Sent: 2018年12月10日 14:17
>> To: amd-gfx@lists.freedesktop.org
>> Cc: Xu, Feifei ; Quan, Evan 
>> Subject: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
>> 
>> On vega20, the job of executing the ASIC_INIT table when posting card
>> is moved to psp. Skip the atombios's ASIC_INIT on vega20 when posting card.
>> 
>> Change-Id: Id1d3c0a0d19296d5ed804de7edf5b09b8d38c0a5
>> Signed-off-by: Feifei Xu 
>> Tested-by: Candice Li 
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index ef36cc595985..a375d2ac112f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -2547,7 +2547,7 @@ int amdgpu_device_init(struct amdgpu_device
>> *adev,
>>  amdgpu_device_detect_sriov_bios(adev);
>> 
>>  /* Post card if necessary */
>> - if (amdgpu_device_need_post(adev)) {
>> + if ((adev->asic_type != CHIP_VEGA20) &&
>> amdgpu_device_need_post(adev))
>> +{
>>  if (!adev->bios) {
>>  dev_err(adev->dev, "no vBIOS found\n");
>>  r = -EINVAL;
>> --
>> 2.17.1
>> 
>> ___
>> 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
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

2018-12-10 Thread Qu, Jim
Hi Feifei,

When PSP perform ASIC_INIT during the whole boot up period?

In S4,  the asic will be reset, and it need be posted at the beginning of 
resume. So it is better move the logic into amdgpu_device_need_post() if 
ASIC_INIT is automatic performed by PSP during S4.

Thanks
JimQu


发件人: Xu, Feifei
发送时间: 2018年12月10日 18:09
收件人: Qu, Jim; Quan, Evan; amd-gfx@lists.freedesktop.org
主题: RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

In fact, in multigpu cases, the original logical in 
amdgpu_device_need_post()->amdgpu_atombios_scratch_need_asic_init() return TRUE.
The logical is to: read ATOM_S7_ASIC_INIT_COMPLETE_MASK bit which is notified 
by BIOS to driver that if post is needed.

After the ASIC_INIT table moved to psp, though post is needed (the 
ATOM_S7_ASIC_INIT_COMPLETE_MASK is unset), we still need to skip the post in 
driver.

Regards,
Feifei

-Original Message-
From: Qu, Jim 
Sent: 2018年12月10日 17:42
To: Quan, Evan ; Xu, Feifei ; 
amd-gfx@lists.freedesktop.org
Subject: 答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

 I think it is better move it into amdgpu_device_need_post() as a negative 
condition.

Thanks
JimQu


发件人: amd-gfx  代表 Quan, Evan 

发送时间: 2018年12月10日 14:33:58
收件人: Xu, Feifei; amd-gfx@lists.freedesktop.org
抄送: Xu, Feifei
主题: RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

Reviewed-by: Evan Quan 

> -Original Message-
> From: amd-gfx  On Behalf Of
> Feifei Xu
> Sent: 2018年12月10日 14:17
> To: amd-gfx@lists.freedesktop.org
> Cc: Xu, Feifei ; Quan, Evan 
> Subject: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
>
> On vega20, the job of executing the ASIC_INIT table when posting card
> is moved to psp. Skip the atombios's ASIC_INIT on vega20 when posting card.
>
> Change-Id: Id1d3c0a0d19296d5ed804de7edf5b09b8d38c0a5
> Signed-off-by: Feifei Xu 
> Tested-by: Candice Li 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index ef36cc595985..a375d2ac112f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2547,7 +2547,7 @@ int amdgpu_device_init(struct amdgpu_device
> *adev,
>   amdgpu_device_detect_sriov_bios(adev);
>
>   /* Post card if necessary */
> - if (amdgpu_device_need_post(adev)) {
> + if ((adev->asic_type != CHIP_VEGA20) &&
> amdgpu_device_need_post(adev))
> +{
>   if (!adev->bios) {
>   dev_err(adev->dev, "no vBIOS found\n");
>   r = -EINVAL;
> --
> 2.17.1
>
> ___
> 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
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 7/7] drm: Split out drm_probe_helper.h

2018-12-10 Thread Thierry Reding
On Mon, Dec 10, 2018 at 11:11:33AM +0100, Daniel Vetter wrote:
> Having the probe helper stuff (which pretty much everyone needs) in
> the drm_crtc_helper.h file (which atomic drivers should never need) is
> confusing. Split them out.
> 
> To make sure I actually achieved the goal here I went through all
> drivers. And indeed, all atomic drivers are now free of
> drm_crtc_helper.h includes.
> 
> Signed-off-by: Daniel Vetter 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: virtualizat...@lists.linux-foundation.org
> Cc: etna...@lists.freedesktop.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: intel-...@lists.freedesktop.org
> Cc: linux-media...@lists.infradead.org
> Cc: linux-amlo...@lists.infradead.org
> Cc: linux-arm-...@vger.kernel.org
> Cc: freedr...@lists.freedesktop.org
> Cc: nouv...@lists.freedesktop.org
> Cc: spice-de...@lists.freedesktop.org
> Cc: amd-gfx@lists.freedesktop.org
> Cc: linux-renesas-...@vger.kernel.org
> Cc: linux-rockc...@lists.infradead.org
> Cc: linux-st...@st-md-mailman.stormreply.com
> Cc: linux-te...@vger.kernel.org
> Cc: xen-de...@lists.xen.org
> ---
>  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c|  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h  |  1 +
>  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  2 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  |  2 +-
>  .../display/amdgpu_dm/amdgpu_dm_services.c|  2 +-
>  drivers/gpu/drm/arc/arcpgu_crtc.c |  2 +-
>  drivers/gpu/drm/arc/arcpgu_drv.c  |  2 +-
>  drivers/gpu/drm/arc/arcpgu_sim.c  |  2 +-
>  drivers/gpu/drm/arm/hdlcd_crtc.c  |  2 +-
>  drivers/gpu/drm/arm/hdlcd_drv.c   |  2 +-
>  drivers/gpu/drm/arm/malidp_crtc.c |  2 +-
>  drivers/gpu/drm/arm/malidp_drv.c  |  2 +-
>  drivers/gpu/drm/arm/malidp_mw.c   |  2 +-
>  drivers/gpu/drm/armada/armada_510.c   |  2 +-
>  drivers/gpu/drm/armada/armada_crtc.c  |  2 +-
>  drivers/gpu/drm/armada/armada_drv.c   |  2 +-
>  drivers/gpu/drm/armada/armada_fb.c|  2 +-
>  drivers/gpu/drm/ast/ast_drv.c |  1 +
>  drivers/gpu/drm/ast/ast_mode.c|  1 +
>  .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c|  2 +-
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h  |  2 +-
>  drivers/gpu/drm/bochs/bochs_drv.c |  1 +
>  drivers/gpu/drm/bochs/bochs_kms.c |  1 +
>  drivers/gpu/drm/bridge/adv7511/adv7511.h  |  2 +-
>  drivers/gpu/drm/bridge/analogix-anx78xx.c |  3 +-
>  .../drm/bridge/analogix/analogix_dp_core.c|  2 +-
>  drivers/gpu/drm/bridge/cdns-dsi.c |  2 +-
>  drivers/gpu/drm/bridge/dumb-vga-dac.c |  2 +-
>  .../bridge/megachips-stdp-ge-b850v3-fw.c  |  2 +-
>  drivers/gpu/drm/bridge/nxp-ptn3460.c  |  2 +-
>  drivers/gpu/drm/bridge/panel.c|  2 +-
>  drivers/gpu/drm/bridge/parade-ps8622.c|  2 +-
>  drivers/gpu/drm/bridge/sii902x.c  |  2 +-
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c |  2 +-
>  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c |  2 +-
>  drivers/gpu/drm/bridge/tc358764.c |  2 +-
>  drivers/gpu/drm/bridge/tc358767.c |  2 +-
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c |  2 +-
>  drivers/gpu/drm/bridge/ti-tfp410.c|  2 +-
>  drivers/gpu/drm/cirrus/cirrus_drv.c   |  1 +
>  drivers/gpu/drm/cirrus/cirrus_mode.c  |  1 +
>  drivers/gpu/drm/drm_atomic_helper.c   |  1 -
>  drivers/gpu/drm/drm_dp_mst_topology.c |  2 +-
>  drivers/gpu/drm/drm_modeset_helper.c  |  2 +-
>  drivers/gpu/drm/drm_probe_helper.c|  2 +-
>  drivers/gpu/drm/drm_simple_kms_helper.c   |  2 +-
>  drivers/gpu/drm/etnaviv/etnaviv_drv.h |  1 -
>  drivers/gpu/drm/exynos/exynos_dp.c|  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_dpi.c   |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_drv.c   |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_dsi.c   |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c  |  2 +-
>  drivers/gpu/drm/exynos/exynos_hdmi.c  |  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c|  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c |  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c   |  2 +-
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c |  2 +-
>  drivers/gpu/drm/gma500/psb_intel_drv.h|  1 +
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c|  2 +-
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c   |  2 +-
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c |  2 +-
>  .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c  |  2 +-
>  drivers/gpu/drm/hisilicon/kirin

[PATCH 7/7] drm: Split out drm_probe_helper.h

2018-12-10 Thread Daniel Vetter
Having the probe helper stuff (which pretty much everyone needs) in
the drm_crtc_helper.h file (which atomic drivers should never need) is
confusing. Split them out.

To make sure I actually achieved the goal here I went through all
drivers. And indeed, all atomic drivers are now free of
drm_crtc_helper.h includes.

Signed-off-by: Daniel Vetter 
Cc: linux-arm-ker...@lists.infradead.org
Cc: virtualizat...@lists.linux-foundation.org
Cc: etna...@lists.freedesktop.org
Cc: linux-samsung-...@vger.kernel.org
Cc: intel-...@lists.freedesktop.org
Cc: linux-media...@lists.infradead.org
Cc: linux-amlo...@lists.infradead.org
Cc: linux-arm-...@vger.kernel.org
Cc: freedr...@lists.freedesktop.org
Cc: nouv...@lists.freedesktop.org
Cc: spice-de...@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-renesas-...@vger.kernel.org
Cc: linux-rockc...@lists.infradead.org
Cc: linux-st...@st-md-mailman.stormreply.com
Cc: linux-te...@vger.kernel.org
Cc: xen-de...@lists.xen.org
---
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c|  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h  |  1 +
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  2 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  |  2 +-
 .../display/amdgpu_dm/amdgpu_dm_services.c|  2 +-
 drivers/gpu/drm/arc/arcpgu_crtc.c |  2 +-
 drivers/gpu/drm/arc/arcpgu_drv.c  |  2 +-
 drivers/gpu/drm/arc/arcpgu_sim.c  |  2 +-
 drivers/gpu/drm/arm/hdlcd_crtc.c  |  2 +-
 drivers/gpu/drm/arm/hdlcd_drv.c   |  2 +-
 drivers/gpu/drm/arm/malidp_crtc.c |  2 +-
 drivers/gpu/drm/arm/malidp_drv.c  |  2 +-
 drivers/gpu/drm/arm/malidp_mw.c   |  2 +-
 drivers/gpu/drm/armada/armada_510.c   |  2 +-
 drivers/gpu/drm/armada/armada_crtc.c  |  2 +-
 drivers/gpu/drm/armada/armada_drv.c   |  2 +-
 drivers/gpu/drm/armada/armada_fb.c|  2 +-
 drivers/gpu/drm/ast/ast_drv.c |  1 +
 drivers/gpu/drm/ast/ast_mode.c|  1 +
 .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c|  2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h  |  2 +-
 drivers/gpu/drm/bochs/bochs_drv.c |  1 +
 drivers/gpu/drm/bochs/bochs_kms.c |  1 +
 drivers/gpu/drm/bridge/adv7511/adv7511.h  |  2 +-
 drivers/gpu/drm/bridge/analogix-anx78xx.c |  3 +-
 .../drm/bridge/analogix/analogix_dp_core.c|  2 +-
 drivers/gpu/drm/bridge/cdns-dsi.c |  2 +-
 drivers/gpu/drm/bridge/dumb-vga-dac.c |  2 +-
 .../bridge/megachips-stdp-ge-b850v3-fw.c  |  2 +-
 drivers/gpu/drm/bridge/nxp-ptn3460.c  |  2 +-
 drivers/gpu/drm/bridge/panel.c|  2 +-
 drivers/gpu/drm/bridge/parade-ps8622.c|  2 +-
 drivers/gpu/drm/bridge/sii902x.c  |  2 +-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c |  2 +-
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c |  2 +-
 drivers/gpu/drm/bridge/tc358764.c |  2 +-
 drivers/gpu/drm/bridge/tc358767.c |  2 +-
 drivers/gpu/drm/bridge/ti-sn65dsi86.c |  2 +-
 drivers/gpu/drm/bridge/ti-tfp410.c|  2 +-
 drivers/gpu/drm/cirrus/cirrus_drv.c   |  1 +
 drivers/gpu/drm/cirrus/cirrus_mode.c  |  1 +
 drivers/gpu/drm/drm_atomic_helper.c   |  1 -
 drivers/gpu/drm/drm_dp_mst_topology.c |  2 +-
 drivers/gpu/drm/drm_modeset_helper.c  |  2 +-
 drivers/gpu/drm/drm_probe_helper.c|  2 +-
 drivers/gpu/drm/drm_simple_kms_helper.c   |  2 +-
 drivers/gpu/drm/etnaviv/etnaviv_drv.h |  1 -
 drivers/gpu/drm/exynos/exynos_dp.c|  2 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_dpi.c   |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_dsi.c   |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  |  2 +-
 drivers/gpu/drm/exynos/exynos_hdmi.c  |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c|  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c   |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c |  2 +-
 drivers/gpu/drm/gma500/psb_intel_drv.h|  1 +
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c|  2 +-
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c   |  2 +-
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c |  2 +-
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c  |  2 +-
 drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c  |  2 +-
 .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   |  2 +-
 .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c   |  2 +-
 drivers/gpu/drm/i2c/ch7006_priv.h |  2 +-
 drivers/gpu/drm/i2c/sil164_drv.c  |  2 +-
 drivers/gpu

[PATCH 7/7] drm: Split out drm_probe_helper.h

2018-12-10 Thread Daniel Vetter
Having the probe helper stuff (which pretty much everyone needs) in
the drm_crtc_helper.h file (which atomic drivers should never need) is
confusing. Split them out.

To make sure I actually achieved the goal here I went through all
drivers. And indeed, all atomic drivers are now free of
drm_crtc_helper.h includes.

Signed-off-by: Daniel Vetter 
Cc: linux-arm-ker...@lists.infradead.org
Cc: virtualizat...@lists.linux-foundation.org
Cc: etna...@lists.freedesktop.org
Cc: linux-samsung-...@vger.kernel.org
Cc: intel-...@lists.freedesktop.org
Cc: linux-media...@lists.infradead.org
Cc: linux-amlo...@lists.infradead.org
Cc: linux-arm-...@vger.kernel.org
Cc: freedr...@lists.freedesktop.org
Cc: nouv...@lists.freedesktop.org
Cc: spice-de...@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-renesas-...@vger.kernel.org
Cc: linux-rockc...@lists.infradead.org
Cc: linux-st...@st-md-mailman.stormreply.com
Cc: linux-te...@vger.kernel.org
Cc: xen-de...@lists.xen.org
---
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c|  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h  |  1 +
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  2 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  |  2 +-
 .../display/amdgpu_dm/amdgpu_dm_services.c|  2 +-
 drivers/gpu/drm/arc/arcpgu_crtc.c |  2 +-
 drivers/gpu/drm/arc/arcpgu_drv.c  |  2 +-
 drivers/gpu/drm/arc/arcpgu_sim.c  |  2 +-
 drivers/gpu/drm/arm/hdlcd_crtc.c  |  2 +-
 drivers/gpu/drm/arm/hdlcd_drv.c   |  2 +-
 drivers/gpu/drm/arm/malidp_crtc.c |  2 +-
 drivers/gpu/drm/arm/malidp_drv.c  |  2 +-
 drivers/gpu/drm/arm/malidp_mw.c   |  2 +-
 drivers/gpu/drm/armada/armada_510.c   |  2 +-
 drivers/gpu/drm/armada/armada_crtc.c  |  2 +-
 drivers/gpu/drm/armada/armada_drv.c   |  2 +-
 drivers/gpu/drm/armada/armada_fb.c|  2 +-
 drivers/gpu/drm/ast/ast_drv.c |  1 +
 drivers/gpu/drm/ast/ast_mode.c|  1 +
 .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c|  2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h  |  2 +-
 drivers/gpu/drm/bochs/bochs_drv.c |  1 +
 drivers/gpu/drm/bochs/bochs_kms.c |  1 +
 drivers/gpu/drm/bridge/adv7511/adv7511.h  |  2 +-
 drivers/gpu/drm/bridge/analogix-anx78xx.c |  3 +-
 .../drm/bridge/analogix/analogix_dp_core.c|  2 +-
 drivers/gpu/drm/bridge/cdns-dsi.c |  2 +-
 drivers/gpu/drm/bridge/dumb-vga-dac.c |  2 +-
 .../bridge/megachips-stdp-ge-b850v3-fw.c  |  2 +-
 drivers/gpu/drm/bridge/nxp-ptn3460.c  |  2 +-
 drivers/gpu/drm/bridge/panel.c|  2 +-
 drivers/gpu/drm/bridge/parade-ps8622.c|  2 +-
 drivers/gpu/drm/bridge/sii902x.c  |  2 +-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c |  2 +-
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c |  2 +-
 drivers/gpu/drm/bridge/tc358764.c |  2 +-
 drivers/gpu/drm/bridge/tc358767.c |  2 +-
 drivers/gpu/drm/bridge/ti-sn65dsi86.c |  2 +-
 drivers/gpu/drm/bridge/ti-tfp410.c|  2 +-
 drivers/gpu/drm/cirrus/cirrus_drv.c   |  1 +
 drivers/gpu/drm/cirrus/cirrus_mode.c  |  1 +
 drivers/gpu/drm/drm_atomic_helper.c   |  1 -
 drivers/gpu/drm/drm_dp_mst_topology.c |  2 +-
 drivers/gpu/drm/drm_modeset_helper.c  |  2 +-
 drivers/gpu/drm/drm_probe_helper.c|  2 +-
 drivers/gpu/drm/drm_simple_kms_helper.c   |  2 +-
 drivers/gpu/drm/etnaviv/etnaviv_drv.h |  1 -
 drivers/gpu/drm/exynos/exynos_dp.c|  2 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_dpi.c   |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_dsi.c   |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  |  2 +-
 drivers/gpu/drm/exynos/exynos_hdmi.c  |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c|  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c   |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c |  2 +-
 drivers/gpu/drm/gma500/psb_intel_drv.h|  1 +
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c|  2 +-
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c   |  2 +-
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c |  2 +-
 .../gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c  |  2 +-
 drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c  |  2 +-
 .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   |  2 +-
 .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c   |  2 +-
 drivers/gpu/drm/i2c/ch7006_priv.h |  2 +-
 drivers/gpu/drm/i2c/sil164_drv.c  |  2 +-
 drivers/gpu

RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

2018-12-10 Thread Xu, Feifei
In fact, in multigpu cases, the original logical in 
amdgpu_device_need_post()->amdgpu_atombios_scratch_need_asic_init() return TRUE.
The logical is to: read ATOM_S7_ASIC_INIT_COMPLETE_MASK bit which is notified 
by BIOS to driver that if post is needed.

After the ASIC_INIT table moved to psp, though post is needed (the 
ATOM_S7_ASIC_INIT_COMPLETE_MASK is unset), we still need to skip the post in 
driver. 

Regards,
Feifei

-Original Message-
From: Qu, Jim  
Sent: 2018年12月10日 17:42
To: Quan, Evan ; Xu, Feifei ; 
amd-gfx@lists.freedesktop.org
Subject: 答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

 I think it is better move it into amdgpu_device_need_post() as a negative 
condition.

Thanks
JimQu


发件人: amd-gfx  代表 Quan, Evan 

发送时间: 2018年12月10日 14:33:58
收件人: Xu, Feifei; amd-gfx@lists.freedesktop.org
抄送: Xu, Feifei
主题: RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

Reviewed-by: Evan Quan 

> -Original Message-
> From: amd-gfx  On Behalf Of 
> Feifei Xu
> Sent: 2018年12月10日 14:17
> To: amd-gfx@lists.freedesktop.org
> Cc: Xu, Feifei ; Quan, Evan 
> Subject: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
>
> On vega20, the job of executing the ASIC_INIT table when posting card 
> is moved to psp. Skip the atombios's ASIC_INIT on vega20 when posting card.
>
> Change-Id: Id1d3c0a0d19296d5ed804de7edf5b09b8d38c0a5
> Signed-off-by: Feifei Xu 
> Tested-by: Candice Li 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index ef36cc595985..a375d2ac112f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2547,7 +2547,7 @@ int amdgpu_device_init(struct amdgpu_device 
> *adev,
>   amdgpu_device_detect_sriov_bios(adev);
>
>   /* Post card if necessary */
> - if (amdgpu_device_need_post(adev)) {
> + if ((adev->asic_type != CHIP_VEGA20) &&
> amdgpu_device_need_post(adev))
> +{
>   if (!adev->bios) {
>   dev_err(adev->dev, "no vBIOS found\n");
>   r = -EINVAL;
> --
> 2.17.1
>
> ___
> 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
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 4/7] drm: Move the legacy kms disable_all helper to crtc helpers

2018-12-10 Thread Daniel Vetter
It's not a core function, and the matching atomic functions are also
not in the core. Plus the suspend/resume helper is also already there.

Needs a tiny bit of open-coding, but less midlayer beats that I think.

Cc: Sam Bobroff 
Signed-off-by: Daniel Vetter 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Ben Skeggs 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: Rex Zhu 
Cc: Andrey Grodzovsky 
Cc: Huang Rui 
Cc: Shaoyun Liu 
Cc: Monk Liu 
Cc: nouv...@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
 drivers/gpu/drm/drm_crtc.c | 31 ---
 drivers/gpu/drm/drm_crtc_helper.c  | 35 ++
 drivers/gpu/drm/nouveau/nouveau_display.c  |  2 +-
 drivers/gpu/drm/radeon/radeon_display.c|  2 +-
 include/drm/drm_crtc.h |  2 --
 include/drm/drm_crtc_helper.h  |  1 +
 7 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index c75badfa5c4c..e669297ffefb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2689,7 +2689,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
amdgpu_irq_disable_all(adev);
if (adev->mode_info.mode_config_initialized){
if (!amdgpu_device_has_dc_support(adev))
-   drm_crtc_force_disable_all(adev->ddev);
+   drm_helper_force_disable_all(adev->ddev);
else
drm_atomic_helper_shutdown(adev->ddev);
}
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index f660819d406e..7dabbaf033a1 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -104,37 +104,6 @@ int drm_crtc_force_disable(struct drm_crtc *crtc)
return drm_mode_set_config_internal(&set);
 }
 
-/**
- * drm_crtc_force_disable_all - Forcibly turn off all enabled CRTCs
- * @dev: DRM device whose CRTCs to turn off
- *
- * Drivers may want to call this on unload to ensure that all displays are
- * unlit and the GPU is in a consistent, low power state. Takes modeset locks.
- *
- * Note: This should only be used by non-atomic legacy drivers. For an atomic
- * version look at drm_atomic_helper_shutdown().
- *
- * Returns:
- * Zero on success, error code on failure.
- */
-int drm_crtc_force_disable_all(struct drm_device *dev)
-{
-   struct drm_crtc *crtc;
-   int ret = 0;
-
-   drm_modeset_lock_all(dev);
-   drm_for_each_crtc(crtc, dev)
-   if (crtc->enabled) {
-   ret = drm_crtc_force_disable(crtc);
-   if (ret)
-   goto out;
-   }
-out:
-   drm_modeset_unlock_all(dev);
-   return ret;
-}
-EXPORT_SYMBOL(drm_crtc_force_disable_all);
-
 static unsigned int drm_num_crtcs(struct drm_device *dev)
 {
unsigned int num = 0;
diff --git a/drivers/gpu/drm/drm_crtc_helper.c 
b/drivers/gpu/drm/drm_crtc_helper.c
index a3c81850e755..23159eb494f1 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -984,3 +984,38 @@ void drm_helper_resume_force_mode(struct drm_device *dev)
drm_modeset_unlock_all(dev);
 }
 EXPORT_SYMBOL(drm_helper_resume_force_mode);
+
+/**
+ * drm_helper_force_disable_all - Forcibly turn off all enabled CRTCs
+ * @dev: DRM device whose CRTCs to turn off
+ *
+ * Drivers may want to call this on unload to ensure that all displays are
+ * unlit and the GPU is in a consistent, low power state. Takes modeset locks.
+ *
+ * Note: This should only be used by non-atomic legacy drivers. For an atomic
+ * version look at drm_atomic_helper_shutdown().
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ */
+int drm_helper_force_disable_all(struct drm_device *dev)
+{
+   struct drm_crtc *crtc;
+   int ret = 0;
+
+   drm_modeset_lock_all(dev);
+   drm_for_each_crtc(crtc, dev)
+   if (crtc->enabled) {
+   struct drm_mode_set set = {
+   .crtc = crtc,
+   };
+
+   ret = drm_mode_set_config_internal(&set);
+   if (ret)
+   goto out;
+   }
+out:
+   drm_modeset_unlock_all(dev);
+   return ret;
+}
+EXPORT_SYMBOL(drm_helper_force_disable_all);
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c 
b/drivers/gpu/drm/nouveau/nouveau_display.c
index f326ffd86766..5d273a655479 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -453,7 +453,7 @@ nouveau_display_fini(struct drm_device *dev, bool suspend, 
bool runtime)
if (drm_drv_uses_atomic_modeset(dev))
drm_atomic_helper_shutdown(dev);
  

答复: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

2018-12-10 Thread Qu, Jim
 I think it is better move it into amdgpu_device_need_post() as a negative 
condition.

Thanks
JimQu


发件人: amd-gfx  代表 Quan, Evan 

发送时间: 2018年12月10日 14:33:58
收件人: Xu, Feifei; amd-gfx@lists.freedesktop.org
抄送: Xu, Feifei
主题: RE: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20

Reviewed-by: Evan Quan 

> -Original Message-
> From: amd-gfx  On Behalf Of
> Feifei Xu
> Sent: 2018年12月10日 14:17
> To: amd-gfx@lists.freedesktop.org
> Cc: Xu, Feifei ; Quan, Evan 
> Subject: [PATCH] drm/amdgpu:skip ASIC_INIT when posting card on vg20
>
> On vega20, the job of executing the ASIC_INIT table when posting card is
> moved to psp. Skip the atombios's ASIC_INIT on vega20 when posting card.
>
> Change-Id: Id1d3c0a0d19296d5ed804de7edf5b09b8d38c0a5
> Signed-off-by: Feifei Xu 
> Tested-by: Candice Li 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index ef36cc595985..a375d2ac112f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2547,7 +2547,7 @@ int amdgpu_device_init(struct amdgpu_device
> *adev,
>   amdgpu_device_detect_sriov_bios(adev);
>
>   /* Post card if necessary */
> - if (amdgpu_device_need_post(adev)) {
> + if ((adev->asic_type != CHIP_VEGA20) &&
> amdgpu_device_need_post(adev))
> +{
>   if (!adev->bios) {
>   dev_err(adev->dev, "no vBIOS found\n");
>   r = -EINVAL;
> --
> 2.17.1
>
> ___
> 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
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH -next] drm/amdgpu: remove set but not used variable 'amdgpu_connector'

2018-12-10 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c: In function 
'amdgpu_display_crtc_scaling_mode_fixup':
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:675:27: warning:
 variable 'amdgpu_connector' set but not used [-Wunused-but-set-variable]

It never used since introduction in
commit d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")

Signed-off-by: YueHaibing 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 15ce7e6..30bdb67 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -672,7 +672,6 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc 
*crtc,
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
struct amdgpu_encoder *amdgpu_encoder;
struct drm_connector *connector;
-   struct amdgpu_connector *amdgpu_connector;
u32 src_v = 1, dst_v = 1;
u32 src_h = 1, dst_h = 1;
 
@@ -684,7 +683,6 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc 
*crtc,
continue;
amdgpu_encoder = to_amdgpu_encoder(encoder);
connector = amdgpu_get_connector_for_encoder(encoder);
-   amdgpu_connector = to_amdgpu_connector(connector);
 
/* set scaling */
if (amdgpu_encoder->rmx_type == RMX_OFF)



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


[PATCH -next] drm/amdgpu: remove set but not used variable 'grbm_soft_reset'

2018-12-10 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function 'gfx_v8_0_pre_soft_reset':
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:4950:27: warning:
 variable 'srbm_soft_reset' set but not used [-Wunused-but-set-variable]

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function 'gfx_v8_0_post_soft_reset':
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:5054:27: warning:
 variable 'srbm_soft_reset' set but not used [-Wunused-but-set-variable]

It never used since introduction in commit d31a501ead7f ("drm/amdgpu: add
pre_soft_reset ip func") and e4ae0fc33631 ("drm/amdgpu: implement
gfx8 post_soft_reset")

Signed-off-by: YueHaibing 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 1454fc3..8c1ba79 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4947,14 +4947,13 @@ static bool gfx_v8_0_check_soft_reset(void *handle)
 static int gfx_v8_0_pre_soft_reset(void *handle)
 {
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-   u32 grbm_soft_reset = 0, srbm_soft_reset = 0;
+   u32 grbm_soft_reset = 0;
 
if ((!adev->gfx.grbm_soft_reset) &&
(!adev->gfx.srbm_soft_reset))
return 0;
 
grbm_soft_reset = adev->gfx.grbm_soft_reset;
-   srbm_soft_reset = adev->gfx.srbm_soft_reset;
 
/* stop the rlc */
adev->gfx.rlc.funcs->stop(adev);
@@ -5051,14 +5050,13 @@ static int gfx_v8_0_soft_reset(void *handle)
 static int gfx_v8_0_post_soft_reset(void *handle)
 {
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-   u32 grbm_soft_reset = 0, srbm_soft_reset = 0;
+   u32 grbm_soft_reset = 0;
 
if ((!adev->gfx.grbm_soft_reset) &&
(!adev->gfx.srbm_soft_reset))
return 0;
 
grbm_soft_reset = adev->gfx.grbm_soft_reset;
-   srbm_soft_reset = adev->gfx.srbm_soft_reset;
 
if (REG_GET_FIELD(grbm_soft_reset, GRBM_SOFT_RESET, SOFT_RESET_CP) ||
REG_GET_FIELD(grbm_soft_reset, GRBM_SOFT_RESET, SOFT_RESET_CPF) ||



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


[PATCH] amd/amdgpu: fix typo about amdgpu_sriov_vf

2018-12-10 Thread Chengming Gui
Signed-off-by: Chengming Gui 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index a9c853a..08f443f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4068,7 +4068,7 @@ static void gfx_v8_0_rlc_start(struct amdgpu_device *adev)
 
 static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
 {
-   if (amdgpu_sriov(adev)) {
+   if (amdgpu_sriov_vf(adev)) {
gfx_v8_0_init_csb(adev);
return 0;
}
-- 
2.7.4

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