diff options
author | Dave Airlie <airlied@redhat.com> | 2014-12-02 17:25:59 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-12-02 17:25:59 -0500 |
commit | 26045b53c96f23b75a48544349c3d936e8402418 (patch) | |
tree | ce550e556d6135aa45a376f067855b8aaa1b26ad /drivers/gpu/drm/i915/intel_hdmi.c | |
parent | 1a92b7a241dcf06a92d84219b4124dcf420ae315 (diff) | |
parent | 064ca1d250b14b785e662b0a13d8d20cb84574e1 (diff) |
Merge tag 'drm-intel-next-2014-11-21-fixed' of git://anongit.freedesktop.org/drm-intel into drm-next
drm-intel-next-2014-11-21:
- infoframe tracking (for fastboot) from Jesse
- start of the dri1/ums support removal
- vlv forcewake timeout fixes (Imre)
- bunch of patches to polish the rps code (Imre) and improve it on bdw (Tom
O'Rourke)
- on-demand pinning for execlist contexts
- vlv/chv backlight improvements (Ville)
- gen8+ render ctx w/a work from various people
- skl edp programming (Satheeshakrishna et al.)
- psr docbook (Rodrigo)
- piles of little fixes and improvements all over, as usual
* tag 'drm-intel-next-2014-11-21-fixed' of git://anongit.freedesktop.org/drm-intel: (117 commits)
drm/i915: Don't pin LRC in GGTT when dumping in debugfs
drm/i915: Update DRIVER_DATE to 20141121
drm/i915/g4x: fix g4x infoframe readout
drm/i915: Only call mod_timer() if not already pending
drm/i915: Don't rely upon encoder->type for infoframe hw state readout
drm/i915: remove the IRQs enabled WARN from intel_disable_gt_powersave
drm/i915: Use ggtt error obj capture helper for gen8 semaphores
drm/i915: vlv: increase timeout when setting idle GPU freq
drm/i915: vlv: fix cdclk setting during modeset while suspended
drm/i915: Dump hdmi pipe_config state
drm/i915: Gen9 shadowed registers
drm/i915/skl: Gen9 multi-engine forcewake
drm/i915: Read power well status before other registers for drpc info
drm/i915: Pin tiled objects for L-shaped configs
drm/i915: Update ring freq for full gpu freq range
drm/i915: change initial rps frequency for gen8
drm/i915: Keep min freq above floor on HSW/BDW
drm/i915: Use efficient frequency for HSW/BDW
drm/i915: Can i915_gem_init_ioctl
drm/i915: Sanitize ->lastclose
...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 29baa53aef90..ec873338e84d 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -166,6 +166,19 @@ static void g4x_write_infoframe(struct drm_encoder *encoder, | |||
166 | POSTING_READ(VIDEO_DIP_CTL); | 166 | POSTING_READ(VIDEO_DIP_CTL); |
167 | } | 167 | } |
168 | 168 | ||
169 | static bool g4x_infoframe_enabled(struct drm_encoder *encoder) | ||
170 | { | ||
171 | struct drm_device *dev = encoder->dev; | ||
172 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
173 | struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); | ||
174 | u32 val = I915_READ(VIDEO_DIP_CTL); | ||
175 | |||
176 | if (VIDEO_DIP_PORT(intel_dig_port->port) == (val & VIDEO_DIP_PORT_MASK)) | ||
177 | return val & VIDEO_DIP_ENABLE; | ||
178 | |||
179 | return false; | ||
180 | } | ||
181 | |||
169 | static void ibx_write_infoframe(struct drm_encoder *encoder, | 182 | static void ibx_write_infoframe(struct drm_encoder *encoder, |
170 | enum hdmi_infoframe_type type, | 183 | enum hdmi_infoframe_type type, |
171 | const void *frame, ssize_t len) | 184 | const void *frame, ssize_t len) |
@@ -204,6 +217,17 @@ static void ibx_write_infoframe(struct drm_encoder *encoder, | |||
204 | POSTING_READ(reg); | 217 | POSTING_READ(reg); |
205 | } | 218 | } |
206 | 219 | ||
220 | static bool ibx_infoframe_enabled(struct drm_encoder *encoder) | ||
221 | { | ||
222 | struct drm_device *dev = encoder->dev; | ||
223 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
224 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
225 | int reg = TVIDEO_DIP_CTL(intel_crtc->pipe); | ||
226 | u32 val = I915_READ(reg); | ||
227 | |||
228 | return val & VIDEO_DIP_ENABLE; | ||
229 | } | ||
230 | |||
207 | static void cpt_write_infoframe(struct drm_encoder *encoder, | 231 | static void cpt_write_infoframe(struct drm_encoder *encoder, |
208 | enum hdmi_infoframe_type type, | 232 | enum hdmi_infoframe_type type, |
209 | const void *frame, ssize_t len) | 233 | const void *frame, ssize_t len) |
@@ -245,6 +269,17 @@ static void cpt_write_infoframe(struct drm_encoder *encoder, | |||
245 | POSTING_READ(reg); | 269 | POSTING_READ(reg); |
246 | } | 270 | } |
247 | 271 | ||
272 | static bool cpt_infoframe_enabled(struct drm_encoder *encoder) | ||
273 | { | ||
274 | struct drm_device *dev = encoder->dev; | ||
275 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
276 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
277 | int reg = TVIDEO_DIP_CTL(intel_crtc->pipe); | ||
278 | u32 val = I915_READ(reg); | ||
279 | |||
280 | return val & VIDEO_DIP_ENABLE; | ||
281 | } | ||
282 | |||
248 | static void vlv_write_infoframe(struct drm_encoder *encoder, | 283 | static void vlv_write_infoframe(struct drm_encoder *encoder, |
249 | enum hdmi_infoframe_type type, | 284 | enum hdmi_infoframe_type type, |
250 | const void *frame, ssize_t len) | 285 | const void *frame, ssize_t len) |
@@ -283,6 +318,17 @@ static void vlv_write_infoframe(struct drm_encoder *encoder, | |||
283 | POSTING_READ(reg); | 318 | POSTING_READ(reg); |
284 | } | 319 | } |
285 | 320 | ||
321 | static bool vlv_infoframe_enabled(struct drm_encoder *encoder) | ||
322 | { | ||
323 | struct drm_device *dev = encoder->dev; | ||
324 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
325 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
326 | int reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe); | ||
327 | u32 val = I915_READ(reg); | ||
328 | |||
329 | return val & VIDEO_DIP_ENABLE; | ||
330 | } | ||
331 | |||
286 | static void hsw_write_infoframe(struct drm_encoder *encoder, | 332 | static void hsw_write_infoframe(struct drm_encoder *encoder, |
287 | enum hdmi_infoframe_type type, | 333 | enum hdmi_infoframe_type type, |
288 | const void *frame, ssize_t len) | 334 | const void *frame, ssize_t len) |
@@ -320,6 +366,18 @@ static void hsw_write_infoframe(struct drm_encoder *encoder, | |||
320 | POSTING_READ(ctl_reg); | 366 | POSTING_READ(ctl_reg); |
321 | } | 367 | } |
322 | 368 | ||
369 | static bool hsw_infoframe_enabled(struct drm_encoder *encoder) | ||
370 | { | ||
371 | struct drm_device *dev = encoder->dev; | ||
372 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
373 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
374 | u32 ctl_reg = HSW_TVIDEO_DIP_CTL(intel_crtc->config.cpu_transcoder); | ||
375 | u32 val = I915_READ(ctl_reg); | ||
376 | |||
377 | return val & (VIDEO_DIP_ENABLE_AVI_HSW | VIDEO_DIP_ENABLE_SPD_HSW | | ||
378 | VIDEO_DIP_ENABLE_VS_HSW); | ||
379 | } | ||
380 | |||
323 | /* | 381 | /* |
324 | * The data we write to the DIP data buffer registers is 1 byte bigger than the | 382 | * The data we write to the DIP data buffer registers is 1 byte bigger than the |
325 | * HDMI infoframe size because of an ECC/reserved byte at position 3 (starting | 383 | * HDMI infoframe size because of an ECC/reserved byte at position 3 (starting |
@@ -724,6 +782,9 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, | |||
724 | if (tmp & HDMI_MODE_SELECT_HDMI) | 782 | if (tmp & HDMI_MODE_SELECT_HDMI) |
725 | pipe_config->has_hdmi_sink = true; | 783 | pipe_config->has_hdmi_sink = true; |
726 | 784 | ||
785 | if (intel_hdmi->infoframe_enabled(&encoder->base)) | ||
786 | pipe_config->has_infoframe = true; | ||
787 | |||
727 | if (tmp & SDVO_AUDIO_ENABLE) | 788 | if (tmp & SDVO_AUDIO_ENABLE) |
728 | pipe_config->has_audio = true; | 789 | pipe_config->has_audio = true; |
729 | 790 | ||
@@ -925,6 +986,9 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, | |||
925 | 986 | ||
926 | pipe_config->has_hdmi_sink = intel_hdmi->has_hdmi_sink; | 987 | pipe_config->has_hdmi_sink = intel_hdmi->has_hdmi_sink; |
927 | 988 | ||
989 | if (pipe_config->has_hdmi_sink) | ||
990 | pipe_config->has_infoframe = true; | ||
991 | |||
928 | if (intel_hdmi->color_range_auto) { | 992 | if (intel_hdmi->color_range_auto) { |
929 | /* See CEA-861-E - 5.1 Default Encoding Parameters */ | 993 | /* See CEA-861-E - 5.1 Default Encoding Parameters */ |
930 | if (pipe_config->has_hdmi_sink && | 994 | if (pipe_config->has_hdmi_sink && |
@@ -1619,18 +1683,23 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, | |||
1619 | if (IS_VALLEYVIEW(dev)) { | 1683 | if (IS_VALLEYVIEW(dev)) { |
1620 | intel_hdmi->write_infoframe = vlv_write_infoframe; | 1684 | intel_hdmi->write_infoframe = vlv_write_infoframe; |
1621 | intel_hdmi->set_infoframes = vlv_set_infoframes; | 1685 | intel_hdmi->set_infoframes = vlv_set_infoframes; |
1686 | intel_hdmi->infoframe_enabled = vlv_infoframe_enabled; | ||
1622 | } else if (IS_G4X(dev)) { | 1687 | } else if (IS_G4X(dev)) { |
1623 | intel_hdmi->write_infoframe = g4x_write_infoframe; | 1688 | intel_hdmi->write_infoframe = g4x_write_infoframe; |
1624 | intel_hdmi->set_infoframes = g4x_set_infoframes; | 1689 | intel_hdmi->set_infoframes = g4x_set_infoframes; |
1690 | intel_hdmi->infoframe_enabled = g4x_infoframe_enabled; | ||
1625 | } else if (HAS_DDI(dev)) { | 1691 | } else if (HAS_DDI(dev)) { |
1626 | intel_hdmi->write_infoframe = hsw_write_infoframe; | 1692 | intel_hdmi->write_infoframe = hsw_write_infoframe; |
1627 | intel_hdmi->set_infoframes = hsw_set_infoframes; | 1693 | intel_hdmi->set_infoframes = hsw_set_infoframes; |
1694 | intel_hdmi->infoframe_enabled = hsw_infoframe_enabled; | ||
1628 | } else if (HAS_PCH_IBX(dev)) { | 1695 | } else if (HAS_PCH_IBX(dev)) { |
1629 | intel_hdmi->write_infoframe = ibx_write_infoframe; | 1696 | intel_hdmi->write_infoframe = ibx_write_infoframe; |
1630 | intel_hdmi->set_infoframes = ibx_set_infoframes; | 1697 | intel_hdmi->set_infoframes = ibx_set_infoframes; |
1698 | intel_hdmi->infoframe_enabled = ibx_infoframe_enabled; | ||
1631 | } else { | 1699 | } else { |
1632 | intel_hdmi->write_infoframe = cpt_write_infoframe; | 1700 | intel_hdmi->write_infoframe = cpt_write_infoframe; |
1633 | intel_hdmi->set_infoframes = cpt_set_infoframes; | 1701 | intel_hdmi->set_infoframes = cpt_set_infoframes; |
1702 | intel_hdmi->infoframe_enabled = cpt_infoframe_enabled; | ||
1634 | } | 1703 | } |
1635 | 1704 | ||
1636 | if (HAS_DDI(dev)) | 1705 | if (HAS_DDI(dev)) |