diff mbox

[1/7] drm/arc: Stop consulting plane->fb

Message ID 20180405195035.24722-1-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä April 5, 2018, 7:50 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We want to stop using plane->fb with atomic driver, so stop looking at
it.

I have no idea what this code is trying to achieve. There is no
corresponding check in the enable path. Also since
arc_pgu_set_pxl_fmt() will anyway oops if there is no fb I'm going
to assuming that I can just remove the check entirely. There seems
to be a general shortage of .atomic_check() in this driver...

Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/arc/arcpgu_crtc.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Daniel Vetter April 5, 2018, 8:08 p.m. UTC | #1
On Thu, Apr 05, 2018 at 10:50:29PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> We want to stop using plane->fb with atomic driver, so stop looking at
> it.
> 
> I have no idea what this code is trying to achieve. There is no
> corresponding check in the enable path. Also since
> arc_pgu_set_pxl_fmt() will anyway oops if there is no fb I'm going
> to assuming that I can just remove the check entirely. There seems
> to be a general shortage of .atomic_check() in this driver...

I think arcpgu is the perfect example of a small driver that _really_
wants to use drm_simple_display_pipe_helper. Which would address the
outright lack of any and all atomic_check code (beyond basic mode
validation through mode_valid).

I also just noticed that it still has a bunch of the legacy hooks set,
e.g. mode_set, mode_set_base are all no longer used in atomic.

I think the code won't be able to oops, since if there's no fb, we don't
enable the plane (and it happily allows that), so should be all
non-oopsing. Even with this check here removed.

Ofc the hw might get pissed at us in this case, but I can't tell that.
Like I said, conversion to drm_simple_display_pipe_helper is probably the
way to go.

