Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1357242 > unrolled thread

Re: [PATCH v15 1/3] drm: rockchip: Add basic drm driver

Started byTomeu Vizoso <tomeu@tomeuvizoso.net>
First post2016-03-14 14:50 +0100
Last post2016-03-17 15:00 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v15 1/3] drm: rockchip: Add basic drm driver Tomeu Vizoso <tomeu@tomeuvizoso.net> - 2016-03-14 14:50 +0100
    Re: [PATCH v15 1/3] drm: rockchip: Add basic drm driver Mark yao <mark.yao@rock-chips.com> - 2016-03-15 02:40 +0100
      Re: [PATCH v15 1/3] drm: rockchip: Add basic drm driver Tomeu Vizoso <tomeu@tomeuvizoso.net> - 2016-03-16 16:30 +0100
        Re: [PATCH v15 1/3] drm: rockchip: Add basic drm driver Tomeu Vizoso <tomeu@tomeuvizoso.net> - 2016-03-17 15:00 +0100

#1357242 — Re: [PATCH v15 1/3] drm: rockchip: Add basic drm driver

FromTomeu Vizoso <tomeu@tomeuvizoso.net>
Date2016-03-14 14:50 +0100
SubjectRe: [PATCH v15 1/3] drm: rockchip: Add basic drm driver
Message-ID<rcB2F-4px-11@gated-at.bofh.it>
On 2 December 2014 at 10:15, Mark Yao <mark.yao@rock-chips.com> wrote:
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> new file mode 100644
> index 0000000..e7ca25b
> --- /dev/null
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -0,0 +1,1455 @@
...
> +static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
> +                               const struct drm_display_mode *mode,
> +                               struct drm_display_mode *adjusted_mode)
> +{
> +       if (adjusted_mode->htotal == 0 || adjusted_mode->vtotal == 0)
> +               return false;

Hi Mark,

what's the rationale for this?

Disabling a CRTC as in [0] will cause mode_fixup() to be called with
an empty mode, failing that test.

Removing the check seems to get things working fine for a short while,
but a later modeset invariably gets the VOP to hang (as reported by
[1]).

Do you know why that check was put in place and what exactly could be
causing the hw to hang?

[0] https://cgit.freedesktop.org/xorg/app/intel-gpu-tools/tree/lib/igt_kms.c#n1616
[1] https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/rockchip/rockchip_drm_vop.c#n873

Thanks,

Tomeu

> +
> +       return true;
> +}

[toc] | [next] | [standalone]


#1357736

