From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from h5.fbrelay.privateemail.com (h5.fbrelay.privateemail.com [162.0.218.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC2102FBE1C for ; Fri, 23 Jan 2026 00:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.0.218.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769127356; cv=none; b=OQbVdb7fMgyfKosMRmJ4Y6SU7Oltx2dSUxRMYR5ZELndQPwWyUu9FU0TkYXlvDOlE54mwPgThcBxVKxeOwE580/DOhPSxZQx0VNmVFZvfqxcMjQQI47c6H43SRYMKCZTZ2pLBXncA/OqKg5Kxi6Bq15yAJmY+AzEvfW0cgVV6QQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769127356; c=relaxed/simple; bh=pyfGMa9QruvS/X4thpoX/nm4V5TV0W/B4Oo9mJRc1s0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uqrHKSAb1RFoRUiBTiZRUql/3QgemOd+UOfuYR5OWfDC451LAmO75CA/Anx2z/pWVaKSYWaMd9ilV45oss6hwfizlh4H5fBSoKayg7aQ5voGbuBy1QY+OUhJEvniM6ivBmdd46Q0WFsX/kajRphnsqRzTPguA+0HS5Z+XguQc3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=effective-light.com; spf=pass smtp.mailfrom=effective-light.com; arc=none smtp.client-ip=162.0.218.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=effective-light.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=effective-light.com Received: from MTA-06-4.privateemail.com (mta-06.privateemail.com [198.54.118.213]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by h5.fbrelay.privateemail.com (Postfix) with ESMTPSA id 4dxys24fGPz2xBg for ; Fri, 23 Jan 2026 00:06:30 +0000 (UTC) Received: from localhost.localdomain (bras-base-toroon4332w-grc-44-142-112-152-160.dsl.bell.ca [142.112.152.160]) by mta-06.privateemail.com (Postfix) with ESMTPA id 4dxyrG4jCnz3hhTB; Thu, 22 Jan 2026 19:05:50 -0500 (EST) From: Hamza Mahfooz To: dri-devel@lists.freedesktop.org Cc: Hamza Mahfooz , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , Harry Wentland , Leo Li , Rodrigo Siqueira , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Sunil Khatri , Ce Sun , Lijo Lazar , Kenneth Feng , Ivan Lipski , Alex Hung , Tom Chung , Melissa Wen , =?UTF-8?q?Michel=20D=C3=A4nzer?= , Fangzhi Zuo , =?UTF-8?q?Timur=20Krist=C3=B3f?= , amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] drm: introduce page_flip_timeout() Date: Thu, 22 Jan 2026 19:05:27 -0500 Message-ID: <20260123000537.2450496-1-someguy@effective-light.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4dxys24fGPz2xBg There should be a mechanism for drivers to respond to flip_done time outs. Since, as it stands it is possible for the display to stall indefinitely, necessitating a hard reset. So, introduce a new crtc callback that is called by drm_atomic_helper_wait_for_flip_done() to give drivers a shot at recovering from page flip timeouts. Signed-off-by: Hamza Mahfooz --- drivers/gpu/drm/drm_atomic_helper.c | 6 +++++- include/drm/drm_crtc.h | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 5840e9cc6f66..3a144c324b19 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1881,9 +1881,13 @@ void drm_atomic_helper_wait_for_flip_done(struct drm_device *dev, continue; ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ); - if (ret == 0) + if (!ret) { drm_err(dev, "[CRTC:%d:%s] flip_done timed out\n", crtc->base.id, crtc->name); + + if (crtc->funcs->page_flip_timeout) + crtc->funcs->page_flip_timeout(crtc); + } } if (state->fake_commit) diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 66278ffeebd6..45dc5a76e915 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -609,6 +609,15 @@ struct drm_crtc_funcs { uint32_t flags, uint32_t target, struct drm_modeset_acquire_ctx *ctx); + /** + * @page_flip_timeout: + * + * This optional hook is called if &drm_crtc_commit.flip_done times out, + * and can be used by drivers to attempt to recover from a page flip + * timeout. + */ + void (*page_flip_timeout)(struct drm_crtc *crtc); + /** * @set_property: * -- 2.52.0