From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A588E98E09 for ; Mon, 23 Feb 2026 08:29:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A8DF10E272; Mon, 23 Feb 2026 08:29:06 +0000 (UTC) Received: from MTA-11-3.privateemail.com (mta-11-3.privateemail.com [198.54.122.105]) by gabe.freedesktop.org (Postfix) with ESMTPS id 274B510E81C; Fri, 20 Feb 2026 17:38:05 +0000 (UTC) Received: from mta-11.privateemail.com (localhost [127.0.0.1]) by mta-11.privateemail.com (Postfix) with ESMTP id 4fHcsS3YYPz3hhbj; Fri, 20 Feb 2026 12:38:04 -0500 (EST) Received: from hal-station (unknown [23.129.64.186]) by mta-11.privateemail.com (Postfix) with ESMTPA; Fri, 20 Feb 2026 12:37:33 -0500 (EST) Date: Fri, 20 Feb 2026 12:37:28 -0500 From: Hamza Mahfooz To: dri-devel@lists.freedesktop.org Cc: Michel =?iso-8859-1?Q?D=E4nzer?= , Mario Limonciello , Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Alex Hung , Aurabindo Pillai , Wayne Lin , Timur =?iso-8859-1?Q?Krist=F3f?= , Ivan Lipski , Dominik Kaszewski , amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] drm/amd/display: add vendor specific reset Message-ID: References: <20260220171518.711594-1-someguy@effective-light.com> <20260220171518.711594-2-someguy@effective-light.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260220171518.711594-2-someguy@effective-light.com> X-Virus-Scanned: ClamAV using ClamSMTP X-Mailman-Approved-At: Mon, 23 Feb 2026 08:29:06 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Fri, Feb 20, 2026 at 12:15:13PM -0500, Hamza Mahfooz wrote: > We now have a means to respond to page flip timeouts. So, hook up > support by trying to reload DMUB firmware if > drm_atomic_helper_wait_for_flip_done() fails. Also, send out a wedged > event if the firmware reload fails. > > Signed-off-by: Hamza Mahfooz > --- > v2: send a wedged event instead of attempting a GPU reset. > v3: read return value of drm_atomic_helper_wait_for_flip_done(). > v4: only send wedged event if firmware reload fails and send out "fake" > page flip completes. > --- > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 24 +++++++++++++++++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > index 7c51d8d7e73c..0ae6ada22fb0 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -87,6 +87,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -10829,6 +10830,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) > struct drm_connector_state *old_con_state = NULL, *new_con_state = NULL; > struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; > int crtc_disable_count = 0; > + struct amdgpu_crtc *acrtc; > > trace_amdgpu_dm_atomic_commit_tail_begin(state); > > @@ -11085,8 +11087,26 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) > /* Signal HW programming completion */ > drm_atomic_helper_commit_hw_done(state); > > - if (wait_for_vblank) > - drm_atomic_helper_wait_for_flip_done(dev, state); > + if (wait_for_vblank && > + drm_atomic_helper_wait_for_flip_done(dev, state)) { > + mutex_lock(&dm->dc_lock); > + if (dm_dmub_hw_init(adev)) > + drm_dev_wedged_event(dev, DRM_WEDGE_RECOVERY_REBIND | > + DRM_WEDGE_RECOVERY_BUS_RESET, > + NULL); > + mutex_unlock(&dm->dc_lock); > + > + spin_lock_irqsave(&dev->event_lock, flags); > + drm_for_each_crtc(crtc, dev) { Whoops, sent out an older version of this patch, the following line is here as of the latest (tested) version: acrtc = to_amdgpu_crtc(crtc); > + if (acrtc->event) { > + drm_crtc_send_vblank_event(crtc, acrtc->event); > + acrtc->event = NULL; > + drm_crtc_vblank_put(crtc); > + acrtc->pflip_status = AMDGPU_FLIP_NONE; > + } > + } > + spin_unlock_irqrestore(&dev->event_lock, flags); > + } > > drm_atomic_helper_cleanup_planes(dev, state); > > -- > 2.53.0 >