summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_hotplug_irq.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2025-05-06 16:06:50 +0300
committerJani Nikula <jani.nikula@intel.com>2025-05-07 11:09:43 +0300
commit0f2ab6a773e26f1e3d4a5de5476ee8288e6628f9 (patch)
tree567afa96bf1f64e2da63b2daa82d50819964e00b /drivers/gpu/drm/i915/display/intel_hotplug_irq.c
parent9536d60202fda83e30dd4885b8c91e7dec53324f (diff)
drm/i915/irq: move i915->irq_lock to display->irq.lock
Observe that i915->irq_lock is no longer used to protect anything outside of display. Make it a display thing. This allows us to remove the ugly #define irq_lock irq.lock hack from xe compat header. Note that this is slightly more subtle than it first looks. For i915, there's no functional change here. The lock is moved. However, for xe, we'll now have *two* locks, xe->irq.lock and display->irq.lock. These should protect different things, though. Indeed, nesting in the past would've lead to a deadlock because they were the same lock. With the i915 references gone, we can make a handful more files independent of i915_drv.h. Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Link: https://lore.kernel.org/r/6d8d2ce0f34a9c7361a5e2fcf96bb32a34c57e76.1746536745.git.jani.nikula@intel.com [Jani: Fixed a comment while applying.] Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_hotplug_irq.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_hotplug_irq.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_hotplug_irq.c b/drivers/gpu/drm/i915/display/intel_hotplug_irq.c
index c841399e5c88..c024b42369c8 100644
--- a/drivers/gpu/drm/i915/display/intel_hotplug_irq.c
+++ b/drivers/gpu/drm/i915/display/intel_hotplug_irq.c
@@ -3,8 +3,10 @@
* Copyright © 2023 Intel Corporation
*/
-#include "i915_drv.h"
+#include <drm/drm_print.h>
+
#include "i915_reg.h"
+#include "i915_utils.h"
#include "intel_de.h"
#include "intel_display_irq.h"
#include "intel_display_types.h"
@@ -183,9 +185,7 @@ static void intel_hpd_init_pins(struct intel_display *display)
void i915_hotplug_interrupt_update_locked(struct intel_display *display,
u32 mask, u32 bits)
{
- struct drm_i915_private *dev_priv = to_i915(display->drm);
-
- lockdep_assert_held(&dev_priv->irq_lock);
+ lockdep_assert_held(&display->irq.lock);
drm_WARN_ON(display->drm, bits & ~mask);
intel_de_rmw(display, PORT_HOTPLUG_EN(display), mask, bits);
@@ -207,11 +207,9 @@ void i915_hotplug_interrupt_update(struct intel_display *display,
u32 mask,
u32 bits)
{
- struct drm_i915_private *dev_priv = to_i915(display->drm);
-
- spin_lock_irq(&dev_priv->irq_lock);
+ spin_lock_irq(&display->irq.lock);
i915_hotplug_interrupt_update_locked(display, mask, bits);
- spin_unlock_irq(&dev_priv->irq_lock);
+ spin_unlock_irq(&display->irq.lock);
}
static bool gen11_port_hotplug_long_detect(enum hpd_pin pin, u32 val)
@@ -556,7 +554,6 @@ void xelpdp_pica_irq_handler(struct intel_display *display, u32 iir)
void icp_irq_handler(struct intel_display *display, u32 pch_iir)
{
- struct drm_i915_private *dev_priv = to_i915(display->drm);
u32 ddi_hotplug_trigger = pch_iir & SDE_DDI_HOTPLUG_MASK_ICP;
u32 tc_hotplug_trigger = pch_iir & SDE_TC_HOTPLUG_MASK_ICP;
u32 pin_mask = 0, long_mask = 0;
@@ -565,9 +562,9 @@ void icp_irq_handler(struct intel_display *display, u32 pch_iir)
u32 dig_hotplug_reg;
/* Locking due to DSI native GPIO sequences */
- spin_lock(&dev_priv->irq_lock);
+ spin_lock(&display->irq.lock);
dig_hotplug_reg = intel_de_rmw(display, SHOTPLUG_CTL_DDI, 0, 0);
- spin_unlock(&dev_priv->irq_lock);
+ spin_unlock(&display->irq.lock);
intel_get_hpd_pins(display, &pin_mask, &long_mask,
ddi_hotplug_trigger, dig_hotplug_reg,
@@ -1395,10 +1392,9 @@ static void i915_hpd_enable_detection(struct intel_encoder *encoder)
static void i915_hpd_irq_setup(struct intel_display *display)
{
- struct drm_i915_private *dev_priv = to_i915(display->drm);
u32 hotplug_en;
- lockdep_assert_held(&dev_priv->irq_lock);
+ lockdep_assert_held(&display->irq.lock);
/*
* Note HDMI and DP share hotplug bits. Enable bits are the same for all