All of lore.kernel.org
 help / color / mirror / Atom feed
* Warning at drivers/gpu/drm/drm_atomic_helper.c
@ 2017-01-21 16:40 Fabio Estevam
  2017-01-22 14:26 ` Fabio Estevam
  0 siblings, 1 reply; 12+ messages in thread
From: Fabio Estevam @ 2017-01-21 16:40 UTC (permalink / raw)
  To: Sascha Hauer, Christian Gmeiner, Russell King - ARM Linux
  Cc: gustavo.padovan, DRI mailing list

Hi,

Stopping kmscube application on mx6q through CTRL + C sometimes leads
to the following kernel warning:

^C[ 3939.785516] ------------[ cut here ]------------
[ 3939.790313] WARNING: CPU: 1 PID: 67 at
drivers/gpu/drm/drm_atomic_helper.c:1032
drm_atomic_helper_wait_for_fences+0xe4/0x104
[ 3939.801626] Modules linked in:
[ 3939.804762] CPU: 1 PID: 67 Comm: kworker/1:1 Tainted: G        W
   4.9.4 #1
[ 3939.812094] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 3939.818666] Workqueue: events drm_mode_rmfb_work_fn
[ 3939.823584] Backtrace:
[ 3939.826100] [<c010c3e4>] (dump_backtrace) from [<c010c68c>]
(show_stack+0x18/0x1c)
[ 3939.833689]  r7:ee8aa000 r6:60000013 r5:00000000 r4:c0e25cac
[ 3939.839367] [<c010c674>] (show_stack) from [<c03f67dc>]
(dump_stack+0xb4/0xe8)
[ 3939.846604] [<c03f6728>] (dump_stack) from [<c0124bb8>] (__warn+0xd8/0x104)
[ 3939.853578]  r10:ee577b80 r9:c04c9f3c r8:00000408 r7:00000009
r6:c0c3c438 r5:00000000
[ 3939.861414]  r4:00000000 r3:00000000
[ 3939.865001] [<c0124ae0>] (__warn) from [<c0124c98>]
(warn_slowpath_null+0x28/0x30)
[ 3939.872581]  r9:00000000 r8:00000000 r7:00000001 r6:ee577b80
r5:00000000 r4:ef101800
[ 3939.880340] [<c0124c70>] (warn_slowpath_null) from [<c04c9f3c>]
(drm_atomic_helper_wait_for_fences+0xe4/0x104)
[ 3939.890356] [<c04c9e58>] (drm_atomic_helper_wait_for_fences) from
[<c04cc754>] (drm_atomic_helper_commit+0x8c/0xe8)
[ 3939.900802]  r9:00000000 r8:ee8b1c8c r7:ee8b1800 r6:00000000
r5:00000000 r4:ee577b80
[ 3939.908562] [<c04cc6c8>] (drm_atomic_helper_commit) from
[<c04f517c>] (imx_drm_atomic_commit+0x1fc/0x340)
[ 3939.918137]  r7:ee8aec18 r6:00000000 r5:ee577b80 r4:00000006
[ 3939.923813] [<c04f4f80>] (imx_drm_atomic_commit) from [<c04ebee0>]
(drm_atomic_commit+0x54/0x60)
[ 3939.932609]  r10:00000001 r9:00000000 r8:ee8b1c8c r7:ee8aec18
r6:ee8b1800 r5:ee577b80
[ 3939.940444]  r4:00000000
[ 3939.942994] [<c04ebe8c>] (drm_atomic_commit) from [<c04ccca4>]
(drm_atomic_helper_set_config+0x80/0xa4)
[ 3939.952395]  r7:ee8aec18 r6:ee8abe2c r5:00000000 r4:ee577b80
[ 3939.958068] [<c04ccc24>] (drm_atomic_helper_set_config) from
[<c04de8e4>] (drm_mode_set_config_internal+0x6c/0xfc)
[ 3939.968424]  r7:ee8b1800 r6:ee8b1c80 r5:ee8aec18 r4:00000000
[ 3939.974095] [<c04de878>] (drm_mode_set_config_internal) from
[<c04de9ac>] (drm_crtc_force_disable+0x38/0x40)
[ 3939.983930]  r7:ee8b1800 r6:ee8b1c80 r5:ee4869c0 r4:ee8aec18
[ 3939.989603] [<c04de974>] (drm_crtc_force_disable) from [<c04ed768>]
(drm_framebuffer_remove+0xc8/0x104)
[ 3939.999011] [<c04ed6a0>] (drm_framebuffer_remove) from [<c04ed7e4>]
(drm_mode_rmfb_work_fn+0x40/0x50)
[ 3940.008240]  r9:00000000 r8:ee8abeb0 r7:ef7b4e00 r6:ef7b1800
r5:ee4d5d58 r4:ee4d5d38
[ 3940.016008] [<c04ed7a4>] (drm_mode_rmfb_work_fn) from [<c013ff5c>]
(process_one_work+0x198/0x4e0)
[ 3940.024888]  r5:ef0f4180 r4:ee4d5d38
[ 3940.028478] [<c013fdc4>] (process_one_work) from [<c01402d8>]
(worker_thread+0x34/0x57c)
[ 3940.036579]  r10:ef0f4180 r9:ef7b1800 r8:c0e04900 r7:ef7b1834
r6:00000008 r5:ef0f4198
[ 3940.044414]  r4:ef7b1800
[ 3940.046964] [<c01402a4>] (worker_thread) from [<c0146970>]
(kthread+0xdc/0xf8)
[ 3940.054196]  r10:00000000 r9:00000000 r8:00000000 r7:c01402a4
r6:ef0f4180 r5:ef0f7000
[ 3940.062031]  r4:00000000
[ 3940.064581] [<c0146894>] (kthread) from [<c0107e30>]
(ret_from_fork+0x14/0x24)
[ 3940.071813]  r7:00000000 r6:00000000 r5:c0146894 r4:ef0f7000
[ 3940.077578] ---[ end trace a2c0d89dc638cc35 ]---

Any ideas on how to fix it?

Thanks,

Fabio Estevam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-21 16:40 Warning at drivers/gpu/drm/drm_atomic_helper.c Fabio Estevam
@ 2017-01-22 14:26 ` Fabio Estevam
  2017-01-23  1:10   ` Fabio Estevam
  0 siblings, 1 reply; 12+ messages in thread
From: Fabio Estevam @ 2017-01-22 14:26 UTC (permalink / raw)
  To: Sascha Hauer, Christian Gmeiner, Russell King - ARM Linux
  Cc: gustavo.padovan, DRI mailing list

On Sat, Jan 21, 2017 at 2:40 PM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi,
>
> Stopping kmscube application on mx6q through CTRL + C sometimes leads
> to the following kernel warning:
>
> ^C[ 3939.785516] ------------[ cut here ]------------
> [ 3939.790313] WARNING: CPU: 1 PID: 67 at
> drivers/gpu/drm/drm_atomic_helper.c:1032
> drm_atomic_helper_wait_for_fences+0xe4/0x104
> [ 3939.801626] Modules linked in:
> [ 3939.804762] CPU: 1 PID: 67 Comm: kworker/1:1 Tainted: G        W
>    4.9.4 #1

Just tested 4.9.5 and the kernel warning is gone.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-22 14:26 ` Fabio Estevam
@ 2017-01-23  1:10   ` Fabio Estevam
  2017-01-23  3:15     ` Marek Vasut
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Fabio Estevam @ 2017-01-23  1:10 UTC (permalink / raw)
  To: Sascha Hauer, Christian Gmeiner, Russell King - ARM Linux, Marek Vasut
  Cc: gustavo.padovan, DRI mailing list

