All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface
@ 2015-11-16 12:50 Daniel Stone
  2015-11-16 12:50 ` [PATCH 2/2] drm/rockchip: Send events for same-fb flips Daniel Stone
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Daniel Stone @ 2015-11-16 12:50 UTC (permalink / raw)
  To: mark.yao; +Cc: linux-rockchip, Sjoerd Simons, Thierry Reding, dri-devel

Passing -1 as the pipe for vblank events now triggers a WARN_ON, but had
previously made multi-screen unusable anyway. Pass the correct pipe to
the event-send function, and use the new API to make this a bit easier
for us.

Fixes WARN present since cc1ef118fc for every pageflip event sent:
[  209.549969] ------------[ cut here ]------------
[  209.554592] WARNING: CPU: 3 PID: 238 at drivers/gpu/drm/drm_irq.c:924 drm_vblank_count_and_time+0x80/0x88 [drm]()
[  209.564832] Modules linked in: [...]
[  209.612401] CPU: 3 PID: 238 Comm: irq/41-ff940000 Tainted: G        W       4.3.0-rc6+ #71
[  209.620647] Hardware name: Rockchip (Device Tree)
[  209.625348] [<c001bb80>] (unwind_backtrace) from [<c001615c>] (show_stack+0x20/0x24)
[  209.633079] [<c001615c>] (show_stack) from [<c02b2c50>] (dump_stack+0x8c/0x9c)
[  209.640289] [<c02b2c50>] (dump_stack) from [<c0052e88>] (warn_slowpath_common+0x94/0xc4)
[  209.648364] [<c0052e88>] (warn_slowpath_common) from [<c0052f74>] (warn_slowpath_null+0x2c/0x34)
[  209.657139] [<c0052f74>] (warn_slowpath_null) from [<bf17dc30>] (drm_vblank_count_and_time+0x80/0x88 [drm])
[  209.666875] [<bf17dc30>] (drm_vblank_count_and_time [drm]) from [<bf17e484>] (drm_send_vblank_event+0x74/0x7c [drm])
[  209.677385] [<bf17e484>] (drm_send_vblank_event [drm]) from [<bf4c1144>] (vop_win_state_complete+0x4c/0x70 [rockchip_drm_vop])
[  209.688757] [<bf4c1144>] (vop_win_state_complete [rockchip_drm_vop]) from [<bf4c3bdc>] (vop_isr_thread+0x170/0x1d4 [rockchip_drm_vop])
[  209.700822] [<bf4c3bdc>] (vop_isr_thread [rockchip_drm_vop]) from [<c00ab93c>] (irq_thread_fn+0x2c/0x50)
[  209.710284] [<c00ab93c>] (irq_thread_fn) from [<c00abcac>] (irq_thread+0x13c/0x188)
[  209.717927] [<c00abcac>] (irq_thread) from [<c00723c8>] (kthread+0xec/0x104)
[  209.724965] [<c00723c8>] (kthread) from [<c0011638>] (ret_from_fork+0x14/0x3c)
[  209.732171] ---[ end trace 0690bc604f5d535d ]---

Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Heiko Stuebner <heiko@sntech.de>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 5d8ae5e..ddf6dc2 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1289,7 +1289,7 @@ static void vop_win_state_complete(struct vop_win *vop_win,
 
 	if (state->event) {
 		spin_lock_irqsave(&drm->event_lock, flags);
-		drm_send_vblank_event(drm, -1, state->event);
+		drm_crtc_send_vblank_event(crtc, state->event);
 		spin_unlock_irqrestore(&drm->event_lock, flags);
 	}
 
-- 
2.5.0

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

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

* [PATCH 2/2] drm/rockchip: Send events for same-fb flips
  2015-11-16 12:50 [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Daniel Stone
@ 2015-11-16 12:50 ` Daniel Stone
  2015-11-16 12:57   ` Sjoerd Simons
       [not found]   ` <1447678222-6858-2-git-send-email-daniels-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
  2015-11-16 12:54 ` [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Sjoerd Simons
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Daniel Stone @ 2015-11-16 12:50 UTC (permalink / raw)
  To: mark.yao; +Cc: linux-rockchip, Sjoerd Simons, dri-devel

Rockchip previously treated a pageflip to the same framebuffer as a
no-op, discarding the event if one was requested. This breaks Weston,
which, when idle, sends a no-op vblank event to discover vblank
timings if the vblank query interface is not usable.

Silently dropping events is also quite a hostile thing to do to
userspace in general.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Cc: Heiko Stuebner <heiko@sntech.de>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 30 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index ddf6dc2..dad607e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -916,25 +916,23 @@ static int vop_update_plane_event(struct drm_plane *plane,
 	 * unreference any previous framebuffers.
 	 */
 	mutex_lock(&vop->vsync_mutex);
-	if (fb != vop_win_last_pending_fb(vop_win)) {
-		ret = drm_vblank_get(plane->dev, vop->pipe);
-		if (ret) {
-			DRM_ERROR("failed to get vblank, %d\n", ret);
-			mutex_unlock(&vop->vsync_mutex);
-			return ret;
-		}
+	ret = drm_vblank_get(plane->dev, vop->pipe);
+	if (ret) {
+		DRM_ERROR("failed to get vblank, %d\n", ret);
+		mutex_unlock(&vop->vsync_mutex);
+		return ret;
+	}
 
-		drm_framebuffer_reference(fb);
+	drm_framebuffer_reference(fb);
 
-		ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
-		if (ret) {
-			drm_vblank_put(plane->dev, vop->pipe);
-			mutex_unlock(&vop->vsync_mutex);
-			return ret;
-		}
-
-		vop->vsync_work_pending = true;
+	ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
+	if (ret) {
+		drm_vblank_put(plane->dev, vop->pipe);
+		mutex_unlock(&vop->vsync_mutex);
+		return ret;
 	}
+
+	vop->vsync_work_pending = true;
 	mutex_unlock(&vop->vsync_mutex);
 
 	spin_lock(&vop->reg_lock);
-- 
2.5.0

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

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

* Re: [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface
  2015-11-16 12:50 [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Daniel Stone
  2015-11-16 12:50 ` [PATCH 2/2] drm/rockchip: Send events for same-fb flips Daniel Stone
