All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Heiko Stuebner <heiko@sntech.de>, David Airlie <airlied@linux.ie>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"open list:VIRTIO CORE,
	NET..." <virtualization@lists.linux-foundation.org>,
	Eric Anholt <eric@anholt.net>,
	Thierry Re ding <thierry.reding@gmail.com>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Alexey Brodkin <abrodkin@synopsys.com>,
	Rob Clark <robdclark@gmail.com>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	Chen-Yu Tsai <wens@csie.org>, Kukjin Kim <kgene@kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	Stephen Warren <swarren@wwwdotorg.org>, linux-arm-msm <linux-ar>
Subject: Re: [PATCH 01/20] drm/atomic: Fix remaining places where !funcs->best_encoder is valid
Date: Thu, 2 Jun 2016 23:57:02 +0200	[thread overview]
Message-ID: <CAKMK7uHyqNbA8Scw2fE0geAyNt0a0XVtzf81nwWjEhbZ-gAvKw__30993.3183518753$1464904644$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <8671722.LHaiaBNqfE@avalon>

On Thu, Jun 2, 2016 at 11:05 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Boris,
>
> Thank you for the patch.
>
> On Thursday 02 Jun 2016 16:31:28 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().
>
> Could you please update include/drm/drm_modeset_helper_vtables.h to document
> this new behaviour ?

Thanks for reminding me. Please update hooks for both
atomic_best_encoder and best_encoder. Also mention that it's only
optional for atomic drivers. There's lots of examples in that file for
the wording usually used.

> The only drawback I see in this patch is the additional object lookup
> performed by drm_atomic_helper_best_encoder() at runtime. I wonder if we could
> somehow cache the information, as the assignment can't change when there's a
> 1:1 correspondence between encoders and connectors.

drm_encoder_find is an idr lookup. That should be plenty fast,
especially for modeset code. Usually what's too expensive even for
modeset code is linear list walks. But Chris just submitted patches to
convert most of them into simple lookups.
-Daniel

>>> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
>> ---
>>  drivers/gpu/drm/drm_atomic_helper.c |  4 +++-
>>  drivers/gpu/drm/drm_fb_helper.c     | 13 ++++++++++++-
>>  2 files changed, 15 insertions(+), 2 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;
>
> --
> Regards,
>
> Laurent Pinchart
>



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2016-06-02 21:57 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 14:31 [PATCH 00/20] drm/atomic: Provide default ->best_encoder() behavior Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 01/20] drm/atomic: Fix remaining places where !funcs->best_encoder is valid Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 21:05   ` Laurent Pinchart
2016-06-02 21:05   ` Laurent Pinchart
2016-06-02 21:05     ` Laurent Pinchart
2016-06-02 21:05     ` Laurent Pinchart
2016-06-02 21:57     ` Daniel Vetter [this message]
2016-06-02 21:57     ` Daniel Vetter
2016-06-02 21:57       ` Daniel Vetter
2016-06-02 21:57       ` Daniel Vetter
2016-06-02 21:57       ` Daniel Vetter
2016-06-02 22:40       ` [Intel-gfx] " Chris Wilson
2016-06-02 22:40       ` Chris Wilson
2016-06-02 22:40         ` [Intel-gfx] " Chris Wilson
2016-06-02 22:40         ` Chris Wilson
2016-06-02 22:40         ` Chris Wilson
2016-06-03  7:37       ` Boris Brezillon
2016-06-03  7:37       ` Boris Brezillon
2016-06-03  7:37         ` Boris Brezillon
2016-06-03  7:37         ` Boris Brezillon
2016-06-03  7:37         ` Boris Brezillon
2016-06-03 19:01         ` Daniel Vetter
2016-06-03 19:01           ` Daniel Vetter
2016-06-03 19:01           ` Daniel Vetter
2016-06-03 19:01           ` Daniel Vetter
2016-06-03 19:01         ` Daniel Vetter
2016-06-03  7:36     ` Boris Brezillon
2016-06-03  7:36       ` Boris Brezillon
2016-06-03  7:36       ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 02/20] drm: arc: Rely on the default ->best_encoder() behavior Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 03/20] drm: atmel-hlcdc: " Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 04/20] drm: exynos: " Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 05/20] drm: fsl-dcu: " Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 06/20] drm: i915: Rely on the default ->best_encoder() behavior where appropriate Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 07/20] drm: mediatek: Rely on the default ->best_encoder() behavior Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 08/20] drm: msm: Rely on the default ->best_encoder() behavior where appropriate Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 09/20] drm: rcar-du: Rely on the default ->best_encoder() behavior Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 20:57   ` Laurent Pinchart
2016-06-02 20:57     ` Laurent Pinchart
2016-06-02 20:57     ` Laurent Pinchart
2016-06-03  7:38     ` Boris Brezillon
2016-06-03  7:38     ` Boris Brezillon
2016-06-03  7:38       ` Boris Brezillon
2016-06-03  7:38       ` Boris Brezillon
2016-06-02 20:57   ` Laurent Pinchart
2016-06-02 14:31 ` [PATCH 10/20] drm: rockchip: " Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-07  0:51   ` Mark yao
2016-06-07  0:51   ` Mark yao
2016-06-07  0:51     ` Mark yao
2016-06-07  0:51     ` Mark yao
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 11/20] drm: sti: " Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 12/20] drm: sun4i: " Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 13/20] drm: tegra: " Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 14/20] drm: vc4: " Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 15/20] drm: virtgpu: " Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 16/20] drm: omap: " Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 21:00   ` Laurent Pinchart
2016-06-02 21:00   ` Laurent Pinchart
2016-06-02 21:00     ` Laurent Pinchart
2016-06-02 21:00     ` Laurent Pinchart
2016-06-02 14:31 ` [PATCH 17/20] drm/bridge: anx78xx: " Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 18/20] drm/bridge: ptn3460: " Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 19/20] drm/bridge: ps8622: " Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` [PATCH 20/20] drm/bridge: dw-hdmi: Use drm_atomic_helper_best_encoder() Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31   ` Boris Brezillon
2016-06-02 14:31 ` Boris Brezillon
2016-06-02 17:34 ` ✗ Ro.CI.BAT: failure for drm/atomic: Provide default ->best_encoder() behavior Patchwork

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='CAKMK7uHyqNbA8Scw2fE0geAyNt0a0XVtzf81nwWjEhbZ-gAvKw__30993.3183518753$1464904644$gmane$org@mail.gmail.com' \
    --to=daniel@ffwll.ch \
    --cc=abrodkin@synopsys.com \
    --cc=airlied@linux.ie \
    --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=heiko@sntech.de \
    --cc=jy0922.shim@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.