Skip to content

Commit b1dc332

Browse files
committed
drm/i915/lvds: implement get_hw_state
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 9a8ee98 commit b1dc332

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

drivers/gpu/drm/i915/intel_lvds.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,32 @@ static struct intel_lvds *intel_attached_lvds(struct drm_connector *connector)
6565
struct intel_lvds, base);
6666
}
6767

68+
static bool intel_lvds_get_hw_state(struct intel_encoder *encoder,
69+
enum pipe *pipe)
70+
{
71+
struct drm_device *dev = encoder->base.dev;
72+
struct drm_i915_private *dev_priv = dev->dev_private;
73+
u32 lvds_reg, tmp;
74+
75+
if (HAS_PCH_SPLIT(dev)) {
76+
lvds_reg = PCH_LVDS;
77+
} else {
78+
lvds_reg = LVDS;
79+
}
80+
81+
tmp = I915_READ(lvds_reg);
82+
83+
if (!(tmp & LVDS_PORT_EN))
84+
return false;
85+
86+
if (HAS_PCH_CPT(dev))
87+
*pipe = PORT_TO_PIPE_CPT(tmp);
88+
else
89+
*pipe = PORT_TO_PIPE(tmp);
90+
91+
return true;
92+
}
93+
6894
/**
6995
* Sets the power state for the panel.
7096
*/
@@ -937,6 +963,8 @@ bool intel_lvds_init(struct drm_device *dev)
937963

938964
intel_encoder->enable = intel_enable_lvds;
939965
intel_encoder->disable = intel_disable_lvds;
966+
intel_encoder->get_hw_state = intel_lvds_get_hw_state;
967+
intel_connector->get_hw_state = intel_connector_get_hw_state;
940968

941969
intel_connector_attach_encoder(intel_connector, intel_encoder);
942970
intel_encoder->type = INTEL_OUTPUT_LVDS;

0 commit comments

Comments
 (0)