[PATCH 3/4] drm/i915: Pass the plane state explicitly to tracpoints
Ville Syrjala
ville.syrjala at linux.intel.com
Wed Dec 18 17:36:49 UTC 2024
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
Using the plane->state pointer in the tracepoints is incorrect
as technically a different state could already have been swapped
in (though in reality that is currently prevented by the stall
hacks in the commit machinery). But let's not leave such footguns
lying around when we can just pass in the correct state by hand.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
.../gpu/drm/i915/display/intel_atomic_plane.c | 4 +--
.../drm/i915/display/intel_display_trace.h | 25 ++++++++++---------
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index 612e9b0ec14a..c6af77491069 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -767,7 +767,7 @@ void intel_plane_update_noarm(struct intel_dsb *dsb,
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
- trace_intel_plane_update_noarm(plane, crtc);
+ trace_intel_plane_update_noarm(plane_state, crtc);
if (plane->update_noarm)
plane->update_noarm(dsb, plane, crtc_state, plane_state);
@@ -797,7 +797,7 @@ void intel_plane_update_arm(struct intel_dsb *dsb,
return;
}
- trace_intel_plane_update_arm(plane, crtc);
+ trace_intel_plane_update_arm(plane_state, crtc);
plane->update_arm(dsb, plane, crtc_state, plane_state);
}
diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h
index 6a9963701423..f63ce022e2d4 100644
--- a/drivers/gpu/drm/i915/display/intel_display_trace.h
+++ b/drivers/gpu/drm/i915/display/intel_display_trace.h
@@ -21,6 +21,7 @@
#include "intel_vblank.h"
#define __dev_name_display(display) dev_name((display)->drm->dev)
+#define __dev_name_drm(obj) dev_name((obj)->dev->dev)
#define __dev_name_kms(obj) dev_name((obj)->base.dev->dev)
/*
@@ -403,17 +404,17 @@ TRACE_EVENT(intel_plane_async_flip,
);
TRACE_EVENT(intel_plane_update_noarm,
- TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc),
- TP_ARGS(plane, crtc),
+ TP_PROTO(const struct intel_plane_state *plane_state, struct intel_crtc *crtc),
+ TP_ARGS(plane_state, crtc),
TP_STRUCT__entry(
- __string(dev, __dev_name_kms(plane))
+ __string(dev, __dev_name_drm(plane_state->uapi.plane))
__field(char, pipe_name)
__field(u32, frame)
__field(u32, scanline)
__array(int, src, 4)
__array(int, dst, 4)
- __string(name, plane->base.name)
+ __string(name, plane_state->uapi.plane->name)
),
TP_fast_assign(
@@ -422,8 +423,8 @@ TRACE_EVENT(intel_plane_update_noarm,
__entry->pipe_name = pipe_name(crtc->pipe);
__entry->frame = intel_crtc_get_vblank_counter(crtc);
__entry->scanline = intel_get_crtc_scanline(crtc);
- memcpy(__entry->src, &plane->base.state->src, sizeof(__entry->src));
- memcpy(__entry->dst, &plane->base.state->dst, sizeof(__entry->dst));
+ memcpy(__entry->src, &plane_state->uapi.src, sizeof(__entry->src));
+ memcpy(__entry->dst, &plane_state->uapi.dst, sizeof(__entry->dst));
),
TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
@@ -434,17 +435,17 @@ TRACE_EVENT(intel_plane_update_noarm,
);
TRACE_EVENT(intel_plane_update_arm,
- TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc),
- TP_ARGS(plane, crtc),
+ TP_PROTO(const struct intel_plane_state *plane_state, struct intel_crtc *crtc),
+ TP_ARGS(plane_state, crtc),
TP_STRUCT__entry(
- __string(dev, __dev_name_kms(plane))
+ __string(dev, __dev_name_drm(plane_state->uapi.plane))
__field(char, pipe_name)
__field(u32, frame)
__field(u32, scanline)
__array(int, src, 4)
__array(int, dst, 4)
- __string(name, plane->base.name)
+ __string(name, plane_state->uapi.plane->name)
),
TP_fast_assign(
@@ -453,8 +454,8 @@ TRACE_EVENT(intel_plane_update_arm,
__entry->pipe_name = pipe_name(crtc->pipe);
__entry->frame = intel_crtc_get_vblank_counter(crtc);
__entry->scanline = intel_get_crtc_scanline(crtc);
- memcpy(__entry->src, &plane->base.state->src, sizeof(__entry->src));
- memcpy(__entry->dst, &plane->base.state->dst, sizeof(__entry->dst));
+ memcpy(__entry->src, &plane_state->uapi.src, sizeof(__entry->src));
+ memcpy(__entry->dst, &plane_state->uapi.dst, sizeof(__entry->dst));
),
TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
--
2.45.2
More information about the Intel-gfx
mailing list