[Intel-xe] [PATCH] drm/xe: Move policy on preemption from WAs to tunings

Lucas De Marchi lucas.demarchi at intel.com
Mon Mar 13 22:50:13 UTC 2023


On Sat, Mar 11, 2023 at 09:15:51AM -0800, Lucas De Marchi wrote:
>The fake WA FtrPerCtxtPreemptionGranularityControl is documented in i915
>and is not a true WA: it's a policy chosen to allow preemption settings
>to be controlled on a per-context basis by userspace. Move it to
>xe_tuning.c since it's more in line with what his is doing. However
>since it's not something suggested by the spec, prefix it with "Policy"
>rather than "Tuning".
>
>Suggested-by: Matt Roper <matthew.d.roper at intel.com>
>Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
>---
> drivers/gpu/drm/xe/xe_hw_engine.c |  2 ++
> drivers/gpu/drm/xe/xe_tuning.c    | 22 ++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_tuning.h    |  1 +
> drivers/gpu/drm/xe/xe_wa.c        |  6 ------
> 4 files changed, 25 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
>index 63a4efd5edcc..53dc342cc3a3 100644
>--- a/drivers/gpu/drm/xe/xe_hw_engine.c
>+++ b/drivers/gpu/drm/xe/xe_hw_engine.c
>@@ -22,6 +22,7 @@
> #include "xe_mmio.h"
> #include "xe_reg_sr.h"
> #include "xe_sched_job.h"
>+#include "xe_tuning.h"
> #include "xe_wa.h"
>
> #define MAX_MMIO_BASES 3
>@@ -293,6 +294,7 @@ static void hw_engine_init_early(struct xe_gt *gt, struct xe_hw_engine *hwe,
>
> 	xe_reg_sr_init(&hwe->reg_sr, hwe->name, gt_to_xe(gt));
> 	xe_wa_process_engine(hwe);
>+	xe_tuning_process_engine(hwe);
>
> 	xe_reg_sr_init(&hwe->reg_whitelist, hwe->name, gt_to_xe(gt));
> 	xe_reg_whitelist_process_engine(hwe);
>diff --git a/drivers/gpu/drm/xe/xe_tuning.c b/drivers/gpu/drm/xe/xe_tuning.c
>index 2861a014c85c..5d3febd0b97e 100644
>--- a/drivers/gpu/drm/xe/xe_tuning.c
>+++ b/drivers/gpu/drm/xe/xe_tuning.c
>@@ -23,6 +23,15 @@ static const struct xe_rtp_entry gt_tunings[] = {
> 	{}
> };
>
>+static const struct xe_rtp_entry engine_tunings[] = {
>+	{ XE_RTP_NAME("Policy: FtrPerCtxtPreemptionGranularityControl"),
>+	  XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1200, 1250), ENGINE_CLASS(RENDER)),

this is actually wrong... should remove the GRAPHICS_VERSION_RANGE()
check. I don't know why it was there in the first place.

Lucas De Marchi


More information about the Intel-xe mailing list