On Fri, Jan 23, 2026 at 3:37 AM Hamza Mahfooz
<[email protected]> 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 <[email protected]>
> ---
> 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.

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
>

Reply via email to