]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Move pipe enable/disable tracepoints to intel_crtc_vblank_{on,off}()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 4 Mar 2021 17:04:18 +0000 (19:04 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 5 Mar 2021 14:38:56 +0000 (16:38 +0200)
On platforms/outputs without a working frame counter we rely
on the vblank code to cook up the frame counter from the timestamps.
That requires that vblank support is enabled. Thus we need to
move the pipe enable/disable tracepoints to the other side
of the drm_vblank_{on,off}() calls. There shouldn't really be
much happening between these old and new call sites so the
tracepoints should still provide reasonable data.

The alternative would be to give up on having the frame counter
values in the trace which would render the tracepoints more or
less pointless.

v2: Missed one case in intel_ddi_post_disable()
    Drop the now useless i915_trace.h includes

Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Tested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210304170421.10901-2-ville.syrjala@linux.intel.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
drivers/gpu/drm/i915/display/intel_crtc.c
drivers/gpu/drm/i915/display/intel_ddi.c
drivers/gpu/drm/i915/display/intel_display.c

index 88b44ac50aae10bfe56802f0114e177c28f15dde..e54f9cff518e9952437961e8fce7b05f48761918 100644 (file)
@@ -84,12 +84,26 @@ void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state)
        drm_crtc_set_max_vblank_count(&crtc->base,
                                      intel_crtc_max_vblank_count(crtc_state));
        drm_crtc_vblank_on(&crtc->base);
+
+       /*
+        * Should really happen exactly when we enable the pipe
+        * but we want the frame counters in the trace, and that
+        * requires vblank support on some platforms/outputs.
+        */
+       trace_intel_pipe_enable(crtc);
 }
 
 void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state)
 {
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 
+       /*
+        * Should really happen exactly when we disable the pipe
+        * but we want the frame counters in the trace, and that
+        * requires vblank support on some platforms/outputs.
+        */
+       trace_intel_pipe_disable(crtc);
+
        drm_crtc_vblank_off(&crtc->base);
        assert_vblank_disabled(&crtc->base);
 }
index 549e4399a0c217a51f4d64d1bd5f040f5c5dca05..c0ace39bbfdff02d14a21e4c6c262d13ca17d4a6 100644 (file)
@@ -28,7 +28,6 @@
 #include <drm/drm_scdc_helper.h>
 
 #include "i915_drv.h"
-#include "i915_trace.h"
 #include "intel_audio.h"
 #include "intel_combo_phy.h"
 #include "intel_connector.h"
@@ -2656,7 +2655,6 @@ static void intel_ddi_post_disable(struct intel_atomic_state *state,
                        intel_atomic_get_old_crtc_state(state, slave);
 
                intel_crtc_vblank_off(old_slave_crtc_state);
-               trace_intel_pipe_disable(slave);
 
                intel_dsc_disable(old_slave_crtc_state);
                skl_scaler_disable(old_slave_crtc_state);
index 39e8ab1408b6712224723a225e09e2b7c7bdeeb8..35bd7798beffd922a35828bcad0d3f6f03ee3317 100644 (file)
@@ -67,7 +67,6 @@
 #include "gt/intel_rps.h"
 
 #include "i915_drv.h"
-#include "i915_trace.h"
 #include "intel_acpi.h"
 #include "intel_atomic.h"
 #include "intel_atomic_plane.h"
@@ -794,8 +793,6 @@ void intel_enable_pipe(const struct intel_crtc_state *new_crtc_state)
                /* FIXME: assert CPU port conditions for SNB+ */
        }
 
-       trace_intel_pipe_enable(crtc);
-
        reg = PIPECONF(cpu_transcoder);
        val = intel_de_read(dev_priv, reg);
        if (val & PIPECONF_ENABLE) {
@@ -835,8 +832,6 @@ void intel_disable_pipe(const struct intel_crtc_state *old_crtc_state)
         */
        assert_planes_disabled(crtc);
 
-       trace_intel_pipe_disable(crtc);
-
        reg = PIPECONF(cpu_transcoder);
        val = intel_de_read(dev_priv, reg);
        if ((val & PIPECONF_ENABLE) == 0)
@@ -4026,10 +4021,8 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
        if (INTEL_GEN(dev_priv) >= 11)
                icl_pipe_mbus_enable(crtc);
 
-       if (new_crtc_state->bigjoiner_slave) {
-               trace_intel_pipe_enable(crtc);
+       if (new_crtc_state->bigjoiner_slave)
                intel_crtc_vblank_on(new_crtc_state);
-       }
 
        intel_encoders_enable(state, crtc);