Bug 85974 - [hsw] flip hangs
Summary: [hsw] flip hangs
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-06 17:14 UTC by Nicola
Modified: 2017-07-24 22:50 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Nicola 2014-11-06 17:14:47 UTC
xorg 1.16.1
xf86-video-intel 2.99.916
kernel 3.17.2

lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)

xvinfo 
X-Video Extension version 2.2
screen #0
  Adaptor #0: "Intel(R) Textured Video"
    number of ports: 16

so I can have at most 16 xvideo ports

with 16 xvideo ports active if I request another one (using for example a gstreamer pipeline or with vlc) the system hangs. I have no trace in dmesg.

I'm sure that with older chip (gen2) and with older drivers I simply get an error message saying that a new xvideo window cannot be open. This seems better than a system hangs :-)

Can I ask why there is such limit about xvideo ports? On my hw I can use a gstreamer app that open 16 xvideo windows (xvimagesink) with 16 full hd video (I send 1920x1080 yuv frame to 16 concurrent xvimagesink gstreamer plugin) but I cannot open 17 xvideo windows showing 160x120 videos. What is the rationale behind this?
Comment 1 Chris Wilson 2014-11-07 07:42:27 UTC
The issue is that we preallocate the number of ports, and that limit is going to be fixed for the client lifetime (even if we did reallocate on the fly).

16 is just an arbitrary value.

I haven't reproduced any system hang trying to use the 17th port. Could you please try and see if it generates any logging at all? The check against number of ports is part of the core Xserver code.
Comment 2 Nicola 2014-11-07 08:27:31 UTC
here is the trace

[ 1981.282910] ------------[ cut here ]------------
[ 1981.282959] WARNING: CPU: 0 PID: 373 at drivers/gpu/drm/i915/intel_display.c:3361 intel_crtc_wait_for_pending_flips+0x1a1/0x1b0 [i915]()
[ 1981.282961] Modules linked in: tun bnep bluetooth fuse act_police cls_basic cls_flow cls_fw cls_u32 sch_fq_codel sch_tbf sch_prio sch_htb sch_hfsc sch_ingress sch_sfq xt_CHECKSUM ipt_rpfilter xt_statistic xt_CT nf_log_ipv4 nf_log_common xt_connlimit xt_realm xt_addrtype xt_comment xt_recent snd_hda_codec_hdmi xt_nat ipt_REJECT ipt_MASQUERADE ipt_ECN ipt_CLUSTERIP ipt_ah xt_set ip_set xt_LOG 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 ts_kmp nf_conntrack_amanda nf_conntrack_sane nf_conntrack_tftp nf_conntrack_sip nf_conntrack_proto_udplite nf_conntrack_proto_sctp nf_conntrack_pptp nf_conntrack_proto_gre nf_conntrack_netlink nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_irc nf_conntrack_h323 nf_conntrack_ftp
[ 1981.282999]  xt_TPROXY nf_defrag_ipv6 xt_time xt_TCPMSS xt_tcpmss xt_sctp xt_policy xt_pkttype xt_physdev xt_owner xt_NFQUEUE xt_NFLOG nfnetlink_log xt_multiport xt_mark xt_mac xt_limit xt_length xt_iprange xt_helper xt_hashlimit xt_DSCP xt_dscp xt_dccp xt_conntrack xt_connmark xt_CLASSIFY xt_tcpudp xt_state iptable_raw iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack iptable_mangle nfnetlink hid_generic uvcvideo cdc_mbim videobuf2_vmalloc videobuf2_memops videobuf2_core usbhid v4l2_common videodev cdc_ncm usbnet mii cdc_wdm hid cdc_acm media joydev mousedev iptable_filter ip_tables x_tables arc4 snd_hda_codec_realtek snd_hda_codec_generic coretemp intel_rapl x86_pkg_temp_thermal intel_powerclamp kvm_intel iwlmvm kvm mac80211 crct10dif_pclmul crc32_pclmul crc32c_intel
[ 1981.283040]  iTCO_wdt iTCO_vendor_support ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper evdev cryptd mac_hid psmouse iwlwifi serio_raw pcspkr i2c_i801 rtsx_pci_ms thermal memstick cfg80211 wmi thinkpad_acpi nvram led_class hwmon battery tpm_tis ac tpm rfkill i915 button snd_hda_intel video snd_hda_controller drm_kms_helper snd_hda_codec drm snd_hwdep snd_pcm e1000e snd_timer intel_gtt i2c_algo_bit snd i2c_core mei_me ie31200_edac mei soundcore ptp shpchp edac_core pps_core lpc_ich processor pci_stub vboxpci(O) vboxnetflt(O) vboxnetadp(O) vboxdrv(O) rtsx_pci_sdmmc mmc_core atkbd libps2 ehci_pci xhci_hcd ehci_hcd rtsx_pci usbcore usb_common i8042 serio ext4 crc16 mbcache sr_mod cdrom jbd2 sd_mod crc_t10dif crct10dif_common ahci libahci libata scsi_mod
[ 1981.283096] CPU: 0 PID: 373 Comm: Xorg.bin Tainted: G        W  O   3.17.2-1-ARCH #1
[ 1981.283098] Hardware name: LENOVO 20BE0065IX/20BE0065IX, BIOS GMET66WW (2.14 ) 07/01/2014
[ 1981.283099]  0000000000000000 000000001f153aca ffff8800a9123c28 ffffffff815367d0
[ 1981.283102]  0000000000000000 ffff8800a9123c60 ffffffff8107054d 0000000000000000
[ 1981.283105]  ffff88022dcf8288 ffff880232f81000 ffff8800aa975800 ffff8800aa975800
[ 1981.283108] Call Trace:
[ 1981.283114]  [<ffffffff815367d0>] dump_stack+0x4d/0x6f
[ 1981.283120]  [<ffffffff8107054d>] warn_slowpath_common+0x7d/0xa0
[ 1981.283123]  [<ffffffff8107067a>] warn_slowpath_null+0x1a/0x20
[ 1981.283142]  [<ffffffffa049a291>] intel_crtc_wait_for_pending_flips+0x1a1/0x1b0 [i915]
[ 1981.283147]  [<ffffffff810af6a0>] ? __wake_up_sync+0x20/0x20
[ 1981.283163]  [<ffffffffa049a348>] intel_primary_plane_disable+0xa8/0xe0 [i915]
[ 1981.283179]  [<ffffffffa03bba02>] setplane_internal+0x192/0x2b0 [drm]
[ 1981.283192]  [<ffffffffa03ba1c9>] ? _object_find+0x69/0xa0 [drm]
[ 1981.283206]  [<ffffffffa03bf0e5>] drm_mode_setplane+0x145/0x1e0 [drm]
[ 1981.283218]  [<ffffffffa03b0fcf>] drm_ioctl+0x1df/0x680 [drm]
[ 1981.283228]  [<ffffffff811de2da>] ? __dentry_kill+0x17a/0x200
[ 1981.283231]  [<ffffffff811e6a38>] ? mntput_no_expire+0x28/0x140
[ 1981.283235]  [<ffffffff811d9eb0>] do_vfs_ioctl+0x2d0/0x4b0
[ 1981.283238]  [<ffffffff811e453e>] ? __fget+0x6e/0xb0
[ 1981.283241]  [<ffffffff811da111>] SyS_ioctl+0x81/0xa0
[ 1981.283245]  [<ffffffff8153c7a9>] system_call_fastpath+0x16/0x1b
[ 1981.283246] ---[ end trace 40e5800abe4f2d8b ]---
[ 1981.302708] [drm:intel_pipe_set_base] *ERROR* pipe is still busy with an old pageflip



