From: Eric Anholt Subject: Re: [RFC PATCH xserver] modesetting: re-set the crtc's mode when link-status goes BAD Date: Sun, 02 Apr 2017 19:21:09 -0700 Message-ID: <87efxamdt6.fsf@eliezer.anholt.net> References: <20170126123728.5680-1-martin.peres@linux.intel.com> <155d45ba-503f-786d-943d-6ebc13fb2d82@linux.intel.com> <8737due0ws.fsf@eliezer.anholt.net> <20170331005048.GM31477@intel.com> <87d1cxw6nq.fsf@eliezer.anholt.net> <20170331201713.GO31477@intel.com> <87vaqp564u.fsf@eliezer.anholt.net> <20170402122809.trh7oxzz25oao4bu@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1208610299==" Return-path: In-Reply-To: <20170402122809.trh7oxzz25oao4bu-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xorg-devel-bounces-go0+a7rfsptAfugRpC6u6w@public.gmane.org Sender: "xorg-devel" To: Daniel Vetter Cc: Manasi Navare , xorg-devel-go0+a7rfsptAfugRpC6u6w@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: dri-devel@lists.freedesktop.org --===============1208610299== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Daniel Vetter writes: > On Fri, Mar 31, 2017 at 05:22:09PM -0700, Eric Anholt wrote: >> Manasi Navare writes: >>=20 >> > On Fri, Mar 31, 2017 at 01:08:41PM -0700, Eric Anholt wrote: >> >> Manasi Navare writes: >> >>=20 >> >> > On Thu, Mar 30, 2017 at 05:37:55PM -0700, Eric Anholt wrote: >> >> >> Martin Peres writes: >> >> >>=20 >> >> >> > On 26/01/17 14:37, Martin Peres wrote: >> >> >> >> Despite all the careful planing of the kernel, a link may become >> >> >> >> insufficient to handle the currently-set mode. At this point, t= he >> >> >> >> kernel should mark this particular configuration as being broken >> >> >> >> and potentially prune the mode before setting the offending con= nector's >> >> >> >> link-status to BAD and send the userspace a hotplug event. This= may >> >> >> >> happen right after a modeset or later on. >> >> >> >> >> >> >> >> When available, we should use the link-status information to re= set >> >> >> >> the wanted mode. >> >> >> >> >> >> >> >> Signed-off-by: Martin Peres >> >> >> > >> >> >> > The relevant kernel patches have landed in drm-tip about a month= ago. >> >> >> > >> >> >> > Eric, would you mind providing feedback on or merging this patch? >> >> >>=20 >> >> >> The later discussion has sounded like the kernel will (always) pru= ne the >> >> >> mode when we re-query, meaning that it doesn't make any sense to t= ry to >> >> >> re-set to the old mode. Is this not the case? >> >> > >> >> > >> >> > No the kernel will simply send a hotplug with link status as bad >> >> > and then after that point its userspace driver's responsibility >> >> > to check if link status is BAD, retry the same mode and if it fails >> >> > then re probe. >> >>=20 >> >> So the kernel will sometimes allow the same mode to be re-set with the >> >> same bpp? >> > >> > So when userspace driver re-sets the same mode, the kernel will call t= he >> > mode valid function where it will see it can allow the sam mode perhaps >> > at a lower bpp now since the link parameters are lowered. >> > So the mode which failed at 30 bpp, might still work at 18bpp and is >> > better going to a lower resolution. >>=20 >> The question was whether the kernel will ever allow the same mode at the >> same bpp, since that's what this patch tries to do. > > Yes, this can happen. Doing a full modeset with recomputing clocks and > everything behind userspace's back might not be something the kernel > driver can pull of with a reasonable amount of effort, hence why we punt > to userspace. The interface spec makes this a CAN, not WILL, to allow less > unreasonable hw to handle these cases directly in the kernel driver. E.g. > plain link-retraining is handled in i915.ko still. So in that case you do need userspace to re-request the same mode at the same bpp? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAljhsZUACgkQtdYpNtH8 nujRsQ/8D2pMKRaKywcDsM2apdK0eoZQ42d7+51Swgmemcf+DM/nASpBJe71VzQ5 IUuorOqVgYfAjIpVsx1L9ZR66yLWi+Ad07NZdq2jZVVpqfUluTo8h3Vxds+59hXl W78PH+P+p7661LrlJ8rM7VsuIM5iwSUjCPTS8R07k2URR5pW/s7zmyedTKKo9LLs D/Lh4g/6Hf+dV6V29Sb1Lst5GVsq/8yaYLKNe0NXsOI2SYmsdeQqTN47oNk2LXhL 2GhT9XCWc/3px9voPavoa8+BWT5JAXX+7REYn0reWve2P6EKSp93IW0GSNgyoh/2 VDki92UgOKN69MG/Wpd1Qya0yZKIGsXb4oK375tOKxijaOT0sB18yGtXgM8sUPxO Pg3QMQZTG1Gx+y3ZrAaA5RJUbElpYsDwoQs0qsgWp3Tf6PC+qhP+EI+kVLACprDn vkf8A/vsrI136PzSRrh/VosqU923txwq4NFrHPPw6E2CdUxDR1eya9oc9MJUtdVB 1XB3nw5Jg0uCjh4Ios+dytrrejmG/wRPlindRxjT7EEJ/bmYzuHf/zjYeGjM92px eWCFr3ACxNvSJY6HgzeO/Y35FoJp7Azne0QXXYVb0iumsQJh1g8RzzYdHV50vuVN EN1Z8F5mJJAJ+FysASdolEz2KF4Q/PejSLP1X0lU4azJPKa87Fs= =4p0g -----END PGP SIGNATURE----- --=-=-=-- --===============1208610299== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KeG9yZy1kZXZl bEBsaXN0cy54Lm9yZzogWC5PcmcgZGV2ZWxvcG1lbnQKQXJjaGl2ZXM6IGh0dHA6Ly9saXN0cy54 Lm9yZy9hcmNoaXZlcy94b3JnLWRldmVsCkluZm86IGh0dHBzOi8vbGlzdHMueC5vcmcvbWFpbG1h bi9saXN0aW5mby94b3JnLWRldmVs --===============1208610299==--