drivers/gpu/drm/xe/xe_step.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_step.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/xe/xe_step.c
Extension
.c
Size
8411 bytes
Lines
291
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (revid < size) {
			drm_dbg(&xe->drm, "Using steppings for revid 0x%02x\n",
				revid);
			graphics = revids[revid].graphics;
			media = revids[revid].media;
			basedie = revids[revid].basedie;
		} else {
			drm_dbg(&xe->drm, "Using future steppings\n");
			graphics = STEP_FUTURE;
		}
	}

	drm_WARN_ON(&xe->drm, graphics == STEP_NONE);

	if (basedie_info && basedie_size) {
		if (baseid < basedie_size && basedie_info[baseid] != STEP_NONE) {
			basedie = basedie_info[baseid];
		} else {
			drm_warn(&xe->drm, "Unknown baseid 0x%02x\n", baseid);
			basedie = STEP_FUTURE;
		}
	}

done:
	xe->info.step.graphics = graphics;
	xe->info.step.media = media;
	xe->info.step.basedie = basedie;
}

/**
 * xe_step_gmdid_get - Determine IP steppings from GMD_ID revid fields
 * @xe: Xe device
 * @graphics_gmdid_revid: value of graphics GMD_ID register's revid field
 * @media_gmdid_revid: value of media GMD_ID register's revid field
 *
 * Convert the revid fields of the GMD_ID registers into proper IP steppings.
 *
 * GMD_ID revid values are currently expected to have consistent meanings on
 * all platforms:  major steppings (A0, B0, etc.) are 4 apart, with minor
 * steppings (A1, A2, etc.) taking the values in between.
 */
void xe_step_gmdid_get(struct xe_device *xe,
		       u32 graphics_gmdid_revid,
		       u32 media_gmdid_revid)
{
	u8 graphics = STEP_A0 + graphics_gmdid_revid;
	u8 media = STEP_A0 + media_gmdid_revid;

	if (graphics >= STEP_FUTURE) {
		graphics = STEP_FUTURE;
		drm_dbg(&xe->drm, "Graphics GMD_ID revid value %d treated as future stepping\n",
			graphics_gmdid_revid);
	}

	if (media >= STEP_FUTURE) {
		media = STEP_FUTURE;
		drm_dbg(&xe->drm, "Media GMD_ID revid value %d treated as future stepping\n",
			media_gmdid_revid);
	}

	xe->info.step.graphics = graphics;
	xe->info.step.media = media;
}

#define STEP_NAME_CASE(name)	\
	case STEP_##name:	\
		return #name;

const char *xe_step_name(enum intel_step step)
{
	switch (step) {
	STEP_NAME_LIST(STEP_NAME_CASE);

	default:
		return "**";
	}
}
EXPORT_SYMBOL_IF_KUNIT(xe_step_name);

Annotation

Implementation Notes