From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rodrigo Siqueira Subject: Re: [PATCH V2] drm/atomic-helper: Make atomic_enable/disable crtc callbacks optional Date: Mon, 25 Mar 2019 08:29:06 -0300 Message-ID: <20190325112906.p4zfgom3by3f2zu4@smtp.gmail.com> References: <20190314184845.gjmvkamobj4dilyp@smtp.gmail.com> <20190315110031.GY2665@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="s53qnnxj7bcumgeh" Return-path: Content-Disposition: inline In-Reply-To: <20190315110031.GY2665@phenom.ffwll.local> Sender: linux-kernel-owner@vger.kernel.org To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Gerd Hoffmann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org --s53qnnxj7bcumgeh Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03/15, Daniel Vetter wrote: > On Thu, Mar 14, 2019 at 03:48:45PM -0300, Rodrigo Siqueira wrote: > > Allow atomic_enable and atomic_disable operations from > > drm_crtc_helper_funcs struct optional. With this, the target display > > drivers don't need to define a dummy function if they don't need one. > >=20 > > Changes since v2: > > * Don't make funcs optional > > * Update kerneldoc for atomic_enable/disable > > * Replace "if (funcs->atomic_enable)" by "if (funcs->commit)" > > * Improve commit message > >=20 > > Signed-off-by: Rodrigo Siqueira >=20 > Reviewed-by: Daniel Vetter Hi, Is it ok if I apply this patch? =20 > > --- > > drivers/gpu/drm/drm_atomic_helper.c | 5 ++--- > > include/drm/drm_modeset_helper_vtables.h | 4 ++++ > > 2 files changed, 6 insertions(+), 3 deletions(-) > >=20 > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_= atomic_helper.c > > index 540a77a2ade9..d506e13c2945 100644 > > --- a/drivers/gpu/drm/drm_atomic_helper.c > > +++ b/drivers/gpu/drm/drm_atomic_helper.c > > @@ -1034,7 +1034,7 @@ disable_outputs(struct drm_device *dev, struct dr= m_atomic_state *old_state) > > funcs->atomic_disable(crtc, old_crtc_state); > > else if (funcs->disable) > > funcs->disable(crtc); > > - else > > + else if (funcs->dpms) > > funcs->dpms(crtc, DRM_MODE_DPMS_OFF); > > =20 > > if (!(dev->irq_enabled && dev->num_crtcs)) > > @@ -1277,10 +1277,9 @@ void drm_atomic_helper_commit_modeset_enables(st= ruct drm_device *dev, > > if (new_crtc_state->enable) { > > DRM_DEBUG_ATOMIC("enabling [CRTC:%d:%s]\n", > > crtc->base.id, crtc->name); > > - > > if (funcs->atomic_enable) > > funcs->atomic_enable(crtc, old_crtc_state); > > - else > > + else if (funcs->commit) > > funcs->commit(crtc); > > } > > } > > diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm= _modeset_helper_vtables.h > > index cfb7be40bed7..ce4de6b1e444 100644 > > --- a/include/drm/drm_modeset_helper_vtables.h > > +++ b/include/drm/drm_modeset_helper_vtables.h > > @@ -418,6 +418,8 @@ struct drm_crtc_helper_funcs { > > * Drivers can use the @old_crtc_state input parameter if the operati= ons > > * needed to enable the CRTC don't depend solely on the new state but > > * also on the transition between the old state and the new state. > > + * > > + * This function is optional. > > */ > > void (*atomic_enable)(struct drm_crtc *crtc, > > struct drm_crtc_state *old_crtc_state); > > @@ -441,6 +443,8 @@ struct drm_crtc_helper_funcs { > > * parameter @old_crtc_state which could be used to access the old > > * state. Atomic drivers should consider to use this one instead > > * of @disable. > > + * > > + * This function is optional. > > */ > > void (*atomic_disable)(struct drm_crtc *crtc, > > struct drm_crtc_state *old_crtc_state); > > --=20 > > 2.21.0 >=20 > --=20 > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch --=20 Rodrigo Siqueira https://siqueira.tech Graduate Student Department of Computer Science University of S=E3o Paulo --s53qnnxj7bcumgeh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE4tZ+ii1mjMCMQbfkWJzP/comvP8FAlyYu4EACgkQWJzP/com vP9SOg//R1J6WmGPr/xGB0gn8OKnq36G/sCCK8ECTFxjtxs2q2NOxZ08fLMPqrf5 Y9ewFTwbX0oVQg5lLcChTpThc+Rj9+bykn9ha7QJbm60QJ8Dl7+wWNyHuevuGmN8 x0gQekUZxbogz+xXCGZ4mE/JIBeYn0gZxdvW1YSjuUnokok/tosT6WMWva/QlFuR rBRonwfVUOrt2fVnA6fIrZBvUpGkQJPbHWjCuSndk0u82EW3PghQVwKNdiKlmK4A irS6a8P5Gce7XNR3Wyg0XqSxf2o0AN0nH9jtKi7C1QUCvDL6Csf/XQrlj6ybY1Ko GV8mQzii6kTBSqxfIWgrLYQbZ5imLsL0wiJJ1CYn5PRXSOsbQ9Oaar39ZRcro8UZ LQJRhVSxlLUrVbJPbgWGkD4INu0jh5ywVybm4eEk+HdNdWBYMMkHtLOX+Xn8ZA1W taZIugKXeA8x+QpZgLg6HN8GPYLSvXPxWQlWbl7mrf1BWDvHQoyDoAQaIsF1gjv7 aqFJ0/EVPyBzavRYTYDoGLCcb/0wD9p7qv15r61mk8LxIChV+lsJ0ofCVXH8gt8o RGn2D3vs356QjeVUh5c5ntNIN45bdR+o+z02QQOHwn3esnJsOPb8BSG8hhLTzwKS wlpe0lTKcTsQDndO6VRDbNyhrZoBwsrgvWSEWFlXKee/cKutgT0= =HKKI -----END PGP SIGNATURE----- --s53qnnxj7bcumgeh--