public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Jonas <mark.jonas@de.bosch.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	<dri-devel@lists.freedesktop.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Leo Ruan <tingquan.ruan@cn.bosch.com>,
	Mark Jonas <mark.jonas@de.bosch.com>
Subject: [PATCH] drm: imx: Move fbdev setup to before output polling
Date: Tue, 17 Nov 2020 16:52:29 +0100	[thread overview]
Message-ID: <20201117155229.9837-1-mark.jonas@de.bosch.com> (raw)

From: Leo Ruan <tingquan.ruan@cn.bosch.com>

The generic fbdev has to be setup before enabling output polling.
Otherwise the fbdev client is not ready to handle delayed events.

Since f53705fd, the generic fbdev is setup after the output polling
init. During fbdev setup, when fbdev probes attached outputs and a
status changes from unknown to connected, the delayed event is
marked and the output_poll_work thread is scheduled without delay.
If output_poll_execute() is runs immediately, the delayed event
is handled without actually polling the output because the fbdev is not
registered yet. So the delayed event is lost. This leads to a dark
screen until a KMS application (or fbcon) sets the screen mode.

This patch fixes the issue by moving the setup of generic fbdev before
initializing and enabling output polling.

Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
---
 drivers/gpu/drm/imx/imx-drm-core.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 9bf5ad6d18a2..2665040e11c7 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -240,14 +240,18 @@ static int imx_drm_bind(struct device *dev)
 		legacyfb_depth = 16;
 	}
 
+	/*
+	 * The generic fbdev has to be setup before enabling output polling.
+	 * Otherwise the fbdev client is not ready to handle delayed events.
+	 */
+	drm_fbdev_generic_setup(drm, legacyfb_depth);
+
 	drm_kms_helper_poll_init(drm);
 
 	ret = drm_dev_register(drm, 0);
 	if (ret)
 		goto err_poll_fini;
 
-	drm_fbdev_generic_setup(drm, legacyfb_depth);
-
 	return 0;
 
 err_poll_fini:
-- 
2.17.1


             reply	other threads:[~2020-11-17 16:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 15:52 Mark Jonas [this message]
2020-11-18  8:10 ` [PATCH] drm: imx: Move fbdev setup to before output polling Thomas Zimmermann
2020-11-18  8:59   ` Daniel Vetter
2020-11-18  9:12     ` Thomas Zimmermann
2020-11-18  9:47       ` AW: " Jonas Mark (BT-FIR/ENG1-Grb)
2020-11-18 10:23         ` Daniel Vetter
2020-11-26  9:44           ` AW: " Jonas Mark (BT-FIR/ENG1-Grb)
2020-11-27 14:50             ` 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=20201117155229.9837-1-mark.jonas@de.bosch.com \
    --to=mark.jonas@de.bosch.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tingquan.ruan@cn.bosch.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