linux/drivers/gpu/drm
Azhar Shaikh 516a49cc19 drm/i915: Fix assert_plane() warning on bootup with external display
On KBL, WHL RVPs, booting up with an external display connected, triggers
below warning, when the BiOS brings up the external display too.
This warning is not seen during hotplug.

[    3.615226] ------------[ cut here ]------------
[    3.619829] plane 1A assertion failure (expected on, current off)
[    3.632039] WARNING: CPU: 2 PID: 354 at drivers/gpu/drm/i915/intel_display.c:1294 assert_plane+0x71/0xbb
[    3.633920] iwlwifi 0000:00:14.3: loaded firmware version 38.c0e03d94.0 op_mode iwlmvm
[    3.647157] Modules linked in: iwlwifi cfg80211 btusb btrtl btbcm btintel bluetooth ecdh_generic
[    3.647163] CPU: 2 PID: 354 Comm: frecon Not tainted 4.17.0-rc7-50176-g655af12d39c2 #3
[    3.647165] Hardware name: Intel Corporation CoffeeLake Client Platform/WhiskeyLake U DDR4 ERB, BIOS CNLSFWR1.R00.X140.B00.1804040304 04/04/2018
[    3.684509] RIP: 0010:assert_plane+0x71/0xbb
[    3.764451] Call Trace:
[    3.766888]  intel_atomic_commit_tail+0xa97/0xb77
[    3.771569]  intel_atomic_commit+0x26a/0x279
[    3.771572]  drm_atomic_helper_set_config+0x5c/0x76
[    3.780670]  __drm_mode_set_config_internal+0x66/0x109
[    3.780672]  drm_mode_setcrtc+0x4c9/0x5cc
[    3.780674]  ? drm_mode_getcrtc+0x162/0x162
[    3.789774]  ? drm_mode_getcrtc+0x162/0x162
[    3.798108]  drm_ioctl_kernel+0x8d/0xe4
[    3.801926]  drm_ioctl+0x27d/0x368
[    3.805311]  ? drm_mode_getcrtc+0x162/0x162
[    3.805314]  ? selinux_file_ioctl+0x14e/0x199
[    3.805317]  vfs_ioctl+0x21/0x2f
[    3.813812]  do_vfs_ioctl+0x491/0x4b4
[    3.813813]  ? security_file_ioctl+0x37/0x4b
[    3.813816]  ksys_ioctl+0x55/0x75
[    3.820672]  __x64_sys_ioctl+0x1a/0x1e
[    3.820674]  do_syscall_64+0x51/0x5f
[    3.820678]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[    3.828221] RIP: 0033:0x7b5e04953967
[    3.835504] RSP: 002b:00007fff2eafb6f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[    3.835505] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007b5e04953967
[    3.835505] RDX: 00007fff2eafb730 RSI: 00000000c06864a2 RDI: 000000000000000f
[    3.835506] RBP: 00007fff2eafb720 R08: 0000000000000000 R09: 0000000000000000
[    3.835507] R10: 0000000000000070 R11: 0000000000000246 R12: 000000000000000f
[    3.879988] R13: 000056bc9dd7d210 R14: 00007fff2eafb730 R15: 00000000c06864a2
[    3.887081] Code: 48 c7 c7 06 71 a5 be 84 c0 48 c7 c2 06 fd a3 be 48 89 f9 48 0f 44 ca 84 db 48 0f 45 d7 48 c7 c7 df d3 a4 be 31 c0 e8 af a0 c0 ff <0f> 0b eb 2b 48 c7 c7 06 fd a3 be 84 c0 48 c7 c2 06 71 a5 be 48
[    3.905845] WARNING: CPU: 2 PID: 354 at drivers/gpu/drm/i915/intel_display.c:1294 assert_plane+0x71/0xbb
[    3.920964] ---[ end trace dac692f4ac46391a ]---

The warning is seen when mode_setcrtc() is called for pipeB
during bootup and before we get a mode_setcrtc() for pipeA,
while doing update_crtcs() in intel_atomic_commit_tail().
Now since, plane1A is still active after commit, update_crtcs()
is done for pipeA and eventually update_plane() for plane1A.

