* [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred
@ 2015-07-06 5:53 Sonika Jindal
2015-07-06 8:36 ` Daniel Vetter
` (2 more replies)
0 siblings, 3 replies; 18+ messages in thread
From: Sonika Jindal @ 2015-07-06 5:53 UTC (permalink / raw)
To: intel-gfx
Writing to PCH_PORT_HOTPLUG for each interrupt is not required.
Handle it only if hpd has actually occurred like we handle other
interrupts.
Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
---
Hi,
I see we don't check for hotplug_trigger before processing the HPD for any of the platform. Is there any reason for this?
For SKL, if I let write to PCH_PORT_HOTPLUG happen for all interrupts, somehow this register gets an invalid value at one point and it zeroes it out.
If I put this check before handling HPD, hotplug behaves fine.
Please let me know if you see any issue with this approach.
Thanks,
Sonika
drivers/gpu/drm/i915/i915_irq.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index a6fbe64..2d47372 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1760,11 +1760,12 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir)
u32 dig_hotplug_reg;
u32 pin_mask, long_mask;
- dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG);
- I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg);
-
- pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt);
- intel_hpd_irq_handler(dev, pin_mask, long_mask);
+ if (hotplug_trigger) {
+ dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG);
+ I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg);
+ pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt);
+ intel_hpd_irq_handler(dev, pin_mask, long_mask);
+ }
if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) {
int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >>
--
1.7.10.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred 2015-07-06 5:53 [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred Sonika Jindal @ 2015-07-06 8:36 ` Daniel Vetter 2015-07-06 8:41 ` Jindal, Sonika 2015-07-06 8:49 ` Ville Syrjälä 2015-07-06 9:54 ` [PATCH] [RFC] " shuang.he 2 siblings, 1 reply; 18+ messages in thread From: Daniel Vetter @ 2015-07-06 8:36 UTC (permalink / raw) To: Sonika Jindal; +Cc: intel-gfx On Mon, Jul 06, 2015 at 11:23:53AM +0530, Sonika Jindal wrote: > Writing to PCH_PORT_HOTPLUG for each interrupt is not required. > Handle it only if hpd has actually occurred like we handle other > interrupts. > > Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> > --- > Hi, > > I see we don't check for hotplug_trigger before processing the HPD for any of the platform. Is there any reason for this? > For SKL, if I let write to PCH_PORT_HOTPLUG happen for all interrupts, somehow this register gets an invalid value at one point and it zeroes it out. > If I put this check before handling HPD, hotplug behaves fine. > Please let me know if you see any issue with this approach. Nice find, this sounds really intrigueing, at least for cpt/ibx platforms. I'm not sure whether what will happen with atom/i9xx platforms though since the irq bits are different there. But at least bxt has a FIXME comment that suggest we do need to save the sticky bits on those platforms too. If we can fix this up for all platforms then I think a subsequent patch could try to re-enable the hpd checks in the hdmi ->detect function and make use spec compliant. Then after maybe 1-2 kernel releases of testing we'll know whether it really works. But I'd really want to enable this everywhere just to have maximal test coverage - we did have reports on all platforms so it seems a generic issue. Thanks, Daniel > > Thanks, > Sonika > > drivers/gpu/drm/i915/i915_irq.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > index a6fbe64..2d47372 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -1760,11 +1760,12 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) > u32 dig_hotplug_reg; > u32 pin_mask, long_mask; > > - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > - > - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > - intel_hpd_irq_handler(dev, pin_mask, long_mask); > + if (hotplug_trigger) { > + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > + intel_hpd_irq_handler(dev, pin_mask, long_mask); > + } > > if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { > int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> > -- > 1.7.10.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred 2015-07-06 8:36 ` Daniel Vetter @ 2015-07-06 8:41 ` Jindal, Sonika 2015-07-06 12:24 ` Daniel Vetter 0 siblings, 1 reply; 18+ messages in thread From: Jindal, Sonika @ 2015-07-06 8:41 UTC (permalink / raw) To: Daniel Vetter; +Cc: intel-gfx On 7/6/2015 2:06 PM, Daniel Vetter wrote: > On Mon, Jul 06, 2015 at 11:23:53AM +0530, Sonika Jindal wrote: >> Writing to PCH_PORT_HOTPLUG for each interrupt is not required. >> Handle it only if hpd has actually occurred like we handle other >> interrupts. >> >> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> >> --- >> Hi, >> >> I see we don't check for hotplug_trigger before processing the HPD for any of the platform. Is there any reason for this? >> For SKL, if I let write to PCH_PORT_HOTPLUG happen for all interrupts, somehow this register gets an invalid value at one point and it zeroes it out. >> If I put this check before handling HPD, hotplug behaves fine. >> Please let me know if you see any issue with this approach. > > Nice find, this sounds really intrigueing, at least for cpt/ibx platforms. > I'm not sure whether what will happen with atom/i9xx platforms though > since the irq bits are different there. But at least bxt has a FIXME > comment that suggest we do need to save the sticky bits on those platforms > too. > > If we can fix this up for all platforms then I think a subsequent patch > could try to re-enable the hpd checks in the hdmi ->detect function and > make use spec compliant. Then after maybe 1-2 kernel releases of testing > we'll know whether it really works. > > But I'd really want to enable this everywhere just to have maximal test > coverage - we did have reports on all platforms so it seems a generic > issue. > I think only cpt/ibx suffer from this. Bxt already set port_hotplug_stat only when hpd occurs. Is there a process to get this checked on all platforms, which the fix I suggested? I can only test on SKL as of now. Regards, Sonika > Thanks, Daniel > >> >> Thanks, >> Sonika >> >> drivers/gpu/drm/i915/i915_irq.c | 11 ++++++----- >> 1 file changed, 6 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c >> index a6fbe64..2d47372 100644 >> --- a/drivers/gpu/drm/i915/i915_irq.c >> +++ b/drivers/gpu/drm/i915/i915_irq.c >> @@ -1760,11 +1760,12 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) >> u32 dig_hotplug_reg; >> u32 pin_mask, long_mask; >> >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> - >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + if (hotplug_trigger) { >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + } >> >> if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { >> int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> >> -- >> 1.7.10.4 >> >> _______________________________________________ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred 2015-07-06 8:41 ` Jindal, Sonika @ 2015-07-06 12:24 ` Daniel Vetter 0 siblings, 0 replies; 18+ messages in thread From: Daniel Vetter @ 2015-07-06 12:24 UTC (permalink / raw) To: Jindal, Sonika; +Cc: intel-gfx On Mon, Jul 06, 2015 at 02:11:12PM +0530, Jindal, Sonika wrote: > > > On 7/6/2015 2:06 PM, Daniel Vetter wrote: > >On Mon, Jul 06, 2015 at 11:23:53AM +0530, Sonika Jindal wrote: > >>Writing to PCH_PORT_HOTPLUG for each interrupt is not required. > >>Handle it only if hpd has actually occurred like we handle other > >>interrupts. > >> > >>Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> > >>--- > >>Hi, > >> > >>I see we don't check for hotplug_trigger before processing the HPD for any of the platform. Is there any reason for this? > >>For SKL, if I let write to PCH_PORT_HOTPLUG happen for all interrupts, somehow this register gets an invalid value at one point and it zeroes it out. > >>If I put this check before handling HPD, hotplug behaves fine. > >>Please let me know if you see any issue with this approach. > > > >Nice find, this sounds really intrigueing, at least for cpt/ibx platforms. > >I'm not sure whether what will happen with atom/i9xx platforms though > >since the irq bits are different there. But at least bxt has a FIXME > >comment that suggest we do need to save the sticky bits on those platforms > >too. > > > >If we can fix this up for all platforms then I think a subsequent patch > >could try to re-enable the hpd checks in the hdmi ->detect function and > >make use spec compliant. Then after maybe 1-2 kernel releases of testing > >we'll know whether it really works. > > > >But I'd really want to enable this everywhere just to have maximal test > >coverage - we did have reports on all platforms so it seems a generic > >issue. > > > I think only cpt/ibx suffer from this. Bxt already set port_hotplug_stat > only when hpd occurs. > Is there a process to get this checked on all platforms, which the fix I > suggested? > I can only test on SKL as of now. Right I was looking at an older version of the bxt hpd handler which still had a FIXME. But we probably still have an issue on bxt/i9xx interrupt handlers since when we've done the original revert to stop looking at the hpd live status bits in commit 202adf4b9f5957b26a1cb97267d78e0edb319c5e Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Fri Feb 22 00:53:04 2013 +0100 drm/i915: Revert hdmi HDP pin checks we had reports from both ibx/cpt systems and g4x. And vlv/chv/bxt hpd seems derived from that (with live status, enable and status all smashed into one register). Therefore I guess that we need a similar fix of only carefully clearing status bits on these platforms too. I have no idea what it is though, might be good to check how exactly windows is handling hpd on these atom platfroms. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred 2015-07-06 5:53 [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred Sonika Jindal 2015-07-06 8:36 ` Daniel Vetter @ 2015-07-06 8:49 ` Ville Syrjälä 2015-07-06 9:01 ` Jindal, Sonika 2015-07-06 10:08 ` Sonika Jindal 2015-07-06 9:54 ` [PATCH] [RFC] " shuang.he 2 siblings, 2 replies; 18+ messages in thread From: Ville Syrjälä @ 2015-07-06 8:49 UTC (permalink / raw) To: Sonika Jindal; +Cc: intel-gfx On Mon, Jul 06, 2015 at 11:23:53AM +0530, Sonika Jindal wrote: > Writing to PCH_PORT_HOTPLUG for each interrupt is not required. > Handle it only if hpd has actually occurred like we handle other > interrupts. > > Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> > --- > Hi, > > I see we don't check for hotplug_trigger before processing the HPD for any of the platform. Is there any reason for this? > For SKL, if I let write to PCH_PORT_HOTPLUG happen for all interrupts, somehow this register gets an invalid value at one point and it zeroes it out. > If I put this check before handling HPD, hotplug behaves fine. > Please let me know if you see any issue with this approach. > > Thanks, > Sonika > > drivers/gpu/drm/i915/i915_irq.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > index a6fbe64..2d47372 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -1760,11 +1760,12 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) > u32 dig_hotplug_reg; > u32 pin_mask, long_mask; > > - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > - > - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > - intel_hpd_irq_handler(dev, pin_mask, long_mask); > + if (hotplug_trigger) { > + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > + intel_hpd_irq_handler(dev, pin_mask, long_mask); > + } Deja vu. I think I have the same patch (also for IBX) in my stalled (and never posted) port A HPD branch. So yeah, I think this makes sense. You can also move the dig_hotplug_reg, pin_mask, and long_mask declarations into the if block since they're not needed elsewhere. > > if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { > int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> > -- > 1.7.10.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred 2015-07-06 8:49 ` Ville Syrjälä @ 2015-07-06 9:01 ` Jindal, Sonika 2015-07-06 11:18 ` Ville Syrjälä 2015-07-06 10:08 ` Sonika Jindal 1 sibling, 1 reply; 18+ messages in thread From: Jindal, Sonika @ 2015-07-06 9:01 UTC (permalink / raw) To: Ville Syrjälä; +Cc: intel-gfx On 7/6/2015 2:19 PM, Ville Syrjälä wrote: > On Mon, Jul 06, 2015 at 11:23:53AM +0530, Sonika Jindal wrote: >> Writing to PCH_PORT_HOTPLUG for each interrupt is not required. >> Handle it only if hpd has actually occurred like we handle other >> interrupts. >> >> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> >> --- >> Hi, >> >> I see we don't check for hotplug_trigger before processing the HPD for any of the platform. Is there any reason for this? >> For SKL, if I let write to PCH_PORT_HOTPLUG happen for all interrupts, somehow this register gets an invalid value at one point and it zeroes it out. >> If I put this check before handling HPD, hotplug behaves fine. >> Please let me know if you see any issue with this approach. >> >> Thanks, >> Sonika >> >> drivers/gpu/drm/i915/i915_irq.c | 11 ++++++----- >> 1 file changed, 6 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c >> index a6fbe64..2d47372 100644 >> --- a/drivers/gpu/drm/i915/i915_irq.c >> +++ b/drivers/gpu/drm/i915/i915_irq.c >> @@ -1760,11 +1760,12 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) >> u32 dig_hotplug_reg; >> u32 pin_mask, long_mask; >> >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> - >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + if (hotplug_trigger) { >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + } > > Deja vu. I think I have the same patch (also for IBX) in my stalled > (and never posted) port A HPD branch. So yeah, I think this > makes sense. > > You can also move the dig_hotplug_reg, pin_mask, and long_mask declarations > into the if block since they're not needed elsewhere. Sure. Do you think I should add this for ibx as well? > > >> >> if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { >> int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> >> -- >> 1.7.10.4 >> >> _______________________________________________ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred 2015-07-06 9:01 ` Jindal, Sonika @ 2015-07-06 11:18 ` Ville Syrjälä 2015-07-07 8:52 ` [PATCH] " Sonika Jindal 0 siblings, 1 reply; 18+ messages in thread From: Ville Syrjälä @ 2015-07-06 11:18 UTC (permalink / raw) To: Jindal, Sonika; +Cc: intel-gfx On Mon, Jul 06, 2015 at 02:31:56PM +0530, Jindal, Sonika wrote: > > > On 7/6/2015 2:19 PM, Ville Syrjälä wrote: > > On Mon, Jul 06, 2015 at 11:23:53AM +0530, Sonika Jindal wrote: > >> Writing to PCH_PORT_HOTPLUG for each interrupt is not required. > >> Handle it only if hpd has actually occurred like we handle other > >> interrupts. > >> > >> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> > >> --- > >> Hi, > >> > >> I see we don't check for hotplug_trigger before processing the HPD for any of the platform. Is there any reason for this? > >> For SKL, if I let write to PCH_PORT_HOTPLUG happen for all interrupts, somehow this register gets an invalid value at one point and it zeroes it out. > >> If I put this check before handling HPD, hotplug behaves fine. > >> Please let me know if you see any issue with this approach. > >> > >> Thanks, > >> Sonika > >> > >> drivers/gpu/drm/i915/i915_irq.c | 11 ++++++----- > >> 1 file changed, 6 insertions(+), 5 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > >> index a6fbe64..2d47372 100644 > >> --- a/drivers/gpu/drm/i915/i915_irq.c > >> +++ b/drivers/gpu/drm/i915/i915_irq.c > >> @@ -1760,11 +1760,12 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) > >> u32 dig_hotplug_reg; > >> u32 pin_mask, long_mask; > >> > >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > >> - > >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); > >> + if (hotplug_trigger) { > >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); > >> + } > > > > Deja vu. I think I have the same patch (also for IBX) in my stalled > > (and never posted) port A HPD branch. So yeah, I think this > > makes sense. > > > > You can also move the dig_hotplug_reg, pin_mask, and long_mask declarations > > into the if block since they're not needed elsewhere. > Sure. Do you think I should add this for ibx as well? Yes. -- Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-06 11:18 ` Ville Syrjälä @ 2015-07-07 8:52 ` Sonika Jindal 2015-07-07 13:21 ` Ville Syrjälä 2015-07-08 8:13 ` shuang.he 0 siblings, 2 replies; 18+ messages in thread From: Sonika Jindal @ 2015-07-07 8:52 UTC (permalink / raw) To: intel-gfx Writing to PCH_PORT_HOTPLUG for each interrupt is not required. Handle it only if hpd has actually occurred like we handle other interrupts. v2: Make few variables local to if block (Ville) v3: Add check for ibx/cpt both (Ville). While at it, remove the redundant check for hotplug_trigger from pch_get_hpd_pins Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> --- drivers/gpu/drm/i915/i915_irq.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index a6fbe64..ba2c27c 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1266,9 +1266,6 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask, *pin_mask = 0; *long_mask = 0; - if (!hotplug_trigger) - return; - for_each_hpd_pin(i) { if ((hpd[i] & hotplug_trigger) == 0) continue; @@ -1658,14 +1655,17 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) struct drm_i915_private *dev_priv = dev->dev_private; int pipe; u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; - u32 dig_hotplug_reg; - u32 pin_mask, long_mask; - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + if (hotplug_trigger) { + u32 dig_hotplug_reg, pin_mask, long_mask; - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_ibx); - intel_hpd_irq_handler(dev, pin_mask, long_mask); + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, + dig_hotplug_reg, hpd_ibx); + intel_hpd_irq_handler(dev, pin_mask, long_mask); + } if (pch_iir & SDE_AUDIO_POWER_MASK) { int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> @@ -1757,14 +1757,16 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) struct drm_i915_private *dev_priv = dev->dev_private; int pipe; u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; - u32 dig_hotplug_reg; - u32 pin_mask, long_mask; - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + if (hotplug_trigger) { + u32 dig_hotplug_reg, pin_mask, long_mask; - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); - intel_hpd_irq_handler(dev, pin_mask, long_mask); + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, + dig_hotplug_reg, hpd_cpt); + intel_hpd_irq_handler(dev, pin_mask, long_mask); + } if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> -- 1.7.10.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-07 8:52 ` [PATCH] " Sonika Jindal @ 2015-07-07 13:21 ` Ville Syrjälä 2015-07-08 5:10 ` Jindal, Sonika 2015-07-08 8:13 ` shuang.he 1 sibling, 1 reply; 18+ messages in thread From: Ville Syrjälä @ 2015-07-07 13:21 UTC (permalink / raw) To: Sonika Jindal; +Cc: intel-gfx On Tue, Jul 07, 2015 at 02:22:20PM +0530, Sonika Jindal wrote: > Writing to PCH_PORT_HOTPLUG for each interrupt is not required. > Handle it only if hpd has actually occurred like we handle other > interrupts. > v2: Make few variables local to if block (Ville) > v3: Add check for ibx/cpt both (Ville). > While at it, remove the redundant check for hotplug_trigger from > pch_get_hpd_pins > > Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> > --- > drivers/gpu/drm/i915/i915_irq.c | 32 +++++++++++++++++--------------- > 1 file changed, 17 insertions(+), 15 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > index a6fbe64..ba2c27c 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -1266,9 +1266,6 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask, > *pin_mask = 0; > *long_mask = 0; > > - if (!hotplug_trigger) > - return; > - Looks like BXT still depends on that. So you should change that too, or leave this in until someone else does it. > for_each_hpd_pin(i) { > if ((hpd[i] & hotplug_trigger) == 0) > continue; > @@ -1658,14 +1655,17 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) > struct drm_i915_private *dev_priv = dev->dev_private; > int pipe; > u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; > - u32 dig_hotplug_reg; > - u32 pin_mask, long_mask; > > - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + if (hotplug_trigger) { > + u32 dig_hotplug_reg, pin_mask, long_mask; > > - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_ibx); > - intel_hpd_irq_handler(dev, pin_mask, long_mask); > + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + > + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, > + dig_hotplug_reg, hpd_ibx); Indentation is fubar. > + intel_hpd_irq_handler(dev, pin_mask, long_mask); > + } > > if (pch_iir & SDE_AUDIO_POWER_MASK) { > int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> > @@ -1757,14 +1757,16 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) > struct drm_i915_private *dev_priv = dev->dev_private; > int pipe; > u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; > - u32 dig_hotplug_reg; > - u32 pin_mask, long_mask; > > - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + if (hotplug_trigger) { > + u32 dig_hotplug_reg, pin_mask, long_mask; > > - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > - intel_hpd_irq_handler(dev, pin_mask, long_mask); > + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, > + dig_hotplug_reg, hpd_cpt); Ditto With those fixed this is Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > + intel_hpd_irq_handler(dev, pin_mask, long_mask); > + } > > if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { > int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> > -- > 1.7.10.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-07 13:21 ` Ville Syrjälä @ 2015-07-08 5:10 ` Jindal, Sonika 2015-07-08 8:48 ` Ville Syrjälä 0 siblings, 1 reply; 18+ messages in thread From: Jindal, Sonika @ 2015-07-08 5:10 UTC (permalink / raw) To: Ville Syrjälä; +Cc: intel-gfx On 7/7/2015 6:51 PM, Ville Syrjälä wrote: > On Tue, Jul 07, 2015 at 02:22:20PM +0530, Sonika Jindal wrote: >> Writing to PCH_PORT_HOTPLUG for each interrupt is not required. >> Handle it only if hpd has actually occurred like we handle other >> interrupts. >> v2: Make few variables local to if block (Ville) >> v3: Add check for ibx/cpt both (Ville). >> While at it, remove the redundant check for hotplug_trigger from >> pch_get_hpd_pins >> >> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> >> --- >> drivers/gpu/drm/i915/i915_irq.c | 32 +++++++++++++++++--------------- >> 1 file changed, 17 insertions(+), 15 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c >> index a6fbe64..ba2c27c 100644 >> --- a/drivers/gpu/drm/i915/i915_irq.c >> +++ b/drivers/gpu/drm/i915/i915_irq.c >> @@ -1266,9 +1266,6 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask, >> *pin_mask = 0; >> *long_mask = 0; >> >> - if (!hotplug_trigger) >> - return; >> - > > Looks like BXT still depends on that. So you should change that too, > or leave this in until someone else does it. No, for bxt, this function is called from bxt_hpd_handler which is called only when "tmp & BXT_DE_PORT_HOTPLUG_MASK" is non-zero. So, it this is fine for bxt. > >> for_each_hpd_pin(i) { >> if ((hpd[i] & hotplug_trigger) == 0) >> continue; >> @@ -1658,14 +1655,17 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) >> struct drm_i915_private *dev_priv = dev->dev_private; >> int pipe; >> u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; >> - u32 dig_hotplug_reg; >> - u32 pin_mask, long_mask; >> >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + if (hotplug_trigger) { >> + u32 dig_hotplug_reg, pin_mask, long_mask; >> >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_ibx); >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, >> + dig_hotplug_reg, hpd_ibx); > > Indentation is fubar. This was to avoid 80 char limit. > >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + } >> >> if (pch_iir & SDE_AUDIO_POWER_MASK) { >> int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> >> @@ -1757,14 +1757,16 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) >> struct drm_i915_private *dev_priv = dev->dev_private; >> int pipe; >> u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; >> - u32 dig_hotplug_reg; >> - u32 pin_mask, long_mask; >> >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + if (hotplug_trigger) { >> + u32 dig_hotplug_reg, pin_mask, long_mask; >> >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, >> + dig_hotplug_reg, hpd_cpt); > > Ditto > This was to avoid 80 char limit. > With those fixed this is > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + } >> >> if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { >> int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> >> -- >> 1.7.10.4 >> >> _______________________________________________ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-08 5:10 ` Jindal, Sonika @ 2015-07-08 8:48 ` Ville Syrjälä 2015-07-08 11:37 ` Sonika Jindal 0 siblings, 1 reply; 18+ messages in thread From: Ville Syrjälä @ 2015-07-08 8:48 UTC (permalink / raw) To: Jindal, Sonika; +Cc: intel-gfx On Wed, Jul 08, 2015 at 10:40:18AM +0530, Jindal, Sonika wrote: > > > On 7/7/2015 6:51 PM, Ville Syrjälä wrote: > > On Tue, Jul 07, 2015 at 02:22:20PM +0530, Sonika Jindal wrote: > >> Writing to PCH_PORT_HOTPLUG for each interrupt is not required. > >> Handle it only if hpd has actually occurred like we handle other > >> interrupts. > >> v2: Make few variables local to if block (Ville) > >> v3: Add check for ibx/cpt both (Ville). > >> While at it, remove the redundant check for hotplug_trigger from > >> pch_get_hpd_pins > >> > >> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> > >> --- > >> drivers/gpu/drm/i915/i915_irq.c | 32 +++++++++++++++++--------------- > >> 1 file changed, 17 insertions(+), 15 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > >> index a6fbe64..ba2c27c 100644 > >> --- a/drivers/gpu/drm/i915/i915_irq.c > >> +++ b/drivers/gpu/drm/i915/i915_irq.c > >> @@ -1266,9 +1266,6 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask, > >> *pin_mask = 0; > >> *long_mask = 0; > >> > >> - if (!hotplug_trigger) > >> - return; > >> - > > > > Looks like BXT still depends on that. So you should change that too, > > or leave this in until someone else does it. > No, for bxt, this function is called from bxt_hpd_handler which is > called only when "tmp & BXT_DE_PORT_HOTPLUG_MASK" is non-zero. > So, it this is fine for bxt. Oh, right you are. No problem then. > > > > >> for_each_hpd_pin(i) { > >> if ((hpd[i] & hotplug_trigger) == 0) > >> continue; > >> @@ -1658,14 +1655,17 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) > >> struct drm_i915_private *dev_priv = dev->dev_private; > >> int pipe; > >> u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; > >> - u32 dig_hotplug_reg; > >> - u32 pin_mask, long_mask; > >> > >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > >> + if (hotplug_trigger) { > >> + u32 dig_hotplug_reg, pin_mask, long_mask; > >> > >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_ibx); > >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); > >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > >> + > >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, > >> + dig_hotplug_reg, hpd_ibx); > > > > Indentation is fubar. > This was to avoid 80 char limit. You have it like this + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, + dig_hotplug_reg, hpd_ibx); and it should look like this + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, + dig_hotplug_reg, hpd_ibx); that is the arguments on following lines should line up after the opening '(' on the first line. Sane editors can do this automagically for you. > > > >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); > >> + } > >> > >> if (pch_iir & SDE_AUDIO_POWER_MASK) { > >> int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> > >> @@ -1757,14 +1757,16 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) > >> struct drm_i915_private *dev_priv = dev->dev_private; > >> int pipe; > >> u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; > >> - u32 dig_hotplug_reg; > >> - u32 pin_mask, long_mask; > >> > >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > >> + if (hotplug_trigger) { > >> + u32 dig_hotplug_reg, pin_mask, long_mask; > >> > >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); > >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, > >> + dig_hotplug_reg, hpd_cpt); > > > > Ditto > > > This was to avoid 80 char limit. > > > With those fixed this is > > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > > > >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); > >> + } > >> > >> if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { > >> int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> > >> -- > >> 1.7.10.4 > >> > >> _______________________________________________ > >> Intel-gfx mailing list > >> Intel-gfx@lists.freedesktop.org > >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > -- Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-08 8:48 ` Ville Syrjälä @ 2015-07-08 11:37 ` Sonika Jindal 2015-07-08 15:18 ` Daniel Vetter 0 siblings, 1 reply; 18+ messages in thread From: Sonika Jindal @ 2015-07-08 11:37 UTC (permalink / raw) To: intel-gfx Writing to PCH_PORT_HOTPLUG for each interrupt is not required. Handle it only if hpd has actually occurred like we handle other interrupts. v2: Make few variables local to if block (Ville) v3: Add check for ibx/cpt both (Ville). While at it, remove the redundant check for hotplug_trigger from pch_get_hpd_pins v4: Indentation (Ville) Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> --- drivers/gpu/drm/i915/i915_irq.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index a6fbe64..a897f68 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1266,9 +1266,6 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask, *pin_mask = 0; *long_mask = 0; - if (!hotplug_trigger) - return; - for_each_hpd_pin(i) { if ((hpd[i] & hotplug_trigger) == 0) continue; @@ -1658,14 +1655,17 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) struct drm_i915_private *dev_priv = dev->dev_private; int pipe; u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; - u32 dig_hotplug_reg; - u32 pin_mask, long_mask; - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + if (hotplug_trigger) { + u32 dig_hotplug_reg, pin_mask, long_mask; - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_ibx); - intel_hpd_irq_handler(dev, pin_mask, long_mask); + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, + dig_hotplug_reg, hpd_ibx); + intel_hpd_irq_handler(dev, pin_mask, long_mask); + } if (pch_iir & SDE_AUDIO_POWER_MASK) { int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> @@ -1757,14 +1757,16 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) struct drm_i915_private *dev_priv = dev->dev_private; int pipe; u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; - u32 dig_hotplug_reg; - u32 pin_mask, long_mask; - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + if (hotplug_trigger) { + u32 dig_hotplug_reg, pin_mask, long_mask; - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); - intel_hpd_irq_handler(dev, pin_mask, long_mask); + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, + dig_hotplug_reg, hpd_cpt); + intel_hpd_irq_handler(dev, pin_mask, long_mask); + } if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> -- 1.7.10.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-08 11:37 ` Sonika Jindal @ 2015-07-08 15:18 ` Daniel Vetter 2015-10-01 14:17 ` Jani Nikula 0 siblings, 1 reply; 18+ messages in thread From: Daniel Vetter @ 2015-07-08 15:18 UTC (permalink / raw) To: Sonika Jindal; +Cc: intel-gfx On Wed, Jul 08, 2015 at 05:07:47PM +0530, Sonika Jindal wrote: > Writing to PCH_PORT_HOTPLUG for each interrupt is not required. > Handle it only if hpd has actually occurred like we handle other > interrupts. > v2: Make few variables local to if block (Ville) > v3: Add check for ibx/cpt both (Ville). > While at it, remove the redundant check for hotplug_trigger from > pch_get_hpd_pins > v4: Indentation (Ville) > > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> Queued for -next, thanks for the patch. -Daniel > --- > drivers/gpu/drm/i915/i915_irq.c | 32 +++++++++++++++++--------------- > 1 file changed, 17 insertions(+), 15 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > index a6fbe64..a897f68 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -1266,9 +1266,6 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask, > *pin_mask = 0; > *long_mask = 0; > > - if (!hotplug_trigger) > - return; > - > for_each_hpd_pin(i) { > if ((hpd[i] & hotplug_trigger) == 0) > continue; > @@ -1658,14 +1655,17 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) > struct drm_i915_private *dev_priv = dev->dev_private; > int pipe; > u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; > - u32 dig_hotplug_reg; > - u32 pin_mask, long_mask; > > - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + if (hotplug_trigger) { > + u32 dig_hotplug_reg, pin_mask, long_mask; > > - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_ibx); > - intel_hpd_irq_handler(dev, pin_mask, long_mask); > + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + > + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, > + dig_hotplug_reg, hpd_ibx); > + intel_hpd_irq_handler(dev, pin_mask, long_mask); > + } > > if (pch_iir & SDE_AUDIO_POWER_MASK) { > int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> > @@ -1757,14 +1757,16 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) > struct drm_i915_private *dev_priv = dev->dev_private; > int pipe; > u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; > - u32 dig_hotplug_reg; > - u32 pin_mask, long_mask; > > - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + if (hotplug_trigger) { > + u32 dig_hotplug_reg, pin_mask, long_mask; > > - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); > - intel_hpd_irq_handler(dev, pin_mask, long_mask); > + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); > + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); > + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, > + dig_hotplug_reg, hpd_cpt); > + intel_hpd_irq_handler(dev, pin_mask, long_mask); > + } > > if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { > int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> > -- > 1.7.10.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-08 15:18 ` Daniel Vetter @ 2015-10-01 14:17 ` Jani Nikula 0 siblings, 0 replies; 18+ messages in thread From: Jani Nikula @ 2015-10-01 14:17 UTC (permalink / raw) To: Daniel Vetter, Sonika Jindal; +Cc: intel-gfx On Wed, 08 Jul 2015, Daniel Vetter <daniel@ffwll.ch> wrote: > On Wed, Jul 08, 2015 at 05:07:47PM +0530, Sonika Jindal wrote: >> Writing to PCH_PORT_HOTPLUG for each interrupt is not required. >> Handle it only if hpd has actually occurred like we handle other >> interrupts. >> v2: Make few variables local to if block (Ville) >> v3: Add check for ibx/cpt both (Ville). >> While at it, remove the redundant check for hotplug_trigger from >> pch_get_hpd_pins >> v4: Indentation (Ville) >> >> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> >> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> > > Queued for -next, thanks for the patch. This patch, i.e. commit aaf5ec2e51ab1d9c5e962b4728a1107ed3ff7a3e Author: Sonika Jindal <sonika.jindal@intel.com> Date: Wed Jul 8 17:07:47 2015 +0530 drm/i915: Handle HPD when it has actually occurred causes *tons* of [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)! at boot. Suspiciously this happens a lot when doing native AUX on the DP monitor. Bug with dmesg is at https://bugs.freedesktop.org/show_bug.cgi?id=92084 BR, Jani. > -Daniel > >> --- >> drivers/gpu/drm/i915/i915_irq.c | 32 +++++++++++++++++--------------- >> 1 file changed, 17 insertions(+), 15 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c >> index a6fbe64..a897f68 100644 >> --- a/drivers/gpu/drm/i915/i915_irq.c >> +++ b/drivers/gpu/drm/i915/i915_irq.c >> @@ -1266,9 +1266,6 @@ static void pch_get_hpd_pins(u32 *pin_mask, u32 *long_mask, >> *pin_mask = 0; >> *long_mask = 0; >> >> - if (!hotplug_trigger) >> - return; >> - >> for_each_hpd_pin(i) { >> if ((hpd[i] & hotplug_trigger) == 0) >> continue; >> @@ -1658,14 +1655,17 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) >> struct drm_i915_private *dev_priv = dev->dev_private; >> int pipe; >> u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; >> - u32 dig_hotplug_reg; >> - u32 pin_mask, long_mask; >> >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + if (hotplug_trigger) { >> + u32 dig_hotplug_reg, pin_mask, long_mask; >> >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_ibx); >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, >> + dig_hotplug_reg, hpd_ibx); >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + } >> >> if (pch_iir & SDE_AUDIO_POWER_MASK) { >> int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> >> @@ -1757,14 +1757,16 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) >> struct drm_i915_private *dev_priv = dev->dev_private; >> int pipe; >> u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; >> - u32 dig_hotplug_reg; >> - u32 pin_mask, long_mask; >> >> - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + if (hotplug_trigger) { >> + u32 dig_hotplug_reg, pin_mask, long_mask; >> >> - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); >> - intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); >> + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); >> + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, >> + dig_hotplug_reg, hpd_cpt); >> + intel_hpd_irq_handler(dev, pin_mask, long_mask); >> + } >> >> if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { >> int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> >> -- >> 1.7.10.4 >> >> _______________________________________________ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-07 8:52 ` [PATCH] " Sonika Jindal 2015-07-07 13:21 ` Ville Syrjälä @ 2015-07-08 8:13 ` shuang.he 1 sibling, 0 replies; 18+ messages in thread From: shuang.he @ 2015-07-08 8:13 UTC (permalink / raw) To: shuang.he, lei.a.liu, intel-gfx, sonika.jindal Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) Task id: 6740 -------------------------------------Summary------------------------------------- Platform Delta drm-intel-nightly Series Applied ILK 302/302 302/302 SNB 312/316 312/316 IVB 343/343 343/343 BYT -2 287/287 285/287 HSW 380/380 380/380 -------------------------------------Detailed------------------------------------- Platform Test drm-intel-nightly Series Applied *BYT igt@gem_partial_pwrite_pread@reads PASS(1) FAIL(1) *BYT igt@gem_partial_pwrite_pread@reads-uncached PASS(1) FAIL(1) Note: You need to pay more attention to line start with '*' _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-06 8:49 ` Ville Syrjälä 2015-07-06 9:01 ` Jindal, Sonika @ 2015-07-06 10:08 ` Sonika Jindal 2015-07-07 5:55 ` shuang.he 1 sibling, 1 reply; 18+ messages in thread From: Sonika Jindal @ 2015-07-06 10:08 UTC (permalink / raw) To: intel-gfx Writing to PCH_PORT_HOTPLUG for each interrupt is not required. Handle it only if hpd has actually occurred like we handle other interrupts. v2: Make few variables local to if block (Ville) Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> --- drivers/gpu/drm/i915/i915_irq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index a6fbe64..cd504dc 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1757,14 +1757,16 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) struct drm_i915_private *dev_priv = dev->dev_private; int pipe; u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; - u32 dig_hotplug_reg; - u32 pin_mask, long_mask; - dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); - I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + if (hotplug_trigger) { + u32 dig_hotplug_reg, pin_mask, long_mask; - pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, dig_hotplug_reg, hpd_cpt); - intel_hpd_irq_handler(dev, pin_mask, long_mask); + dig_hotplug_reg = I915_READ(PCH_PORT_HOTPLUG); + I915_WRITE(PCH_PORT_HOTPLUG, dig_hotplug_reg); + pch_get_hpd_pins(&pin_mask, &long_mask, hotplug_trigger, + dig_hotplug_reg, hpd_cpt); + intel_hpd_irq_handler(dev, pin_mask, long_mask); + } if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> -- 1.7.10.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] drm/i915: Handle HPD when it has actually occurred 2015-07-06 10:08 ` Sonika Jindal @ 2015-07-07 5:55 ` shuang.he 0 siblings, 0 replies; 18+ messages in thread From: shuang.he @ 2015-07-07 5:55 UTC (permalink / raw) To: shuang.he, lei.a.liu, intel-gfx, sonika.jindal Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) Task id: 6724 -------------------------------------Summary------------------------------------- Platform Delta drm-intel-nightly Series Applied ILK 302/302 302/302 SNB 312/316 312/316 IVB 345/345 345/345 BYT -1 289/289 288/289 HSW 382/382 382/382 -------------------------------------Detailed------------------------------------- Platform Test drm-intel-nightly Series Applied *BYT igt@gem_partial_pwrite_pread@reads-uncached PASS(1) FAIL(1) Note: You need to pay more attention to line start with '*' _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred 2015-07-06 5:53 [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred Sonika Jindal 2015-07-06 8:36 ` Daniel Vetter 2015-07-06 8:49 ` Ville Syrjälä @ 2015-07-06 9:54 ` shuang.he 2 siblings, 0 replies; 18+ messages in thread From: shuang.he @ 2015-07-06 9:54 UTC (permalink / raw) To: shuang.he, lei.a.liu, intel-gfx, sonika.jindal Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) Task id: 6723 -------------------------------------Summary------------------------------------- Platform Delta drm-intel-nightly Series Applied ILK 302/302 302/302 SNB 312/316 312/316 IVB 343/343 343/343 BYT -2 287/287 285/287 HSW 380/380 380/380 -------------------------------------Detailed------------------------------------- Platform Test drm-intel-nightly Series Applied *BYT igt@gem_partial_pwrite_pread@reads PASS(1) FAIL(1) *BYT igt@gem_tiled_partial_pwrite_pread@reads PASS(1) FAIL(1) Note: You need to pay more attention to line start with '*' _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2015-10-01 14:14 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-07-06 5:53 [PATCH] [RFC] drm/i915: Handle HPD when it has actually occurred Sonika Jindal 2015-07-06 8:36 ` Daniel Vetter 2015-07-06 8:41 ` Jindal, Sonika 2015-07-06 12:24 ` Daniel Vetter 2015-07-06 8:49 ` Ville Syrjälä 2015-07-06 9:01 ` Jindal, Sonika 2015-07-06 11:18 ` Ville Syrjälä 2015-07-07 8:52 ` [PATCH] " Sonika Jindal 2015-07-07 13:21 ` Ville Syrjälä 2015-07-08 5:10 ` Jindal, Sonika 2015-07-08 8:48 ` Ville Syrjälä 2015-07-08 11:37 ` Sonika Jindal 2015-07-08 15:18 ` Daniel Vetter 2015-10-01 14:17 ` Jani Nikula 2015-07-08 8:13 ` shuang.he 2015-07-06 10:08 ` Sonika Jindal 2015-07-07 5:55 ` shuang.he 2015-07-06 9:54 ` [PATCH] [RFC] " shuang.he
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox