Re: [PATCH] drm/sun4i: Clear encoder->bridge if a bridge is not found

2016-08-31 Thread Maxime Ripard
On Wed, Aug 31, 2016 at 06:27:08PM +0200, Daniel Vetter wrote: > > > >> + if (IS_ERR(encoder->bridge)) > > > >> + encoder->bridge = NULL; > > > >> + > > > > > > > > And that could be the else condition of the if statement below. > > > > > > That would be a bit confusing, changing i

Re: [PATCH] drm/sun4i: Clear encoder->bridge if a bridge is not found

2016-08-31 Thread Maxime Ripard
On Wed, Aug 31, 2016 at 07:09:23PM +0800, Chen-Yu Tsai wrote: > >>> sun4i_tcon_channel_disable(tcon, 0); > >>> > >>> - if (!IS_ERR(encoder->bridge)) > >>> - drm_bridge_disable(encoder->bridge); > >>> + drm_bridge_disable(encoder->bridge); > >> > >> I'd rather keep those ch

Re: [PATCH] drm/sun4i: Clear encoder->bridge if a bridge is not found

2016-08-31 Thread Daniel Vetter
On Wed, Aug 31, 2016 at 05:40:02PM +0200, Maxime Ripard wrote: > On Tue, Aug 30, 2016 at 11:51:26PM +0800, Chen-Yu Tsai wrote: > > On Tue, Aug 30, 2016 at 8:56 PM, Maxime Ripard > > wrote: > > > Hi, > > > > > > On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote: > > >> The KMS helpers (d

Re: [PATCH] drm/sun4i: Clear encoder->bridge if a bridge is not found

2016-08-31 Thread Maxime Ripard
On Tue, Aug 30, 2016 at 11:51:26PM +0800, Chen-Yu Tsai wrote: > On Tue, Aug 30, 2016 at 8:56 PM, Maxime Ripard > wrote: > > Hi, > > > > On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote: > >> The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass > >> encoder->bridge directly

Re: [PATCH] drm/sun4i: Clear encoder->bridge if a bridge is not found

2016-08-31 Thread Chen-Yu Tsai
Hi Maxime, On Tue, Aug 30, 2016 at 11:51 PM, Chen-Yu Tsai wrote: > On Tue, Aug 30, 2016 at 8:56 PM, Maxime Ripard > wrote: >> Hi, >> >> On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote: >>> The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass >>> encoder->bridge directly

Re: [PATCH] drm/sun4i: Clear encoder->bridge if a bridge is not found

2016-08-30 Thread Chen-Yu Tsai
On Tue, Aug 30, 2016 at 8:56 PM, Maxime Ripard wrote: > Hi, > > On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote: >> The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass >> encoder->bridge directly to drm_bridge_mode_fixup, which expects a >> valid pointer, or NULL (in whi

Re: [PATCH] drm/sun4i: Clear encoder->bridge if a bridge is not found

2016-08-30 Thread Maxime Ripard
Hi, On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote: > The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass > encoder->bridge directly to drm_bridge_mode_fixup, which expects a > valid pointer, or NULL (in which case it just returns). > > Clear encoder->bridge if a bridg

[PATCH] drm/sun4i: Clear encoder->bridge if a bridge is not found

2016-08-30 Thread Chen-Yu Tsai
The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass encoder->bridge directly to drm_bridge_mode_fixup, which expects a valid pointer, or NULL (in which case it just returns). Clear encoder->bridge if a bridge is not found, instead of keeping the ERR_PTR value. Since other drm_bridge