Commit 3e488e98 authored by Lucas De Marchi's avatar Lucas De Marchi Committed by Rodrigo Vivi

drm/xe/rtp: Also check gt type

When running rules on MTL and beyond that have media as a standalone GT,
the rule should only match if the gt passed as parameter match the
version/range/stepping that the rule is checking. This allows
workarounds affecting only the media GT to be applied only on that GT
and vice-versa.

For platforms before MTL, the GT will not be of media type, even if it
includes media engines. Make sure to cover that case by checking if the
platforma has standalone media.
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20230526164358.86393-21-lucas.demarchi@intel.comSigned-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 5e782507
...@@ -23,6 +23,11 @@ ...@@ -23,6 +23,11 @@
* the values to the registers that have matching rules. * the values to the registers that have matching rules.
*/ */
static bool has_samedia(const struct xe_device *xe)
{
return xe->info.media_verx100 >= 1300;
}
static bool rule_matches(const struct xe_device *xe, static bool rule_matches(const struct xe_device *xe,
struct xe_gt *gt, struct xe_gt *gt,
struct xe_hw_engine *hwe, struct xe_hw_engine *hwe,
...@@ -43,26 +48,32 @@ static bool rule_matches(const struct xe_device *xe, ...@@ -43,26 +48,32 @@ static bool rule_matches(const struct xe_device *xe,
xe->info.subplatform == r->subplatform; xe->info.subplatform == r->subplatform;
break; break;
case XE_RTP_MATCH_GRAPHICS_VERSION: case XE_RTP_MATCH_GRAPHICS_VERSION:
match = xe->info.graphics_verx100 == r->ver_start; match = xe->info.graphics_verx100 == r->ver_start &&
(!has_samedia(xe) || !xe_gt_is_media_type(gt));
break; break;
case XE_RTP_MATCH_GRAPHICS_VERSION_RANGE: case XE_RTP_MATCH_GRAPHICS_VERSION_RANGE:
match = xe->info.graphics_verx100 >= r->ver_start && match = xe->info.graphics_verx100 >= r->ver_start &&
xe->info.graphics_verx100 <= r->ver_end; xe->info.graphics_verx100 <= r->ver_end &&
(!has_samedia(xe) || !xe_gt_is_media_type(gt));
break; break;
case XE_RTP_MATCH_GRAPHICS_STEP: case XE_RTP_MATCH_GRAPHICS_STEP:
match = xe->info.step.graphics >= r->step_start && match = xe->info.step.graphics >= r->step_start &&
xe->info.step.graphics < r->step_end; xe->info.step.graphics < r->step_end &&
(!has_samedia(xe) || !xe_gt_is_media_type(gt));
break; break;
case XE_RTP_MATCH_MEDIA_VERSION: case XE_RTP_MATCH_MEDIA_VERSION:
match = xe->info.media_verx100 == r->ver_start; match = xe->info.media_verx100 == r->ver_start &&
(!has_samedia(xe) || xe_gt_is_media_type(gt));
break; break;
case XE_RTP_MATCH_MEDIA_VERSION_RANGE: case XE_RTP_MATCH_MEDIA_VERSION_RANGE:
match = xe->info.media_verx100 >= r->ver_start && match = xe->info.media_verx100 >= r->ver_start &&
xe->info.media_verx100 <= r->ver_end; xe->info.media_verx100 <= r->ver_end &&
(!has_samedia(xe) || xe_gt_is_media_type(gt));
break; break;
case XE_RTP_MATCH_MEDIA_STEP: case XE_RTP_MATCH_MEDIA_STEP:
match = xe->info.step.media >= r->step_start && match = xe->info.step.media >= r->step_start &&
xe->info.step.media < r->step_end; xe->info.step.media < r->step_end &&
(!has_samedia(xe) || xe_gt_is_media_type(gt));
break; break;
case XE_RTP_MATCH_INTEGRATED: case XE_RTP_MATCH_INTEGRATED:
match = !xe->info.is_dgfx; match = !xe->info.is_dgfx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment