From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH v5 04/10] drm/stm: Add STM32 LTDC driver Date: Tue, 11 Apr 2017 22:51:32 +0200 Message-ID: <20170411205132.sze2wfnnim4halqb@phenom.ffwll.local> References: <1490694293-18358-1-git-send-email-yannick.fertre@st.com> <1490694293-18358-5-git-send-email-yannick.fertre@st.com> <87wpaqeks2.fsf@eliezer.anholt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <87wpaqeks2.fsf-omZaPlIz5HhaEpDpdNBo/KxOck334EZe@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Eric Anholt Cc: Yannick Fertre , Alexandre TORGUE , Thierry Reding , David Airlie , Maxime Coquelin , Russell King , Mark Rutland , Rob Herring , Arnd Bergmann , Benjamin Gaignard , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-F5mvAk5X5gdBDgjK7y7TUQ@public.gmane.org, Philippe Cornu , dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Fabien Dessenne , Mickael Reulier , Vincent Abriou , Gabriel FERNANDEZ , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Tue, Apr 11, 2017 at 01:45:01PM -0700, Eric Anholt wrote: > Yannick Fertre writes: > > +static void ltdc_crtc_disable(struct drm_crtc *crtc) > > +{ > > + struct ltdc_device *ldev = crtc_to_ltdc(crtc); > > + struct drm_pending_vblank_event *event = crtc->state->event; > > + > > + DRM_DEBUG_DRIVER("\n"); > > + > > + if (!crtc->enabled) { > > + DRM_DEBUG_DRIVER("already disabled\n"); > > + return; > > + } > > I think this crtc->enabled is a given for the disable() being called. Yup, one design principle of atomic (compared to the legacy modeset helpers) is to correctly keep track of hw state and not call a hook when not needed. If you don't trust them, conver them to WARN_ON, but otherwise best to remove. But like Eric said, totally fine in a follow-up patch. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html