Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [CI 1/2] drm/i915: Prevent HW access during init from SDVO TV get_modes hook
@ 2024-02-12 17:52 Imre Deak
  2024-02-12 17:52 ` [CI 2/2] drm/i915: Prevent HW access during init from connector get_modes hooks Imre Deak
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Imre Deak @ 2024-02-12 17:52 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jouni Högander

Prevent accessing the HW from the SDVO/TV get_modes connector hook.
Returning 0 from the hook will make the caller -
drm_helper_probe_single_connector_modes() - return a default/EDID
override mode list to users. This matches the case where
intel_sdvo_get_tv_modes() fails to retrieve the current mode list due to
a HW access failure.

v2: Clarify the commit message wrt. which modes get_modes() returns. (Jouni)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
---
 drivers/gpu/drm/i915/display/intel_sdvo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
index 412c15d32f07e..c67605059aa3e 100644
--- a/drivers/gpu/drm/i915/display/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
@@ -2312,6 +2312,9 @@ static int intel_sdvo_get_tv_modes(struct drm_connector *connector)
 	drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s]\n",
 		    connector->base.id, connector->name);
 
+	if (!intel_display_driver_check_access(i915))
+		return 0;
+
 	/*
 	 * Read the list of supported input resolutions for the selected TV
 	 * format.
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-13 11:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-12 17:52 [CI 1/2] drm/i915: Prevent HW access during init from SDVO TV get_modes hook Imre Deak
2024-02-12 17:52 ` [CI 2/2] drm/i915: Prevent HW access during init from connector get_modes hooks Imre Deak
2024-02-12 18:53 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [CI,1/2] drm/i915: Prevent HW access during init from SDVO TV get_modes hook Patchwork
2024-02-12 19:03 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-12 21:54 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-02-13 11:43   ` Imre Deak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox