linux/drivers/gpu/drm
Lyude f165d2834c drm/i915/ilk: Don't disable SSC source if it's in use
Thanks to Ville Syrjälä for pointing me towards the cause of this issue.

Unfortunately one of the sideaffects of having the refclk for a DPLL set
to SSC is that as long as it's set to SSC, the GPU will prevent us from
powering down any of the pipes or transcoders using it. A couple of
BIOSes enable SSC in both PCH_DREF_CONTROL and in the DPLL
configurations. This causes issues on the first modeset, since we don't
expect SSC to be left on and as a result, can't successfully power down
the pipes or the transcoders using it. Here's an example from this Dell
OptiPlex 990:

[drm:intel_modeset_init] SSC enabled by BIOS, overriding VBT which says disabled
[drm:intel_modeset_init] 2 display pipes available.
[drm:intel_update_cdclk] Current CD clock rate: 400000 kHz
[drm:intel_update_max_cdclk] Max CD clock rate: 400000 kHz
[drm:intel_update_max_cdclk] Max dotclock rate: 360000 kHz
vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
[drm:intel_crt_reset] crt adpa set to 0xf40000
[drm:intel_dp_init_connector] Adding DP connector on port C
[drm:intel_dp_aux_init] registering DPDDC-C bus for card0-DP-1
[drm:ironlake_init_pch_refclk] has_panel 0 has_lvds 0 has_ck505 0
[drm:ironlake_init_pch_refclk] Disabling SSC entirely
… later we try committing the first modeset …
[drm:intel_dump_pipe_config] [CRTC:26][modeset] config ffff88041b02e800 for pipe A
[drm:intel_dump_pipe_config] cpu_transcoder: A
…
[drm:intel_dump_pipe_config] dpll_hw_state: dpll: 0xc4016001, dpll_md: 0x0, fp0: 0x20e08, fp1: 0x30d07
[drm:intel_dump_pipe_config] planes on this crtc
[drm:intel_dump_pipe_config] STANDARD PLANE:23 plane: 0.0 idx: 0 enabled
[drm:intel_dump_pipe_config]     FB:42, fb = 800x600 format = 0x34325258
[drm:intel_dump_pipe_config]     scaler:0 src (0, 0) 800x600 dst (0, 0) 800x600
[drm:intel_dump_pipe_config] CURSOR PLANE:25 plane: 0.1 idx: 1 disabled, scaler_id = 0
[drm:intel_dump_pipe_config] STANDARD PLANE:27 plane: 0.1 idx: 2 disabled, scaler_id = 0
[drm:intel_get_shared_dpll] CRTC:26 allocated PCH DPLL A
[drm:intel_get_shared_dpll] using PCH DPLL A for pipe A
[drm:ilk_audio_codec_disable] Disable audio codec on port C, pipe A
[drm:intel_disable_pipe] disabling pipe A
------------[ cut here ]------------
WARNING: CPU: 1 PID: 130 at drivers/gpu/drm/i915/intel_display.c:1146 intel_disable_pipe+0x297/0x2d0 [i915]
pipe_off wait timed out
…
---[ end trace 94fc8aa03ae139e8 ]---
[drm:intel_dp_link_down]
[drm:ironlake_crtc_disable [i915]] *ERROR* failed to disable transcoder A

Later modesets succeed since they reset the DPLL's configuration anyway,
but this is enough to get stuck with a big fat warning in dmesg.

A better solution would be to add refcounts for the SSC source, but for
now leaving the source clock on should suffice.

Changes since v3:
 - Move temp variable into loop
 - Move checks for using_ssc_source to after we've figured out has_ck505
 - Add using_ssc_source to debug output
Changes since v2:
 - Fix debug output for when we disable the CPU source
Changes since v1:
 - Leave the SSC source clock on instead of just shutting it off on all
   of the DPLL configurations.

