From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 4/4] drm/atomic-helpers: Make encoder picking more robust Date: Tue, 4 Aug 2015 10:56:22 +0200 Message-ID: <20150804085620.GC3886@ulmo> References: <1438615451-856-1-git-send-email-daniel.vetter@ffwll.ch> <1438615451-856-4-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0627320721==" Return-path: In-Reply-To: <1438615451-856-4-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: Theodore Ts'o , Intel Graphics Development , Linus Torvalds , DRI Development , Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org --===============0627320721== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/Uq4LBwYP4y1W6pO" Content-Disposition: inline --/Uq4LBwYP4y1W6pO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 03, 2015 at 05:24:11PM +0200, Daniel Vetter wrote: > We've had a few issues with atomic where subtle bugs in the encoder > picking logic lead to accidental self-stealing of the encoder, > resulting in a NULL connector_state->crtc in update_connector_routing > and subsequent. >=20 > Linus applied some duct-tape for an mst regression in >=20 > commit 27667f4744fc5a0f3e50910e78740bac5670d18b > Author: Linus Torvalds > Date: Wed Jul 29 22:18:16 2015 -0700 >=20 > i915: temporary fix for DP MST docking station NULL pointer dereferen= ce >=20 > But that was incomplete (the code will still oops when debuggin is > enabled) and mangled the state even further. So instead WARN and bail > out as the more future-proof option. >=20 > Cc: Theodore Ts'o > Cc: Linus Torvalds > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_atomic_helper.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_at= omic_helper.c > index 8694ca9beee3..9dcc7280e572 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -234,13 +234,14 @@ update_connector_routing(struct drm_atomic_state *s= tate, int conn_idx) > } > } > =20 > + if (WARN_ON(!connector_state->crtc)) > + return -EINVAL; > + > connector_state->best_encoder =3D new_encoder; > - if (connector_state->crtc) { > - idx =3D drm_crtc_index(connector_state->crtc); > + idx =3D drm_crtc_index(connector_state->crtc); > =20 > - crtc_state =3D state->crtc_states[idx]; > - crtc_state->mode_changed =3D true; > - } > + crtc_state =3D state->crtc_states[idx]; > + crtc_state->mode_changed =3D true; > =20 > DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d]\= n", > connector->base.id, Reviewed-by: Thierry Reding --/Uq4LBwYP4y1W6pO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJVwH40AAoJEN0jrNd/PrOh5ScP/i9WrrQ7CFSNqY8rumCVtFbc riWDAzB0I5c6lyKF8IgqHYUrtIqHrVxL+6bqklsbkvIF+knYZa26atD8qoW71upW hmPiBtpqRTC0xxEUbPMoQN+kyAAhi727iOPhtxZJwoCk8lzXu9Cq1gcCSIzttnq1 z4TuJgst0ipAll+GGyci0vGZZ7bYZ+osw+gOkYrvVH3xVl1vlBgmDl3qtBpwZEGx 33DRkmjj6cfjnLoZcY087uq0zP4pT60X7XDqwQamsS484T37wOm5F4h2RzlSE16z 00odqTQYkagKbvVypmOij//LlneO1ui2e5nBII5Ve84Zl8ZyqVYNCa4eweRxEouO aVxnT2xtEMtmJiHmF7iyy5LH7RnjQ5jTxtq/wliDyxhtvSR8k2i9fbExI9n8d1yS y96TIO8wovXz57N6532qRemvU19K+cs+kzeJLW5FDAvnxi6U6wAZVL3fjD/SAfON xkF0/2CJX0t7y9Nm9TSZTfqkFetEp+G1IYvao8jfcc785izpQJcj7TUE0oG/+M3N wN0Ak3CmMnQmIMyAZiXoq9aNJisc4xTuAdNeUOnDy38DXAZT5mbRV5hCA/udZXJq uxfoPMos78O8E12CgGAlkbAuLmRSIOHodDrYhpzBkEUVy5hhYzMxxx7/T2Tdevh3 uPi3mZsIJm1RBaqXDrUK =qbng -----END PGP SIGNATURE----- --/Uq4LBwYP4y1W6pO-- --===============0627320721== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0627320721==--