Merge drm/drm-next into drm-intel-next
authorJani Nikula <jani.nikula@intel.com>
Mon, 22 Nov 2021 15:35:32 +0000 (17:35 +0200)
committerJani Nikula <jani.nikula@intel.com>
Mon, 22 Nov 2021 15:35:32 +0000 (17:35 +0200)
Sync up with drm-next to get v5.16-rc2.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1  2 
drivers/gpu/drm/i915/Kconfig
drivers/gpu/drm/i915/i915_trace.h
drivers/gpu/drm/i915/intel_runtime_pm.c

@@@ -21,7 -21,7 +21,7 @@@ config DRM_I91
        select ACPI_VIDEO if ACPI
        select ACPI_BUTTON if ACPI
        select SYNC_FILE
 -      select IOSF_MBI
 +      select IOSF_MBI if X86
        select CRC32
        select SND_HDA_I915 if SND_HDA_CORE
        select CEC_CORE if CEC_NOTIFIER
@@@ -126,6 -126,7 +126,7 @@@ config DRM_I915_GVT_KVMG
        depends on DRM_I915_GVT
        depends on KVM
        depends on VFIO_MDEV
+       select KVM_EXTERNAL_WRITE_TRACKING
        default n
        help
          Choose this option if you want to enable KVMGT support for
