All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: dri-devel@lists.freedesktop.org,
	Hamza Mahfooz <someguy@effective-light.com>
Cc: "Hamza Mahfooz" <someguy@effective-light.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Sunil Khatri" <sunil.khatri@amd.com>,
	"Lijo Lazar" <lijo.lazar@amd.com>, "Ce Sun" <cesun102@amd.com>,
	"Ivan Lipski" <ivan.lipski@amd.com>,
	"Kenneth Feng" <kenneth.feng@amd.com>,
	"Alex Hung" <alex.hung@amd.com>,
	"Tom Chung" <chiahsuan.chung@amd.com>,
	"Melissa Wen" <mwen@igalia.com>,
	"Michel Dänzer" <mdaenzer@redhat.com>,
	"Fangzhi Zuo" <Jerry.Zuo@amd.com>,
	amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/amdgpu: implement page_flip_timeout() support
Date: Fri, 23 Jan 2026 12:20:30 +0100	[thread overview]
Message-ID: <10030872.eNJFYEL58v@timur-hyperion> (raw)
In-Reply-To: <20260123000537.2450496-2-someguy@effective-light.com>

On Friday, January 23, 2026 1:05:28 AM Central European Standard Time Hamza 
Mahfooz 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@effective-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.
> ---

MODE2 reset _is_ a full reset on APUs, it resets everything but just doesn't 
lose the RAM contents. Also note that MODE2 reset is not supported on 
dedicated GPUs, so this will likely trigger a full reset for those.

Can you say how you tested this? I'd be happy to test it myself too.

>  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);
> +	}
> +}
> +
>  /* 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,





  reply	other threads:[~2026-01-23 11:20 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23  0:05 [PATCH 1/2] drm: introduce page_flip_timeout() Hamza Mahfooz
2026-01-23  0:05 ` [PATCH 2/2] drm/amdgpu: implement page_flip_timeout() support Hamza Mahfooz
2026-01-23 11:20   ` Timur Kristóf [this message]
2026-01-23 14:25     ` Hamza Mahfooz
2026-01-23 12:26   ` kernel test robot
2026-01-23 15:16   ` kernel test robot
2026-01-23 17:49   ` Alex Deucher
2026-01-23 18:10     ` Alex Deucher
2026-01-23 13:52 ` [PATCH 1/2] drm: introduce page_flip_timeout() Christian König
2026-01-23 14:44   ` Hamza Mahfooz
2026-01-23 16:12     ` Christian König
2026-01-23 19:41     ` Alex Deucher
2026-01-23 14:44   ` Timur Kristóf
2026-01-23 22:30     ` Mario Limonciello
2026-01-24 18:32       ` Hamza Mahfooz
2026-01-24 18:43         ` Mario Limonciello
2026-01-24 19:49           ` Hamza Mahfooz
2026-01-27 22:44             ` Hamza Mahfooz
2026-01-26 14:20         ` Alex Deucher
2026-01-27 22:52           ` Hamza Mahfooz
2026-01-27 22:57             ` Alex Deucher
2026-01-28 10:39               ` Christian König
2026-01-28 11:26                 ` Michel Dänzer
2026-01-28 12:14                   ` Timur Kristóf
2026-01-28 12:48                     ` Christian König
2026-01-28 14:25                       ` Michel Dänzer
2026-01-29 10:06                         ` Michel Dänzer
2026-01-29 11:25                           ` Timur Kristóf
2026-01-29 11:38                             ` Christian König
2026-01-29 12:06                               ` Timur Kristóf
2026-01-29 12:59                                 ` Christian König
2026-01-29 14:04                                   ` Hamza Mahfooz
2026-01-29 14:24                                     ` Christian König
2026-01-29 14:33                                       ` Hamza Mahfooz
2026-01-29 14:41                                         ` Christian König
2026-02-03 21:48                                   ` Timur Kristóf
2026-01-29 21:56                           ` Xaver Hugl
2026-01-26 10:14     ` Christian König
2026-01-26 10:27       ` Michel Dänzer
2026-01-26 13:00         ` Christian König
2026-01-26 14:31           ` Michel Dänzer
2026-01-28  9:19           ` Timur Kristóf
2026-01-28 11:25             ` Christian König
2026-01-28 12:22               ` Timur Kristóf
2026-01-28 14:25               ` Michel Dänzer
2026-01-28 14:35                 ` Christian König
2026-01-29 21:39           ` Xaver Hugl

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=10030872.eNJFYEL58v@timur-hyperion \
    --to=timur.kristof@gmail.com \
    --cc=Jerry.Zuo@amd.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=cesun102@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=ivan.lipski@amd.com \
    --cc=kenneth.feng@amd.com \
    --cc=lijo.lazar@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mdaenzer@redhat.com \
    --cc=mripard@kernel.org \
    --cc=mwen@igalia.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=someguy@effective-light.com \
    --cc=sunil.khatri@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.