[PATCH 1/4] drm/xe: Set IP names in functions handling IP version
Matt Roper
matthew.d.roper at intel.com
Thu Feb 20 20:40:47 UTC 2025
On Thu, Feb 20, 2025 at 02:25:08PM -0300, Gustavo Sousa wrote:
> 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.
>
> Signed-off-by: Gustavo Sousa <gustavo.sousa at intel.com>
Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
> ---
> drivers/gpu/drm/xe/xe_pci.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 70b697fde5b9..feea897f130d 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -564,9 +564,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";
> + }
>
> }
>
> @@ -588,6 +593,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;
> }
> @@ -598,8 +604,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;
> @@ -608,6 +615,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;
> }
> @@ -698,9 +706,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;
> --
> 2.48.1
>
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
More information about the Intel-xe
mailing list