Commit 91103ca3 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Add async flip tracepoint



Add a separate tracepoint for async flips vs. sync plane updates
to make it a bit easier to figure out what is happening.

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240611133344.30673-3-ville.syrjala@linux.intel.com


Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent b493b26b
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -801,17 +801,29 @@ void intel_plane_update_noarm(struct intel_plane *plane,
		plane->update_noarm(plane, crtc_state, plane_state);
}

void intel_plane_async_flip(struct intel_plane *plane,
			    const struct intel_crtc_state *crtc_state,
			    const struct intel_plane_state *plane_state,
			    bool async_flip)
{
	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);

	trace_intel_plane_async_flip(plane, crtc, async_flip);
	plane->async_flip(plane, crtc_state, plane_state, async_flip);
}

void intel_plane_update_arm(struct intel_plane *plane,
			    const struct intel_crtc_state *crtc_state,
			    const struct intel_plane_state *plane_state)
{
	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);

	trace_intel_plane_update_arm(plane, crtc);
	if (crtc_state->do_async_flip && plane->async_flip) {
		intel_plane_async_flip(plane, crtc_state, plane_state, true);
		return;
	}

	if (crtc_state->do_async_flip && plane->async_flip)
		plane->async_flip(plane, crtc_state, plane_state, true);
	else
	trace_intel_plane_update_arm(plane, crtc);
	plane->update_arm(plane, crtc_state, plane_state);
}

+4 −0
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
				       struct intel_crtc *crtc);
void intel_plane_copy_hw_state(struct intel_plane_state *plane_state,
			       const struct intel_plane_state *from_plane_state);
void intel_plane_async_flip(struct intel_plane *plane,
			    const struct intel_crtc_state *crtc_state,
			    const struct intel_plane_state *plane_state,
			    bool async_flip);
void intel_plane_update_noarm(struct intel_plane *plane,
			      const struct intel_crtc_state *crtc_state,
			      const struct intel_plane_state *plane_state);
+2 −2
Original line number Diff line number Diff line
@@ -1160,7 +1160,7 @@ static void intel_crtc_async_flip_disable_wa(struct intel_atomic_state *state,
			 * Apart from the async flip bit we want to
			 * preserve the old state for the plane.
			 */
			plane->async_flip(plane, old_crtc_state,
			intel_plane_async_flip(plane, old_crtc_state,
					       old_plane_state, false);
			need_vbl_wait = true;
		}
+27 −0
Original line number Diff line number Diff line
@@ -308,6 +308,33 @@ TRACE_EVENT(vlv_fifo_size,
		      __entry->sprite0_start, __entry->sprite1_start, __entry->fifo_size)
);

TRACE_EVENT(intel_plane_async_flip,
	    TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc, bool async_flip),
	    TP_ARGS(plane, crtc, async_flip),

	    TP_STRUCT__entry(
			     __string(dev, __dev_name_kms(plane))
			     __field(enum pipe, pipe)
			     __field(u32, frame)
			     __field(u32, scanline)
			     __field(bool, async_flip)
			     __string(name, plane->base.name)
			     ),

	    TP_fast_assign(
			   __assign_str(dev);
			   __assign_str(name);
			   __entry->pipe = crtc->pipe;
			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
			   __entry->scanline = intel_get_crtc_scanline(crtc);
			   __entry->async_flip = async_flip;
			   ),

	    TP_printk("dev %s, pipe %c, plane %s, frame=%u, scanline=%u, async_flip=%s",
		      __get_str(dev), pipe_name(__entry->pipe), __get_str(name),
		      __entry->frame, __entry->scanline, str_yes_no(__entry->async_flip))
);

TRACE_EVENT(intel_plane_update_noarm,
	    TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc),
	    TP_ARGS(plane, crtc),