[Intel-xe] [PATCH v4 09/21] drm/xe/rtp: Add check for media stepping
Matt Roper
matthew.d.roper at intel.com
Thu May 25 22:39:36 UTC 2023
On Thu, May 25, 2023 at 02:33:55PM -0700, Lucas De Marchi wrote:
> Start differentiating the media and graphics stepping as it will be
> important for MTL. Note that RTP is still not prepared to handle the
> different types of GT, i.e. checking for graphics version/range/stepping
> on a media gt or vice versa still matches regardless of the gt being
> passed as parameter. Changing it to accommodate MTL is left for a future
> patch.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
As you noted, we can check that the current GT is of the proper type in
a future patch.
Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
> ---
> drivers/gpu/drm/xe/xe_rtp.c | 12 +++++++-----
> drivers/gpu/drm/xe/xe_rtp.h | 17 +++++++++++++++++
> drivers/gpu/drm/xe/xe_rtp_types.h | 1 +
> 3 files changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_rtp.c b/drivers/gpu/drm/xe/xe_rtp.c
> index 2ac7b47942fe..70769852a93d 100644
> --- a/drivers/gpu/drm/xe/xe_rtp.c
> +++ b/drivers/gpu/drm/xe/xe_rtp.c
> @@ -43,13 +43,16 @@ static bool rule_matches(const struct xe_device *xe,
> xe->info.subplatform == r->subplatform;
> break;
> case XE_RTP_MATCH_GRAPHICS_VERSION:
> - /* TODO: match display */
> match = xe->info.graphics_verx100 == r->ver_start;
> break;
> case XE_RTP_MATCH_GRAPHICS_VERSION_RANGE:
> match = xe->info.graphics_verx100 >= r->ver_start &&
> xe->info.graphics_verx100 <= r->ver_end;
> break;
> + case XE_RTP_MATCH_GRAPHICS_STEP:
> + match = xe->info.step.graphics >= r->step_start &&
> + xe->info.step.graphics < r->step_end;
> + break;
> case XE_RTP_MATCH_MEDIA_VERSION:
> match = xe->info.media_verx100 == r->ver_start;
> break;
> @@ -57,10 +60,9 @@ static bool rule_matches(const struct xe_device *xe,
> match = xe->info.media_verx100 >= r->ver_start &&
> xe->info.media_verx100 <= r->ver_end;
> break;
> - case XE_RTP_MATCH_GRAPHICS_STEP:
> - /* TODO: match media/display */
> - match = xe->info.step.graphics >= r->step_start &&
> - xe->info.step.graphics < r->step_end;
> + case XE_RTP_MATCH_MEDIA_STEP:
> + match = xe->info.step.media >= r->step_start &&
> + xe->info.step.media < r->step_end;
> break;
> case XE_RTP_MATCH_INTEGRATED:
> match = !xe->info.is_dgfx;
> diff --git a/drivers/gpu/drm/xe/xe_rtp.h b/drivers/gpu/drm/xe/xe_rtp.h
> index 7ba9d2ecab92..d55701d2f39b 100644
> --- a/drivers/gpu/drm/xe/xe_rtp.h
> +++ b/drivers/gpu/drm/xe/xe_rtp.h
> @@ -39,6 +39,10 @@ struct xe_reg_sr;
> { .match_type = XE_RTP_MATCH_GRAPHICS_STEP, \
> .step_start = start__, .step_end = end__ }
>
> +#define _XE_RTP_RULE_MEDIA_STEP(start__, end__) \
> + { .match_type = XE_RTP_MATCH_MEDIA_STEP, \
> + .step_start = start__, .step_end = end__ }
> +
> #define _XE_RTP_RULE_ENGINE_CLASS(cls__) \
> { .match_type = XE_RTP_MATCH_ENGINE_CLASS, \
> .engine_class = (cls__) }
> @@ -75,6 +79,19 @@ struct xe_reg_sr;
> #define XE_RTP_RULE_GRAPHICS_STEP(start_, end_) \
> _XE_RTP_RULE_GRAPHICS_STEP(STEP_##start_, STEP_##end_)
>
> +/**
> + * XE_RTP_RULE_MEDIA_STEP - Create rule matching media stepping
> + * @start_: First stepping matching the rule
> + * @end_: First stepping that does not match the rule
> + *
> + * Note that the range matching this rule is [ @start_, @end_ ), i.e. inclusive
> + * on the left, exclusive on the right.
> + *
> + * Refer to XE_RTP_RULES() for expected usage.
> + */
> +#define XE_RTP_RULE_MEDIA_STEP(start_, end_) \
> + _XE_RTP_RULE_MEDIA_STEP(STEP_##start_, STEP_##end_)
> +
> /**
> * XE_RTP_RULE_ENGINE_CLASS - Create rule matching an engine class
> * @cls_: Engine class to match
> diff --git a/drivers/gpu/drm/xe/xe_rtp_types.h b/drivers/gpu/drm/xe/xe_rtp_types.h
> index 52adbf7de752..af49cbf98407 100644
> --- a/drivers/gpu/drm/xe/xe_rtp_types.h
> +++ b/drivers/gpu/drm/xe/xe_rtp_types.h
> @@ -42,6 +42,7 @@ enum {
> XE_RTP_MATCH_GRAPHICS_STEP,
> XE_RTP_MATCH_MEDIA_VERSION,
> XE_RTP_MATCH_MEDIA_VERSION_RANGE,
> + XE_RTP_MATCH_MEDIA_STEP,
> XE_RTP_MATCH_INTEGRATED,
> XE_RTP_MATCH_DISCRETE,
> XE_RTP_MATCH_ENGINE_CLASS,
> --
> 2.40.1
>
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
More information about the Intel-xe
mailing list