diff mbox

[15/26] drm/arc: Implement nonblocking commit correctly

Message ID 1464546923-13439-16-git-send-email-daniel.vetter@ffwll.ch
State New
Headers show

Commit Message

Daniel Vetter May 29, 2016, 6:35 p.m. UTC
Committing with block it is not.

Thanks to the fixed up vblank event handling we can just use the
helper support for nonblocking commits now.

Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/arc/arcpgu_drv.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Maarten Lankhorst May 30, 2016, 8:15 a.m. UTC | #1
Op 29-05-16 om 20:35 schreef Daniel Vetter:
> Committing with block it is not.
>
> Thanks to the fixed up vblank event handling we can just use the
> helper support for nonblocking commits now.
>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: linux-snps-arc@lists.infradead.org
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
This breaks page flip on arc, it uses drm_atomic_helper_page_flip.
Daniel Vetter May 30, 2016, 9:24 a.m. UTC | #2
On Mon, May 30, 2016 at 10:15:14AM +0200, Maarten Lankhorst wrote:
> Op 29-05-16 om 20:35 schreef Daniel Vetter:
> > Committing with block it is not.
> >
> > Thanks to the fixed up vblank event handling we can just use the
> > helper support for nonblocking commits now.
> >
> > Cc: Carlos Palminha <palminha@synopsys.com>
> > Cc: Alexey Brodkin <abrodkin@synopsys.com>
> > Cc: linux-snps-arc@lists.infradead.org
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> This breaks page flip on arc, it uses drm_atomic_helper_page_flip.

How exactly does this break page_flip? Note that the commit to implement
generic nonblocking commit in drm_atomic_helper_commit is _before_ this
patch in the series.
-Daniel
Maarten Lankhorst May 30, 2016, 9:36 a.m. UTC | #3
Op 30-05-16 om 11:24 schreef Daniel Vetter:
> On Mon, May 30, 2016 at 10:15:14AM +0200, Maarten Lankhorst wrote:
>> Op 29-05-16 om 20:35 schreef Daniel Vetter:
>>> Committing with block it is not.
>>>
>>> Thanks to the fixed up vblank event handling we can just use the
>>> helper support for nonblocking commits now.
>>>
>>> Cc: Carlos Palminha <palminha@synopsys.com>
>>> Cc: Alexey Brodkin <abrodkin@synopsys.com>
>>> Cc: linux-snps-arc@lists.infradead.org
>>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>> This breaks page flip on arc, it uses drm_atomic_helper_page_flip.
> How exactly does this break page_flip? Note that the commit to implement
> generic nonblocking commit in drm_atomic_helper_commit is _before_ this
> patch in the series.
> -Daniel

This is patch 15/16, I found this in patch 21/26:

@@ -1147,8 +1206,11 @@ int drm_atomic_helper_commit(struct drm_device *dev,
 {
 	int ret;
 
-	if (nonblock)
-		return -EBUSY;
Daniel Vetter May 30, 2016, 3:10 p.m. UTC | #4
On Mon, May 30, 2016 at 11:36:06AM +0200, Maarten Lankhorst wrote:
> Op 30-05-16 om 11:24 schreef Daniel Vetter:
> > On Mon, May 30, 2016 at 10:15:14AM +0200, Maarten Lankhorst wrote:
> >> Op 29-05-16 om 20:35 schreef Daniel Vetter:
> >>> Committing with block it is not.
> >>>
> >>> Thanks to the fixed up vblank event handling we can just use the
> >>> helper support for nonblocking commits now.
> >>>
> >>> Cc: Carlos Palminha <palminha@synopsys.com>
> >>> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> >>> Cc: linux-snps-arc@lists.infradead.org
> >>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> >> This breaks page flip on arc, it uses drm_atomic_helper_page_flip.
> > How exactly does this break page_flip? Note that the commit to implement
> > generic nonblocking commit in drm_atomic_helper_commit is _before_ this
> > patch in the series.
> > -Daniel
> 
> This is patch 15/16, I found this in patch 21/26:
> 
> @@ -1147,8 +1206,11 @@ int drm_atomic_helper_commit(struct drm_device *dev,
>  {
>  	int ret;
>  
> -	if (nonblock)
> -		return -EBUSY;

Oh right, I mixed things up. Most of the prep work is for drm event
handling. We need to do that _before_ the non-blocking commit lands for
the drivers that just directly reuse drm_atomic_helper_commit, since the
nonblocking helpers will time out when drm events don't work.

But this one indeed should only happen after that commit. I'll reorder.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index d407fd79a400..a92e533531c3 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -32,17 +32,11 @@  static void arcpgu_fb_output_poll_changed(struct drm_device *dev)
 		drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
 }
 
-static int arcpgu_atomic_commit(struct drm_device *dev,
-				    struct drm_atomic_state *state, bool async)
-{
-	return drm_atomic_helper_commit(dev, state, false);
-}
-
 static struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
 	.fb_create  = drm_fb_cma_create,
 	.output_poll_changed = arcpgu_fb_output_poll_changed,
 	.atomic_check = drm_atomic_helper_check,
-	.atomic_commit = arcpgu_atomic_commit,
+	.atomic_commit = drm_atomic_helper_commit,
 };
 
 static void arcpgu_setup_mode_config(struct drm_device *drm)