Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Apr 2017 15:46:36 +0300
From:      Arto Pekkanen <isoa@kapsi.fi>
To:        freebsd-x11@freebsd.org
Subject:   Re: The Intel driver updates broke TearFree option at some point, here is a workaround
Message-ID:  <aa8d03f1-5543-0405-10fb-1aa68a2440b1@kapsi.fi>
In-Reply-To: <37a7d2b3-d56e-746b-edfc-98259404a3ff@kapsi.fi>
References:  <37a7d2b3-d56e-746b-edfc-98259404a3ff@kapsi.fi>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--JpIOw5V0J02koQd9daH3nhRjHjIovwggt
Content-Type: multipart/mixed; boundary="Uw4lRfVucQlLqO9KlmP4G30Fukalof9lF";
 protected-headers="v1"
From: Arto Pekkanen <isoa@kapsi.fi>
To: freebsd-x11@freebsd.org
Message-ID: <aa8d03f1-5543-0405-10fb-1aa68a2440b1@kapsi.fi>
Subject: Re: The Intel driver updates broke TearFree option at some point,
 here is a workaround
References: <37a7d2b3-d56e-746b-edfc-98259404a3ff@kapsi.fi>
In-Reply-To: <37a7d2b3-d56e-746b-edfc-98259404a3ff@kapsi.fi>

--Uw4lRfVucQlLqO9KlmP4G30Fukalof9lF
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Oh yeah I forgot to mention that you also need to start compton with:
compton -b

Add the above command to your .xinitrc

On 25.4.2017 15:26, Arto Pekkanen wrote:
> 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.
>=20
> My X.org was configured as such:
>=20
> Section "Device"
>     Driver "intel"
>     Option "AccelMethod" "SNA"
>     Option "TearFree" "True"
> EndSection
>=20
> 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 playe=
r
> applications, namely mpv.
>=20
> 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.
>=20
> Unfortunately, mpv and many other video players do not VSync. They just=

> ... don't. Probably the developers decided that it was up to graphics
> drivers and/or X.org.
>=20
> Yet again, drivers devs think one thing, app devs think other. And thin=
g
> 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.
>=20
> 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.
>=20
> Thus, I reconfigured file /usr/local/etc/X11/xorg.conf.d/10-intel.conf
>=20
> Section "Device"
>     Driver "intel"
>     Option "AccelMethod" "SNA"
> EndSection
>=20
> 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.
>=20
> Then as root:
> pkg install compton
>=20
> 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;
>=20
> Then I just restarted X (pkill xorg)
>=20
> 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

--=20
Arto Pekkanen


--Uw4lRfVucQlLqO9KlmP4G30Fukalof9lF--

--JpIOw5V0J02koQd9daH3nhRjHjIovwggt
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/RS8ACgkQTBivhqtJa2493gD+IOcwXyGlk80Wk2/DAjduMFgL
+RTa/3JnKktDVbXS3iwA/0fPvmD2tM8Q66H3TWHg6M+Oa408Ymua4wJT8STPgF2D
=I5fO
-----END PGP SIGNATURE-----

--JpIOw5V0J02koQd9daH3nhRjHjIovwggt--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?aa8d03f1-5543-0405-10fb-1aa68a2440b1>