From: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>
To: Boris Brezillon
<boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Krzysztof Kozlowski
<k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>,
Thierry Reding
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Laurent Pinchart
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
Benjamin Gaignard
<benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Daniel Vetter
<daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Alexandre Courbot
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Joonyoung Shim
<jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Alexey Brodkin <abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
Kyungmin Park
<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
Kukjin Kim <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Jani Nikula <jani.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Ink
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-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
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
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2016-06-07 14:39 UTC|newest]
Thread overview: 28+ 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
[not found] ` <1465300095-16971-2-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
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-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 10/20] drm: rockchip: " 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
[not found] ` <1465300095-16971-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-07 11:47 ` [PATCH v2 03/20] drm: atmel-hlcdc: " 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
[not found] ` <20160610152412.GL3363-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
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 11/20] drm: sti: " Boris Brezillon
[not found] ` <1465300095-16971-12-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
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 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-/w4ywyx8dfk@public.gmane.org \
--cc=abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
--cc=intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=jani.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=wens-jdAy2FN1RRM@public.gmane.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;
as well as URLs for NNTP newsgroup(s).