lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADnq5_O2nvAEPm654aD1g5EQDfHOpE82N1wLVtCBxveWyiHB1w@mail.gmail.com>
Date: Fri, 23 Jan 2026 13:10:37 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Hamza Mahfooz <someguy@...ective-light.com>
Cc: dri-devel@...ts.freedesktop.org, Alex Deucher <alexander.deucher@....com>, 
	Christian König <christian.koenig@....com>, 
	David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, 
	Harry Wentland <harry.wentland@....com>, Leo Li <sunpeng.li@....com>, 
	Rodrigo Siqueira <siqueira@...lia.com>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, 
	Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, 
	Sunil Khatri <sunil.khatri@....com>, Lijo Lazar <lijo.lazar@....com>, Ce Sun <cesun102@....com>, 
	Ivan Lipski <ivan.lipski@....com>, Kenneth Feng <kenneth.feng@....com>, 
	Alex Hung <alex.hung@....com>, Tom Chung <chiahsuan.chung@....com>, 
	Melissa Wen <mwen@...lia.com>, Michel Dänzer <mdaenzer@...hat.com>, 
	Fangzhi Zuo <Jerry.Zuo@....com>, Timur Kristóf <timur.kristof@...il.com>, 
	amd-gfx@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] drm/amdgpu: implement page_flip_timeout() support

On Fri, Jan 23, 2026 at 12:49 PM Alex Deucher <alexdeucher@...il.com> wrote:
>
> On Fri, Jan 23, 2026 at 3:37 AM Hamza Mahfooz
> <someguy@...ective-light.com> wrote:
> >
> > We now have a means to respond to page flip timeouts. So, hook up
> > support for the new page_flip_timeout() callback.
> >
> > Signed-off-by: Hamza Mahfooz <someguy@...ective-light.com>
> > ---
> > Hi,
> >
> > I have tested this on 7940HS system and it appears even a MODE2 reset
> > will reset display firmware, so I don't think we need to force a full
> > reset here.
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c      |  2 ++
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h      |  1 +
> >  .../drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 18 ++++++++++++++++++
> >  3 files changed, 21 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> > index 28c4ad62f50e..bd63f0345984 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> > @@ -343,6 +343,8 @@ void amdgpu_reset_get_desc(struct amdgpu_reset_context *rst_ctxt, char *buf,
> >         case AMDGPU_RESET_SRC_USERQ:
> >                 strscpy(buf, "user queue trigger", len);
> >                 break;
> > +       case AMDGPU_RESET_SRC_DISPLAY:
> > +               strscpy(buf, "display hang", len);
> >         default:
> >                 strscpy(buf, "unknown", len);
> >         }
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h
> > index 07b4d37f1db6..53b577062b11 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h
> > @@ -44,6 +44,7 @@ enum AMDGPU_RESET_SRCS {
> >         AMDGPU_RESET_SRC_HWS,
> >         AMDGPU_RESET_SRC_USER,
> >         AMDGPU_RESET_SRC_USERQ,
> > +       AMDGPU_RESET_SRC_DISPLAY,
> >  };
> >
> >  struct amdgpu_reset_context {
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
> > index 697e232acebf..2233e5b3b6a2 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
> > @@ -28,6 +28,7 @@
> >
> >  #include "dc.h"
> >  #include "amdgpu.h"
> > +#include "amdgpu_reset.h"
> >  #include "amdgpu_dm_psr.h"
> >  #include "amdgpu_dm_replay.h"
> >  #include "amdgpu_dm_crtc.h"
> > @@ -578,12 +579,29 @@ amdgpu_dm_atomic_crtc_get_property(struct drm_crtc *crtc,
> >  }
> >  #endif
> >
> > +static void amdgpu_dm_crtc_handle_timeout(struct drm_crtc *crtc)
> > +{
> > +       struct amdgpu_device *adev = drm_to_adev(crtc->dev);
> > +       struct amdgpu_reset_context reset_context = {0};
> > +
> > +       if (amdgpu_device_should_recover_gpu(adev)) {
> > +               memset(&reset_context, 0, sizeof(reset_context));
> > +
> > +               reset_context.method = AMD_RESET_METHOD_NONE;
> > +               reset_context.reset_req_dev = adev;
> > +               reset_context.src = AMDGPU_RESET_SRC_DISPLAY;
> > +
> > +               amdgpu_device_gpu_recover(adev, NULL, &reset_context);
> > +       }
>
> Rather than resetting the whole GPU here, does just suspending and
> resuming DC help?  E.g., call dm_suspend() and dm_resume(), but force
> the reset path (the amdgpu_in_reset() case) in those functions.  If
> that works, that should help narrow down where the problem is.

Actually does just calling drm_crtc_send_vblank_event() for all of the
relevant crtcs at this point help?

Alex

>
> Alex
>
>
> > +}
> > +
> >  /* Implemented only the options currently available for the driver */
> >  static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = {
> >         .reset = amdgpu_dm_crtc_reset_state,
> >         .destroy = amdgpu_dm_crtc_destroy,
> >         .set_config = drm_atomic_helper_set_config,
> >         .page_flip = drm_atomic_helper_page_flip,
> > +       .page_flip_timeout = amdgpu_dm_crtc_handle_timeout,
> >         .atomic_duplicate_state = amdgpu_dm_crtc_duplicate_state,
> >         .atomic_destroy_state = amdgpu_dm_crtc_destroy_state,
> >         .set_crc_source = amdgpu_dm_crtc_set_crc_source,
> > --
> > 2.52.0
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