On Tue, Aug 20, 2024 at 10:00:35PM +0300, Jani Nikula wrote: > The intel_display_step_name() is an unnecessary extra > indirection. Simplify by just adding a macro to map intel_step_name() to > xe_step_name(). > > We'll need to temporarily add a compat INTEL_DISPLAY_STEP() for this. > > Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> Reviewed-by: Matt Roper <matthew.d.roper@xxxxxxxxx> > --- > drivers/gpu/drm/i915/display/intel_dmc.c | 2 +- > drivers/gpu/drm/i915/intel_step.c | 5 ----- > drivers/gpu/drm/i915/intel_step.h | 1 - > drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h | 2 ++ > drivers/gpu/drm/xe/compat-i915-headers/intel_step.h | 9 +-------- > 5 files changed, 4 insertions(+), 15 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c > index 73977b173898..7c756d5ba2a2 100644 > --- a/drivers/gpu/drm/i915/display/intel_dmc.c > +++ b/drivers/gpu/drm/i915/display/intel_dmc.c > @@ -391,7 +391,7 @@ static const struct stepping_info * > intel_get_stepping_info(struct drm_i915_private *i915, > struct stepping_info *si) > { > - const char *step_name = intel_display_step_name(i915); > + const char *step_name = intel_step_name(INTEL_DISPLAY_STEP(i915)); > > si->stepping = step_name[0]; > si->substepping = step_name[1]; > diff --git a/drivers/gpu/drm/i915/intel_step.c b/drivers/gpu/drm/i915/intel_step.c > index a5adfb5d8fd2..80464e4edcce 100644 > --- a/drivers/gpu/drm/i915/intel_step.c > +++ b/drivers/gpu/drm/i915/intel_step.c > @@ -275,8 +275,3 @@ const char *intel_step_name(enum intel_step step) > return "**"; > } > } > - > -const char *intel_display_step_name(struct drm_i915_private *i915) > -{ > - return intel_step_name(RUNTIME_INFO(i915)->step.display_step); > -} > diff --git a/drivers/gpu/drm/i915/intel_step.h b/drivers/gpu/drm/i915/intel_step.h > index b6f43b624774..96dfca4cba73 100644 > --- a/drivers/gpu/drm/i915/intel_step.h > +++ b/drivers/gpu/drm/i915/intel_step.h > @@ -78,6 +78,5 @@ enum intel_step { > > void intel_step_init(struct drm_i915_private *i915); > const char *intel_step_name(enum intel_step step); > -const char *intel_display_step_name(struct drm_i915_private *i915); > > #endif /* __INTEL_STEP_H__ */ > diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h > index 1f1ad4d3ef51..82b934fe230a 100644 > --- a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h > +++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h > @@ -82,6 +82,8 @@ static inline struct drm_i915_private *kdev_to_i915(struct device *kdev) > > #define HAS_GMD_ID(xe) GRAPHICS_VERx100(xe) >= 1270 > > +#define INTEL_DISPLAY_STEP(xe) ((xe)->info.step.display) > + > /* Workarounds not handled yet */ > #define IS_DISPLAY_STEP(xe, first, last) ({u8 __step = (xe)->info.step.display; first <= __step && __step < last; }) > > diff --git a/drivers/gpu/drm/xe/compat-i915-headers/intel_step.h b/drivers/gpu/drm/xe/compat-i915-headers/intel_step.h > index 0006ef812346..ee3f45b668b9 100644 > --- a/drivers/gpu/drm/xe/compat-i915-headers/intel_step.h > +++ b/drivers/gpu/drm/xe/compat-i915-headers/intel_step.h > @@ -6,15 +6,8 @@ > #ifndef __INTEL_STEP_H__ > #define __INTEL_STEP_H__ > > -#include "xe_device_types.h" > #include "xe_step.h" > > -#define intel_display_step_name xe_display_step_name > - > -static inline > -const char *xe_display_step_name(struct xe_device *xe) > -{ > - return xe_step_name(xe->info.step.display); > -} > +#define intel_step_name xe_step_name > > #endif /* __INTEL_STEP_H__ */ > -- > 2.39.2 > -- Matt Roper Graphics Software Engineer Linux GPU Platform Enablement Intel Corporation