[PATCH 6/6] drm/xe/vf: Treat GMDID as another runtime register

Matt Roper matthew.d.roper at intel.com
Thu May 23 21:21:45 UTC 2024


On Thu, May 23, 2024 at 09:22:40PM +0200, Michal Wajdeczko wrote:
> While the GMDID registers are not part of the runtime register list
> shared by the PF driver, we may still return cached values from our
> VF specific read32() helper function.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> index 347ab7060588..66069eb8c5be 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> @@ -13,6 +13,7 @@
>  #include "abi/guc_communication_mmio_abi.h"
>  #include "abi/guc_klvs_abi.h"
>  #include "abi/guc_relay_actions_abi.h"
> +#include "regs/xe_gt_regs.h"
>  
>  #include "xe_assert.h"
>  #include "xe_device.h"
> @@ -764,6 +765,12 @@ u32 xe_gt_sriov_vf_read32(struct xe_gt *gt, struct xe_reg reg)
>  	xe_gt_assert(gt, gt->sriov.vf.pf_version.major);
>  	xe_gt_assert(gt, !reg.vf);
>  
> +	if (reg.addr == GMD_ID.addr) {
> +		xe_gt_sriov_dbg_verbose(gt, "gmdid(%#x) = %#x\n",
> +					addr, gt->sriov.vf.runtime.gmdid);
> +		return gt->sriov.vf.runtime.gmdid;
> +	}
> +
>  	rr = vf_lookup_reg(gt, addr);
>  	if (!rr) {
>  		xe_gt_WARN(gt, IS_ENABLED(CONFIG_DRM_XE_DEBUG),
> -- 
> 2.43.0
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list