Hey,

Den 2026-02-25 kl. 10:25, skrev Jani Nikula:
> On Fri, 20 Feb 2026, Maarten Lankhorst <[email protected]> wrote:
>> intel_set_pipe_src_size(), hsw_set_linetime_wm(),
>> intel_cpu_transcoder_set_m1_n1() and intel_set_transcoder_timings_lrr()
>> are called from an atomic context on PREEMPT_RT, and should be using the
>> _fw functions.
> 
> Problem is, ~nobody knows when they should be using _fw anymore when
> they're all over the place. It'll get cargo culted.

It's not too hard, IMO.

Called from vblank evasion:
All functions should use the _dsb postfixed functions if applicable, and 
intel_de_read_fw.
On code only for old platforms, the _fw functions can be used.

Lockdep complains hard on PREEMPT_RT if this is not the case, especially since 
vblank
evasion with this series  doesn't acquire or release any lock at all. It will 
allow us
to uncouple the VBLANK_EVASION_TIME_US define from PROVE_LOCKING.

Should I switch to use the _dsb prefixes all the time for readability?

Called from vblank readout:
- we're disabling preemption, so _fw functions must be used as the spinlocks 
cannot be taken.

Other cases:
- Normal functions. Same for encoder enabling etc.

Sidenote:
I believe it's a mistake to make the intel_dmc_wl_get/put() functions implicit. 
There
is already power well support for everything that needs it.

Explicit force_wake like xe_force_wake would be a better model. It could be 
implemented as
simple as holding the dmc forcewake around the entire modeset sequence, which 
would still
be protective. While for debugging we can still complain about affected 
registers outside
the sequence until CI is clean.

Kind regards,
~Maarten Lankhorst

Reply via email to