mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/6] drm/atomic: Don't skip drm_bridge_*() calls if !drm_encoder_helper_funcs
Date: Wed, 11 May 2016 18:55:04 +0200	[thread overview]
Message-ID: <20160511165504.GS27098@phenom.ffwll.local> (raw)
In-Reply-To: <1462982962-10530-5-git-send-email-noralf@tronnes.org>

On Wed, May 11, 2016 at 06:09:20PM +0200, Noralf Trønnes wrote:
> Don't skip drm_bridge_*() calls if encoder->helper_private is NULL.
> 
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>

Applied to drm-misc, thanks.
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 39 ++++++++++++++++---------------------
>  1 file changed, 17 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 027b227..46a3201 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -384,8 +384,6 @@ mode_fixup(struct drm_atomic_state *state)
>  		 */
>  		encoder = conn_state->best_encoder;
>  		funcs = encoder->helper_private;
> -		if (!funcs)
> -			continue;
>  
>  		ret = drm_bridge_mode_fixup(encoder->bridge, &crtc_state->mode,
>  				&crtc_state->adjusted_mode);
> @@ -394,7 +392,7 @@ mode_fixup(struct drm_atomic_state *state)
>  			return -EINVAL;
>  		}
>  
> -		if (funcs->atomic_check) {
> +		if (funcs && funcs->atomic_check) {
>  			ret = funcs->atomic_check(encoder, crtc_state,
>  						  conn_state);
>  			if (ret) {
> @@ -402,7 +400,7 @@ mode_fixup(struct drm_atomic_state *state)
>  						 encoder->base.id, encoder->name);
>  				return ret;
>  			}
> -		} else if (funcs->mode_fixup) {
> +		} else if (funcs && funcs->mode_fixup) {
>  			ret = funcs->mode_fixup(encoder, &crtc_state->mode,
>  						&crtc_state->adjusted_mode);
>  			if (!ret) {
> @@ -696,8 +694,6 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
>  			continue;
>  
>  		funcs = encoder->helper_private;
> -		if (!funcs)
> -			continue;
>  
>  		DRM_DEBUG_ATOMIC("disabling [ENCODER:%d:%s]\n",
>  				 encoder->base.id, encoder->name);
> @@ -709,12 +705,14 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
>  		drm_bridge_disable(encoder->bridge);
>  
>  		/* Right function depends upon target state. */
> -		if (connector->state->crtc && funcs->prepare)
> -			funcs->prepare(encoder);
> -		else if (funcs->disable)
> -			funcs->disable(encoder);
> -		else if (funcs->dpms)
> -			funcs->dpms(encoder, DRM_MODE_DPMS_OFF);
> +		if (funcs) {
> +			if (connector->state->crtc && funcs->prepare)
> +				funcs->prepare(encoder);
> +			else if (funcs->disable)
> +				funcs->disable(encoder);
> +			else if (funcs->dpms)
> +				funcs->dpms(encoder, DRM_MODE_DPMS_OFF);
> +		}
>  
>  		drm_bridge_post_disable(encoder->bridge);
>  	}
> @@ -861,9 +859,6 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state)
>  
>  		encoder = connector->state->best_encoder;
>  		funcs = encoder->helper_private;
> -		if (!funcs)
> -			continue;
> -
>  		new_crtc_state = connector->state->crtc->state;
>  		mode = &new_crtc_state->mode;
>  		adjusted_mode = &new_crtc_state->adjusted_mode;
> @@ -878,7 +873,7 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state)
>  		 * Each encoder has at most one connector (since we always steal
>  		 * it away), so we won't call mode_set hooks twice.
>  		 */
> -		if (funcs->mode_set)
> +		if (funcs && funcs->mode_set)
>  			funcs->mode_set(encoder, mode, adjusted_mode);
>  
>  		drm_bridge_mode_set(encoder->bridge, mode, adjusted_mode);
> @@ -969,8 +964,6 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
>  
>  		encoder = connector->state->best_encoder;
>  		funcs = encoder->helper_private;
> -		if (!funcs)
> -			continue;
>  
>  		DRM_DEBUG_ATOMIC("enabling [ENCODER:%d:%s]\n",
>  				 encoder->base.id, encoder->name);
> @@ -981,10 +974,12 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
>  		 */
>  		drm_bridge_pre_enable(encoder->bridge);
>  
> -		if (funcs->enable)
> -			funcs->enable(encoder);
> -		else if (funcs->commit)
> -			funcs->commit(encoder);
> +		if (funcs) {
> +			if (funcs->enable)
> +				funcs->enable(encoder);
> +			else if (funcs->commit)
> +				funcs->commit(encoder);
> +		}
>  
>  		drm_bridge_enable(encoder->bridge);
>  	}
> -- 
> 2.8.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2016-05-11 16:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 16:09 [PATCH v2 0/6] drm: Add various helpers for simple drivers Noralf Trønnes
2016-05-11 16:09 ` [PATCH v2 1/6] drm/fb-helper: Remove mention of CONFIG_FB_DEFERRED_IO in docs Noralf Trønnes
2016-05-11 16:09 ` [PATCH v2 2/6] drm/fb-cma-helper: Hook up to DocBook and fix some docs Noralf Trønnes
2016-05-11 16:48   ` Daniel Vetter
2016-05-11 16:09 ` [PATCH v2 3/6] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs() Noralf Trønnes
2016-05-11 16:09 ` [PATCH v2 4/6] drm/atomic: Don't skip drm_bridge_*() calls if !drm_encoder_helper_funcs Noralf Trønnes
2016-05-11 16:55   ` Daniel Vetter [this message]
2016-05-11 16:09 ` [PATCH v2 5/6] drm/atomic: Add drm_atomic_helper_best_encoder() Noralf Trønnes
2016-05-11 16:55   ` Daniel Vetter
2016-05-11 16:09 ` [PATCH v2 6/6] drm: Add helper for simple display pipeline Noralf Trønnes
2016-05-11 17:09   ` Daniel Vetter
2016-05-11 19:10     ` Paul Bolle
2016-05-11 19:30       ` Noralf Trønnes
2016-05-11 19:27     ` Noralf Trønnes
2016-05-12  8:11     ` Daniel Vetter
2016-05-12 10:18       ` Noralf Trønnes
2016-05-12 10:44         ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160511165504.GS27098@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®