mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: Vladimir Lypak <vladimir.lypak@gmail.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Jagan Teki <jagan@amarulasolutions.com>
Subject: Re: [PATCH 1/1] drm/bridge: Fix handling of bridges with pre_enable_prev_first flag
Date: Mon, 10 Jul 2023 09:46:23 +0200	[thread overview]
Message-ID: <7c4affcb-bcb4-5f4b-cc2f-bed2cad9de71@kontron.de> (raw)
In-Reply-To: <20230707190020.6280-2-vladimir.lypak@gmail.com>

On 07.07.23 21:00, Vladimir Lypak wrote:
> [Sie erhalten nicht häufig E-Mails von vladimir.lypak@gmail.com. Weitere Informationen, warum dies wichtig ist, finden Sie unter https://aka.ms/LearnAboutSenderIdentification ]
> 
> In function drm_atomic_bridge_chain_post_disable handling of
> pre_enable_prev_first flag is broken because "next" variable will always
> end up set to value of "bridge". This breaks loop which should disable
> bridges in reverse:
> 
>  next = list_next_entry(bridge, chain_node);
> 
>  if (next->pre_enable_prev_first) {
>         /* next bridge had requested that prev
>          * was enabled first, so disabled last
>          */
>         limit = next;
> 
>         /* Find the next bridge that has NOT requested
>          * prev to be enabled first / disabled last
>          */
>         list_for_each_entry_from(next, &encoder->bridge_chain,
>                                  chain_node) {
> // Next condition is always true. It is likely meant to be inversed
> // according to comment above. But doing this uncovers another problem:
> // it won't work if there are few bridges with this flag set at the end.
>                 if (next->pre_enable_prev_first) {
>                         next = list_prev_entry(next, chain_node);
>                         limit = next;
> // Here we always set next = limit = branch at first iteration.
>                         break;
>                 }
>         }
> 
>         /* Call these bridges in reverse order */
>         list_for_each_entry_from_reverse(next, &encoder->bridge_chain,
>                                          chain_node) {
> // This loop never executes past this branch.
>                 if (next == bridge)
>                         break;
> 
>                 drm_atomic_bridge_call_post_disable(next, old_state);
> 
> In this patch logic for handling the flag is simplified. Temporary
> "iter" variable is introduced instead of "next" which is used only
> inside inner loops.
> 
> Fixes: 4fb912e5e190 ("drm/bridge: Introduce pre_enable_prev_first to alter bridge init order")
> Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>

I haven't had a chance to look at this, but I still want to reference
another patch by Jagan that intends to fix some bug in this area:

https://patchwork.kernel.org/project/dri-devel/patch/20230328170752.1102347-1-jagan@amarulasolutions.com/

+Cc: Jagan

Dave, as you introduced this feature, did you have a chance to look at
Jagan's and Vladimir's patches?

  reply	other threads:[~2023-07-10  7:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-07 19:00 Vladimir Lypak
2023-07-10  7:46 ` Frieder Schrempf [this message]
2023-07-14 17:16   ` Dave Stevenson
2023-07-17  7:09     ` Frieder Schrempf

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=7c4affcb-bcb4-5f4b-cc2f-bed2cad9de71@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=vladimir.lypak@gmail.com \
    /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®