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

drm/i915/guc: Remove plain ads_blob pointer

Now we have the access to content of GuC ADS either using iosys_map
API or using a temporary buffer. Remove guc->ads_blob as there shouldn't
be updates using the bare pointer anymore.

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-17-lucas.demarchi@intel.com

+5 -6
+1 -2
drivers/gpu/drm/i915/gt/uc/intel_guc.h
··· 147 147 148 148 /** @ads_vma: object allocated to hold the GuC ADS */ 149 149 struct i915_vma *ads_vma; 150 - /** @ads_blob: contents of the GuC ADS */ 151 - struct __guc_ads_blob *ads_blob; 150 + /** @ads_map: contents of the GuC ADS */ 152 151 struct iosys_map ads_map; 153 152 /** @ads_regset_size: size of the save/restore regsets in the ADS */ 154 153 u32 ads_regset_size;
+4 -4
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
··· 667 667 */ 668 668 int intel_guc_ads_create(struct intel_guc *guc) 669 669 { 670 + void *ads_blob; 670 671 u32 size; 671 672 int ret; 672 673 ··· 692 691 size = guc_ads_blob_size(guc); 693 692 694 693 ret = intel_guc_allocate_and_map_vma(guc, size, &guc->ads_vma, 695 - (void **)&guc->ads_blob); 694 + &ads_blob); 696 695 if (ret) 697 696 return ret; 698 697 699 698 if (i915_gem_object_is_lmem(guc->ads_vma->obj)) 700 - iosys_map_set_vaddr_iomem(&guc->ads_map, (void __iomem *)guc->ads_blob); 699 + iosys_map_set_vaddr_iomem(&guc->ads_map, (void __iomem *)ads_blob); 701 700 else 702 - iosys_map_set_vaddr(&guc->ads_map, guc->ads_blob); 701 + iosys_map_set_vaddr(&guc->ads_map, ads_blob); 703 702 704 703 __guc_ads_init(guc); 705 704 ··· 721 720 void intel_guc_ads_destroy(struct intel_guc *guc) 722 721 { 723 722 i915_vma_unpin_and_release(&guc->ads_vma, I915_VMA_RELEASE_MAP); 724 - guc->ads_blob = NULL; 725 723 iosys_map_clear(&guc->ads_map); 726 724 kfree(guc->ads_regset); 727 725 }