@ 2015-11-16 12:54 ` Sjoerd Simons
  2015-11-16 14:37 ` Heiko Stübner
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Sjoerd Simons @ 2015-11-16 12:54 UTC (permalink / raw)
  To: Daniel Stone, mark.yao; +Cc: linux-rockchip, Thierry Reding, dri-devel

On Mon, 2015-11-16 at 12:50 +0000, Daniel Stone wrote:
> Passing -1 as the pipe for vblank events now triggers a WARN_ON, but
> had
> previously made multi-screen unusable anyway. Pass the correct pipe
> to
> the event-send function, and use the new API to make this a bit
> easier
> for us.

Tested on a Radxa Rock 2 square board.

Tested-By: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

> Fixes WARN present since cc1ef118fc for every pageflip event sent:
> [  209.549969] ------------[ cut here ]------------
> [  209.554592] WARNING: CPU: 3 PID: 238 at
> drivers/gpu/drm/drm_irq.c:924 drm_vblank_count_and_time+0x80/0x88
> [drm]()
> [  209.564832] Modules linked in: [...]
> [  209.612401] CPU: 3 PID: 238 Comm: irq/41-ff940000 Tainted:
> G        W       4.3.0-rc6+ #71
> [  209.620647] Hardware name: Rockchip (Device Tree)
> [  209.625348] [<c001bb80>] (unwind_backtrace) from [<c001615c>]
> (show_stack+0x20/0x24)
> [  209.633079] [<c001615c>] (show_stack) from [<c02b2c50>]
> (dump_stack+0x8c/0x9c)
> [  209.640289] [<c02b2c50>] (dump_stack) from [<c0052e88>]
> (warn_slowpath_common+0x94/0xc4)
> [  209.648364] [<c0052e88>] (warn_slowpath_common) from [<c0052f74>]
> (warn_slowpath_null+0x2c/0x34)
> [  209.657139] [<c0052f74>] (warn_slowpath_null) from [<bf17dc30>]
> (drm_vblank_count_and_time+0x80/0x88 [drm])
> [  209.666875] [<bf17dc30>] (drm_vblank_count_and_time [drm]) from
> [<bf17e484>] (drm_send_vblank_event+0x74/0x7c [drm])
> [  209.677385] [<bf17e484>] (drm_send_vblank_event [drm]) from
> [<bf4c1144>] (vop_win_state_complete+0x4c/0x70 [rockchip_drm_vop])
> [  209.688757] [<bf4c1144>] (vop_win_state_complete
> [rockchip_drm_vop]) from [<bf4c3bdc>] (vop_isr_thread+0x170/0x1d4
> [rockchip_drm_vop])
> [  209.700822] [<bf4c3bdc>] (vop_isr_thread [rockchip_drm_vop]) from
> [<c00ab93c>] (irq_thread_fn+0x2c/0x50)
> [  209.710284] [<c00ab93c>] (irq_thread_fn) from [<c00abcac>]
> (irq_thread+0x13c/0x188)
> [  209.717927] [<c00abcac>] (irq_thread) from [<c00723c8>]
> (kthread+0xec/0x104)
> [  209.724965] [<c00723c8>] (kthread) from [<c0011638>]
> (ret_from_fork+0x14/0x3c)
> [  209.732171] ---[ end trace 0690bc604f5d535d ]---
> 
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 5d8ae5e..ddf6dc2 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1289,7 +1289,7 @@ static void vop_win_state_complete(struct
> vop_win *vop_win,
>  
>  	if (state->event) {
>  		spin_lock_irqsave(&drm->event_lock, flags);
> -		drm_send_vblank_event(drm, -1, state->event);
> +		drm_crtc_send_vblank_event(crtc, state->event);
>  		spin_unlock_irqrestore(&drm->event_lock, flags);
>  	}
>  

-- 
Sjoerd Simons
Collabora Ltd.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 2/2] drm/rockchip: Send events for same-fb flips
  2015-11-16 12:50 ` [PATCH 2/2] drm/rockchip: Send events for same-fb flips Daniel Stone
@ 2015-11-16 12:57   ` Sjoerd Simons
       [not found]   ` <1447678222-6858-2-git-send-email-daniels-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Sjoerd Simons @ 2015-11-16 12:57 UTC (permalink / raw)
  To: Daniel Stone, mark.yao; +Cc: linux-rockchip, dri-devel

On Mon, 2015-11-16 at 12:50 +0000, Daniel Stone wrote:
> Rockchip previously treated a pageflip to the same framebuffer as a
> no-op, discarding the event if one was requested. This breaks Weston,
> which, when idle, sends a no-op vblank event to discover vblank
> timings if the vblank query interface is not usable.
> 
> Silently dropping events is also quite a hostile thing to do to
> userspace in general.

Tested on a Radxa Rock 2 square board, the combination of this patch
and the previous in this series makes weston (drm compositor, pixman
renderer) work nicely on this hardware while before it would get stuck
right away for the reasons pointed out by daniels

Tested-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

> Signed-off-by: Daniel Stone <daniels@collabora.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 30 ++++++++++++++-----
> ----------
>  1 file changed, 14 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index ddf6dc2..dad607e 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -916,25 +916,23 @@ static int vop_update_plane_event(struct
> drm_plane *plane,
>  	 * unreference any previous framebuffers.
>  	 */
>  	mutex_lock(&vop->vsync_mutex);
> -	if (fb != vop_win_last_pending_fb(vop_win)) {
> -		ret = drm_vblank_get(plane->dev, vop->pipe);
> -		if (ret) {
> -			DRM_ERROR("failed to get vblank, %d\n",
> ret);
> -			mutex_unlock(&vop->vsync_mutex);
> -			return ret;
> -		}
> +	ret = drm_vblank_get(plane->dev, vop->pipe);
> +	if (ret) {
> +		DRM_ERROR("failed to get vblank, %d\n", ret);
> +		mutex_unlock(&vop->vsync_mutex);
> +		return ret;
> +	}
>  
> -		drm_framebuffer_reference(fb);
> +	drm_framebuffer_reference(fb);
>  
> -		ret = vop_win_queue_fb(vop_win, fb, yrgb_mst,
> event);
> -		if (ret) {
> -			drm_vblank_put(plane->dev, vop->pipe);
> -			mutex_unlock(&vop->vsync_mutex);
> -			return ret;
> -		}
> -
> -		vop->vsync_work_pending = true;
> +	ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
> +	if (ret) {
> +		drm_vblank_put(plane->dev, vop->pipe);
> +		mutex_unlock(&vop->vsync_mutex);
> +		return ret;
>  	}
> +
> +	vop->vsync_work_pending = true;
>  	mutex_unlock(&vop->vsync_mutex);
>  
>  	spin_lock(&vop->reg_lock);

-- 
Sjoerd Simons
Collabora Ltd.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface
  2015-11-16 12:50 [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Daniel Stone
  2015-11-16 12:50 ` [PATCH 2/2] drm/rockchip: Send events for same-fb flips Daniel Stone
  2015-11-16 12:54 ` [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Sjoerd Simons
@ 2015-11-16 14:37 ` Heiko Stübner
  2015-11-16 15:13 ` Thierry Reding
  2015-12-02  1:02 ` Mark yao
  4 siblings, 0 replies; 11+ messages in thread
