drm/i915: Split skl+ plane update into noarm+arm pair
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 18 Oct 2021 11:50:26 +0000 (14:50 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 4 Nov 2021 15:59:24 +0000 (17:59 +0200)
commit890b6ec4a522799d36bd10aee993059d771c06f4
tree77e7de0ca9f3a225389fbe454ee7918364206421
parent8ac80733cf6f08b9fdac9bf6800dd81e9304b4c6
drm/i915: Split skl+ plane update into noarm+arm pair

Chop skl_program_plane() into two halves. Fist half becomes
the _noarm() variant, second part the _arm() variant.

Fortunately I have already previously grouped the register
writes into roughtly the correct order, so the split looks
surprisingly clean.

A few notable oddities I did not realize were self arming
are AUX_DIST and COLOR_CTL.

i915_update_info doesn't look too terrible on my cfl running
kms_atomic_transition --r plane-all-transition --extended:
w/o patch                           w/ patch
Updates: 2178                       Updates: 2018
       |                                   |
   1us |                               1us |
       |                                   |
   4us |                               4us |*****
       |*********                          |**********
  16us |**********                    16us |*******
       |***                                |
  66us |                              66us |
       |                                   |
 262us |                             262us |
       |                                   |
   1ms |                               1ms |
       |                                   |
   4ms |                               4ms |
       |                                   |
  17ms |                              17ms |
       |                                   |
Min update: 8332ns                  Min update: 6164ns
Max update: 48758ns                 Max update: 31808ns
Average update: 19959ns             Average update: 13159ns
Overruns > 100us: 0                 Overruns > 100us: 0

And with lockdep enabled:
w/o patch                           w/ patch
Updates: 2177     Updates: 2172
       |         |
   1us |        1us |
       |         |
   4us |        4us |
       |*******         |*********
  16us |**********       16us |**********
       |*******         |*
  66us |       66us |
       |         |
 262us |      262us |
       |         |
   1ms |        1ms |
       |         |
   4ms |        4ms |
       |         |
  17ms |       17ms |
       |         |
Min update: 12645ns     Min update: 9980ns
Max update: 50153ns     Max update: 33533ns
Average update: 25337ns     Average update: 18245ns
Overruns > 250us: 0     Overruns > 250us: 0

TODO: On icl+ everything seems to be armed by PLANE_SURF, so we
      can optimize this even further on modern platforms. But I
      think there's a bit of refactoring to be done first to
      figure out the best way to go about it (eg. just reusing
      the current skl+ functions, or doing a lower level split).

TODO: Split scaler programming as well, but IIRC the scaler
      has some oddball double buffering behaviour on some
      platforms, so needs proper reverse engineering

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