intel_plane_state->ctl for plane1A is not updated since set_modecrtc() is
called for pipeB. So intel_plane_state->ctl for plane 1A will be 0x0.
So doing an update_plane() for plane1A, will result in clearing
PLANE_CTL_ENABLE bit, and hence the warning.

To fix this warning, force all active planes to recompute their states
in probe.

Changes in v8:
- Actually add Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Changes in v7:
- Move call to intel_initial_commit() after sanitize_watermarks()
  Otherwise the plane update will still consult potentially bogus
  watermarks we read out from the hardware. (Ville)
- Carry Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
  from v6

Changes in v6:
- Handle EDEADLK for drm_atomic_get_crtc_state() and
  drm_atomic_add_affected_planes()
- Remove optimization of calling intel_initial_commit()
  only when there is more than one active pipe in probe.
- Avoid using intel_ types.

Changes in v5:
- Drop drm_modeset_lock_all_ctx() since locks will be taken later.

Changes in v4:
- Handle locking in intel_initial_commit()
- Move the for loop inside intel_initial_commit() so that
  drm_atomic_commit() is called only once
- Call intel_initial_commit() only for more than one active crtc on boot.
- Save the return value of intel_initial_commit() and print a message in
  case of an error

Changes in v3:
- Add comments

Changes in v2:
- Force all planes to recompute their states.(Ville Syrjälä)
- Update the commit message

