Merge tag 'drm-intel-gt-next-2023-12-08' of git://anongit.freedesktop.org/drm/drm...
authorDave Airlie <airlied@redhat.com>
Wed, 13 Dec 2023 01:20:49 +0000 (11:20 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 13 Dec 2023 01:20:49 +0000 (11:20 +1000)
UAPI Changes:

-   drm/i915: Implement fdinfo memory stats printing

    Use the newly added drm_print_memory_stats helper to show memory
    utilisation of our objects in drm/driver specific fdinfo output.

    To collect the stats we walk the per memory regions object lists
    and accumulate object size into the respective drm_memory_stats
    categories.

Cross-subsystem Changes:

- Backmerge of drm-next (to bring drm-intel-next for PXP changes)

Driver Changes:

- Wa_18028616096 now applies to all DG2 (Matt R)
- Drop Wa_22014600077 on all DG2 (Matt R)
- Add new ATS-M device ID (Haridhar)
- More Meteorlake (MTL) workarounds (Matt R, Dnyaneshwar, Jonathan,
  Gustavo, Radhakrishna)
- PMU WARN_ON cleanup on driver unbind (Umesh)
- Limit GGTT WC flushing workaround to pre BXT/ICL platforms
- Complement implementation for Wa_16018031267 / Wa_16018063123
  (Andrzej, Jonathan, Nirmoy, Chris)

- Properly print internal GSC engine in trace logs (Tvrtko)
- Track gt pm wakerefs (Andrzej)
- Fix null deref bugs on perf code when perf is disabled (Harshit,
  Tvrtko)
- Fix __i915_request_create memory leak on driver unbind (Andrzej)
- Remove spurious unsupported HuC message on MTL (Daniele)
- Read a shadowed mmio register for ggtt flush (Vinay)
- Add missing new-line to GT_TRACE (Andrzej)
- Add drm_dbgs for critical PXP events (Alan)
- Skip pxp init if gt is wedged (Zhanjun)

- Replace custom intel runtime_pm tracker with ref_tracker library
  (Andrzej)
- Compiler warning/static checker/coding style cleanups (Arnd, Nirmoy,
  Soumya, Gilbert, Dorcas, Kunwu, Sam, Tvrtko)
- Code structure and helper cleanups (Jani, Tvrtko, Andi)
- Selftest improvements (John, Tvrtko, Andrzej)

Signed-off-by: Dave Airlie <airlied@redhat.com>
# Conflicts:
# drivers/gpu/drm/i915/gt/intel_gt_mcr.c
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZXNBcsSwJEVsq9On@jlahtine-mobl.ger.corp.intel.com
1  2 
drivers/gpu/drm/i915/display/intel_display_power.c
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/gt/intel_gt.h
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_driver.c
drivers/gpu/drm/i915/i915_gpu_error.c
drivers/gpu/drm/i915/i915_gpu_error.h
drivers/gpu/drm/i915/intel_runtime_pm.c
drivers/gpu/drm/i915/intel_runtime_pm.h

Simple merge
Simple merge
Simple merge
Simple merge
index 4ce227f7e1e125290b9ef22a0943c034b4ef565a,b75052e69a2b76db5aea12f96f817eb37adcafeb..7c255bb1c3190d3294950bf07f77beacc59caaff
@@@ -15,8 -15,8 +15,9 @@@
  #include <drm/drm_mm.h>
  
  #include "display/intel_display_device.h"
 +#include "display/intel_display_params.h"
  #include "gt/intel_engine.h"
+ #include "gt/intel_engine_types.h"
  #include "gt/intel_gt_types.h"
  #include "gt/uc/intel_uc_fw.h"
  
index 156cb1536b4738266c221d39fca78afe0126496f,91491111dbd5adc87f53234a3f5d8d5565f1e1da..860b51b56a92be4a9f99e50a8a1cc524e863d9c1
   * present for a given platform.
   */
  
 +static struct drm_i915_private *rpm_to_i915(struct intel_runtime_pm *rpm)
 +{
 +      return container_of(rpm, struct drm_i915_private, runtime_pm);
 +}
 +
  #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
  
- #include <linux/sort.h>
- #define STACKDEPTH 8
- static noinline depot_stack_handle_t __save_depot_stack(void)
- {
-       unsigned long entries[STACKDEPTH];
-       unsigned int n;
-       n = stack_trace_save(entries, ARRAY_SIZE(entries), 1);
-       return stack_depot_save(entries, n, GFP_NOWAIT | __GFP_NOWARN);
- }
  static void init_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm)
  {
-       spin_lock_init(&rpm->debug.lock);
-       stack_depot_init();
+       ref_tracker_dir_init(&rpm->debug, INTEL_REFTRACK_DEAD_COUNT, dev_name(rpm->kdev));
  }
  
- static noinline depot_stack_handle_t
+ static intel_wakeref_t
  track_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm)
  {
-       depot_stack_handle_t stack, *stacks;
-       unsigned long flags;
-       if (rpm->no_wakeref_tracking)
+       if (!rpm->available || rpm->no_wakeref_tracking)
                return -1;
  
-       stack = __save_depot_stack();
-       if (!stack)
-               return -1;
-       spin_lock_irqsave(&rpm->debug.lock, flags);
-       if (!rpm->debug.count)
-               rpm->debug.last_acquire = stack;
-       stacks = krealloc(rpm->debug.owners,
-                         (rpm->debug.count + 1) * sizeof(*stacks),
-                         GFP_NOWAIT | __GFP_NOWARN);
-       if (stacks) {
-               stacks[rpm->debug.count++] = stack;
-               rpm->debug.owners = stacks;
-       } else {
-               stack = -1;
-       }
-       spin_unlock_irqrestore(&rpm->debug.lock, flags);
-       return stack;
+       return intel_ref_tracker_alloc(&rpm->debug);
  }
  
  static void untrack_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm,