From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 28/28] drm/atomic-helper: Reject legacy flips on a disabled pipe Date: Mon, 7 Dec 2015 16:25:49 +0100 Message-ID: <20151207152549.GI13177@ulmo> References: <1449218769-16577-1-git-send-email-daniel.vetter@ffwll.ch> <1449218769-16577-29-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0711669775==" Return-path: In-Reply-To: <1449218769-16577-29-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Daniel Vetter Cc: Intel Graphics Development , Daniel Stone , DRI Development List-Id: intel-gfx@lists.freedesktop.org --===============0711669775== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="588wvpgrYaEESfyK" Content-Disposition: inline --588wvpgrYaEESfyK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 04, 2015 at 09:46:09AM +0100, Daniel Vetter wrote: > We want this for consistency with existing page_flip semantics. >=20 > Since this spurred quite a discussion on IRC also document why we > reject even generation when the pipe is off: It's not that it's hard > to implement, but userspace has a track recording proofing that it's > way too easy to accidentally abuse and cause havoc. We want to make > sure userspace doesn't get away with that. >=20 > Cc: Daniel Stone > Cc: Ville Syrj=C3=A4l=C3=A4 > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_atomic.c | 9 +++++++++ > drivers/gpu/drm/drm_atomic_helper.c | 8 ++++++++ > 2 files changed, 17 insertions(+) >=20 > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c > index 7426d40017a0..06cdb52907da 100644 > --- a/drivers/gpu/drm/drm_atomic.c > +++ b/drivers/gpu/drm/drm_atomic.c > @@ -1265,6 +1265,15 @@ int drm_atomic_check_only(struct drm_atomic_state = *state) > if (config->funcs->atomic_check) > ret =3D config->funcs->atomic_check(state->dev, state); > =20 > + /* > + * Reject event generation for when a CRTC is off and stays off. It > + * wouldn't be hard to implement this, but userspace has a track record > + * of happily burning through 100% cpu (or worse, crash) when the > + * display pipe is suspended. To avoid all that fun just reject updates > + * that ask for events since likely that indicates a bug in the > + * compositors drawing loop. This is consistent with the vblank ioctl "compositor's". > + * which also rejects service on a disabled pipe. > + */ > if (!state->allow_modeset) { > for_each_crtc_in_state(state, crtc, crtc_state, i) { > if (drm_atomic_crtc_needs_modeset(crtc_state)) { > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_at= omic_helper.c > index 110f3db8dd05..8e281a96c35f 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -2283,6 +2283,14 @@ retry: > goto fail; > drm_atomic_set_fb_for_plane(plane_state, fb); > =20 > + state->allow_modeset =3D false; Perhaps explain the reason for setting this? Thierry --588wvpgrYaEESfyK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJWZaT8AAoJEN0jrNd/PrOhAlwP/AycTNUhtVRaNuTMaRXDbxDK NbMvnBDRbtTnGttlT0AOc7nUviBGiYry8GRqnfz7PHGW04IK290GWC2gZwHwX5ZD Axhpf2nGJ7gu5e7LzYA6NaCIbXA1SQ6BKFV4RAPaS6CH65ZVj7La/i3a6lt8VDQO wPhSH+5vDeygv2NykXafvYPjk9jRRDJjJAVHlYAdZJ4WCq4JCBlffwFBkp124JP3 g5tc/9nF+zIx/ZZRq/pV4B2GrJX9Czjq5ExkgUa08v3w3rYXxpSPy4+JFhNJP3jm QWu1omAJtIkhZzG0zd6Ar0II9SD3t7Of3fcN2baJ/pNpwBuJAkf0JuYmrWraHXkn li35/03N03hIRV8RWTQSB8iaNvQuv9rnu5aVydYqWMJxFBLCzGEVm7VvXH9TRrk6 5uLREk3Z0yRH6vIIzKOo+kpiqPcUE6O4hsWJrj+6IgxsntJtV3hf3UBJZU9piJgk W5iKLUEBMj6ngkg8CIIoVk2NIpiB4to7QIFtH9JUTX3Vsfqp/K/2FDddqngVMncP E/VfqCzWs0LHgxB1DD/KBCaLOz1L9386wJJ+LDsQMPuP66cH2pzHbyKBPgf5hxU5 2g5kQhYX19qcMRQ8O1lbrCSdXPTwEQ3AG7yYly+NJ/yxDo7oKzegX9MZxC3P0Kx4 q3Q5qXSXTE5dU2jHQmGo =mBVG -----END PGP SIGNATURE----- --588wvpgrYaEESfyK-- --===============0711669775== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0711669775==--