dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Liviu Dudau <liviu.dudau@arm.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Mihail Atanassov <mihail.atanassov@arm.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	Emil Velikov <emil.velikov@collabora.com>,
	linux-renesas-soc@vger.kernel.org,
	Jonathan Hunter <jonathanh@nvidia.com>,
	David Airlie <airlied@linux.ie>,
	Ludovic Desroches <ludovic.desroches@microchip.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	"James \(Qian\) Wang" <james.qian.wang@arm.com>,
	Thierry Reding <treding@nvidia.com>,
	syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Jyri Sarha <jsarha@ti.com>, Sean Paul <seanpaul@chromium.org>,
	linux-tegra@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Boris Brezillon <bbrezillon@kernel.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	zhengbin <zhengbin13@huawei.com>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Brian Masney <masneyb@onstation.org>
Subject: Re: [PATCH 1/8] drm/atomic-helper: reset vblank on crtc reset
Date: Wed, 24 Jun 2020 11:42:03 +0200	[thread overview]
Message-ID: <20200624094203.5dw267lb4c7ongvy@gilmour.lan> (raw)
In-Reply-To: <20200612160056.2082681-1-daniel.vetter@ffwll.ch>

On Fri, Jun 12, 2020 at 06:00:49PM +0200, Daniel Vetter wrote:
> Only when vblanks are supported ofc.
> 
> Some drivers do this already, but most unfortunately missed it. This
> opens up bugs after driver load, before the crtc is enabled for the
> first time. syzbot spotted this when loading vkms as a secondary
> output. Given how many drivers are buggy it's best to solve this once
> and for all in shared helper code.
> 
> Aside from moving the few existing calls to drm_crtc_vblank_reset into
> helpers (i915 doesn't use helpers, so keeps its own) I think the
> regression risk is minimal: atomic helpers already rely on drivers
> calling drm_crtc_vblank_on/off correctly in their hooks when they
> support vblanks. And driver that's failing to handle vblanks after
> this is missing those calls already, and vblanks could only work by
> accident when enabling a CRTC for the first time right after boot.
> 
> Big thanks to Tetsuo for helping track down what's going wrong here.
> 
> There's only a few drivers which already had the necessary call and
> needed some updating:
> - komeda, atmel and tidss also needed to be changed to call
>   __drm_atomic_helper_crtc_reset() intead of open coding it
> - tegra and msm even had it in the same place already, just code
>   motion, and malidp already uses __drm_atomic_helper_crtc_reset().
> 
> Only call left is in i915, which doesn't use drm_mode_config_reset,
> but has its own fastboot infrastructure. So that's the only case where
> we actually want this in the driver still.
> 
> I've also reviewed all other drivers which set up vblank support with
> drm_vblank_init. After the previous patch fixing mxsfb all atomic
> drivers do call drm_crtc_vblank_on/off as they should, the remaining
> drivers are either legacy kms or legacy dri1 drivers, so not affected
> by this change to atomic helpers.
> 
> v2: Use the drm_dev_has_vblank() helper.
> 
> v3: Laurent pointed out that omap and rcar-du used drm_crtc_vblank_off
> instead of drm_crtc_vblank_reset. Adjust them too.
> 
> v4: Laurent noticed that rcar-du and omap open-code their crtc reset
> and hence would actually be broken by this patch now. So fix them up
> by reusing the helpers, which brings the drm_crtc_vblank_reset() back.
> 
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> Acked-by: Liviu Dudau <liviu.dudau@arm.com>
> Acked-by: Thierry Reding <treding@nvidia.com>
> Link: https://syzkaller.appspot.com/bug?id=0ba17d70d062b2595e1f061231474800f076c7cb
> Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Reported-by: syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com
> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Cc: "James (Qian) Wang" <james.qian.wang@arm.com>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: Mihail Atanassov <mihail.atanassov@arm.com>
> Cc: Brian Starkey <brian.starkey@arm.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Boris Brezillon <bbrezillon@kernel.org>
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Jonathan Hunter <jonathanh@nvidia.com>
> Cc: Jyri Sarha <jsarha@ti.com>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Brian Masney <masneyb@onstation.org>
> Cc: Emil Velikov <emil.velikov@collabora.com>
> Cc: zhengbin <zhengbin13@huawei.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: linux-tegra@vger.kernel.org
> Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-renesas-soc@vger.kernel.org
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Acked-by: Maxime Ripard <mripard@kernel.org>

Maxime
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-06-25  7:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12 16:00 [PATCH 1/8] drm/atomic-helper: reset vblank on crtc reset Daniel Vetter
2020-06-12 16:00 ` [PATCH 2/8] drm/amdgpu: Use __drm_atomic_helper_crtc_reset Daniel Vetter
2020-06-12 17:24   ` Harry Wentland
2020-06-12 17:41     ` Alex Deucher
2020-07-02 18:21       ` Daniel Vetter
2020-06-12 16:00 ` [PATCH 3/8] drm/imx: " Daniel Vetter
2020-06-24  7:25   ` Daniel Vetter
2020-07-02  9:41     ` Daniel Vetter
2020-07-02 10:12       ` Philipp Zabel
2020-06-12 16:00 ` [PATCH 4/8] drm/mtk: " Daniel Vetter
2020-06-23 16:01   ` Chun-Kuang Hu
2020-06-12 16:00 ` [PATCH 5/8] drm/vc4: " Daniel Vetter
2020-06-24  8:49   ` Maxime Ripard
2020-06-12 16:00 ` [PATCH 6/8] drm/vmwgfx: " Daniel Vetter
2020-06-12 20:32   ` kernel test robot
2020-06-12 20:49   ` [PATCH] " Daniel Vetter
2020-06-22 14:31     ` Roland Scheidegger
2020-06-12 23:21   ` [PATCH 6/8] " kernel test robot
2020-06-12 16:00 ` [PATCH 7/8] drm/mipi-dbi: Remove ->enabled Daniel Vetter
2020-06-13 13:42   ` Noralf Trønnes
2020-06-13 18:47   ` David Lechner
2020-06-15 21:31   ` [Intel-gfx] " Emil Velikov
2020-06-16  6:50     ` Daniel Vetter
2020-06-16 13:54       ` Emil Velikov
2020-06-16 17:16         ` Daniel Vetter
2020-06-24  7:18           ` Daniel Vetter
2020-06-12 16:00 ` [PATCH 8/8] drm/tiny/repaper: Drop edp->enabled Daniel Vetter
2020-06-13 13:43   ` Noralf Trønnes
2020-06-24  7:15     ` Daniel Vetter
2020-06-24  9:42 ` Maxime Ripard [this message]
2020-07-02 11:27 ` [PATCH 1/8] drm/atomic-helper: reset vblank on crtc reset Laurent Pinchart
2020-07-02 11:40   ` Daniel Vetter
2020-08-06  6:43     ` Tetsuo Handa
2020-08-06  6:57       ` daniel

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=20200624094203.5dw267lb4c7ongvy@gilmour.lan \
    --to=maxime@cerno.tech \
    --cc=airlied@linux.ie \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=boris.brezillon@collabora.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.velikov@collabora.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=james.qian.wang@arm.com \
    --cc=jonathanh@nvidia.com \
    --cc=jsarha@ti.com \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=ludovic.desroches@microchip.com \
    --cc=masneyb@onstation.org \
    --cc=mihail.atanassov@arm.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=sam@ravnborg.org \
    --cc=seanpaul@chromium.org \
    --cc=syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=treding@nvidia.com \
    --cc=tzimmermann@suse.de \
    --cc=zhengbin13@huawei.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;
as well as URLs for NNTP newsgroup(s).