@@@ -288,7 -288,7 +288,7 @@@ TRACE_EVENT(vlv_fifo_size
  
  /* plane updates */
  
 -TRACE_EVENT(intel_update_plane,
 +TRACE_EVENT(intel_plane_update_noarm,
            TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
            TP_ARGS(plane, crtc),
  
                      DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
  );
  
 -TRACE_EVENT(intel_disable_plane,
 +TRACE_EVENT(intel_plane_update_arm,
 +          TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
 +          TP_ARGS(plane, crtc),
 +
 +          TP_STRUCT__entry(
 +                           __field(enum pipe, pipe)
 +                           __field(u32, frame)
 +                           __field(u32, scanline)
 +                           __array(int, src, 4)
 +                           __array(int, dst, 4)
 +                           __string(name, plane->name)
 +                           ),
 +
 +          TP_fast_assign(
 +                         __assign_str(name, plane->name);
 +                         __entry->pipe = crtc->pipe;
 +                         __entry->frame = intel_crtc_get_vblank_counter(crtc);
 +                         __entry->scanline = intel_get_crtc_scanline(crtc);
 +                         memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
 +                         memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
 +                         ),
 +
 +          TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
 +                    pipe_name(__entry->pipe), __get_str(name),
 +                    __entry->frame, __entry->scanline,
 +                    DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
 +                    DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
 +);
 +
 +TRACE_EVENT(intel_plane_disable_arm,
            TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
            TP_ARGS(plane, crtc),
  
@@@ -433,48 -404,6 +433,48 @@@ TRACE_EVENT(intel_fbc_nuke
  
  /* pipe updates */
  
 +TRACE_EVENT(intel_crtc_vblank_work_start,
 +          TP_PROTO(struct intel_crtc *crtc),
 +          TP_ARGS(crtc),
 +
 +          TP_STRUCT__entry(
 +                           __field(enum pipe, pipe)
 +                           __field(u32, frame)
 +                           __field(u32, scanline)
 +                           ),
 +
 +          TP_fast_assign(
 +                         __entry->pipe = crtc->pipe;
 +                         __entry->frame = intel_crtc_get_vblank_counter(crtc);
 +                         __entry->scanline = intel_get_crtc_scanline(crtc);
 +                         ),
 +
 +          TP_printk("pipe %c, frame=%u, scanline=%u",
 +                    pipe_name(__entry->pipe), __entry->frame,
 +                     __entry->scanline)
 +);
 +
 +TRACE_EVENT(intel_crtc_vblank_work_end,
 +          TP_PROTO(struct intel_crtc *crtc),
 +          TP_ARGS(crtc),
 +
 +          TP_STRUCT__entry(
 +                           __field(enum pipe, pipe)
 +                           __field(u32, frame)
 +                           __field(u32, scanline)
 +                           ),
 +
 +          TP_fast_assign(
 +                         __entry->pipe = crtc->pipe;
 +                         __entry->frame = intel_crtc_get_vblank_counter(crtc);
 +                         __entry->scanline = intel_get_crtc_scanline(crtc);
 +                         ),
 +
 +          TP_printk("pipe %c, frame=%u, scanline=%u",
 +                    pipe_name(__entry->pipe), __entry->frame,
 +                     __entry->scanline)
 +);
 +
  TRACE_EVENT(intel_pipe_update_start,
            TP_PROTO(struct intel_crtc *crtc),
            TP_ARGS(crtc),
@@@ -865,7 -794,6 +865,6 @@@ DECLARE_EVENT_CLASS(i915_request
            TP_STRUCT__entry(
                             __field(u32, dev)
                             __field(u64, ctx)
-                            __field(u32, guc_id)
                             __field(u16, class)
                             __field(u16, instance)
                             __field(u32, seqno)
                           __entry->dev = rq->engine->i915->drm.primary->index;
                           __entry->class = rq->engine->uabi_class;
                           __entry->instance = rq->engine->uabi_instance;
-                          __entry->guc_id = rq->context->guc_id.id;
                           __entry->ctx = rq->fence.context;
                           __entry->seqno = rq->fence.seqno;
                           __entry->tail = rq->tail;
                           ),
  
-           TP_printk("dev=%u, engine=%u:%u, guc_id=%u, ctx=%llu, seqno=%u, tail=%u",
+           TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, tail=%u",
                      __entry->dev, __entry->class, __entry->instance,
-                     __entry->guc_id, __entry->ctx, __entry->seqno,
-                     __entry->tail)
+                     __entry->ctx, __entry->seqno, __entry->tail)
  );
  
  DEFINE_EVENT(i915_request, i915_request_add,
@@@ -65,16 -65,6 +65,6 @@@ static noinline depot_stack_handle_t __
        return stack_depot_save(entries, n, GFP_NOWAIT | __GFP_NOWARN);
  }
  
- static void __print_depot_stack(depot_stack_handle_t stack,
-                               char *buf, int sz, int indent)
- {
-       unsigned long *entries;
-       unsigned int nr_entries;
-       nr_entries = stack_depot_fetch(stack, &entries);
-       stack_trace_snprint(buf, sz, entries, nr_entries, indent);
- }
  static void init_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm)
  {
        spin_lock_init(&rpm->debug.lock);
@@@ -146,12 -136,12 +136,12 @@@ static void untrack_intel_runtime_pm_wa
                if (!buf)
                        return;
  
-               __print_depot_stack(stack, buf, PAGE_SIZE, 2);
+               stack_depot_snprint(stack, buf, PAGE_SIZE, 2);
                DRM_DEBUG_DRIVER("wakeref %x from\n%s", stack, buf);
  
                stack = READ_ONCE(rpm->debug.last_release);
                if (stack) {
-                       __print_depot_stack(stack, buf, PAGE_SIZE, 2);
+                       stack_depot_snprint(stack, buf, PAGE_SIZE, 2);
                        DRM_DEBUG_DRIVER("wakeref last released at\n%s", buf);
                }
  
@@@ -183,12 -173,12 +173,12 @@@ __print_intel_runtime_pm_wakeref(struc
                return;
  
        if (dbg->last_acquire) {
-               __print_depot_stack(dbg->last_acquire, buf, PAGE_SIZE, 2);
+               stack_depot_snprint(dbg->last_acquire, buf, PAGE_SIZE, 2);
                drm_printf(p, "Wakeref last acquired:\n%s", buf);
        }
  
        if (dbg->last_release) {
-               __print_depot_stack(dbg->last_release, buf, PAGE_SIZE, 2);
+               stack_depot_snprint(dbg->last_release, buf, PAGE_SIZE, 2);
                drm_printf(p, "Wakeref last released:\n%s", buf);
        }
  
                rep = 1;
                while (i + 1 < dbg->count && dbg->owners[i + 1] == stack)
                        rep++, i++;
-               __print_depot_stack(stack, buf, PAGE_SIZE, 2);
+               stack_depot_snprint(stack, buf, PAGE_SIZE, 2);
                drm_printf(p, "Wakeref x%lu taken at:\n%s", rep, buf);
        }
  
@@@ -600,9 -590,6 +590,9 @@@ void intel_runtime_pm_enable(struct int
                pm_runtime_use_autosuspend(kdev);
        }
  
 +      /* Enable by default */
 +      pm_runtime_allow(kdev);
 +
        /*
         * The core calls the driver load handler with an RPM reference held.
         * We drop that here and will reacquire it during unloading in