Anyway, this patch here looks good, if you adjust the commit message to
explain why it can't oops:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> 
> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/arc/arcpgu_crtc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
> index 16903dc7fe0d..c3349b8fb58b 100644
> --- a/drivers/gpu/drm/arc/arcpgu_crtc.c
> +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
> @@ -136,9 +136,6 @@ static void arc_pgu_crtc_atomic_disable(struct drm_crtc *crtc,
>  {
>  	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
>  
> -	if (!crtc->primary->fb)
> -		return;
> -
>  	clk_disable_unprepare(arcpgu->clk);
>  	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
>  			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) &
> -- 
> 2.16.1
>
Ville Syrjälä April 5, 2018, 8:19 p.m. UTC | #2
On Thu, Apr 05, 2018 at 10:08:57PM +0200, Daniel Vetter wrote:
> On Thu, Apr 05, 2018 at 10:50:29PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > We want to stop using plane->fb with atomic driver, so stop looking at
> > it.
> > 
> > I have no idea what this code is trying to achieve. There is no
> > corresponding check in the enable path. Also since
> > arc_pgu_set_pxl_fmt() will anyway oops if there is no fb I'm going
> > to assuming that I can just remove the check entirely. There seems
> > to be a general shortage of .atomic_check() in this driver...
> 
> I think arcpgu is the perfect example of a small driver that _really_
> wants to use drm_simple_display_pipe_helper. Which would address the
> outright lack of any and all atomic_check code (beyond basic mode
> validation through mode_valid).
> 
> I also just noticed that it still has a bunch of the legacy hooks set,
> e.g. mode_set, mode_set_base are all no longer used in atomic.
> 
> I think the code won't be able to oops, since if there's no fb, we don't
> enable the plane (and it happily allows that), so should be all
> non-oopsing. Even with this check here removed.

arc_pgu_set_pxl_fmt() gets called from the .mode_set_nofb() hook
which I assume doesn't care about planes at all. So to me it looks like
it'll definitely oops.

> 
> Ofc the hw might get pissed at us in this case, but I can't tell that.
> Like I said, conversion to drm_simple_display_pipe_helper is probably the
> way to go.
> 
> Anyway, this patch here looks good, if you adjust the commit message to
> explain why it can't oops:
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> > 
> > Cc: Alexey Brodkin <abrodkin@synopsys.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/arc/arcpgu_crtc.c | 3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
> > index 16903dc7fe0d..c3349b8fb58b 100644
> > --- a/drivers/gpu/drm/arc/arcpgu_crtc.c
> > +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
> > @@ -136,9 +136,6 @@ static void arc_pgu_crtc_atomic_disable(struct drm_crtc *crtc,
> >  {
> >  	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
> >  
> > -	if (!crtc->primary->fb)
> > -		return;
> > -
> >  	clk_disable_unprepare(arcpgu->clk);
> >  	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
> >  			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) &
> > -- 
> > 2.16.1
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
Daniel Vetter April 5, 2018, 8:43 p.m. UTC | #3
On Thu, Apr 05, 2018 at 11:19:44PM +0300, Ville Syrjälä wrote:
> On Thu, Apr 05, 2018 at 10:08:57PM +0200, Daniel Vetter wrote:
> > On Thu, Apr 05, 2018 at 10:50:29PM +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > We want to stop using plane->fb with atomic driver, so stop looking at
> > > it.
> > > 
> > > I have no idea what this code is trying to achieve. There is no
> > > corresponding check in the enable path. Also since
> > > arc_pgu_set_pxl_fmt() will anyway oops if there is no fb I'm going
> > > to assuming that I can just remove the check entirely. There seems
> > > to be a general shortage of .atomic_check() in this driver...
> > 
> > I think arcpgu is the perfect example of a small driver that _really_
> > wants to use drm_simple_display_pipe_helper. Which would address the
> > outright lack of any and all atomic_check code (beyond basic mode
> > validation through mode_valid).
> > 
> > I also just noticed that it still has a bunch of the legacy hooks set,
> > e.g. mode_set, mode_set_base are all no longer used in atomic.
> > 
> > I think the code won't be able to oops, since if there's no fb, we don't
> > enable the plane (and it happily allows that), so should be all
> > non-oopsing. Even with this check here removed.
> 
> arc_pgu_set_pxl_fmt() gets called from the .mode_set_nofb() hook
> which I assume doesn't care about planes at all. So to me it looks like
> it'll definitely oops.

Indeed, I was blind. Commit message looks good.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> 
> > 
> > Ofc the hw might get pissed at us in this case, but I can't tell that.
> > Like I said, conversion to drm_simple_display_pipe_helper is probably the
> > way to go.
> > 
> > Anyway, this patch here looks good, if you adjust the commit message to
> > explain why it can't oops:
> > 
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > 
> > > 
> > > Cc: Alexey Brodkin <abrodkin@synopsys.com>
> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/arc/arcpgu_crtc.c | 3 ---
> > >  1 file changed, 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
> > > index 16903dc7fe0d..c3349b8fb58b 100644
> > > --- a/drivers/gpu/drm/arc/arcpgu_crtc.c
> > > +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
> > > @@ -136,9 +136,6 @@ static void arc_pgu_crtc_atomic_disable(struct drm_crtc *crtc,
> > >  {
> > >  	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
> > >  
> > > -	if (!crtc->primary->fb)
> > > -		return;
> > > -
> > >  	clk_disable_unprepare(arcpgu->clk);
> > >  	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
> > >  			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) &
> > > -- 
> > > 2.16.1
> > > 
> > 
> > -- 
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> 
> -- 
> Ville Syrjälä
> Intel OTC
Saarinen, Jani April 6, 2018, 5:58 a.m. UTC | #4
HI,

> -----Original Message-----

> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of

> Patchwork

> Sent: perjantai 6. huhtikuuta 2018 1.51

> To: Ville Syrjala <ville.syrjala@linux.intel.com>

> Cc: intel-gfx@lists.freedesktop.org

> Subject: [Intel-gfx] ✗ Fi.CI.IGT: warning for series starting with [1/7] drm/arc:

> Stop consulting plane->fb (rev2)

> 

> == Series Details ==

> 

> Series: series starting with [1/7] drm/arc: Stop consulting plane->fb (rev2)

> URL   : https://patchwork.freedesktop.org/series/41230/

> State : warning

> 

> == Summary ==

> 

> ---- Possible new issues:

> 

> Test kms_flip:

>         Subgroup 2x-flip-vs-modeset:

>                 pass       -> DMESG-WARN (shard-hsw)

> Test kms_frontbuffer_tracking:

>         Subgroup fbcpsr-1p-primscrn-shrfb-msflip-blt:

>                 fail       -> SKIP       (shard-snb)

> 

> ---- Known issues:

> 

> Test kms_flip:

>         Subgroup 2x-flip-vs-expired-vblank:

>                 fail       -> PASS       (shard-hsw) fdo#102887 +1

>         Subgroup 2x-plain-flip-ts-check:

>                 pass       -> FAIL       (shard-hsw) fdo#100368 +1

>         Subgroup modeset-vs-vblank-race:

>                 pass       -> FAIL       (shard-hsw) fdo#103060

> Test kms_setmode:

>         Subgroup basic:

>                 pass       -> FAIL       (shard-apl) fdo#99912

> Test perf:

>         Subgroup blocking:

>                 fail       -> PASS       (shard-hsw) fdo#102252

> 

> fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887

> fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368

> fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060

> fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

> fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

> 

> shard-apl        total:2680 pass:1835 dwarn:1   dfail:0   fail:7   skip:836

> time:12652s

> shard-hsw        total:2680 pass:1783 dwarn:2   dfail:0   fail:3   skip:891

> time:11339s

> shard-snb        total:2680 pass:1375 dwarn:1   dfail:0   fail:5   skip:1299

> time:6880s

> Blacklisted hosts:

> shard-kbl        total:1945 pass:1424 dwarn:1   dfail:0   fail:3   skip:516

> time:6732s

For some reason not totally success run for kbl. 
Execution stops on   0.00 igt@pm_rpm@system-suspend-execbuf incomplete 
Tomi, Ville, any idea? 

> 

> == Logs ==

> 

> For more details see: https://intel-gfx-ci.01.org/tree/drm-

> tip/Patchwork_8606/shards.html

> _______________________________________________

> Intel-gfx mailing list

> Intel-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Alexey Brodkin April 6, 2018, 8:50 a.m. UTC | #5
Hi Ville,

On Thu, 2018-04-05 at 22:50 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>

> 

> We want to stop using plane->fb with atomic driver, so stop looking at

> it.

> 

> I have no idea what this code is trying to achieve. There is no

> corresponding check in the enable path. Also since

> arc_pgu_set_pxl_fmt() will anyway oops if there is no fb I'm going

> to assuming that I can just remove the check entirely. There seems

> to be a general shortage of .atomic_check() in this driver...

> 

> Cc: Alexey Brodkin <abrodkin@synopsys.com>

> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>


Acked-by: Alexey Brodkin <abrodkin@synopys.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
index 16903dc7fe0d..c3349b8fb58b 100644
--- a/drivers/gpu/drm/arc/arcpgu_crtc.c
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -136,9 +136,6 @@  static void arc_pgu_crtc_atomic_disable(struct drm_crtc *crtc,
 {
 	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
 
-	if (!crtc->primary->fb)
-		return;
-
 	clk_disable_unprepare(arcpgu->clk);
 	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
 			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) &