From: Heiko Stübner @ 2015-11-16 14:37 UTC (permalink / raw)
  To: Daniel Stone; +Cc: linux-rockchip, Sjoerd Simons, Thierry Reding, dri-devel

Am Montag, 16. November 2015, 12:50:21 schrieb Daniel Stone:
> Passing -1 as the pipe for vblank events now triggers a WARN_ON, but had
> previously made multi-screen unusable anyway. Pass the correct pipe to
> the event-send function, and use the new API to make this a bit easier
> for us.
> 
> Fixes WARN present since cc1ef118fc for every pageflip event sent:
> [  209.549969] ------------[ cut here ]------------
> [  209.554592] WARNING: CPU: 3 PID: 238 at drivers/gpu/drm/drm_irq.c:924
> drm_vblank_count_and_time+0x80/0x88 [drm]() [  209.564832] Modules linked
> in: [...]
> [  209.612401] CPU: 3 PID: 238 Comm: irq/41-ff940000 Tainted: G        W    
>   4.3.0-rc6+ #71 [  209.620647] Hardware name: Rockchip (Device Tree)
> [  209.625348] [<c001bb80>] (unwind_backtrace) from [<c001615c>]
> (show_stack+0x20/0x24) [  209.633079] [<c001615c>] (show_stack) from
> [<c02b2c50>] (dump_stack+0x8c/0x9c) [  209.640289] [<c02b2c50>]
> (dump_stack) from [<c0052e88>] (warn_slowpath_common+0x94/0xc4) [ 
> 209.648364] [<c0052e88>] (warn_slowpath_common) from [<c0052f74>]
> (warn_slowpath_null+0x2c/0x34) [  209.657139] [<c0052f74>]
> (warn_slowpath_null) from [<bf17dc30>] (drm_vblank_count_and_time+0x80/0x88
> [drm]) [  209.666875] [<bf17dc30>] (drm_vblank_count_and_time [drm]) from
> [<bf17e484>] (drm_send_vblank_event+0x74/0x7c [drm]) [  209.677385]
> [<bf17e484>] (drm_send_vblank_event [drm]) from [<bf4c1144>]
> (vop_win_state_complete+0x4c/0x70 [rockchip_drm_vop]) [  209.688757]
> [<bf4c1144>] (vop_win_state_complete [rockchip_drm_vop]) from [<bf4c3bdc>]
> (vop_isr_thread+0x170/0x1d4 [rockchip_drm_vop]) [  209.700822] [<bf4c3bdc>]
> (vop_isr_thread [rockchip_drm_vop]) from [<c00ab93c>]
> (irq_thread_fn+0x2c/0x50) [  209.710284] [<c00ab93c>] (irq_thread_fn) from
> [<c00abcac>] (irq_thread+0x13c/0x188) [  209.717927] [<c00abcac>]
> (irq_thread) from [<c00723c8>] (kthread+0xec/0x104) [  209.724965]
> [<c00723c8>] (kthread) from [<c0011638>] (ret_from_fork+0x14/0x3c) [ 
> 209.732171] ---[ end trace 0690bc604f5d535d ]---
> 
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Heiko Stuebner <heiko@sntech.de>