I have an additional display connected to my laptop, maybe this can make some difference.

Regarding the limit, since it is arbitrary, probably make sense to raise to something like 32 at least for modern hw, for example the same laptop with windows OS can display more than 16 videos using direct3d
Comment 3 Chris Wilson 2014-11-07 09:15:40 UTC
Ah, the lockup is just a coincidence. Sure I can bump the limit, just not sure what a more sensible value is. 64k? ;-)
Comment 4 Nicola 2014-11-07 09:24:31 UTC
a coincidence that often happen when I forgot the limit and I ask for more than 16 ports :-)

Regarding the limit 64k is a good value :-) Most nvidia hw use 32. Based on my experience generally 16 ports are good for a single monitor, so if a graphics card support 3 monitor the limit should be 16*3. Most video walls systems supports 16 video per monitor. This can change with 4k monitors
Comment 5 Chris Wilson 2014-11-07 09:58:50 UTC
Tricky, I can't just pick num_outputs * 3 as we may be in a headless environment. Oh well, there is no reason not to bump the value for modern systems:

commit ab6680375cc6d5efebe8e40816d1906b15678d6e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Nov 7 09:54:35 2014 +0000

    sna/xv: Give the illusion of hardware progress
    
    The number of ports we provide for Xv textured video is arbitrary. The
    main cost is reservation of a number of XIDs and preallocation of a
    block of memory. Whatever value we pick, someone will always want
    more...
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=85974
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 6 Nicola 2014-11-07 10:33:40 UTC
I applied the patch, on my hw the limit is now 32 and I confirm that I can open 32 xvideo windows, thanks!

Regarding the trace, I think it show up when I tryed "systemctl gdm restart" before no trace but the system was no usable (mouse pointer move but the click on any window do nothing)
Comment 7 Jani Nikula 2015-02-12 12:02:25 UTC
Seems to be fixed, thanks for the report.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.