drm/i915: Split pipe+output CSC programming to noarm+arm pair
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 24 Feb 2022 16:51:03 +0000 (18:51 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 29 Mar 2022 13:35:33 +0000 (16:35 +0300)
commitd13dde4495800c4e7b98d81eab9472ae248ff49e
tree7117ef59ab22e861ea4a38c83a5a7ae8d7bece13
parente9b14658d51950d5ab6ef219fb3c9483c70a18ec
drm/i915: Split pipe+output CSC programming to noarm+arm pair

Move most of the pipe+output CSC programming to the
.color_commit_noarm() hook which runs before vblank evasion.
Only PIPE_CSC_MODE (the arming register) needs to remain in
inside the critical section.

A test case that just updates the CTM in a loop produces
the following i915_update_info numbers on ilk (w/o lockdep):
old                                 new
Updates: 10012     Updates: 10008
       |         |
   1us |**        1us |**********
       |*************         |*************
   4us |*********        4us |*
       |*         |**
  16us |       16us |
       |         |
  66us |       66us |
       |         |
 262us |      262us |
       |         |
   1ms |        1ms |
       |         |
   4ms |        4ms |
       |         |
  17ms |       17ms |
       |         |
Min update: 1345ns     Min update: 1268ns
Max update: 16672ns     Max update: 15656ns
Average update: 3914ns     Average update: 2185ns
Overruns > 100us: 0     Overruns > 100us: 0

And here is tgl (forced to update both pipe CSC and
output CSC, and with lockdep enabled):
old                                 new
Updates: 10012     Updates: 10012
       |         |
   1us |        1us |
       |         |
   4us |*        4us |**
       |**         |**********
  16us |*************       16us |*************
       |*         |
  66us |       66us |
       |         |
 262us |      262us |
       |         |
   1ms |        1ms |
       |         |
   4ms |        4ms |
       |         |
  17ms |       17ms |
       |         |
Min update: 5204ns     Min update: 5176ns
Max update: 176038ns     Max update: 186685ns
Average update: 23931ns     Average update: 16654ns
Overruns > 250us: 0     Overruns > 250us: 0

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220224165103.15682-5-ville.syrjala@linux.intel.com
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
drivers/gpu/drm/i915/display/intel_color.c