From owner-freebsd-x11@freebsd.org Tue Apr 25 12:27:02 2017 Return-Path: Delivered-To: freebsd-x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 524E8D4E277 for ; Tue, 25 Apr 2017 12:27:02 +0000 (UTC) (envelope-from isoa@kapsi.fi) Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:1bc8:1004::1:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E9D8E06 for ; Tue, 25 Apr 2017 12:27:02 +0000 (UTC) (envelope-from isoa@kapsi.fi) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Type:MIME-Version:Date:Message-ID:Subject:From:To; bh=4GcCUUTAx5N1+eZaQv06+mVTJ6DavmBstAHUOmVttEQ=; b=h0txzPjaVPGwD9KbUdHl0WM5bOISTvwxJ+FQtWz7K8Nw3rR6yToAyO2gAQCekE8d6tPo9cS3qbiUy91TMLzSVS04Y1lc31jPyPG3tqaaZXaD/wFskB0P8xUqt1qO/UMWshnsIEq8nL5OvW1rVuOR7qTjfpZ3b14cYOtmKrGjy7WOhnXjAYgxA2Dphu4QT+xru6y213AQ1pT51xdijwvPKf9tcfwaZE738JHROltlFFZppLW+GJ9AC/nY2mwRfTa+O/9YorNp3+WfpsIpHLQPNbO4gpBdwAPmafiPEpp54EFXYa3ISF+vnSSYlIGrvx7l2xpEnHm+xsCp23rlHSnd6A==; Received: from dsl-jklbng11-54fa5a-206.dhcp.inet.fi ([84.250.90.206] helo=[192.168.255.112]) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1d2zYZ-0007dR-0U for freebsd-x11@freebsd.org; Tue, 25 Apr 2017 15:26:59 +0300 To: freebsd-x11@freebsd.org From: Arto Pekkanen Subject: The Intel driver updates broke TearFree option at some point, here is a workaround Message-ID: <37a7d2b3-d56e-746b-edfc-98259404a3ff@kapsi.fi> Date: Tue, 25 Apr 2017 15:26:50 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tBAL0wud0I7A85fL95NA2kdB3lOMqitQ4" X-SA-Exim-Connect-IP: 84.250.90.206 X-SA-Exim-Mail-From: isoa@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2017 12:27:02 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tBAL0wud0I7A85fL95NA2kdB3lOMqitQ4 Content-Type: multipart/mixed; boundary="8LvmAXs4a1Q5dF47bWFj0GmWDjFx9QwEL"; protected-headers="v1" From: Arto Pekkanen To: freebsd-x11@freebsd.org Message-ID: <37a7d2b3-d56e-746b-edfc-98259404a3ff@kapsi.fi> Subject: The Intel driver updates broke TearFree option at some point, here is a workaround --8LvmAXs4a1Q5dF47bWFj0GmWDjFx9QwEL Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable So, I updated base system and ports weekly, and at some point I found out that while playing videos full screen, the video would jump back to some previously played frame every now and then. My X.org was configured as such: Section "Device" Driver "intel" Option "AccelMethod" "SNA" Option "TearFree" "True" EndSection The above configuration previously yield a tear-free VSynced video output with all applications (including video playback via VAAPI). But this broke, and video playback started flickering with some video player applications, namely mpv. After mucking around I realized that the TearFree option is NOT even listed in the current intel man page! You can see it for yourself, no TearFree option there. I dug around in Google, and it seem the option has been deprecated for quite some time. The reasoning for this deprecation mostly seems to be that it should be up to the application to use VSync, either via OpenGL extensions (which there are at least 3) or by using the DRI specific device IOCTLs. Unfortunately, mpv and many other video players do not VSync. They just =2E.. don't. Probably the developers decided that it was up to graphics drivers and/or X.org. Yet again, drivers devs think one thing, app devs think other. And thing break horribly for the end user. My brilliant and simple solution has been deemed obsolete yet again by the Linux graphics driver developers. I was not pleased. Then I decided to fix the problem with a standard method used in most Linuxen: run a compositor, and let compositor do VSync for you. Thus, I reconfigured file /usr/local/etc/X11/xorg.conf.d/10-intel.conf Section "Device" Driver "intel" Option "AccelMethod" "SNA" EndSection Use SNA, no TearFree. The default in FreeBSD is UXA, and we don't want that, SNA works better for IGPUs in Sandy Bridge and newer. Then as root: pkg install compton Then I created configuration for Compton, file ~/.compton.conf backend =3D "glx"; paint-on-overlay =3D true; glx-swap-method =3D 1; glx-no-stencil =3D true; sw-opti =3D true; vsync =3D "opengl-mswc"; shadow =3D false; fading =3D false; unredir-if-possible =3D true; Then I just restarted X (pkill xorg) After this the Compton compositor will buffer every frame from every application and sync them on vertical blank. Basically the same as TearFree, but CPU usage is a bit higher. --=20 Arto Pekkanen --8LvmAXs4a1Q5dF47bWFj0GmWDjFx9QwEL-- --tBAL0wud0I7A85fL95NA2kdB3lOMqitQ4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlj/QI4ACgkQTBivhqtJa26RHQEAuVW3j9ewlCC9MRzfIYqH1mvY 0Vmrz0sufibG8dpQEEIBAJ2A5Az83V6BnzyAkmYLEBffNsg3s45eO3gHKfvkTjIg =UUph -----END PGP SIGNATURE----- --tBAL0wud0I7A85fL95NA2kdB3lOMqitQ4--