public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel.vetter@intel.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Alexey Brodkin <abrodkin@synopsys.com>,
	Inki Dae <inki.dae@samsung.com>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Stefan Agner <stefan@agner.ch>,
	Alison Wang <alison.wang@freescale.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Rob Clark <robdclark@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mark Yao <mark.yao@rock-chips.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Vincent Abriou <vincent.abriou@st.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Eric Anholt <eric@anholt.net>, Gerd Hoffmann <kraxel@redhat.com>,
	linux-mediatek@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2 01/20] drm/atomic: Fix remaining places where !funcs->best_encoder is valid
Date: Tue, 7 Jun 2016 16:39:34 +0200	[thread overview]
Message-ID: <20160607143934.GA3363@phenom.ffwll.local> (raw)
In-Reply-To: <1465300095-16971-2-git-send-email-boris.brezillon@free-electrons.com>

On Tue, Jun 07, 2016 at 01:47:56PM +0200, Boris Brezillon wrote:
> Adapt drm_pick_crtcs() and update_connector_routing() to fallback to
> drm_atomic_helper_best_encoder() if funcs->best_encoder() is NULL so
> that DRM drivers can leave this hook unassigned if they know they want
> to use drm_atomic_helper_best_encoder().
> 
> Update the vtables documentation accordingly.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Applied to drm-misc, thanks. I think I'll wait with the driver patches
until next week or so.
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic_helper.c      |  4 +++-
>  drivers/gpu/drm/drm_fb_helper.c          | 13 ++++++++++++-
>  include/drm/drm_modeset_helper_vtables.h | 10 ++++++++--
>  3 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index f6a3350..849d029 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -300,8 +300,10 @@ update_connector_routing(struct drm_atomic_state *state,
>  	if (funcs->atomic_best_encoder)
>  		new_encoder = funcs->atomic_best_encoder(connector,
>  							 connector_state);
> -	else
> +	else if (funcs->best_encoder)
>  		new_encoder = funcs->best_encoder(connector);
> +	else
> +		new_encoder = drm_atomic_helper_best_encoder(connector);
>  
>  	if (!new_encoder) {
>  		DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n",
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 7c2eb75..d44389a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2000,7 +2000,18 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
>  		my_score++;
>  
>  	connector_funcs = connector->helper_private;
> -	encoder = connector_funcs->best_encoder(connector);
> +
> +	/*
> +	 * If the DRM device implements atomic hooks and ->best_encoder() is
> +	 * NULL we fallback to the default drm_atomic_helper_best_encoder()
> +	 * helper.
> +	 */
> +	if (fb_helper->dev->mode_config.funcs->atomic_commit &&
> +	    !connector_funcs->best_encoder)
> +		encoder = drm_atomic_helper_best_encoder(connector);
> +	else
> +		encoder = connector_funcs->best_encoder(connector);
> +
>  	if (!encoder)
>  		goto out;
>  
> diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
> index d4619dc..4e7a53b 100644
> --- a/include/drm/drm_modeset_helper_vtables.h
> +++ b/include/drm/drm_modeset_helper_vtables.h
> @@ -736,6 +736,11 @@ struct drm_connector_helper_funcs {
>  	 * inspect dynamic configuration state should instead use
>  	 * @atomic_best_encoder.
>  	 *
> +	 * You can leave this function to NULL if the connector is only
> +	 * attached to a single encoder and you are using the atomic helpers.
> +	 * In this case, the core will call drm_atomic_helper_best_encoder()
> +	 * for you.
> +	 *
>  	 * RETURNS:
>  	 *
>  	 * Encoder that should be used for the given connector and connector
> @@ -752,8 +757,9 @@ struct drm_connector_helper_funcs {
>  	 * need to select the best encoder depending upon the desired
>  	 * configuration and can't select it statically.
>  	 *
> -	 * This function is used by drm_atomic_helper_check_modeset() and either
> -	 * this or @best_encoder is required.
> +	 * This function is used by drm_atomic_helper_check_modeset().
> +	 * If it is not implemented, the core will fallback to @best_encoder
> +	 * (or drm_atomic_helper_best_encoder() if @best_encoder is NULL).
>  	 *
>  	 * NOTE:
>  	 *
> -- 
> 2.7.4
> 

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

  reply	other threads:[~2016-06-07 14:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 11:47 [PATCH v2 00/20] drm/atomic: Provide default ->best_encoder() behavior Boris Brezillon
2016-06-07 11:47 ` [PATCH v2 01/20] drm/atomic: Fix remaining places where !funcs->best_encoder is valid Boris Brezillon
2016-06-07 14:39   ` Daniel Vetter [this message]
2016-06-07 11:47 ` [PATCH v2 02/20] drm: arc: Rely on the default ->best_encoder() behavior Boris Brezillon
2016-06-10 15:05   ` Alexey Brodkin
2016-06-07 11:47 ` [PATCH v2 03/20] drm: atmel-hlcdc: " Boris Brezillon
2016-06-07 11:47 ` [PATCH v2 04/20] drm: exynos: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 05/20] drm: fsl-dcu: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 06/20] drm: i915: Rely on the default ->best_encoder() behavior where appropriate Boris Brezillon
2016-06-10 15:24   ` Daniel Vetter
2016-06-10 16:41     ` Daniel Vetter
2016-06-07 11:48 ` [PATCH v2 07/20] drm: mediatek: Rely on the default ->best_encoder() behavior Boris Brezillon
2016-06-08 11:17   ` Matthias Brugger
2016-06-07 11:48 ` [PATCH v2 08/20] drm: msm: Rely on the default ->best_encoder() behavior where appropriate Boris Brezillon
2016-06-08 10:09   ` Archit Taneja
2016-06-07 11:48 ` [PATCH v2 09/20] drm: rcar-du: Rely on the default ->best_encoder() behavior Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 10/20] drm: rockchip: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 11/20] drm: sti: " Boris Brezillon
2016-06-08  9:35   ` Vincent ABRIOU
2016-06-07 11:48 ` [PATCH v2 12/20] drm: sun4i: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 13/20] drm: tegra: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 14/20] drm: vc4: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 15/20] drm: virtgpu: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 16/20] drm: omap: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 17/20] drm/bridge: anx78xx: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 18/20] drm/bridge: ptn3460: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 19/20] drm/bridge: ps8622: " Boris Brezillon
2016-06-07 11:48 ` [PATCH v2 20/20] drm/bridge: dw-hdmi: Use drm_atomic_helper_best_encoder() Boris Brezillon
2016-06-10 15:25 ` [PATCH v2 00/20] drm/atomic: Provide default ->best_encoder() behavior 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=20160607143934.GA3363@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=abrodkin@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=alison.wang@freescale.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=boris.brezillon@free-electrons.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=freedreno@lists.freedesktop.org \
    --cc=gnurou@gmail.com \
    --cc=heiko@sntech.de \
    --cc=inki.dae@samsung.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jy0922.shim@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=kraxel@redhat.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mark.yao@rock-chips.com \
    --cc=matthias.bgg@gmail.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=robdclark@gmail.com \
    --cc=stefan@agner.ch \
    --cc=sw0312.kim@samsung.com \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    --cc=vincent.abriou@st.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wens@csie.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