* [PATCH] drm/i915: Sanitize prepare_pipes after valleyview_modeset_global_pipes()
@ 2013-11-05 20:34 ville.syrjala
2013-11-06 7:33 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: ville.syrjala @ 2013-11-05 20:34 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
valleyview_modeset_global_pipes() may add pipes that are getting fully
disabled to prepare_pipes bitmask. The rest of the code doesn't expect
this, so clear out any such pipes from the prepare_pipes bitmask.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f97e895..ddbef9c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9514,10 +9514,14 @@ static int __intel_set_mode(struct drm_crtc *crtc,
* mode set on this crtc. For other crtcs we need to use the
* adjusted_mode bits in the crtc directly.
*/
- if (IS_VALLEYVIEW(dev))
+ if (IS_VALLEYVIEW(dev)) {
valleyview_modeset_global_pipes(dev, &prepare_pipes,
modeset_pipes, pipe_config);
+ /* may have added more to prepare_pipes than we should */
+ prepare_pipes &= ~disable_pipes;
+ }
+
for_each_intel_crtc_masked(dev, disable_pipes, intel_crtc)
intel_crtc_disable(&intel_crtc->base);
--
1.8.1.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Sanitize prepare_pipes after valleyview_modeset_global_pipes()
2013-11-05 20:34 [PATCH] drm/i915: Sanitize prepare_pipes after valleyview_modeset_global_pipes() ville.syrjala
@ 2013-11-06 7:33 ` Daniel Vetter
2013-11-06 10:42 ` Ville Syrjälä
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2013-11-06 7:33 UTC (permalink / raw)
To: ville.syrjala; +Cc: intel-gfx
On Tue, Nov 05, 2013 at 10:34:12PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> valleyview_modeset_global_pipes() may add pipes that are getting fully
> disabled to prepare_pipes bitmask. The rest of the code doesn't expect
> this, so clear out any such pipes from the prepare_pipes bitmask.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index f97e895..ddbef9c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9514,10 +9514,14 @@ static int __intel_set_mode(struct drm_crtc *crtc,
> * mode set on this crtc. For other crtcs we need to use the
> * adjusted_mode bits in the crtc directly.
> */
> - if (IS_VALLEYVIEW(dev))
> + if (IS_VALLEYVIEW(dev)) {
> valleyview_modeset_global_pipes(dev, &prepare_pipes,
> modeset_pipes, pipe_config);
>
> + /* may have added more to prepare_pipes than we should */
> + prepare_pipes &= ~disable_pipes;
> + }
I'd have move the full "take disable_pipes out" block from affected_pipes.
Afacs there's no need to do it twice.
-Daniel
> +
> for_each_intel_crtc_masked(dev, disable_pipes, intel_crtc)
> intel_crtc_disable(&intel_crtc->base);
>
> --
> 1.8.1.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Sanitize prepare_pipes after valleyview_modeset_global_pipes()
2013-11-06 7:33 ` Daniel Vetter
@ 2013-11-06 10:42 ` Ville Syrjälä
2013-11-06 16:29 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2013-11-06 10:42 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
On Wed, Nov 06, 2013 at 08:33:08AM +0100, Daniel Vetter wrote:
> On Tue, Nov 05, 2013 at 10:34:12PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > valleyview_modeset_global_pipes() may add pipes that are getting fully
> > disabled to prepare_pipes bitmask. The rest of the code doesn't expect
> > this, so clear out any such pipes from the prepare_pipes bitmask.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index f97e895..ddbef9c 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -9514,10 +9514,14 @@ static int __intel_set_mode(struct drm_crtc *crtc,
> > * mode set on this crtc. For other crtcs we need to use the
> > * adjusted_mode bits in the crtc directly.
> > */
> > - if (IS_VALLEYVIEW(dev))
> > + if (IS_VALLEYVIEW(dev)) {
> > valleyview_modeset_global_pipes(dev, &prepare_pipes,
> > modeset_pipes, pipe_config);
> >
> > + /* may have added more to prepare_pipes than we should */
> > + prepare_pipes &= ~disable_pipes;
> > + }
>
> I'd have move the full "take disable_pipes out" block from affected_pipes.
> Afacs there's no need to do it twice.
I think we'd need to keep the '*modeset_pipes &= ~(*disable_pipes)' part
in intel_modeset_affected_pipes(). Otherwise we might end up calling
intel_modeset_pipe_config() for a disabled pipe. For prepare_pipes, it
looks like we could move the masking to happen only once after
valleyview_modeset_global_pipes(). Not sure if spreading it around like
that makes sense.
> -Daniel
> > +
> > for_each_intel_crtc_masked(dev, disable_pipes, intel_crtc)
> > intel_crtc_disable(&intel_crtc->base);
> >
> > --
> > 1.8.1.5
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
Ville Syrjälä
Intel OTC
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Sanitize prepare_pipes after valleyview_modeset_global_pipes()
2013-11-06 10:42 ` Ville Syrjälä
@ 2013-11-06 16:29 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-11-06 16:29 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
On Wed, Nov 06, 2013 at 12:42:20PM +0200, Ville Syrjälä wrote:
> On Wed, Nov 06, 2013 at 08:33:08AM +0100, Daniel Vetter wrote:
> > On Tue, Nov 05, 2013 at 10:34:12PM +0200, ville.syrjala@linux.intel.com wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > valleyview_modeset_global_pipes() may add pipes that are getting fully
> > > disabled to prepare_pipes bitmask. The rest of the code doesn't expect
> > > this, so clear out any such pipes from the prepare_pipes bitmask.
> > >
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > > drivers/gpu/drm/i915/intel_display.c | 6 +++++-
> > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index f97e895..ddbef9c 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -9514,10 +9514,14 @@ static int __intel_set_mode(struct drm_crtc *crtc,
> > > * mode set on this crtc. For other crtcs we need to use the
> > > * adjusted_mode bits in the crtc directly.
> > > */
> > > - if (IS_VALLEYVIEW(dev))
> > > + if (IS_VALLEYVIEW(dev)) {
> > > valleyview_modeset_global_pipes(dev, &prepare_pipes,
> > > modeset_pipes, pipe_config);
> > >
> > > + /* may have added more to prepare_pipes than we should */
> > > + prepare_pipes &= ~disable_pipes;
> > > + }
> >
> > I'd have move the full "take disable_pipes out" block from affected_pipes.
> > Afacs there's no need to do it twice.
>
> I think we'd need to keep the '*modeset_pipes &= ~(*disable_pipes)' part
> in intel_modeset_affected_pipes(). Otherwise we might end up calling
> intel_modeset_pipe_config() for a disabled pipe. For prepare_pipes, it
> looks like we could move the masking to happen only once after
> valleyview_modeset_global_pipes(). Not sure if spreading it around like
> that makes sense.
Hm, good point. I've merged this, we can beautify this code once the real
atomic modeset stuff has landed and we can actually do modesets on more
than one pipe.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-11-06 16:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05 20:34 [PATCH] drm/i915: Sanitize prepare_pipes after valleyview_modeset_global_pipes() ville.syrjala
2013-11-06 7:33 ` Daniel Vetter
2013-11-06 10:42 ` Ville Syrjälä
2013-11-06 16:29 ` Daniel Vetter
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.