Commit ffab82b0 authored by Michal Wajdeczko's avatar Michal Wajdeczko
Browse files

drm/xe: Introduce xe_gt_is_main_type helper



Instead of checking for not being a media type GT provide a small
helper to explicitly express our intentions.

Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: default avatarPiotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://lore.kernel.org/r/20250713103625.1964-5-michal.wajdeczko@intel.com
parent 76293a83
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ static int bb_prefetch(struct xe_gt *gt)
{
	struct xe_device *xe = gt_to_xe(gt);

	if (GRAPHICS_VERx100(xe) >= 1250 && !xe_gt_is_media_type(gt))
	if (GRAPHICS_VERx100(xe) >= 1250 && xe_gt_is_main_type(gt))
		/*
		 * RCS and CCS require 1K, although other engines would be
		 * okay with 512.
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)
{
	int i, j;

	if (!xe_gt_is_media_type(gt))
	if (xe_gt_is_main_type(gt))
		init_domain(fw, XE_FW_DOMAIN_ID_RENDER,
			    FORCEWAKE_RENDER,
			    FORCEWAKE_ACK_RENDER);
+6 −6
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ static void xe_gt_enable_host_l2_vram(struct xe_gt *gt)
	if (!fw_ref)
		return;

	if (!xe_gt_is_media_type(gt)) {
	if (xe_gt_is_main_type(gt)) {
		reg = xe_gt_mcr_unicast_read_any(gt, XE2_GAMREQSTRM_CTRL);
		reg |= CG_DIS_CNTLBUS;
		xe_gt_mcr_multicast_write(gt, XE2_GAMREQSTRM_CTRL, reg);
@@ -470,7 +470,7 @@ static int gt_init_with_gt_forcewake(struct xe_gt *gt)
	xe_gt_mcr_init(gt);
	xe_gt_enable_host_l2_vram(gt);

	if (!xe_gt_is_media_type(gt)) {
	if (xe_gt_is_main_type(gt)) {
		err = xe_ggtt_init(gt_to_tile(gt)->mem.ggtt);
		if (err)
			goto err_force_wake;
@@ -547,7 +547,7 @@ static int gt_init_with_all_forcewake(struct xe_gt *gt)
	if (err)
		goto err_force_wake;

	if (!xe_gt_is_media_type(gt)) {
	if (xe_gt_is_main_type(gt)) {
		/*
		 * USM has its only SA pool to non-block behind user operations
		 */
@@ -563,7 +563,7 @@ static int gt_init_with_all_forcewake(struct xe_gt *gt)
		}
	}

	if (!xe_gt_is_media_type(gt)) {
	if (xe_gt_is_main_type(gt)) {
		struct xe_tile *tile = gt_to_tile(gt);

		tile->migrate = xe_migrate_init(tile);
@@ -583,7 +583,7 @@ static int gt_init_with_all_forcewake(struct xe_gt *gt)
		xe_gt_apply_ccs_mode(gt);
	}

	if (IS_SRIOV_PF(gt_to_xe(gt)) && !xe_gt_is_media_type(gt))
	if (IS_SRIOV_PF(gt_to_xe(gt)) && xe_gt_is_main_type(gt))
		xe_lmtt_init_hw(&gt_to_tile(gt)->sriov.pf.lmtt);

	if (IS_SRIOV_PF(gt_to_xe(gt))) {
@@ -780,7 +780,7 @@ static int do_gt_restart(struct xe_gt *gt)
	if (err)
		return err;

	if (IS_SRIOV_PF(gt_to_xe(gt)) && !xe_gt_is_media_type(gt))
	if (IS_SRIOV_PF(gt_to_xe(gt)) && xe_gt_is_main_type(gt))
		xe_lmtt_init_hw(&gt_to_tile(gt)->sriov.pf.lmtt);

	if (IS_SRIOV_PF(gt_to_xe(gt)))
+5 −0
Original line number Diff line number Diff line
@@ -106,6 +106,11 @@ static inline bool xe_gt_has_indirect_ring_state(struct xe_gt *gt)
	       xe_device_uc_enabled(gt_to_xe(gt));
}

static inline bool xe_gt_is_main_type(struct xe_gt *gt)
{
	return gt->info.type == XE_GT_TYPE_MAIN;
}

static inline bool xe_gt_is_media_type(struct xe_gt *gt)
{
	return gt->info.type == XE_GT_TYPE_MEDIA;
+1 −1
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ void xe_gt_idle_enable_pg(struct xe_gt *gt)
	if (vcs_mask || vecs_mask)
		gtidle->powergate_enable = MEDIA_POWERGATE_ENABLE;

	if (!xe_gt_is_media_type(gt))
	if (xe_gt_is_main_type(gt))
		gtidle->powergate_enable |= RENDER_POWERGATE_ENABLE;

	if (xe->info.platform != XE_DG1) {
Loading