Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/vf: Custom hardware config load step if VF

The VF drivers may immediately communicate with the GuC to obtain
the hardware config since the firmware shall already be running.

With the GuC communication established, VFs can also obtain the
values of the runtime registers (fuses) from the PF driver.

Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240516110546.2216-6-michal.wajdeczko@intel.com

+36
+36
drivers/gpu/drm/xe/xe_guc.c
··· 19 19 #include "xe_force_wake.h" 20 20 #include "xe_gt.h" 21 21 #include "xe_gt_printk.h" 22 + #include "xe_gt_sriov_vf.h" 22 23 #include "xe_guc_ads.h" 23 24 #include "xe_guc_ct.h" 24 25 #include "xe_guc_db_mgr.h" ··· 548 547 return 0 /* FIXME: ret, don't want to stop load currently */; 549 548 } 550 549 550 + static int vf_guc_min_load_for_hwconfig(struct xe_guc *guc) 551 + { 552 + struct xe_gt *gt = guc_to_gt(guc); 553 + int ret; 554 + 555 + ret = xe_gt_sriov_vf_bootstrap(gt); 556 + if (ret) 557 + return ret; 558 + 559 + ret = xe_gt_sriov_vf_query_config(gt); 560 + if (ret) 561 + return ret; 562 + 563 + ret = xe_guc_hwconfig_init(guc); 564 + if (ret) 565 + return ret; 566 + 567 + ret = xe_guc_enable_communication(guc); 568 + if (ret) 569 + return ret; 570 + 571 + ret = xe_gt_sriov_vf_connect(gt); 572 + if (ret) 573 + return ret; 574 + 575 + ret = xe_gt_sriov_vf_query_runtime(gt); 576 + if (ret) 577 + return ret; 578 + 579 + return 0; 580 + } 581 + 551 582 /** 552 583 * xe_guc_min_load_for_hwconfig - load minimal GuC and read hwconfig table 553 584 * @guc: The GuC object ··· 594 561 int xe_guc_min_load_for_hwconfig(struct xe_guc *guc) 595 562 { 596 563 int ret; 564 + 565 + if (IS_SRIOV_VF(guc_to_xe(guc))) 566 + return vf_guc_min_load_for_hwconfig(guc); 597 567 598 568 xe_guc_ads_populate_minimal(&guc->ads); 599 569