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

drm/i915/guc: Convert __guc_ads_init to iosys_map

Now that all the called functions from __guc_ads_init() are converted to
use ads_map, stop using ads_blob in __guc_ads_init().

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220216174147.3073235-16-lucas.demarchi@intel.com

+14 -11
+14 -11
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
··· 608 608 { 609 609 struct intel_gt *gt = guc_to_gt(guc); 610 610 struct drm_i915_private *i915 = gt->i915; 611 - struct __guc_ads_blob *blob = guc->ads_blob; 612 611 struct iosys_map info_map = IOSYS_MAP_INIT_OFFSET(&guc->ads_map, 613 612 offsetof(struct __guc_ads_blob, system_info)); 614 613 u32 base; ··· 618 619 /* System info */ 619 620 fill_engine_enable_masks(gt, &info_map); 620 621 621 - blob->system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_SLICE_ENABLED] = 622 - hweight8(gt->info.sseu.slice_mask); 623 - blob->system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_VDBOX_SFC_SUPPORT_MASK] = 624 - gt->info.vdbox_sfc_access; 622 + ads_blob_write(guc, system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_SLICE_ENABLED], 623 + hweight8(gt->info.sseu.slice_mask)); 624 + ads_blob_write(guc, system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_VDBOX_SFC_SUPPORT_MASK], 625 + gt->info.vdbox_sfc_access); 625 626 626 627 if (GRAPHICS_VER(i915) >= 12 && !IS_DGFX(i915)) { 627 628 u32 distdbreg = intel_uncore_read(gt->uncore, 628 629 GEN12_DIST_DBS_POPULATED); 629 - blob->system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_DOORBELL_COUNT_PER_SQIDI] = 630 - ((distdbreg >> GEN12_DOORBELLS_PER_SQIDI_SHIFT) & 631 - GEN12_DOORBELLS_PER_SQIDI) + 1; 630 + ads_blob_write(guc, 631 + system_info.generic_gt_sysinfo[GUC_GENERIC_GT_SYSINFO_DOORBELL_COUNT_PER_SQIDI], 632 + ((distdbreg >> GEN12_DOORBELLS_PER_SQIDI_SHIFT) 633 + & GEN12_DOORBELLS_PER_SQIDI) + 1); 632 634 } 633 635 634 636 /* Golden contexts for re-initialising after a watchdog reset */ ··· 643 643 guc_capture_list_init(guc); 644 644 645 645 /* ADS */ 646 - blob->ads.scheduler_policies = base + ptr_offset(blob, policies); 647 - blob->ads.gt_system_info = base + ptr_offset(blob, system_info); 646 + ads_blob_write(guc, ads.scheduler_policies, base + 647 + offsetof(struct __guc_ads_blob, policies)); 648 + ads_blob_write(guc, ads.gt_system_info, base + 649 + offsetof(struct __guc_ads_blob, system_info)); 648 650 649 651 /* MMIO save/restore list */ 650 652 guc_mmio_reg_state_init(guc); 651 653 652 654 /* Private Data */ 653 - blob->ads.private_data = base + guc_ads_private_data_offset(guc); 655 + ads_blob_write(guc, ads.private_data, base + 656 + guc_ads_private_data_offset(guc)); 654 657 655 658 i915_gem_object_flush_map(guc->ads_vma->obj); 656 659 }