Commit c8f33a6f authored by Gustavo Sousa's avatar Gustavo Sousa Committed by Matt Roper
Browse files

drm/xe: Set IP names in functions handling IP version



In an upcoming change, we will handle setting graphics_name and
media_name differently for GMDID-based IPs. As such, let's make both
handle_pre_gmdid() and handle_gmdid() functions responsible for
initializing those fields. While now we have both doing essentially the
same thing with respect to those fields, handle_pre_gmdid() will diverge
soon.

Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250221-xe-unify-ip-descriptors-v2-1-5bc0c6d0c13f@intel.com


Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
parent ba767b9d
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -559,9 +559,14 @@ static void handle_pre_gmdid(struct xe_device *xe,
			     const struct xe_media_desc *media)
{
	xe->info.graphics_verx100 = graphics->ver * 100 + graphics->rel;
	xe->info.graphics_name = graphics->name;

	if (media)
	if (media) {
		xe->info.media_verx100 = media->ver * 100 + media->rel;
		xe->info.media_name = media->name;
	} else {
		xe->info.media_name = "none";
	}

}

@@ -583,6 +588,7 @@ static void handle_gmdid(struct xe_device *xe,
		if (ver == graphics_ip_map[i].ver) {
			xe->info.graphics_verx100 = ver;
			*graphics = graphics_ip_map[i].ip;
			xe->info.graphics_name = (*graphics)->name;

			break;
		}
@@ -593,8 +599,9 @@ static void handle_gmdid(struct xe_device *xe,
			ver / 100, ver % 100);
	}

	read_gmdid(xe, GMDID_MEDIA, &ver, media_revid);
	xe->info.media_name = "none";

	read_gmdid(xe, GMDID_MEDIA, &ver, media_revid);
	/* Media may legitimately be fused off / not present */
	if (ver == 0)
		return;
@@ -603,6 +610,7 @@ static void handle_gmdid(struct xe_device *xe,
		if (ver == media_ip_map[i].ver) {
			xe->info.media_verx100 = ver;
			*media = media_ip_map[i].ip;
			xe->info.media_name = (*media)->name;

			break;
		}
@@ -693,9 +701,6 @@ static int xe_info_init(struct xe_device *xe,
	if (!graphics_desc)
		return -ENODEV;

	xe->info.graphics_name = graphics_desc->name;
	xe->info.media_name = media_desc ? media_desc->name : "none";

	xe->info.vram_flags = graphics_desc->vram_flags;
	xe->info.va_bits = graphics_desc->va_bits;
	xe->info.vm_max_level = graphics_desc->vm_max_level;