On Sun, Jan 22, 2017 at 12:26 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Sat, Jan 21, 2017 at 2:40 PM, Fabio Estevam <festevam@gmail.com> wrote:
>> Hi,
>>
>> Stopping kmscube application on mx6q through CTRL + C sometimes leads
>> to the following kernel warning:
>>
>> ^C[ 3939.785516] ------------[ cut here ]------------
>> [ 3939.790313] WARNING: CPU: 1 PID: 67 at
>> drivers/gpu/drm/drm_atomic_helper.c:1032
>> drm_atomic_helper_wait_for_fences+0xe4/0x104
>> [ 3939.801626] Modules linked in:
>> [ 3939.804762] CPU: 1 PID: 67 Comm: kworker/1:1 Tainted: G        W
>>    4.9.4 #1
>
> Just tested 4.9.5 and the kernel warning is gone.

Actually 4.9.5 shows the same warning.

If I change .atomic_commit like in 782ea2a493ba90800 ("drm/imx: Switch
to drm_fb_cma_prepare_fb() helper") from 4.10-rc1

-       .atomic_commit = imx_drm_atomic_commit,
+       .atomic_commit = drm_atomic_helper_commit,

it fixes the problem.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-23  1:10   ` Fabio Estevam
@ 2017-01-23  3:15     ` Marek Vasut
  2017-01-23 11:51       ` Fabio Estevam
  2017-01-23  8:38     ` Daniel Vetter
  2017-01-25 10:43     ` Lucas Stach
  2 siblings, 1 reply; 12+ messages in thread
From: Marek Vasut @ 2017-01-23  3:15 UTC (permalink / raw)
  To: Fabio Estevam, Sascha Hauer, Christian Gmeiner, Russell King - ARM Linux
  Cc: gustavo.padovan, DRI mailing list

On 01/23/2017 02:10 AM, Fabio Estevam wrote:
> On Sun, Jan 22, 2017 at 12:26 PM, Fabio Estevam <festevam@gmail.com> wrote:
>> On Sat, Jan 21, 2017 at 2:40 PM, Fabio Estevam <festevam@gmail.com> wrote:
>>> Hi,
>>>
>>> Stopping kmscube application on mx6q through CTRL + C sometimes leads
>>> to the following kernel warning:
>>>
>>> ^C[ 3939.785516] ------------[ cut here ]------------
>>> [ 3939.790313] WARNING: CPU: 1 PID: 67 at
>>> drivers/gpu/drm/drm_atomic_helper.c:1032
>>> drm_atomic_helper_wait_for_fences+0xe4/0x104
>>> [ 3939.801626] Modules linked in:
>>> [ 3939.804762] CPU: 1 PID: 67 Comm: kworker/1:1 Tainted: G        W
>>>    4.9.4 #1
>>
>> Just tested 4.9.5 and the kernel warning is gone.
> 
> Actually 4.9.5 shows the same warning.
> 
> If I change .atomic_commit like in 782ea2a493ba90800 ("drm/imx: Switch
> to drm_fb_cma_prepare_fb() helper") from 4.10-rc1
> 
> -       .atomic_commit = imx_drm_atomic_commit,
> +       .atomic_commit = drm_atomic_helper_commit,
> 
> it fixes the problem.
> 
IMHO this will no longer handle the fences correctly and you'll see
rendering artifacts sometimes.

-- 
Best regards,
Marek Vasut
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-23  1:10   ` Fabio Estevam
  2017-01-23  3:15     ` Marek Vasut
@ 2017-01-23  8:38     ` Daniel Vetter
  2017-01-25 10:43     ` Lucas Stach
  2 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-01-23  8:38 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Marek Vasut, Russell King - ARM Linux, DRI mailing list,
	gustavo.padovan, Sascha Hauer

On Sun, Jan 22, 2017 at 11:10:06PM -0200, Fabio Estevam wrote:
> On Sun, Jan 22, 2017 at 12:26 PM, Fabio Estevam <festevam@gmail.com> wrote:
> > On Sat, Jan 21, 2017 at 2:40 PM, Fabio Estevam <festevam@gmail.com> wrote:
> >> Hi,
> >>
> >> Stopping kmscube application on mx6q through CTRL + C sometimes leads
> >> to the following kernel warning:
> >>
> >> ^C[ 3939.785516] ------------[ cut here ]------------
> >> [ 3939.790313] WARNING: CPU: 1 PID: 67 at
> >> drivers/gpu/drm/drm_atomic_helper.c:1032
> >> drm_atomic_helper_wait_for_fences+0xe4/0x104
> >> [ 3939.801626] Modules linked in:
> >> [ 3939.804762] CPU: 1 PID: 67 Comm: kworker/1:1 Tainted: G        W
> >>    4.9.4 #1
> >
> > Just tested 4.9.5 and the kernel warning is gone.
> 
> Actually 4.9.5 shows the same warning.
> 
> If I change .atomic_commit like in 782ea2a493ba90800 ("drm/imx: Switch
> to drm_fb_cma_prepare_fb() helper") from 4.10-rc1
> 
> -       .atomic_commit = imx_drm_atomic_commit,
> +       .atomic_commit = drm_atomic_helper_commit,
> 
> it fixes the problem.

Please submit that as a patch (of course needs to remove the function
itself too) for review by the maintainers.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-23  3:15     ` Marek Vasut
@ 2017-01-23 11:51       ` Fabio Estevam
  2017-01-23 17:56         ` Daniel Vetter
  0 siblings, 1 reply; 12+ messages in thread
From: Fabio Estevam @ 2017-01-23 11:51 UTC (permalink / raw)
  To: Marek Vasut
  Cc: DRI mailing list, gustavo.padovan, Russell King - ARM Linux,
	Sascha Hauer

On Mon, Jan 23, 2017 at 1:15 AM, Marek Vasut <marex@denx.de> wrote:

> IMHO this will no longer handle the fences correctly and you'll see
> rendering artifacts sometimes.

Ok, for 4.9.x stable we cannot apply your 782ea2a493ba90800 ("drm/imx: Switch
to drm_fb_cma_prepare_fb() helper") as it depends on many things that
only show up on 4.10-rc1, so we need to provide a different fix for
4.9.x.

What I did not figure out so far is why are we getting sometimes the
WARN_ON(!plane_state->fb); inside drm_atomic_helper_wait_for_fences()?

The way to reproduce this issue on 4.9.x:

1. Start kmscube
2. Stop kmscube with CTRL + C

Repeate this sequence several times (10 to 20 times) and the
WARN_ON(!plane_state->fb) will trigger about 20% of the times.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-23 11:51       ` Fabio Estevam
@ 2017-01-23 17:56         ` Daniel Vetter
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-01-23 17:56 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Marek Vasut, gustavo.padovan, Sascha Hauer,
	Russell King - ARM Linux, DRI mailing list

On Mon, Jan 23, 2017 at 09:51:55AM -0200, Fabio Estevam wrote:
> On Mon, Jan 23, 2017 at 1:15 AM, Marek Vasut <marex@denx.de> wrote:
> 
> > IMHO this will no longer handle the fences correctly and you'll see
> > rendering artifacts sometimes.
> 
> Ok, for 4.9.x stable we cannot apply your 782ea2a493ba90800 ("drm/imx: Switch
> to drm_fb_cma_prepare_fb() helper") as it depends on many things that
> only show up on 4.10-rc1, so we need to provide a different fix for
> 4.9.x.
> 
> What I did not figure out so far is why are we getting sometimes the
> WARN_ON(!plane_state->fb); inside drm_atomic_helper_wait_for_fences()?
> 
> The way to reproduce this issue on 4.9.x:
> 
> 1. Start kmscube
> 2. Stop kmscube with CTRL + C
> 
> Repeate this sequence several times (10 to 20 times) and the
> WARN_ON(!plane_state->fb) will trigger about 20% of the times.

Sorry, my brain was still offline when I wrote that reply (I blame jetlag
...). Since this is all in 4.10 I'm not really sure what we should be
doing now. I also have no idea why it's blowing up on ->fb sometimes.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-23  1:10   ` Fabio Estevam
  2017-01-23  3:15     ` Marek Vasut
  2017-01-23  8:38     ` Daniel Vetter
@ 2017-01-25 10:43     ` Lucas Stach
  2017-01-25 11:20       ` Fabio Estevam
  2 siblings, 1 reply; 12+ messages in thread
From: Lucas Stach @ 2017-01-25 10:43 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Marek Vasut, Russell King - ARM Linux, DRI mailing list,
	gustavo.padovan, Sascha Hauer

Am Sonntag, den 22.01.2017, 23:10 -0200 schrieb Fabio Estevam:
> On Sun, Jan 22, 2017 at 12:26 PM, Fabio Estevam <festevam@gmail.com> wrote:
> > On Sat, Jan 21, 2017 at 2:40 PM, Fabio Estevam <festevam@gmail.com> wrote:
> >> Hi,
> >>
> >> Stopping kmscube application on mx6q through CTRL + C sometimes leads
> >> to the following kernel warning:
> >>
> >> ^C[ 3939.785516] ------------[ cut here ]------------
> >> [ 3939.790313] WARNING: CPU: 1 PID: 67 at
> >> drivers/gpu/drm/drm_atomic_helper.c:1032
> >> drm_atomic_helper_wait_for_fences+0xe4/0x104
> >> [ 3939.801626] Modules linked in:
> >> [ 3939.804762] CPU: 1 PID: 67 Comm: kworker/1:1 Tainted: G        W
> >>    4.9.4 #1
> >
> > Just tested 4.9.5 and the kernel warning is gone.
> 
> Actually 4.9.5 shows the same warning.
> 
> If I change .atomic_commit like in 782ea2a493ba90800 ("drm/imx: Switch
> to drm_fb_cma_prepare_fb() helper") from 4.10-rc1
> 
> -       .atomic_commit = imx_drm_atomic_commit,
> +       .atomic_commit = drm_atomic_helper_commit,
> 
> it fixes the problem.

This only fixes the issue, as with this change we never attach fences to
the plane state. I've looked into this issue a bit and if I'm not
mistaken, this should still be reproducible with 4.10-rc. Correct?

In that case I'll cook up a patch for you to test.

Regards,
Lucas

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-25 10:43     ` Lucas Stach
@ 2017-01-25 11:20       ` Fabio Estevam
  2017-01-25 11:30         ` Lucas Stach
  0 siblings, 1 reply; 12+ messages in thread
From: Fabio Estevam @ 2017-01-25 11:20 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Marek Vasut, Russell King - ARM Linux, DRI mailing list,
	gustavo.padovan, Sascha Hauer

Hi Lucas,

On Wed, Jan 25, 2017 at 8:43 AM, Lucas Stach <l.stach@pengutronix.de> wrote:

> This only fixes the issue, as with this change we never attach fences to
> the plane state. I've looked into this issue a bit and if I'm not
> mistaken, this should still be reproducible with 4.10-rc. Correct?

I could not reproduce this kernel warning with 4.10-rc, as it does not
use imx_drm_atomic_commit() anymore.

The problem happens with 4.9.x stable, which uses imx_drm_atomic_commit().

Thanks
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-25 11:20       ` Fabio Estevam
@ 2017-01-25 11:30         ` Lucas Stach
  2017-01-25 11:47           ` Fabio Estevam
  0 siblings, 1 reply; 12+ messages in thread
From: Lucas Stach @ 2017-01-25 11:30 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Marek Vasut, Russell King - ARM Linux, DRI mailing list,
	gustavo.padovan, Sascha Hauer

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

Am Mittwoch, den 25.01.2017, 09:20 -0200 schrieb Fabio Estevam:
> Hi Lucas,
> 
> On Wed, Jan 25, 2017 at 8:43 AM, Lucas Stach <l.stach@pengutronix.de> wrote:
> 
> > This only fixes the issue, as with this change we never attach fences to
> > the plane state. I've looked into this issue a bit and if I'm not
> > mistaken, this should still be reproducible with 4.10-rc. Correct?
> 
> I could not reproduce this kernel warning with 4.10-rc, as it does not
> use imx_drm_atomic_commit() anymore.
> 
> The problem happens with 4.9.x stable, which uses imx_drm_atomic_commit().

Kernel 4.10 just moves the fence attach to the plane state. It has
nothing to do with the used commit function. The issue going away if you
change that on kernel 4.9 is a red herring.

In any case, can you try the attached patch? It's against 4.10, if you
want to test it on 4.9 you need to replace dma_fence_put(), with
fence_put().

Regards,
Lucas 


[-- Attachment #2: 0001-drm-atomic-clean-up-fences-when-commit-fails-before-.patch --]
[-- Type: text/x-patch, Size: 1572 bytes --]

From ceaa7ab6c87ddf231024115c123868507b6d9e75 Mon Sep 17 00:00:00 2001
From: Lucas Stach <l.stach@pengutronix.de>
Date: Wed, 25 Jan 2017 12:12:00 +0100
Subject: [PATCH] drm/atomic: clean up fences when commit fails before fence
 wait finished

The plane_state fences are only unreferenced when the wait for them
has finished successfully. If the commit fails before or at that point
(abort from userspace) the fences are kept referenced.

As the drivers are not responsible for fence cleanup when the commit is
successful, the helper should also clean them up in the failing case.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/gpu/drm/drm_atomic_helper.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 34f757bcabae..2fb2aa78773e 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1957,6 +1957,17 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev,
 		if (!drm_atomic_helper_framebuffer_changed(dev, old_state, plane_state->crtc))
 			continue;
 
+		/*
+		 * If the atomic update failed before waiting for fences
+		 * finished, the fences are kept referenced in the state. As the
+		 * drivers are not responsible for cleaning up fences when the
+		 * commit is successful, mirror this behavior when it fails.
+		 */
+		if (plane_state->fence) {
+			dma_fence_put(plane_state->fence);
+			plane_state->fence = NULL;
+		}
+
 		funcs = plane->helper_private;
 
 		if (funcs->cleanup_fb)
-- 
2.11.0


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-25 11:30         ` Lucas Stach
@ 2017-01-25 11:47           ` Fabio Estevam
  2017-01-27 10:34             ` Lucas Stach
  0 siblings, 1 reply; 12+ messages in thread
From: Fabio Estevam @ 2017-01-25 11:47 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Marek Vasut, Russell King - ARM Linux, DRI mailing list,
	gustavo.padovan, Sascha Hauer

On Wed, Jan 25, 2017 at 9:30 AM, Lucas Stach <l.stach@pengutronix.de> wrote:

> Kernel 4.10 just moves the fence attach to the plane state. It has
> nothing to do with the used commit function. The issue going away if you
> change that on kernel 4.9 is a red herring.
>
> In any case, can you try the attached patch? It's against 4.10, if you
> want to test it on 4.9 you need to replace dma_fence_put(), with
> fence_put().

Just tested it on 4.9 (using fence_put()) and I can still get the
warning sometimes:
http://pastebin.com/p6acMLcY
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning at drivers/gpu/drm/drm_atomic_helper.c
  2017-01-25 11:47           ` Fabio Estevam
@ 2017-01-27 10:34             ` Lucas Stach
  0 siblings, 0 replies; 12+ messages in thread
From: Lucas Stach @ 2017-01-27 10:34 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Marek Vasut, Russell King - ARM Linux, DRI mailing list,
	gustavo.padovan, Sascha Hauer

Am Mittwoch, den 25.01.2017, 09:47 -0200 schrieb Fabio Estevam:
> On Wed, Jan 25, 2017 at 9:30 AM, Lucas Stach <l.stach@pengutronix.de> wrote:
> 
> > Kernel 4.10 just moves the fence attach to the plane state. It has
> > nothing to do with the used commit function. The issue going away if you
> > change that on kernel 4.9 is a red herring.
> >
> > In any case, can you try the attached patch? It's against 4.10, if you
> > want to test it on 4.9 you need to replace dma_fence_put(), with
> > fence_put().
> 
> Just tested it on 4.9 (using fence_put()) and I can still get the
> warning sometimes:
> http://pastebin.com/p6acMLcY
> 
Okay, after looking more at the 4.9 code, I understand what's going on.
I've just sent out a patch to fix this issue for kernel 4.9.

Regards,
Lucas

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-01-27 10:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21 16:40 Warning at drivers/gpu/drm/drm_atomic_helper.c Fabio Estevam
2017-01-22 14:26 ` Fabio Estevam
2017-01-23  1:10   ` Fabio Estevam
2017-01-23  3:15     ` Marek Vasut
2017-01-23 11:51       ` Fabio Estevam
2017-01-23 17:56         ` Daniel Vetter
2017-01-23  8:38     ` Daniel Vetter
2017-01-25 10:43     ` Lucas Stach
2017-01-25 11:20       ` Fabio Estevam
2017-01-25 11:30         ` Lucas Stach
2017-01-25 11:47           ` Fabio Estevam
2017-01-27 10:34             ` Lucas Stach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.