on a rk3288_veyron_jerry

Tested-by: Heiko Stuebner <heiko@sntech.de>

Everything up to GLES2 using the binary userspace driver still works

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

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

* Re: [PATCH 2/2] drm/rockchip: Send events for same-fb flips
       [not found]   ` <1447678222-6858-2-git-send-email-daniels-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
@ 2015-11-16 14:37     ` Heiko Stübner
  2015-11-23  7:46     ` Caesar Wang
  1 sibling, 0 replies; 11+ messages in thread
From: Heiko Stübner @ 2015-11-16 14:37 UTC (permalink / raw)
  To: Daniel Stone
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Sjoerd Simons,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	mark.yao-TNX95d0MmH7DzftRWevZcw

Am Montag, 16. November 2015, 12:50:22 schrieb Daniel Stone:
> Rockchip previously treated a pageflip to the same framebuffer as a
> no-op, discarding the event if one was requested. This breaks Weston,
> which, when idle, sends a no-op vblank event to discover vblank
> timings if the vblank query interface is not usable.
> 
> Silently dropping events is also quite a hostile thing to do to
> userspace in general.
> 
> Signed-off-by: Daniel Stone <daniels-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
> Cc: Sjoerd Simons <sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
> Cc: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>

on a rk3288_veyron_jerry

Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>

Everything up to GLES2 using the binary userspace driver still works

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

* Re: [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface
  2015-11-16 12:50 [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Daniel Stone
                   ` (2 preceding siblings ...)
  2015-11-16 14:37 ` Heiko Stübner
@ 2015-11-16 15:13 ` Thierry Reding
  2015-12-02  1:02 ` Mark yao
  4 siblings, 0 replies; 11+ messages in thread
From: Thierry Reding @ 2015-11-16 15:13 UTC (permalink / raw)
  To: Daniel Stone; +Cc: linux-rockchip, Sjoerd Simons, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 2411 bytes --]

On Mon, Nov 16, 2015 at 12:50:21PM +0000, Daniel Stone wrote:
> Passing -1 as the pipe for vblank events now triggers a WARN_ON, but had
> previously made multi-screen unusable anyway. Pass the correct pipe to
> the event-send function, and use the new API to make this a bit easier
> for us.
> 
> Fixes WARN present since cc1ef118fc for every pageflip event sent:
> [  209.549969] ------------[ cut here ]------------
> [  209.554592] WARNING: CPU: 3 PID: 238 at drivers/gpu/drm/drm_irq.c:924 drm_vblank_count_and_time+0x80/0x88 [drm]()
> [  209.564832] Modules linked in: [...]
> [  209.612401] CPU: 3 PID: 238 Comm: irq/41-ff940000 Tainted: G        W       4.3.0-rc6+ #71
> [  209.620647] Hardware name: Rockchip (Device Tree)
> [  209.625348] [<c001bb80>] (unwind_backtrace) from [<c001615c>] (show_stack+0x20/0x24)
> [  209.633079] [<c001615c>] (show_stack) from [<c02b2c50>] (dump_stack+0x8c/0x9c)
> [  209.640289] [<c02b2c50>] (dump_stack) from [<c0052e88>] (warn_slowpath_common+0x94/0xc4)
> [  209.648364] [<c0052e88>] (warn_slowpath_common) from [<c0052f74>] (warn_slowpath_null+0x2c/0x34)
> [  209.657139] [<c0052f74>] (warn_slowpath_null) from [<bf17dc30>] (drm_vblank_count_and_time+0x80/0x88 [drm])
> [  209.666875] [<bf17dc30>] (drm_vblank_count_and_time [drm]) from [<bf17e484>] (drm_send_vblank_event+0x74/0x7c [drm])
> [  209.677385] [<bf17e484>] (drm_send_vblank_event [drm]) from [<bf4c1144>] (vop_win_state_complete+0x4c/0x70 [rockchip_drm_vop])
> [  209.688757] [<bf4c1144>] (vop_win_state_complete [rockchip_drm_vop]) from [<bf4c3bdc>] (vop_isr_thread+0x170/0x1d4 [rockchip_drm_vop])
> [  209.700822] [<bf4c3bdc>] (vop_isr_thread [rockchip_drm_vop]) from [<c00ab93c>] (irq_thread_fn+0x2c/0x50)
> [  209.710284] [<c00ab93c>] (irq_thread_fn) from [<c00abcac>] (irq_thread+0x13c/0x188)
> [  209.717927] [<c00abcac>] (irq_thread) from [<c00723c8>] (kthread+0xec/0x104)
> [  209.724965] [<c00723c8>] (kthread) from [<c0011638>] (ret_from_fork+0x14/0x3c)
> [  209.732171] ---[ end trace 0690bc604f5d535d ]---
> 
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: [PATCH 2/2] drm/rockchip: Send events for same-fb flips
       [not found]   ` <1447678222-6858-2-git-send-email-daniels-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
  2015-11-16 14:37     ` Heiko Stübner
@ 2015-11-23  7:46     ` Caesar Wang
  2015-12-02  1:01       ` Mark yao
  1 sibling, 1 reply; 11+ messages in thread
From: Caesar Wang @ 2015-11-23  7:46 UTC (permalink / raw)
  To: Daniel Stone, mark.yao-TNX95d0MmH7DzftRWevZcw
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Sjoerd Simons,
	Heiko Stuebner, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi,

于 2015年11月16日 20:50, Daniel Stone 写道:
> Rockchip previously treated a pageflip to the same framebuffer as a
> no-op, discarding the event if one was requested. This breaks Weston,
> which, when idle, sends a no-op vblank event to discover vblank
> timings if the vblank query interface is not usable.
>
> Silently dropping events is also quite a hostile thing to do to
> userspace in general.
>
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Heiko Stuebner <heiko@sntech.de>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 30 ++++++++++++++---------------
>   1 file changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index ddf6dc2..dad607e 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -916,25 +916,23 @@ static int vop_update_plane_event(struct drm_plane *plane,
>   	 * unreference any previous framebuffers.
>   	 */
>   	mutex_lock(&vop->vsync_mutex);
> -	if (fb != vop_win_last_pending_fb(vop_win)) {

There is a warning for building.

CC drivers/gpu/drm/rockchip/rockchip_drm_vop.o
drivers/gpu/drm/rockchip/rockchip_drm_vop.c:753:32: warning: 
'vop_win_last_pending_fb' defined but not used [-Wunused-function]

Maybe, we can also remove the vop_win_last_pending_fb() function.

> -		ret = drm_vblank_get(plane->dev, vop->pipe);
> -		if (ret) {
> -			DRM_ERROR("failed to get vblank, %d\n", ret);
> -			mutex_unlock(&vop->vsync_mutex);
> -			return ret;
> -		}
> +	ret = drm_vblank_get(plane->dev, vop->pipe);
> +	if (ret) {
> +		DRM_ERROR("failed to get vblank, %d\n", ret);
> +		mutex_unlock(&vop->vsync_mutex);
> +		return ret;
> +	}
>   
> -		drm_framebuffer_reference(fb);
> +	drm_framebuffer_reference(fb);
>   
> -		ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
> -		if (ret) {
> -			drm_vblank_put(plane->dev, vop->pipe);
> -			mutex_unlock(&vop->vsync_mutex);
> -			return ret;
> -		}
> -
> -		vop->vsync_work_pending = true;
> +	ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
> +	if (ret) {
> +		drm_vblank_put(plane->dev, vop->pipe);
> +		mutex_unlock(&vop->vsync_mutex);
> +		return ret;
>   	}
> +
> +	vop->vsync_work_pending = true;
>   	mutex_unlock(&vop->vsync_mutex);
>   
>   	spin_lock(&vop->reg_lock);


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH 2/2] drm/rockchip: Send events for same-fb flips
  2015-11-23  7:46     ` Caesar Wang
