From: Sebastian Reichel Subject: Re: [PATCH 22/29] drm/omap: Move DISPC timing checks to CRTC .mode_valid() operation Date: Sun, 9 Dec 2018 23:07:55 +0100 Message-ID: <20181209220755.y4leg6ud233hsrmf@earth.universe> References: <20181205150022.24200-1-laurent.pinchart@ideasonboard.com> <20181205150022.24200-23-laurent.pinchart@ideasonboard.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0729537436==" Return-path: Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 39DF06E237 for ; Sun, 9 Dec 2018 22:08:00 +0000 (UTC) In-Reply-To: <20181205150022.24200-23-laurent.pinchart@ideasonboard.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Laurent Pinchart Cc: Tomi Valkeinen , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0729537436== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3vzlwziifubveqyg" Content-Disposition: inline --3vzlwziifubveqyg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Dec 05, 2018 at 05:00:15PM +0200, Laurent Pinchart wrote: > The DISPC timings checks relate to the CRTC, but they're performed in > the encoder and connector .atomic_check() and .mode_valid() operations. > Move them to the CRTC .mode_valid() operation. >=20 > Signed-off-by: Laurent Pinchart > --- Reviewed-by: Sebastian Reichel This should also fix the issue with DSI in a less ugly way: https://lists.freedesktop.org/archives/dri-devel/2018-November/196622.html -- Sebastian > drivers/gpu/drm/omapdrm/omap_connector.c | 6 ------ > drivers/gpu/drm/omapdrm/omap_crtc.c | 9 +++++++++ > drivers/gpu/drm/omapdrm/omap_encoder.c | 6 ------ > 3 files changed, 9 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/o= mapdrm/omap_connector.c > index 8db1f2fbcf43..dd1e0f2e8ffc 100644 > --- a/drivers/gpu/drm/omapdrm/omap_connector.c > +++ b/drivers/gpu/drm/omapdrm/omap_connector.c > @@ -245,8 +245,6 @@ static int omap_connector_mode_valid(struct drm_conne= ctor *connector, > struct drm_display_mode *mode) > { > struct omap_connector *omap_connector =3D to_omap_connector(connector); > - enum omap_channel channel =3D omap_connector->output->dispc_channel; > - struct omap_drm_private *priv =3D connector->dev->dev_private; > struct omap_dss_device *dssdev; > struct videomode vm =3D {0}; > struct drm_device *dev =3D connector->dev; > @@ -256,10 +254,6 @@ static int omap_connector_mode_valid(struct drm_conn= ector *connector, > drm_display_mode_to_videomode(mode, &vm); > mode->vrefresh =3D drm_mode_vrefresh(mode); > =20 > - r =3D priv->dispc_ops->mgr_check_timings(priv->dispc, channel, &vm); > - if (r) > - goto done; > - > for (dssdev =3D omap_connector->output; dssdev; dssdev =3D dssdev->next= ) { > if (!dssdev->ops->check_timings) > continue; > diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdr= m/omap_crtc.c > index caffc547ef97..51036e6fca1c 100644 > --- a/drivers/gpu/drm/omapdrm/omap_crtc.c > +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c > @@ -391,6 +391,15 @@ static enum drm_mode_status omap_crtc_mode_valid(str= uct drm_crtc *crtc, > const struct drm_display_mode *mode) > { > struct omap_drm_private *priv =3D crtc->dev->dev_private; > + struct omap_crtc *omap_crtc =3D to_omap_crtc(crtc); > + struct videomode vm =3D {0}; > + int r; > + > + drm_display_mode_to_videomode(mode, &vm); > + r =3D priv->dispc_ops->mgr_check_timings(priv->dispc, omap_crtc->channe= l, > + &vm); > + if (r) > + return r; > =20 > /* Check for bandwidth limit */ > if (priv->max_bandwidth) { > diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/oma= pdrm/omap_encoder.c > index 79ee927cd905..7d01df6fa723 100644 > --- a/drivers/gpu/drm/omapdrm/omap_encoder.c > +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c > @@ -198,19 +198,13 @@ static int omap_encoder_atomic_check(struct drm_enc= oder *encoder, > struct drm_connector_state *conn_state) > { > struct omap_encoder *omap_encoder =3D to_omap_encoder(encoder); > - enum omap_channel channel =3D omap_encoder->output->dispc_channel; > struct drm_device *dev =3D encoder->dev; > - struct omap_drm_private *priv =3D dev->dev_private; > struct omap_dss_device *dssdev; > struct videomode vm =3D { 0 }; > int ret; > =20 > drm_display_mode_to_videomode(&crtc_state->mode, &vm); > =20 > - ret =3D priv->dispc_ops->mgr_check_timings(priv->dispc, channel, &vm); > - if (ret) > - goto done; > - > for (dssdev =3D omap_encoder->output; dssdev; dssdev =3D dssdev->next) { > if (!dssdev->ops->check_timings) > continue; > --=20 > Regards, >=20 > Laurent Pinchart >=20 > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel --3vzlwziifubveqyg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlwNkjsACgkQ2O7X88g7 +pqiuA//bHtk0wT3vlfI2BqbxKm/e3OPPI428O9q0O7ST0kk6yeAsOcSD0brU4Fv frmfD/1EIDrKJhVCaye6AFQgMf/99zSDb8h2zkhGbv/RqMK71Z2Q7FSwcYTcudoc A/rhevdbBbJvUT+4+M5tLlU/snNkSyig4enLunXlEyD0Y+3M8gDaQOBx1WeeUlIi EiEP4RJT0B5ayMFhpGHdCeR8rE4B7RBF33KMvVBFEseh4G+XruekUXwKxAYKA7lP jiiYiehaYxzv6rTlVNIs+rdoLn6Hr1VHPHnRmcApYvHLUXXAXzZ08Z+9xrubufvT rE8sZp+PrSuFmVVerk2M3DAJc2F0h/PicM5FrLFyI7x/I0PKwHf1+PWgGX8RCkFf uxJg/DYNonGz8hvHJr0jHBxU+1nSg8JRftNxskwFLzsCxLmwrF8Dc2mrHUUXTOsJ phCUdQgNUMHZ5qkAh5hJs9pLK6lrvtaNhPpJnca/6YpBziQ2r/Tr9ogTVyyfUCCf qgmLOoDdIYAJRKxBiXW+bT89i7aWtQXjMNQIJngbIPzRlgThyLeEK+z8p/UvnDcd EqHHwnIlumgJGAR6dOXYi7Ny3q1xGGB9vq7TVkm3KIKIdHIyiz0Cl30daci66y8t OIMmce4bwzlHkBLiSSaPcVo+y4wtfvFkiFneCcLATtaEyXxwNdk= =WWHq -----END PGP SIGNATURE----- --3vzlwziifubveqyg-- --===============0729537436== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0729537436==--