Signed-off-by: Azhar Shaikh <azhar.shaikh@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1530902250-44583-1-git-send-email-azhar.shaikh@intel.com
2018-07-19 23:20:44 +03:00
..
amd Merge branch 'drm-fixes-4.17' of git://people.freedesktop.org/~agd5f/linux into drm-fixes 2018-04-26 11:08:26 +10:00
arc drm/arcpgu: remove drm_encoder_slave 2018-01-30 18:05:25 +01:00
arm drm: mali-dp: Add YUV->RGB conversion support for video layers 2018-03-14 11:41:01 +00:00
armada drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2018-03-05 20:48:25 +02:00
ast drm/ast: fix mode_valid's return type 2018-04-25 09:09:22 +02:00
atmel-hlcdc drm/atmel-hclcdc: Convert to the new generic alpha property 2018-04-16 21:20:40 +02:00
bochs drm/bochs: fix mode_valid's return type 2018-04-25 09:34:00 +02:00
bridge drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
cirrus Linux 4.16-rc7 2018-03-28 14:30:41 +10:00
etnaviv drm/etnaviv: bump HW job limit to 4 2018-03-22 11:08:48 +01:00
exynos drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
fsl-dcu
gma500 drm/gma500: fix psb_intel_lvds_mode_valid()'s return type 2018-04-25 09:38:37 +02:00
hisilicon drm/hisilicon: fix mode_valid's return type 2018-04-25 09:09:22 +02:00
i2c drm/i2c: tda998x: fix mode_valid's return type 2018-04-25 09:38:57 +02:00
i810
i915 drm/i915: Fix assert_plane() warning on bootup with external display 2018-07-19 23:20:44 +03:00
imx Linux 4.16-rc7 2018-03-28 14:30:41 +10:00
lib
mediatek drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2018-03-05 20:48:25 +02:00
meson Linux 4.16-rc7 2018-03-28 14:30:41 +10:00
mga
mgag200 drm/mgag200: fix mode_valid's return type 2018-04-25 09:09:22 +02:00
msm Merge tag 'drm-msm-fixes-2018-04-25' of git://people.freedesktop.org/~robclark/linux into drm-fixes 2018-04-26 11:09:04 +10:00
mxsfb drm/mxsfb: Use simple_display_pipe prepare_fb helper 2018-04-24 13:58:43 +02:00
nouveau Merge airlied/drm-next into drm-misc-next 2018-03-30 12:35:45 -04:00
omapdrm drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
panel drm/panel: rm68200: Add backlight dependency 2018-03-14 11:51:24 +01:00
pl111 drm/pl111: Use simple_display_pipe prepare_fb helper 2018-04-24 13:58:24 +02:00
qxl drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
r128 r128: don't open-code memdup_user() 2017-12-27 19:00:09 -05:00
radeon drm/radeon: add PX quirk for Asus K73TK 2018-04-11 13:11:50 -05:00
rcar-du drm/rcar-du: Convert to the new generic alpha property 2018-04-16 21:20:59 +02:00
rockchip drm/rockchip: psr: Remove flush by CRTC 2018-04-24 08:34:54 +02:00
savage
scheduler treewide/trivial: Remove ';;$' typo noise 2018-02-22 10:59:33 +01:00
selftests
shmobile
sis
sti drm/sti: Depend on OF rather than selecting it 2018-04-05 14:04:17 +02:00
stm drm/stm: ltdc: fix warning in ltdc_crtc_update_clut() 2018-04-19 12:24:45 +02:00
sun4i drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
tdfx
tegra drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
tilcdc drm/tilcdc: tilcdc_panel: Rename device from "panel" to "tilcdc-panel" 2018-02-28 11:48:25 +02:00
tinydrm drm: Move simple_display_pipe prepare_fb helper into gem fb helpers 2018-04-24 13:57:22 +02:00
ttm drm/ttm: Export the ttm_k[un]map_atomic_prot API. 2018-03-22 11:10:06 +01:00
tve200 drm/tve200: Use simple_display_pipe prepare_fb helper 2018-04-24 13:58:06 +02:00
udl drm/udl: fix mode_valid's return type 2018-04-25 09:09:22 +02:00
vc4 drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
vgem
via
virtio drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
vmwgfx drm/vmwgfx: Remove no-op prepare/cleanup_fb callbacks 2018-04-24 13:57:11 +02:00
xen drm/xen-front: use simple display pipe prepare_fb helper 2018-04-24 14:02:53 +02:00
zte drm/zte: Stop consulting plane->crtc 2018-03-29 19:14:21 +03:00
Kconfig drm/xen-front: Add support for Xen PV display frontend 2018-04-03 14:41:48 +03:00
Makefile drm/xen-front: Add support for Xen PV display frontend 2018-04-03 14:41:48 +03:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic.c Merge drm/drm-next into drm-intel-next-queued 2018-05-02 12:20:32 +03:00
drm_atomic_helper.c drm/atomic: Add sanity checks to drm_atomic_helper_async_commit() 2018-04-18 09:06:16 +02:00
drm_auth.c drm: Check for lessee in DROP_MASTER ioctl 2018-01-31 09:27:51 +01:00
drm_blend.c drm/blend: Add a generic alpha property 2018-04-16 21:17:29 +02:00
drm_bridge.c
drm_bufs.c drm: dma_bufs: Fixed checkpatch issues 2018-03-19 09:31:20 -04:00
drm_cache.c
drm_color_mgmt.c kernel.h: Retain constant expression output for max()/min() 2018-04-05 14:17:16 -07:00
drm_connector.c drm/docs: Document "scaling mode" property better 2018-02-20 12:10:46 +01:00
drm_context.c
drm_crtc.c drm: Use plane->state->fb over plane->fb 2018-03-29 19:14:21 +03:00
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h drm: Don't EXPORT drm_add/reset_display_info 2018-04-24 21:34:53 +02:00
drm_debugfs.c
drm_debugfs_crc.c drm/crc: Add support for polling on the data fd. 2018-02-05 13:22:44 +01:00
drm_dma.c
drm_dp_aux_dev.c sched/wait, drivers/drm: Convert wait_on_atomic_t() usage to the new wait_var_event() API 2018-03-20 08:23:18 +01:00
drm_dp_dual_mode_helper.c drm/i915: Fix LSPCON TMDS output buffer enabling from low-power state 2018-04-18 16:33:14 +03:00
drm_dp_helper.c drm/dp: Add HBR3 support in existing DRM DP helpers 2018-01-26 13:36:53 +02:00
drm_dp_mst_topology.c drm/dp/mst: Fix off-by-one typo when dump payload table 2018-03-28 09:12:16 +03:00
drm_drv.c drm: Use srcu to protect drm_device.unplugged 2018-03-29 13:19:20 +03:00
drm_dumb_buffers.c
drm_edid.c drm-misc-next for v4.18: 2018-04-30 09:32:43 +10:00
drm_edid_load.c
drm_encoder.c drm: Warn if plane/crtc/encoder/connector index exceeds our 32bit bitmasks 2018-01-29 18:46:53 +02:00
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c drm: Remove now pointelss blob->data casts 2018-03-16 15:44:01 +02:00
drm_file.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
drm_flip_work.c
drm_fourcc.c drm/fourcc: Add a alpha field to drm_format_info 2018-01-29 12:07:47 +01:00
drm_framebuffer.c drm: Reshuffle getfb error returns 2018-03-30 17:54:27 +01:00
drm_gem.c drm/i915: Prevent writing into a read-only object via a GGTT mmap 2018-07-13 16:14:04 +01:00
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c drm: Move simple_display_pipe prepare_fb helper into gem fb helpers 2018-04-24 13:57:22 +02:00
drm_global.c
drm_hashtab.c
drm_info.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c drm: Print the pid when debug logging an ioctl error. 2018-02-10 22:23:10 +00:00
drm_irq.c
drm_kms_helper_common.c
drm_lease.c gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry 2018-03-26 10:38:06 +02:00
drm_legacy.h
drm_lock.c
drm_memory.c drm: fix drm_get_max_iomem type mismatch 2018-02-22 11:18:58 -05:00
drm_mipi_dsi.c drm/dsi: Fix improper use of mipi_dsi_device_transfer() return value 2018-01-16 17:10:14 -05:00
drm_mm.c Linux 4.16-rc7 2018-03-28 14:30:41 +10:00
drm_mode_config.c Linux 4.15-rc4 2017-12-19 21:37:24 +10:00
drm_mode_object.c
drm_modes.c drm: Fix uabi regression by allowing garbage mode->type from userspace 2018-03-23 13:51:12 +02:00
drm_modeset_helper.c
drm_modeset_lock.c drm/atomic: Call ww_acquire_done after drm_modeset_lock_all 2018-03-05 10:35:32 +01:00
drm_of.c drm: of: simplify component probe code 2018-03-06 14:05:00 +05:30
drm_panel.c
drm_panel_orientation_quirks.c drm: panel-orientation-quirks: Add quirk for Lenovo Ideapad Mixx 320 2018-04-24 13:43:45 +02:00
drm_pci.c
drm_plane.c drm: Use plane->state->fb over plane->fb 2018-03-29 19:14:21 +03:00
drm_plane_helper.c drm: Don't pass clip to drm_atomic_helper_check_plane_state() 2018-03-05 20:48:25 +02:00
drm_prime.c drm: add parameter explanation for some gem dmabuf_ops 2018-03-28 15:10:28 -05:00
drm_print.c drm: Reduce object size of DRM_DEV_<LEVEL> uses 2018-03-19 15:15:42 +01:00
drm_probe_helper.c Linux 4.16-rc7 2018-03-28 14:30:41 +10:00
drm_property.c Revert "drm: Use a flexible array member for blob property data" 2018-03-16 15:44:01 +02:00
drm_rect.c
drm_scatter.c
drm_scdc_helper.c drm/scdc-helper: Convert errors into debug messages 2018-03-26 21:37:24 +03:00
drm_simple_kms_helper.c drm/simple-kms-helper: Plumb plane state to the enable hook 2018-03-28 19:19:32 +03:00
drm_syncobj.c drm: Use idr_init_base(1) when using id==0 for invalid 2018-02-19 12:21:24 +00:00
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c Merge tag 'drm-intel-next-2018-03-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2018-03-14 14:53:01 +10:00
drm_vm.c
drm_vma_manager.c