FromMark yao <mark.yao@rock-chips.com>
Date2016-03-15 02:40 +0100
Message-ID<rcM7M-3sq-7@gated-at.bofh.it>
In reply to#1357242
On 2016年03月14日 21:35, Tomeu Vizoso wrote:
> On 2 December 2014 at 10:15, Mark Yao <mark.yao@rock-chips.com> wrote:
>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> new file mode 100644
>> index 0000000..e7ca25b
>> --- /dev/null
>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> @@ -0,0 +1,1455 @@
> ...
>> +static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
>> +                               const struct drm_display_mode *mode,
>> +                               struct drm_display_mode *adjusted_mode)
>> +{
>> +       if (adjusted_mode->htotal == 0 || adjusted_mode->vtotal == 0)
>> +               return false;
> Hi Mark,
>
> what's the rationale for this?
>
> Disabling a CRTC as in [0] will cause mode_fixup() to be called with
> an empty mode, failing that test.
>
> Removing the check seems to get things working fine for a short while,
> but a later modeset invariably gets the VOP to hang (as reported by
> [1]).
>
> Do you know why that check was put in place and what exactly could be
> causing the hw to hang?
>
> [0] https://cgit.freedesktop.org/xorg/app/intel-gpu-tools/tree/lib/igt_kms.c#n1616
> [1] https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/rockchip/rockchip_drm_vop.c#n873
>
> Thanks,
>
> Tomeu
>
Hi Tomeu

Just thinking that "adjusted_mode->htotal == 0 || adjusted_mode->vtotal 
== 0" is not a good mode for vop.

And you said VOP hang, only WARN_ON error message? or system hang, die?

I think maybe crtc disable too fast, vblank is off, then no one can feed the wait_update_complete.
Can you test it again with following patch?
drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -503,6 +503,8 @@ static void vop_crtc_disable(struct drm_crtc *crtc)
         if (!vop->is_enabled)
                 return;
  
+       vop_crtc_wait_for_update(crtc);
+
         drm_crtc_vblank_off(crtc);

Thanks.

-- 
Mark Yao

[toc] | [prev] | [next] | [standalone]


#1359089

FromTomeu Vizoso <tomeu@tomeuvizoso.net>
Date2016-03-16 16:30 +0100
Message-ID<rdlyy-2jP-9@gated-at.bofh.it>
In reply to#1357736

[Multipart message — attachments visible in raw view] — view raw

On 15 March 2016 at 02:30, Mark yao <mark.yao@rock-chips.com> wrote:
> On 2016年03月14日 21:35, Tomeu Vizoso wrote:
>>
>> On 2 December 2014 at 10:15, Mark Yao <mark.yao@rock-chips.com> wrote:
>>>
>>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>>> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>>> new file mode 100644
>>> index 0000000..e7ca25b
>>> --- /dev/null
>>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>>> @@ -0,0 +1,1455 @@
>>
>> ...
>>>
>>> +static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
>>> +                               const struct drm_display_mode *mode,
>>> +                               struct drm_display_mode *adjusted_mode)
>>> +{
>>> +       if (adjusted_mode->htotal == 0 || adjusted_mode->vtotal == 0)
>>> +               return false;
>>
>> Hi Mark,
>>
>> what's the rationale for this?
>>
>> Disabling a CRTC as in [0] will cause mode_fixup() to be called with
>> an empty mode, failing that test.
>>
>> Removing the check seems to get things working fine for a short while,
>> but a later modeset invariably gets the VOP to hang (as reported by
>> [1]).
>>
>> Do you know why that check was put in place and what exactly could be
>> causing the hw to hang?
>>
>> [0]
>> https://cgit.freedesktop.org/xorg/app/intel-gpu-tools/tree/lib/igt_kms.c#n1616
>> [1]
>> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/rockchip/rockchip_drm_vop.c#n873
>>
>> Thanks,
>>
>> Tomeu
>>
> Hi Tomeu
>
> Just thinking that "adjusted_mode->htotal == 0 || adjusted_mode->vtotal ==
> 0" is not a good mode for vop.

Ah, ok. Guess it should be removed then so we don't break userspace?

> And you said VOP hang, only WARN_ON error message? or system hang, die?

Sorry, the symptom was only the warning, I just went a bit too far and
assumed the VOP had stopped working at all.

> I think maybe crtc disable too fast, vblank is off, then no one can feed the
> wait_update_complete.
> Can you test it again with following patch?

Actually, in today's testing I don't see that happening any more,
sorry about that :/

What I have been looking at today is a related issue when running the
kms_flip_event_leak test from intel-gpu-tools. If I remove the check
mentioned above so CRTCs can be disabled with the SetCRTC IOCTL, I see
this page fault the second and subsequent times I run the test.

[   75.809031] rk_iommu ff930300.iommu: Page fault at 0x01000000 of type read
[   75.809035] rk_iommu ff930300.iommu: iova = 0x01000000: dte_index:
0x4 pte_index: 0x0 page_offset: 0x0
[   75.809040] rk_iommu ff930300.iommu: mmu_dte_addr: 0x2c258000
dte@0x2c258010: 0x2c561001 valid: 1 pte@0x2c561000: 0x2a000006 valid:
0 page@0x00000000 flags: 0x0
[   76.951288] rk_iommu ff930300.iommu: Enable stall request timed
out, status: 0x00004b

I have written a smaller standalone test that is attached in case you
want to check it out, but I haven't been able to find out why it only
happens when the test is rerun.

Apparently the VOP is still trying to read a BO (0x01000000) right
when the kernel frees it, but from what I can see, it should be
scanning another BO at that point.

Do you have any ideas on what could be happening?

Thanks,

Tomeu

> drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -503,6 +503,8 @@ static void vop_crtc_disable(struct drm_crtc *crtc)
>         if (!vop->is_enabled)
>                 return;
>  +       vop_crtc_wait_for_update(crtc);
> +
>         drm_crtc_vblank_off(crtc);
>
> Thanks.
>
> --
> Mark Yao
>
>

[toc] | [prev] | [next] | [standalone]


#1359872

FromTomeu Vizoso <tomeu@tomeuvizoso.net>
Date2016-03-17 15:00 +0100
Message-ID<rdGD1-87J-17@gated-at.bofh.it>
In reply to#1359089

[Multipart message — attachments visible in raw view] — view raw

On 16 March 2016 at 16:23, Tomeu Vizoso <tomeu@tomeuvizoso.net> wrote:
> On 15 March 2016 at 02:30, Mark yao <mark.yao@rock-chips.com> wrote:
>> On 2016年03月14日 21:35, Tomeu Vizoso wrote:
>>>
>>> On 2 December 2014 at 10:15, Mark Yao <mark.yao@rock-chips.com> wrote:
>>>>
>>>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>>>> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>>>> new file mode 100644
>>>> index 0000000..e7ca25b
>>>> --- /dev/null
>>>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>>>> @@ -0,0 +1,1455 @@
>>>
>>> ...
>>>>
>>>> +static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
>>>> +                               const struct drm_display_mode *mode,
>>>> +                               struct drm_display_mode *adjusted_mode)
>>>> +{
>>>> +       if (adjusted_mode->htotal == 0 || adjusted_mode->vtotal == 0)
>>>> +               return false;
>>>
>>> Hi Mark,
>>>
>>> what's the rationale for this?
>>>
>>> Disabling a CRTC as in [0] will cause mode_fixup() to be called with
>>> an empty mode, failing that test.
>>>
>>> Removing the check seems to get things working fine for a short while,
>>> but a later modeset invariably gets the VOP to hang (as reported by
>>> [1]).
>>>
>>> Do you know why that check was put in place and what exactly could be
>>> causing the hw to hang?
>>>
>>> [0]
>>> https://cgit.freedesktop.org/xorg/app/intel-gpu-tools/tree/lib/igt_kms.c#n1616
>>> [1]
>>> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/rockchip/rockchip_drm_vop.c#n873
>>>
>>> Thanks,
>>>
>>> Tomeu
>>>
>> Hi Tomeu
>>
>> Just thinking that "adjusted_mode->htotal == 0 || adjusted_mode->vtotal ==
>> 0" is not a good mode for vop.
>
> Ah, ok. Guess it should be removed then so we don't break userspace?
>
>> And you said VOP hang, only WARN_ON error message? or system hang, die?
>
> Sorry, the symptom was only the warning, I just went a bit too far and
> assumed the VOP had stopped working at all.
>
>> I think maybe crtc disable too fast, vblank is off, then no one can feed the
>> wait_update_complete.
>> Can you test it again with following patch?
>
> Actually, in today's testing I don't see that happening any more,
> sorry about that :/
>
> What I have been looking at today is a related issue when running the
> kms_flip_event_leak test from intel-gpu-tools. If I remove the check
> mentioned above so CRTCs can be disabled with the SetCRTC IOCTL, I see
> this page fault the second and subsequent times I run the test.
>
> [   75.809031] rk_iommu ff930300.iommu: Page fault at 0x01000000 of type read
> [   75.809035] rk_iommu ff930300.iommu: iova = 0x01000000: dte_index:
> 0x4 pte_index: 0x0 page_offset: 0x0
> [   75.809040] rk_iommu ff930300.iommu: mmu_dte_addr: 0x2c258000
> dte@0x2c258010: 0x2c561001 valid: 1 pte@0x2c561000: 0x2a000006 valid:
> 0 page@0x00000000 flags: 0x0
> [   76.951288] rk_iommu ff930300.iommu: Enable stall request timed
> out, status: 0x00004b
>
> I have written a smaller standalone test that is attached in case you
> want to check it out, but I haven't been able to find out why it only
> happens when the test is rerun.
>
> Apparently the VOP is still trying to read a BO (0x01000000) right
> when the kernel frees it, but from what I can see, it should be
> scanning another BO at that point.
>
> Do you have any ideas on what could be happening?

Apparently, when the VOP is re-enabled, it will start scanning from
the framebuffer address that had been set last.

Because DMA addresses are recycled and there's going to be a low
number of framebuffers, this isn't going to be obvious unless we make
sure that there isn't a FB allocated at that DMA address any more.

The attached test case does just that.

Regards,

Tomeu

> Thanks,
>
> Tomeu
>
>> drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> @@ -503,6 +503,8 @@ static void vop_crtc_disable(struct drm_crtc *crtc)
>>         if (!vop->is_enabled)
>>                 return;
>>  +       vop_crtc_wait_for_update(crtc);
>> +
>>         drm_crtc_vblank_off(crtc);
>>
>> Thanks.
>>
>> --
>> Mark Yao
>>
>>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web