Cc: stable@vger.kernel.org
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Lyude <cpaul@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1464199863-9397-1-git-send-email-cpaul@redhat.com
2016-05-26 09:55:12 +02:00
..
amd drm/amd/powerplay: rewrite pp_sw_init to make code readable 2016-05-11 13:30:33 -04:00
arc drm/arcpgu: use dedicated memory area for frame buffer 2016-04-29 14:22:32 +03:00
arm drm/arm/hdlcd: Rename async to nonblock. 2016-05-02 16:36:09 +02:00
armada mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
ast drm/ttm: implement LRU add callbacks v2 2016-05-04 20:21:38 -04:00
atmel-hlcdc Merge branch 'drm-atmel-hlcdc-devel' of https://github.com/bbrezillon/linux-at91 into drm-next 2016-04-22 09:06:44 +10:00
bochs drm/ttm: implement LRU add callbacks v2 2016-05-04 20:21:38 -04:00
bridge drm/bridge: Add Analogix anx78xx support 2016-05-12 11:32:14 +02:00
cirrus drm/ttm: implement LRU add callbacks v2 2016-05-04 20:21:38 -04:00
etnaviv Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de:/git/lst/linux into drm-next 2016-05-10 15:07:50 +10:00
exynos Merge tag 'topic/drm-misc-2016-05-13' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-05-17 07:06:14 +10:00
fsl-dcu drm/fsl-dcu: use bus_flags for pixel clock polarity 2016-05-05 10:09:06 -07:00
gma500 Linux 4.6-rc3 2016-04-22 08:32:51 +10:00
hisilicon drm/hisilicon: Fix DRM_INFO printed issue 2016-05-11 19:05:36 +08:00
i2c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
i810
i915 drm/i915/ilk: Don't disable SSC source if it's in use 2016-05-26 09:55:12 +02:00
imx drm/imx: Use lockless gem BO free callback 2016-05-04 12:27:54 +02:00
mediatek drm/mediatek: Add DPI sub driver 2016-05-06 17:47:38 +02:00
mga
mgag200 drm/ttm: implement LRU add callbacks v2 2016-05-04 20:21:38 -04:00
msm drm/msm: Drop load/unload drm_driver ops 2016-05-08 10:22:19 -04:00
nouveau Linux 4.6-rc7 2016-05-09 13:49:56 +10:00
omapdrm drm/omapdrm: Rename async to nonblock. 2016-05-02 16:36:34 +02:00
panel drm/panel: simple: Add support for TPK U.S.A. LLC Fusion 7" and 10.1" panels 2016-05-12 11:32:14 +02:00
qxl Linux 4.6-rc7 2016-05-09 13:49:56 +10:00
r128
radeon Linux 4.6-rc7 2016-05-09 13:49:56 +10:00
rcar-du Merge tag 'topic/drm-misc-2016-05-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-05-05 09:56:30 +10:00
rockchip Merge tag 'topic/drm-misc-2016-05-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-05-05 09:56:30 +10:00
savage
shmobile drm/shmobile: use drm_crtc_send_vblank_event() 2016-05-02 17:04:50 +02:00
sis
sti drm/sti: include linux/seq_file.h where needed 2016-05-11 09:47:05 +02:00
sun4i drm: sun4i: tv: Add NTSC output standard 2016-04-28 10:30:05 +02:00
tdfx
tegra Merge tag 'topic/drm-misc-2016-05-13' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-05-17 07:06:14 +10:00
tilcdc drm/tilcdc: use drm_crtc_send_vblank_event() 2016-05-02 17:04:59 +02:00
ttm Linux 4.6-rc7 2016-05-09 13:49:56 +10:00
udl drm/udl: Use drm_fb_helper deferred_io support 2016-05-02 16:25:55 +02:00
vc4 Merge tag 'topic/drm-misc-2016-05-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-05-05 09:56:30 +10:00
vgem drm/vgem: Drop dev->struct_mutex 2016-04-20 12:58:45 +02:00
via mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
virtio Linux 4.6-rc7 2016-05-09 13:49:56 +10:00
vmwgfx Linux 4.6-rc7 2016-05-09 13:49:56 +10:00
ati_pcigart.c
drm_agpsupport.c drm: Give drm_agp_clear drm_legacy_ prefix 2016-04-27 08:41:34 +02:00
drm_atomic_helper.c drm/atomic: Add drm_atomic_helper_best_encoder() 2016-05-11 18:55:16 +02:00
drm_atomic.c drm/atomic: use connector references (v3) 2016-05-05 12:52:05 +10:00
drm_auth.c
drm_bridge.c drm: bridge: Make (pre/post) enable/disable callbacks optional 2016-03-29 08:34:05 +02:00
drm_bufs.c drm: Hide master MAP cleanup in drm_bufs.c 2016-04-27 10:14:17 +02:00
drm_cache.c
drm_context.c
drm_crtc_helper.c drm: Make drm_encoder_helper_funcs optional 2016-05-10 08:54:09 +02:00
drm_crtc_internal.h drm/mode: rework drm_mode_object_put to drm_mode_object_unregister. 2016-04-22 10:26:37 +10:00
drm_crtc.c drm/core: Do not preserve framebuffer on rmfb, v4. 2016-05-05 13:50:53 +02:00
drm_debugfs.c
drm_dma.c
drm_dp_aux_dev.c drm/dp: Allow signals to interrupt drm_aux-dev reads/writes 2016-04-28 11:48:09 +02:00
drm_dp_dual_mode_helper.c drm: Add helper for DP++ adaptors 2016-05-09 14:05:17 +03:00
drm_dp_helper.c drm/dp_helper: Perform throw-away read before actual read in drm_dp_dpcd_read() 2016-04-22 18:52:24 +02:00
drm_dp_mst_topology.c Linux 4.6-rc7 2016-05-09 13:49:56 +10:00
drm_drv.c drm: Protect dev->filelist with its own mutex 2016-04-27 10:16:17 +02:00
drm_edid_load.c drm/edid: convert to use match_string() helper 2016-03-17 15:09:34 -07:00
drm_edid.c Linux 4.6-rc7 2016-05-09 13:49:56 +10:00
drm_encoder_slave.c
drm_fb_cma_helper.c drm/fb-cma-helper: Hook up to DocBook and fix some docs 2016-05-11 18:48:10 +02:00
drm_fb_helper.c drm/fb-helper: Remove mention of CONFIG_FB_DEFERRED_IO in docs 2016-05-11 18:47:51 +02:00
drm_flip_work.c
drm_fops.c drm: Protect dev->filelist with its own mutex 2016-04-27 10:16:17 +02:00
drm_gem_cma_helper.c dma, mm/pat: Rename dma_*_writecombine() to dma_*_wc() 2016-03-09 14:57:51 +01:00
drm_gem.c drm: Fixup locking WARN_ON mistake around gem_object_free_unlocked 2016-05-04 15:24:32 +02:00
drm_global.c
drm_hashtab.c
drm_info.c drm: Protect dev->filelist with its own mutex 2016-04-27 10:16:17 +02:00
drm_internal.h drm: Make drm_vm_open/close_locked private to drm_vm.c 2016-04-27 10:15:56 +02:00
drm_ioc32.c
drm_ioctl.c drm: Move drm_getmap into drm_bufs.c and give it a legacy prefix 2016-04-27 08:42:48 +02:00
drm_irq.c drm/core: Add drm_accurate_vblank_count, v5. 2016-05-19 14:33:10 +02:00
drm_kms_helper_common.c
drm_legacy.h drm: Move drm_getmap into drm_bufs.c and give it a legacy prefix 2016-04-27 08:42:48 +02:00
drm_lock.c
drm_memory.c
drm_mipi_dsi.c drm/dsi: Get DSI host by DT device node 2016-03-02 17:02:54 +01:00
drm_mm.c
drm_modes.c drm/mode: rework drm_mode_object_put to drm_mode_object_unregister. 2016-04-22 10:26:37 +10:00
drm_modeset_lock.c
drm_of.c
drm_panel.c drm/panel: Flesh out kerneldoc 2016-05-06 16:04:48 +02:00
drm_pci.c drm: Give drm_agp_clear drm_legacy_ prefix 2016-04-27 08:41:34 +02:00
drm_plane_helper.c
drm_platform.c
drm_prime.c
drm_probe_helper.c drm: probe_helper: Hide ugly ifdef 2016-04-20 13:35:14 +02:00
drm_rect.c
drm_scatter.c
drm_sysfs.c drm/sysfs: Annote lockless show functions with READ_ONCE 2016-04-26 13:23:24 +02:00
drm_trace_points.c
drm_trace.h
drm_vm.c drm: Make drm_vm_open/close_locked private to drm_vm.c 2016-04-27 10:15:56 +02:00
drm_vma_manager.c
Kconfig drm/mediatek: Add DRM Driver for Mediatek SoC MT8173. 2016-05-06 17:47:35 +02:00
Makefile Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued 2016-05-17 12:15:49 +02:00