From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH] drm: Try to document legacy DPMS uapi a bit better Date: Wed, 20 Sep 2017 15:48:20 -0700 Message-ID: <87poaluguj.fsf@anholt.net> References: <20170815145519.1162-1-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1556257397==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id B26AD6E7EA for ; Wed, 20 Sep 2017 22:48:23 +0000 (UTC) In-Reply-To: <20170815145519.1162-1-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: DRI Development Cc: Daniel Vetter , Laurent Pinchart , Daniel Vetter List-Id: dri-devel@lists.freedesktop.org --===============1556257397== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Daniel Vetter writes: > Laurent asked for this. > > Cc: Laurent Pinchart > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_connector.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c > index ba9f36cef68c..b458eb488128 100644 > --- a/drivers/gpu/drm/drm_connector.c > +++ b/drivers/gpu/drm/drm_connector.c > @@ -720,6 +720,25 @@ DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name, > * callback. For atomic drivers the remapping to the "ACTIVE" property is > * implemented in the DRM core. This is the only standard connector > * property that userspace can change. > + * > + * WARNING: > + * > + * For userspace also running on legacy drivers the "DPMS" semantics are a > + * lot more complicated. First, userspace cannot rely on the "DPMS" value > + * returned by the GETCONNECTOR actually reflecting reality, because many > + * drivers fail to update it. For atomic drivers this is taken care of in > + * drm_atomic_helper_update_legacy_modeset_state(). > + * > + * The second issue is that the DPMS state is only relevant when the s/relevant/defined/ maybe? > + * connector is connected to a CRTC. In atomic the DRM core enforces that > + * "ACTIVE" is off in such a case, no such checks exists for "DPMS". Maybe another newline here? > + * Finally, when enabling an output using the legacy SETCONFIG ioctl then > + * "DPMS" is forced to ON. But see above, that might not be reflected in > + * the software value. Maybe add " on legacy drivers"? > + * > + * Summarizing: Only set "DPMS" when the connector is known to be enabled, > + * assume that a successful SETCONFIG call also set "DPMS" to on, and never "also sets" > + * read back the value of "DPMS" because it can be incorrect. With whatever set of my suggestions you like, Reviewed-by: Eric Anholt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlnC8DQACgkQtdYpNtH8 nugGZw/7BdzlXzfyxZl+ZZUdR7z0r+NsU//QOS6P7OirWnKooEIfUou1rpTe6K9g 6KPbDpEEXzrFV4iIekUbUfGl8HiwYfxUhBId0yWNdujyfOg27zUyA4GM9A2p7Z9v tEC6rtu1suMG2cRdBih+JyB7LctIHGAYd0vG621hqvm637jmoudT/Gg6UQI19ncq EJb+Rzyx6f0zEpyJkJd1aHnZ/6vi0ZCSFeVwQs+HzIgb3MLnjl6vW9h9mr98Wg5v NT+6RsnceNT21r5I5I/NPM0Fm/K2+6x1rKLT/pNX139OljZs7rVWjsNWBq8nEeP5 QI1ZMnsK+6VUm5Hqd5eN6NjgSIxFut7cVTSuG2n9D7G6RjpV6sQocp3P/ZvenW3C xk/xbpa+8pN+Lyld+kSTzVIIZG827j9ODZUo1j/uGpVR+yxmLh9a1Hl4YOlXnfTY JpLP6PLD8t2oKWVzSRPLd35Ax077cRx1k35UDZtV6wZ3vhoim7FKTlQTwnJDNNzg VaJP+1DBDihzs9BY0us9vmW5OWk8Ls4i11cAG0QnrE/O3D58at7Qfe4EJ+HKTsV0 nAg2OYbJodxIgYAuWwcQ1+kVbRGwgPzFkdrtX6/qkONyW8g0kyK2o1cgLe4dpLF2 20CtmpHWfUr+ugQeA17TYRkZq/Ufqk+/i81XjZTk1BcYEJxn7Kk= =dC4Y -----END PGP SIGNATURE----- --=-=-=-- --===============1556257397== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1556257397==--