drm/i915: Fix sdvo connector get_hw_state function
Subsystems (2)
PATCH 1/1 drm/i915: Fix sdvo connector get_hw_state function
The active output is only the currently selected one, which does not imply that it's actually enabled. Since we don't use the sdvo encoder side dpms support, we need to check whether the chip-side sdvo port is enabled instead.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60138
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62944
--- drivers/gpu/drm/i915/intel_sdvo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_sdvo.c +5 -1
@@ -1219,11 +1219,15 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (&connector->base);struct intel_sdvo *intel_sdvo =intel_attached_sdvo (&connector->base); +struct drm_i915_private *dev_priv = intel_sdvo->base.base.dev->dev_private;u16 active_outputs; +u32 tmp; + tmp =I915_READ (intel_sdvo->sdvo_reg);intel_sdvo_get_active_outputs (intel_sdvo, &active_outputs); -if (active_outputs & intel_sdvo_connector->output_flag) +if ((active_outputs & intel_sdvo_connector->output_flag) && + (tmp &SDVO_ENABLE ))return true;else return false;
Signature · 1 line
1.7.10.4
PATCH 1/1 drm/i915: Fix sdvo connector get_hw_state function
The active output is only the currently selected one, which does not imply that it's actually enabled. Since we don't use the sdvo encoder side dpms support, we need to check whether the chip-side sdvo port is enabled instead.
v2: Fix up Bugzilla links.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60138
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63031
--- drivers/gpu/drm/i915/intel_sdvo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_sdvo.c +5 -1
@@ -1219,11 +1219,15 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (&connector->base);struct intel_sdvo *intel_sdvo =intel_attached_sdvo (&connector->base); +struct drm_i915_private *dev_priv = intel_sdvo->base.base.dev->dev_private;u16 active_outputs; +u32 tmp; + tmp =I915_READ (intel_sdvo->sdvo_reg);intel_sdvo_get_active_outputs (intel_sdvo, &active_outputs); -if (active_outputs & intel_sdvo_connector->output_flag) +if ((active_outputs & intel_sdvo_connector->output_flag) && + (tmp &SDVO_ENABLE ))return true;else return false;
Signature · 1 line
1.7.10.4
Quoted 26 lines · Daniel Vetter
The active output is only the currently selected one, which does not imply that it's actually enabled. Since we don't use the sdvo encoder side dpms support, we need to check whether the chip-side sdvo port is enabled instead.
v2: Fix up Bugzilla links.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60138
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63031Cc Egbert Eich <[email protected]Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/i915/intel_sdvo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_sdvo.c +2
-0@@ -1219,11 +1219,15 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (&connector->base);struct intel_sdvo *intel_sdvo =intel_attached_sdvo (&connector->base); +struct drm_i915_private *dev_priv = intel_sdvo->base.base.dev->dev_private;u16 active_outputs; +u32 tmp;
drivers/gpu/drm/i915/intel_sdvo.c static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector) · line 1233
Quoted 10 lines
drivers/gpu/drm/i915/intel_sdvo.c +3
-1+ tmp =I915_READ (intel_sdvo->sdvo_reg);intel_sdvo_get_active_outputs (intel_sdvo, &active_outputs); -if (active_outputs & intel_sdvo_connector->output_flag) +if ((active_outputs & intel_sdvo_connector->output_flag) && + (tmp &SDVO_ENABLE ))return true;else return false;
Would this function be tidier as:
/* Check if this SDVO pipe is on and connected to our output */ if (I915_READ(intel_sdvo->sdvo_reg) & SDVO_ENABLE)
return false;
intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); return (active_outputs & intel_sdvo_connector->output_flag) != 0;
At the very least the patch by shrunk by adjusting it to only add the earlier check.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
PATCH 1/1 drm/i915: Fix sdvo connector get_hw_state function
The active output is only the currently selected one, which does not imply that it's actually enabled. Since we don't use the sdvo encoder side dpms support, we need to check whether the chip-side sdvo port is enabled instead.
v2: Fix up Bugzilla links.
v3: Simplify logic a bit (Chris).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60138
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63031
--- drivers/gpu/drm/i915/intel_sdvo.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_sdvo.c +4 -0
@@ -1219,8 +1219,12 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (&connector->base);struct intel_sdvo *intel_sdvo =intel_attached_sdvo (&connector->base); +struct drm_i915_private *dev_priv = intel_sdvo->base.base.dev->dev_private;u16 active_outputs; +if (!(I915_READ (intel_sdvo->sdvo_reg) &SDVO_ENABLE )) +return false; +intel_sdvo_get_active_outputs (intel_sdvo, &active_outputs);if (active_outputs & intel_sdvo_connector->output_flag)
Signature · 1 line
1.7.10.4
Quoted 7 lines · Daniel Vetter
The active output is only the currently selected one, which does not imply that it's actually enabled. Since we don't use the sdvo encoder side dpms support, we need to check whether the chip-side sdvo port is enabled instead.
v2: Fix up Bugzilla links.
Quoted 7 lines
v3: Simplify logic a bit (Chris).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60138
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63031Cc Egbert Eich <[email protected]>Cc Chris Wilson <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Queued for next with a cc: stable tag. Since it's just mostly harmless warnings imo not something for -fixes right away.
-Daniel
Quoted 24 lines
--- drivers/gpu/drm/i915/intel_sdvo.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/gpu/drm/i915/intel_sdvo.c +4
-0@@ -1219,8 +1219,12 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (&connector->base);struct intel_sdvo *intel_sdvo =intel_attached_sdvo (&connector->base); +struct drm_i915_private *dev_priv = intel_sdvo->base.base.dev->dev_private;u16 active_outputs; +if (!(I915_READ (intel_sdvo->sdvo_reg) &SDVO_ENABLE )) +return false; +intel_sdvo_get_active_outputs (intel_sdvo, &active_outputs);if (active_outputs & intel_sdvo_connector->output_flag)Signature · 1 line
1.7.10.4
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch