From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PULL] topic/vblank-rework, take 2 Date: Wed, 8 Oct 2014 15:21:50 +0200 Message-ID: <20141008132148.GA32477@ulmo> References: <20140912074859.GA30934@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0917187268==" Return-path: In-Reply-To: <20140912074859.GA30934@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Daniel Vetter , Ville =?utf-8?B?U3lyasOkbMOk?= Cc: Joonyoung Shim , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Inki Dae , Andrzej Hajda , Benjamin Gaignard , Russell King List-Id: intel-gfx@lists.freedesktop.org --===============0917187268== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LwW0XdcUbUexiWVK" Content-Disposition: inline --LwW0XdcUbUexiWVK Content-Type: multipart/mixed; boundary="TRYliJ5NKNqkz5bu" Content-Disposition: inline --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 12, 2014 at 09:48:59AM +0200, Daniel Vetter wrote: [...] > Ville Syrj=C3=A4l=C3=A4 (16): > drm: Always reject drm_vblank_get() after drm_vblank_off() This particular commit seems to be wreaking havoc. Inki already reported this at some point and Andrzej and Joonyoung tried to fix this on Exynos already, but it seems like a couple more drivers would suffer from this. At least those using drm_vblank_off() but not drm_vblank_on() would see the same issue. A quick grep indicate that Armada, Exynos, GMA500 and STI would all suffer from the same problem. Adding the respective maintainers. I've used the attached patch to fix the issue on Tegra. Ville, does that conversion look right? Perhaps it would be safer to call drm_crtc_vblank_on() before activating the CRTC to avoid a potential race? It seems like drm_vblank_on() and drm_vblank_off() would replace drm_vblank_{pre,post}_modeset() completely, so I've removed them as part of the patch as well. I suppose the attached patch and equivalent ones for the other drivers would need to be carried in this series to avoid regressions. Thierry --TRYliJ5NKNqkz5bu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="0001-drm-tegra-dc-Add-missing-call-to-drm_vblank_on.patch" Content-Transfer-Encoding: quoted-printable =46rom 1b7539953054f8f4b102570c21ddee36a65f4a06 Mon Sep 17 00:00:00 2001 =46rom: Thierry Reding Date: Wed, 8 Oct 2014 14:48:51 +0200 Subject: [PATCH] drm/tegra: dc: Add missing call to drm_vblank_on() When the CRTC is enabled, make sure the VBLANK machinery is enabled. Failure to do so will cause drm_vblank_get() to not enable the VBLANK on the CRTC and VBLANK-synchronized page-flips won't work. While at it, get rid of the legacy drm_vblank_pre_modeset() and drm_vblank_post_modeset() calls that are replaced by drm_vblank_on() and drm_vblank_off(). Reported-by: Alexandre Courbot Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/dc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 2bc344b1fcd5..2aeaa4960d21 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -741,7 +741,6 @@ static const struct drm_crtc_funcs tegra_crtc_funcs =3D= { =20 static void tegra_crtc_disable(struct drm_crtc *crtc) { - struct tegra_dc *dc =3D to_tegra_dc(crtc); struct drm_device *drm =3D crtc->dev; struct drm_plane *plane; =20 @@ -757,7 +756,7 @@ static void tegra_crtc_disable(struct drm_crtc *crtc) } } =20 - drm_vblank_off(drm, dc->pipe); + drm_crtc_vblank_off(crtc); } =20 static bool tegra_crtc_mode_fixup(struct drm_crtc *crtc, @@ -846,8 +845,6 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, u32 value; int err; =20 - drm_vblank_pre_modeset(crtc->dev, dc->pipe); - err =3D tegra_crtc_setup_clk(crtc, mode); if (err) { dev_err(dc->dev, "failed to setup clock for CRTC: %d\n", err); @@ -948,7 +945,7 @@ static void tegra_crtc_commit(struct drm_crtc *crtc) value =3D GENERAL_ACT_REQ | WIN_A_ACT_REQ; tegra_dc_writel(dc, value, DC_CMD_STATE_CONTROL); =20 - drm_vblank_post_modeset(crtc->dev, dc->pipe); + drm_crtc_vblank_on(crtc); } =20 static void tegra_crtc_load_lut(struct drm_crtc *crtc) --=20 2.1.0 --TRYliJ5NKNqkz5bu-- --LwW0XdcUbUexiWVK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUNTpsAAoJEN0jrNd/PrOhWTQP/jwl4Z2WTnEkLAm2x432BXUk yD6tdAYydX02LDNe8aoSL11o9ReuKbQaG6MYvg8fV9Czp8U3VPuSxhkta6c5K21G xkkLKChY9o8NWBoL6iAzU5MGHrOQ8hJr0m7XF2Hxz6f7rp25GBkVh4s3nnH7i0aD o6H832l4Q2X21VpPHM0Sge9JACjYofF/YqnVq1n1rt1LBELcK9jpQqU7INpELnFc 4MOUZoQtTAKEFaGOx8S80o64t0zu86ZJo69BIenAMYjTFwGP+8GA/i6L9aBNpc/M SwlK+dgZPDB7DQhf/IcrQx0Ydf8Sw7ciZK18Xr9xlCDCfTZ9KoZ4JXhNStwDtyLC Pd0xpbLP8DuSDF1pwP+IGcLxetwFeQzzEBfs0PeNLCBnadCPCSwg5ziOBg/oNAK3 p/ypmb5yTMCZ+PRmcRmkwSanENQaiJMXPREyyWYIaBKryF1IhuavG7f0k0jJMKSy tn2Dl+jA7grys0Ye82tlUVNZrtlJLD9AgOzP3bLgAKwBjMSceb/C6AGmHl/NZV2E sOJqLs0lJcgqcaBsKEaFPzJ+ImkJYdWlmA2Tqunuxfr0SNarC+mNOVRuHSOTfsqe zxlILnDBCH4M5a5pudVC5LB5ZuIBi0eF6uZlUM9itv3Z0ECRaLbNJUTDMplZ6tnK AowoZZUkxv7ynI7oF7O1 =/+iE -----END PGP SIGNATURE----- --LwW0XdcUbUexiWVK-- --===============0917187268== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0917187268==--