aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-03-03 09:15:29 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-10 16:46:26 -0400
commit718006329556b95c4394cc9163bafac85ccbe2f2 (patch)
treee39ea1dd8d9ec0d2679c1cb64cc926a121001b98
parente8e6e6012d68c4967e8f26fdd39ac95c247d4789 (diff)
drm/i915: Don't use HDMI 12bpc when cloning with other encoder types
When cloning HDMI with other output types, we can't use 12bpc since the clocks for the other encoder types would be off. So have intel_hdmi_compute_config() check if there are other encoders besides HDMI being fed from the same pipe, and if so, pick 8bpc insted if 12bpc. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index d13c65d607b2..a89e15a40bf7 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -848,6 +848,30 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
848 return MODE_OK; 848 return MODE_OK;
849} 849}
850 850
851static bool hdmi_12bpc_possible(struct intel_crtc *crtc)
852{
853 struct drm_device *dev = crtc->base.dev;
854 struct intel_encoder *encoder;
855 int count = 0, count_hdmi = 0;
856
857 if (!HAS_PCH_SPLIT(dev))
858 return false;
859
860 list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) {
861 if (encoder->new_crtc != crtc)
862 continue;
863
864 count_hdmi += encoder->type == INTEL_OUTPUT_HDMI;
865 count++;
866 }
867
868 /*
869 * HDMI 12bpc affects the clocks, so it's only possible
870 * when not cloning with other encoder types.
871 */
872 return count_hdmi > 0 && count_hdmi == count;
873}
874
851bool intel_hdmi_compute_config(struct intel_encoder *encoder, 875bool intel_hdmi_compute_config(struct intel_encoder *encoder,
852 struct intel_crtc_config *pipe_config) 876 struct intel_crtc_config *pipe_config)
853{ 877{
@@ -880,7 +904,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
880 * within limits. 904 * within limits.
881 */ 905 */
882 if (pipe_config->pipe_bpp > 8*3 && intel_hdmi->has_hdmi_sink && 906 if (pipe_config->pipe_bpp > 8*3 && intel_hdmi->has_hdmi_sink &&
883 clock_12bpc <= portclock_limit && HAS_PCH_SPLIT(dev)) { 907 clock_12bpc <= portclock_limit &&
908 hdmi_12bpc_possible(encoder->new_crtc)) {
884 DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n"); 909 DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
885 desired_bpp = 12*3; 910 desired_bpp = 12*3;
886 911