[PATCH 8/8] drm/i915/irq: move i915->irq_lock to display->irq.lock

Jani Nikula jani.nikula at intel.com
Wed May 7 08:34:30 UTC 2025


On Tue, 06 May 2025, Gustavo Sousa <gustavo.sousa at intel.com> wrote:
> Quoting Jani Nikula (2025-05-06 10:06:50-03:00)
>>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.
>>
>>Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>
> Besides reviewing the patch itself, I also did a git-grep to check for
> lexical references to irq_lock in the code after this patch is applied.
>
> I found 2 references in comments:
>
>  (1) A reference to "drm_i915_private::irq_lock" in the comment for member
>      detection_work_enabled of struct intel_hotplug. I think we can
>      simply refer to "intel_display::irq::lock" now.
>
>  (2) A reference to "i915->irq_lock" in a comment inside struct intel_rps.
>      Looking at the history, it looks like we started using gt->irq_lock
>      with commit d762043f7ab1 ("drm/i915: Extract GT powermanagement
>      interrupt handling"), which failed to update the comment. I think
>      we can update the comment to make it more accurate. I guess that
>      could be on a patch of its own...

Thanks for spotting these!

I sent a separate fix for (2), because it is kind of separate [1].

> So, with the small tweak suggested in (1),
>
>   Reviewed-by: Gustavo Sousa <gustavo.sousa at intel.com>

Thanks a lot for the reviews! I took the liberty of tweaking the comment
(1) while applying, and pushed the series to din.

BR,
Jani.


[1] https://lore.kernel.org/r/20250507083136.1987023-1-jani.nikula@intel.com


-- 
Jani Nikula, Intel


More information about the Intel-xe mailing list