[Intel-xe] [PATCH 2/4] drm/xe: Simplify rebar sizing

Ruhl, Michael J michael.j.ruhl at intel.com
Wed May 3 20:21:10 UTC 2023


>-----Original Message-----
>From: Auld, Matthew <matthew.auld at intel.com>
>Sent: Wednesday, May 3, 2023 12:04 PM
>To: Ruhl, Michael J <michael.j.ruhl at intel.com>; intel-
>xe at lists.freedesktop.org
>Cc: Brost, Matthew <matthew.brost at intel.com>; Kershner, David
><david.kershner at intel.com>; Ghimiray, Himal Prasad
><himal.prasad.ghimiray at intel.com>; Upadhyay, Tejas
><tejas.upadhyay at intel.com>
>Subject: Re: [PATCH 2/4] drm/xe: Simplify rebar sizing
>

<snip>

>>
>> -	xe_resize_vram_bar(xe, vram_size);
>> -	xe->mem.vram.io_start = pci_resource_start(pdev,
>GEN12_LMEM_BAR);
>> -	xe->mem.vram.io_size = min(vram_size,
>> -				   pci_resource_len(pdev,
>GEN12_LMEM_BAR));
>> -	xe->mem.vram.size = xe->mem.vram.io_size;
>
>I think we still need to keep the io_size and vram.size clamping in this
>patch.

Ok, I will see what I can do.

M

>> -
>> -	if (!xe->mem.vram.size)
>> -		return -EIO;
>> -
>> -	if (vram_size > xe->mem.vram.io_size)
>> -		drm_warn(&xe->drm, "Restricting VRAM size to PCI resource
>size (%lluMiB->%lluMiB)\n",
>> -			 (u64)vram_size >> 20, (u64)xe->mem.vram.io_size >>
>20);
>> +	err = xe_determine_lmem_bar_size(xe);
>> +	if (err)
>> +		return err;
>>
>> -	xe->mem.vram.mapping = ioremap_wc(xe->mem.vram.io_start, xe-
>>mem.vram.io_size);
>> -	xe->mem.vram.size = min_t(u64, xe->mem.vram.size, vram_size);
>> +	/* small bar issues will only cover gt0 sizes */
>> +	if (xe->mem.vram.io_size < vram_size)
>> +		drm_warn(&xe->drm, "Restricting VRAM size to PCI resource
>size (0x%llx->0x%llx)\n",
>> +			 vram_size, (u64)xe->mem.vram.io_size);
>>
>> -	drm_info(&xe->drm, "TOTAL VRAM: %pa, %pa\n", &xe-
>>mem.vram.io_start, &xe->mem.vram.size);
>> +	drm_info(&xe->drm, "VISIBLE VRAM: %pa, %pa\n", &xe-
>>mem.vram.io_start,
>> +		 &xe->mem.vram.io_size);
>>
>>   	/* FIXME: Assuming equally partitioned VRAM, incorrect */
>>   	if (xe->info.tile_count > 1) {
>> @@ -268,7 +286,7 @@ int xe_mmio_probe_vram(struct xe_device *xe)
>>
>>   		XE_BUG_ON(!adj_tile_count);
>>
>> -		size = xe->mem.vram.size / adj_tile_count;
>> +		size = xe->mem.vram.io_size / adj_tile_count;
>>   		io_start = xe->mem.vram.io_start;
>>   		io_size = xe->mem.vram.io_size;
>>
>> @@ -301,7 +319,7 @@ int xe_mmio_probe_vram(struct xe_device *xe)
>>   				 &gt->mem.vram.size);
>>   		}
>>   	} else {
>> -		gt->mem.vram.size = xe->mem.vram.size;
>> +		gt->mem.vram.size = xe->mem.vram.io_size;
>>   		gt->mem.vram.io_start = xe->mem.vram.io_start;
>>   		gt->mem.vram.io_size = xe->mem.vram.io_size;
>>   		gt->mem.vram.mapping = xe->mem.vram.mapping;


More information about the Intel-xe mailing list