[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#775217: drm/i915: Add limited color range readout for HDMI/DP ports on g4x/vlv/chv



Source: linux
Severity: important
Tags: upstream patch

Dear Maintainers,

Officiel kernel regularly spits out the following when plugged to a HDMI TV.
This *may* lead to HDMI link instabilities and EDID checksum mismatchs,
although I have not been able to reproduce my single occurence of broken TV
output.

[179305.004168] [drm:intel_pipe_config_compare] *ERROR* mismatch in limited_color_range (expected 1, found 0)
[179305.004176] ------------[ cut here ]------------
[179305.004221] WARNING: CPU: 0 PID: 22693 at /build/linux-CMiYW9/linux-3.16.7-ckt2/drivers/gpu/drm/i915/intel_display.c:10192 check_crtc_state+0x743/0xda0 [i915]()
[179305.004265] pipe state doesn't match!
[179305.004268] Modules linked in: sha256_ssse3 sha256_generic dm_crypt ecb cbc algif_skcipher af_alg veth binfmt_misc cpufreq_stats cpufreq_powersave cpufreq_userspace cpufreq_conservative iptable_nat nf_nat_ipv4 ipt_REJECT iptable_mangle iptable_raw nf_conntrack_ipv4 nf_defrag_ipv4 xt_recent ip6table_nat nf_nat_ipv6 xt_comment ip6t_REJECT xt_addrtype xt_physdev xt_mark ip6table_mangle xt_tcpudp xt_CT ip6table_raw xt_multiport nf_conntrack_ipv6 nf_defrag_ipv6 ipt_ULOG xt_conntrack nf_nat_tftp nf_nat_snmp_basic nf_conntrack_snmp nf_nat_sip nf_nat_pptp nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat_amanda xt_NFLOG nf_nat nfnetlink_log xt_LOG nf_conntrack_tftp nf_conntrack_sip nf_conntrack_sane nf_conntrack_proto_udplite nf_conntrack_proto_sctp nf_conntrack_pptp nf_conntrack_proto_gre nf_conntrack_netlink nfnetlink nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_irc ts_kmp nf_conntrack_h323 nf_conntrack_ftp nf_conntrack_amanda nf_conntrack ip6table_filter ip6_tab
 les iptable_filter ip_tables x_tables bridge stp llc iTCO_wdt iTCO_vendor_support snd_hda_codec_hdmi snd_hda_codec_via snd_hda_codec_generic ppdev snd_hda_intel snd_hda_controller snd_hda_codec snd_hwdep snd_pcm coretemp lpc_ich i915 pcspkr snd_timer evdev serio_raw video drm_kms_helper drm i2c_i801 mfd_core snd soundcore tpm_infineon i2c_algo_bit i2c_core tpm_tis tpm rng_core shpchp parport_pc parport button acpi_cpufreq processor thermal_sys loop fuse autofs4 ext4 crc16 mbcache jbd2 dm_mod raid1 md_mod sg sd_mod crc_t10dif crct10dif_generic crct10dif_common sr_mod cdrom ata_generic 8139too ata_piix 8139cp mii libata scsi_mod ehci_pci atl1c uhci_hcd ehci_hcd usbcore usb_common
[179305.004444] CPU: 0 PID: 22693 Comm: Xorg Tainted: G        W     3.16.0-4-amd64 #1 Debian 3.16.7-ckt2-1
[179305.004448] Hardware name: MSI MS-7592/G41M-P34 (MS-7592), BIOS V25.3 03/03/2010
[179305.004451]  0000000000000009 ffffffff81507263 ffff88005a9c3a30 ffffffff81065847
[179305.004457]  ffff88007a69a058 ffff88005a9c3a80 ffff88007910f800 ffff88007a69a6f8
[179305.004462]  ffff88007910fb40 ffffffff810658ac ffffffffa03f8672 ffffffff00000018
[179305.004467] Call Trace:
[179305.004478]  [<ffffffff81507263>] ? dump_stack+0x41/0x51
[179305.004485]  [<ffffffff81065847>] ? warn_slowpath_common+0x77/0x90
[179305.004490]  [<ffffffff810658ac>] ? warn_slowpath_fmt+0x4c/0x50
[179305.004517]  [<ffffffffa0394de3>] ? check_crtc_state+0x743/0xda0 [i915]
[179305.004545]  [<ffffffffa03a2e95>] ? intel_modeset_check_state+0x255/0x780 [i915]
[179305.004563]  [<ffffffffa02e3554>] ? _object_find+0x64/0x90 [drm]
[179305.004580]  [<ffffffffa02e8fd6>] ? drm_mode_obj_set_property_ioctl+0x396/0x3b0 [drm]
[179305.004596]  [<ffffffffa02e901e>] ? drm_mode_connector_property_set_ioctl+0x2e/0x40 [drm]
[179305.004610]  [<ffffffffa02d88b7>] ? drm_ioctl+0x1c7/0x5b0 [drm]
[179305.004621]  [<ffffffff813ff397>] ? move_addr_to_user+0xa7/0xc0
[179305.004627]  [<ffffffff811b7d2f>] ? do_vfs_ioctl+0x2cf/0x4b0
[179305.004632]  [<ffffffff811b7f91>] ? SyS_ioctl+0x81/0xa0
[179305.004637]  [<ffffffff8150f368>] ? page_fault+0x28/0x30
[179305.004643]  [<ffffffff8150d32d>] ? system_call_fast_compare_end+0x10/0x15
[179305.004646] ---[ end trace 72d92f83c05ee4fc ]---

The attached patch fixes the problem. It has been accepted upstream.

Thanks,

Alex

-- System Information:
Debian Release: 8.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
From: Alexandre Rossi <alexandre.rossi@gmail.com>

Patch forward ported to apply with c84db77010877da6c5da119868ed54c43d59e726
(drm/i915/hdmi: fix hdmi audio state readout).

>From 8c875fca1a8d76665c60fa141c220cee65f44f5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
Date: Fri, 12 Sep 2014 15:46:29 +0300
Subject: drm/i915: Add limited color range readout for HDMI/DP ports on
 g4x/vlv/chv
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The limited color range knob is in the port registers on
g4x and vlv/chv for HDMI, and on g4x for DP. Add the relevant code
to read out the hardware state into pipe config. On vlv/chv the
DP port limited color range knob is in PIPECONF for which we
already have readout code.

Cc: Chris Clayton <chris2553@googlemail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Chris Clayton <chris2553@googlemail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 81d7681..fdff1d4 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1631,6 +1631,10 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
 
 	pipe_config->adjusted_mode.flags |= flags;
 
+	if (!HAS_PCH_SPLIT(dev) && !IS_VALLEYVIEW(dev) &&
+	    tmp & DP_COLOR_RANGE_16_235)
+		pipe_config->limited_color_range = true;
+
 	pipe_config->has_dp_encoder = true;
 
 	intel_dp_get_m_n(crtc, pipe_config);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index f9151f6..ca34de7 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -712,7 +712,8 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
 				  struct intel_crtc_config *pipe_config)
 {
 	struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
-	struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
+	struct drm_device *dev = encoder->base.dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 tmp, flags = 0;
 	int dotclock;
 
@@ -734,6 +735,10 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
 	if (tmp & SDVO_AUDIO_ENABLE)
 		pipe_config->has_audio = true;
 
+	if (!HAS_PCH_SPLIT(dev) &&
+	    tmp & HDMI_COLOR_RANGE_16_235)
+		pipe_config->limited_color_range = true;
+
 	pipe_config->adjusted_mode.flags |= flags;
 
 	if ((tmp & SDVO_COLOR_FORMAT_MASK) == HDMI_COLOR_FORMAT_12bpc)
-- 
cgit v0.10.2


Reply to: