From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher James Halse Rogers Subject: Re: [PATCH 1/3] drm: Send pending vblank events before disabling vblank. Date: Thu, 28 Apr 2011 18:09:58 +1000 Message-ID: <1303978198.7048.28.camel@Ed> References: <1303884659-739-1-git-send-email-christopher.halse.rogers@canonical.com> <1303893156.5633.126.camel@thor.local> <1303894719.15750.13.camel@Ed> <1303895309.5633.137.camel@thor.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1554219188==" Return-path: Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by gabe.freedesktop.org (Postfix) with ESMTP id 750D79E8C3 for ; Thu, 28 Apr 2011 01:10:07 -0700 (PDT) In-Reply-To: <1303895309.5633.137.camel@thor.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Michel =?ISO-8859-1?Q?D=E4nzer?= Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1554219188== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-sLCciYh70y3dFDpYnpKl" --=-sLCciYh70y3dFDpYnpKl Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2011-04-27 at 11:08 +0200, Michel D=C3=A4nzer wrote: > On Mit, 2011-04-27 at 18:58 +1000, Christopher James Halse Rogers > wrote:=20 > > On Wed, 2011-04-27 at 10:32 +0200, Michel D=C3=A4nzer wrote: > > > On Mit, 2011-04-27 at 16:10 +1000, christopher.halse.rogers@canonical= .com wrote: > > > > From: Christopher James Halse Rogers > > > >=20 > > > > This is the least-bad behaviour. It means that we signal the > > > > vblank event before it actually happens, but since we're disabling > > > > vblanks there's no guarantee that it will *ever* happen otherwise. > > >=20 > > > This may indeed be the best we can do for events that are pending whe= n > > > the CRTC is disabled[0], but I can't see anything that would prevent = new > > > events from getting scheduled (or synchronous vblank waits from timin= g > > > out) while the CRTC is disabled? > > >=20 > > > [0] Though it might unnecessarily send events prematurely when the CR= TC > > > is just disabled temporarily, e.g. as part of a modeset. > > >=20 > > >=20 > > > Also, this patch won't seem to help at all for other drivers which do= n't > > > call drm_vblank_off() directly when disabling a CRTC. > >=20 > > This is true. On the other hand, the other drivers don't wedge the > > vblank code into a state where vblanks cannot be re-enabled. So it's > > only a problem when disabling one of 2+ monitors on those drivers, >=20 > And with DPMS? >=20 > > whereas it's easily triggerable on single monitor systems on intel.=20 >=20 > Anyway, this patch is probably good at least as a preliminary fix for > the inconsistent vblank state with the intel driver. >=20 >=20 > > > Maybe it would be possible to move those calls to core code, and/or o= nly > > > force sending out events when the CRTC isn't just getting disabled > > > temporarily. > > >=20 > >=20 > > As in: have the core modesetting code call drm_vblank_off before making > > the driver-specific calls when disabling a crtc? I'll look into it - > > that would appear to be a more general solution. >=20 > Yeah, something like that, thanks. >=20 Ok. This appears to be surprisingly difficult. Particularly, the vblank code indexes crtcs based on the driver-private numbering, and there doesn't appear to be a generic interface to grab this number; Intel uses the DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID ioctl, radeon uses something different. I'll see what I can come up with, but I don't think I'm sufficiently familiar with the kms code to quickly come up with a nice API. --=-sLCciYh70y3dFDpYnpKl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAABCAAGBQJNuSDWAAoJEBUHnPSAqAygM0AIALDcVWAmQ6axqC5bDB731yjQ iAAr6UMn9bW77nf87/xW/EdtKgx/FTR54daNmhC69fRS4TcJbq7H/KfTs4u6N212 GMTH57X2X9whBWtiKDgkkQwOdZ1NUIIsraip18mZm7yA3qVd4Wn9KZQX5NboRisH PkM9raPtixkoF9v5qU05KCKYKpzjocGtW7hsrAtyOLVFKnqCMDcaJqcF9NB9n98m lsWkKWXFhyEiATTvyV10N9NZg/C6xHkexNv5xSszaru8pJGtjao1ZZrS8WI7CrZt LkwKMYFjKHfImMXayY5aKjc4cyJ88RYTPtQxYOHnLTyROaX3F+6Acz3xj1Klw+8= =/cQb -----END PGP SIGNATURE----- --=-sLCciYh70y3dFDpYnpKl-- --===============1554219188== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1554219188==--