@ 2015-12-02  1:01       ` Mark yao
  2015-12-02 14:07         ` Daniel Stone
  0 siblings, 1 reply; 11+ messages in thread
From: Mark yao @ 2015-12-02  1:01 UTC (permalink / raw)
  To: Caesar Wang, Daniel Stone; +Cc: linux-rockchip, Sjoerd Simons, dri-devel

On 2015年11月23日 15:46, Caesar Wang wrote:
> Hi,
>
> 于 2015年11月16日 20:50, Daniel Stone 写道:
>> Rockchip previously treated a pageflip to the same framebuffer as a
>> no-op, discarding the event if one was requested. This breaks Weston,
>> which, when idle, sends a no-op vblank event to discover vblank
>> timings if the vblank query interface is not usable.
>>
>> Silently dropping events is also quite a hostile thing to do to
>> userspace in general.
>>
>> Signed-off-by: Daniel Stone <daniels@collabora.com>
>> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
>> Cc: Heiko Stuebner <heiko@sntech.de>
>> ---
>>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 30 
>> ++++++++++++++---------------
>>   1 file changed, 14 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c 
>> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> index ddf6dc2..dad607e 100644
>> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> @@ -916,25 +916,23 @@ static int vop_update_plane_event(struct 
>> drm_plane *plane,
>>        * unreference any previous framebuffers.
>>        */
>>       mutex_lock(&vop->vsync_mutex);
>> -    if (fb != vop_win_last_pending_fb(vop_win)) {
>
> There is a warning for building.
>
> CC drivers/gpu/drm/rockchip/rockchip_drm_vop.o
> drivers/gpu/drm/rockchip/rockchip_drm_vop.c:753:32: warning: 
> 'vop_win_last_pending_fb' defined but not used [-Wunused-function]
>
> Maybe, we can also remove the vop_win_last_pending_fb() function.
>

Can you test this problem with my new atomic patches? I think atomic 
patch fix the problem.

Thanks.

>> -        ret = drm_vblank_get(plane->dev, vop->pipe);
>> -        if (ret) {
>> -            DRM_ERROR("failed to get vblank, %d\n", ret);
>> -            mutex_unlock(&vop->vsync_mutex);
>> -            return ret;
>> -        }
>> +    ret = drm_vblank_get(plane->dev, vop->pipe);
>> +    if (ret) {
>> +        DRM_ERROR("failed to get vblank, %d\n", ret);
>> +        mutex_unlock(&vop->vsync_mutex);
>> +        return ret;
>> +    }
>>   -        drm_framebuffer_reference(fb);
>> +    drm_framebuffer_reference(fb);
>>   -        ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
>> -        if (ret) {
>> -            drm_vblank_put(plane->dev, vop->pipe);
>> -            mutex_unlock(&vop->vsync_mutex);
>> -            return ret;
>> -        }
>> -
>> -        vop->vsync_work_pending = true;
>> +    ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
>> +    if (ret) {
>> +        drm_vblank_put(plane->dev, vop->pipe);
>> +        mutex_unlock(&vop->vsync_mutex);
>> +        return ret;
>>       }
>> +
>> +    vop->vsync_work_pending = true;
>>       mutex_unlock(&vop->vsync_mutex);
>>         spin_lock(&vop->reg_lock);
>
>
>


-- 
Mark Yao


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

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

* Re: [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface
  2015-11-16 12:50 [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Daniel Stone
                   ` (3 preceding siblings ...)
  2015-11-16 15:13 ` Thierry Reding
@ 2015-12-02  1:02 ` Mark yao
  4 siblings, 0 replies; 11+ messages in thread
From: Mark yao @ 2015-12-02  1:02 UTC (permalink / raw)
  To: Daniel Stone; +Cc: linux-rockchip, Sjoerd Simons, Thierry Reding, dri-devel

On 2015年11月16日 20:50, Daniel Stone wrote:
> Passing -1 as the pipe for vblank events now triggers a WARN_ON, but had
> previously made multi-screen unusable anyway. Pass the correct pipe to
> the event-send function, and use the new API to make this a bit easier
> for us.
>
> Fixes WARN present since cc1ef118fc for every pageflip event sent:
> [  209.549969] ------------[ cut here ]------------
> [  209.554592] WARNING: CPU: 3 PID: 238 at drivers/gpu/drm/drm_irq.c:924 drm_vblank_count_and_time+0x80/0x88 [drm]()
> [  209.564832] Modules linked in: [...]
> [  209.612401] CPU: 3 PID: 238 Comm: irq/41-ff940000 Tainted: G        W       4.3.0-rc6+ #71
> [  209.620647] Hardware name: Rockchip (Device Tree)
> [  209.625348] [<c001bb80>] (unwind_backtrace) from [<c001615c>] (show_stack+0x20/0x24)
> [  209.633079] [<c001615c>] (show_stack) from [<c02b2c50>] (dump_stack+0x8c/0x9c)
> [  209.640289] [<c02b2c50>] (dump_stack) from [<c0052e88>] (warn_slowpath_common+0x94/0xc4)
> [  209.648364] [<c0052e88>] (warn_slowpath_common) from [<c0052f74>] (warn_slowpath_null+0x2c/0x34)
> [  209.657139] [<c0052f74>] (warn_slowpath_null) from [<bf17dc30>] (drm_vblank_count_and_time+0x80/0x88 [drm])
> [  209.666875] [<bf17dc30>] (drm_vblank_count_and_time [drm]) from [<bf17e484>] (drm_send_vblank_event+0x74/0x7c [drm])
> [  209.677385] [<bf17e484>] (drm_send_vblank_event [drm]) from [<bf4c1144>] (vop_win_state_complete+0x4c/0x70 [rockchip_drm_vop])
> [  209.688757] [<bf4c1144>] (vop_win_state_complete [rockchip_drm_vop]) from [<bf4c3bdc>] (vop_isr_thread+0x170/0x1d4 [rockchip_drm_vop])
> [  209.700822] [<bf4c3bdc>] (vop_isr_thread [rockchip_drm_vop]) from [<c00ab93c>] (irq_thread_fn+0x2c/0x50)
> [  209.710284] [<c00ab93c>] (irq_thread_fn) from [<c00abcac>] (irq_thread+0x13c/0x188)
> [  209.717927] [<c00abcac>] (irq_thread) from [<c00723c8>] (kthread+0xec/0x104)
> [  209.724965] [<c00723c8>] (kthread) from [<c0011638>] (ret_from_fork+0x14/0x3c)
> [  209.732171] ---[ end trace 0690bc604f5d535d ]---
>
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 5d8ae5e..ddf6dc2 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1289,7 +1289,7 @@ static void vop_win_state_complete(struct vop_win *vop_win,
>   
>   	if (state->event) {
>   		spin_lock_irqsave(&drm->event_lock, flags);
> -		drm_send_vblank_event(drm, -1, state->event);
> +		drm_crtc_send_vblank_event(crtc, state->event);
>   		spin_unlock_irqrestore(&drm->event_lock, flags);
>   	}
>   

Applied to my drm-fixes, Thanks for this fix.

-- 
Mark Yao


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

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

* Re: [PATCH 2/2] drm/rockchip: Send events for same-fb flips
  2015-12-02  1:01       ` Mark yao
@ 2015-12-02 14:07         ` Daniel Stone
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Stone @ 2015-12-02 14:07 UTC (permalink / raw)
  To: Mark yao
  Cc: linux-rockchip, Sjoerd Simons, Daniel Stone, dri-devel, Caesar Wang

Hi Mark, Caesar,

On 2 December 2015 at 01:01, Mark yao <mark.yao@rock-chips.com> wrote:
> On 2015年11月23日 15:46, Caesar Wang wrote:
>> There is a warning for building.
>>
>> CC drivers/gpu/drm/rockchip/rockchip_drm_vop.o
>> drivers/gpu/drm/rockchip/rockchip_drm_vop.c:753:32: warning:
>> 'vop_win_last_pending_fb' defined but not used [-Wunused-function]
>>
>> Maybe, we can also remove the vop_win_last_pending_fb() function.

You're absolutely right, and I have removed this in the next patchset,
which I will find the time to post shortly.

> Can you test this problem with my new atomic patches? I think atomic patch
> fix the problem.

I need some more time to do a full review of the atomic work. But
either way, atomic is not appropriate for a -fixes pull - I would like
to see this in 4.4 if possible, rather than 4.6.

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-12-02 14:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 12:50 [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Daniel Stone
2015-11-16 12:50 ` [PATCH 2/2] drm/rockchip: Send events for same-fb flips Daniel Stone
2015-11-16 12:57   ` Sjoerd Simons
     [not found]   ` <1447678222-6858-2-git-send-email-daniels-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-11-16 14:37     ` Heiko Stübner
2015-11-23  7:46     ` Caesar Wang
2015-12-02  1:01       ` Mark yao
2015-12-02 14:07         ` Daniel Stone
2015-11-16 12:54 ` [PATCH 1/2] drm/rockchip: Use CRTC vblank event interface Sjoerd Simons
2015-11-16 14:37 ` Heiko Stübner
2015-11-16 15:13 ` Thierry Reding
2015-12-02  1:02 ` Mark yao

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.