Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Laguna, Lukasz" <lukasz.laguna@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: <piotr.piorkowski@intel.com>
Subject: Re: [PATCH v2] drm/xe/pf: Always expose VRAM provisioning data on discrete GPUs
Date: Fri, 17 Oct 2025 12:43:04 +0200	[thread overview]
Message-ID: <dbaa050e-696d-4938-b192-e0456f1f0a29@intel.com> (raw)
In-Reply-To: <d973e543-d348-4360-a8d2-a140fc1a6628@intel.com>

On 10/17/2025 12:27, Michal Wajdeczko wrote:
>
> On 10/16/2025 2:22 PM, Lukasz Laguna wrote:
>> Currently, VRAM provisioning data is only exposed if the device supports
>> LMTT. While it should not be possible to modify VRAM provisioning on
>> platforms without LMTT, it is still useful to be able to read the VRAM
>> provisioning data on all discrete GPU platforms.
>>
>> Expose the VRAM debugfs attributes whenever running on dGFX, adjusting
>> file permissions to read only when LMTT is not available.
>>
>> Fixes: 921ddb37d87c ("drm/xe/pf: Don't allow LMEM provisioning if LMTT isn't available on the device")
> all our current DGFX SR-IOV platforms are using LMTT, so IMO there is nothing to fix

OK, we can remove the Fixes tag.

>
>> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
>> ---
>> v2:
>>   - add extra protection against changing the LMEM provisioning (Piotr)
>> ---
>>   drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c    | 3 ++-
>>   drivers/gpu/drm/xe/xe_tile_sriov_pf_debugfs.c | 9 ++++++---
>>   2 files changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>> index b2e5c52978e6..c0c0215c0703 100644
>> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>> @@ -1548,7 +1548,8 @@ int xe_gt_sriov_pf_config_set_lmem(struct xe_gt *gt, unsigned int vfid, u64 size
>>   {
>>   	int err;
>>   
>> -	xe_gt_assert(gt, xe_device_has_lmtt(gt_to_xe(gt)));
>> +	if (!xe_device_has_lmtt(gt_to_xe(gt)))
>> +		return -EPERM;
>>   
>>   	mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
>>   	if (vfid)
>> diff --git a/drivers/gpu/drm/xe/xe_tile_sriov_pf_debugfs.c b/drivers/gpu/drm/xe/xe_tile_sriov_pf_debugfs.c
>> index c8df18af4d00..6ba2332c77d4 100644
>> --- a/drivers/gpu/drm/xe/xe_tile_sriov_pf_debugfs.c
>> +++ b/drivers/gpu/drm/xe/xe_tile_sriov_pf_debugfs.c
>> @@ -165,14 +165,17 @@ DEFINE_SRIOV_TILE_CONFIG_DEBUGFS_ATTRIBUTE(vram, lmem, u64, "%llu\n");
>>   
>>   static void pf_add_config_attrs(struct xe_tile *tile, struct dentry *dent, unsigned int vfid)
>>   {
>> +	struct xe_device *xe = tile->xe;
>> +
>>   	xe_tile_assert(tile, tile == extract_tile(dent));
>>   	xe_tile_assert(tile, vfid == extract_vfid(dent));
>>   
>>   	debugfs_create_file_unsafe(vfid ? "ggtt_quota" : "ggtt_spare",
>>   				   0644, dent, dent, &ggtt_fops);
>> -	if (xe_device_has_lmtt(tile->xe))
>> +	if (IS_DGFX(xe))
>>   		debugfs_create_file_unsafe(vfid ? "vram_quota" : "vram_spare",
>> -					   0644, dent, dent, &vram_fops);
>> +					   xe_device_has_lmtt(xe) ? 0644 : 0444,
>> +					   dent, dent, &vram_fops);
> for platforms without LMTT, does it make sense to expose PF's "spare" attribute?

In my opinion yes - if it's exposed we can check the size of the region 
assigned to PF.

>>   }
>>   
>>   static void pf_populate_tile(struct xe_tile *tile, struct dentry *dent, unsigned int vfid)
>> @@ -188,7 +191,7 @@ static void pf_populate_tile(struct xe_tile *tile, struct dentry *dent, unsigned
>>   		drm_debugfs_create_files(pf_ggtt_info,
>>   					 ARRAY_SIZE(pf_ggtt_info),
>>   					 dent, minor);
>> -		if (xe_device_has_lmtt(xe))
>> +		if (IS_DGFX(xe))
>>   			drm_debugfs_create_files(pf_vram_info,
>>   						 ARRAY_SIZE(pf_vram_info),
>>   						 dent, minor);

  reply	other threads:[~2025-10-17 10:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 12:22 [PATCH v2] drm/xe/pf: Always expose VRAM provisioning data on discrete GPUs Lukasz Laguna
2025-10-16 14:15 ` ✓ CI.KUnit: success for drm/xe/pf: Always expose VRAM provisioning data on discrete GPUs (rev2) Patchwork
2025-10-16 14:47 ` [PATCH v2] drm/xe/pf: Always expose VRAM provisioning data on discrete GPUs Piotr Piórkowski
2025-10-16 15:07 ` ✓ Xe.CI.BAT: success for drm/xe/pf: Always expose VRAM provisioning data on discrete GPUs (rev2) Patchwork
2025-10-17 10:27 ` [PATCH v2] drm/xe/pf: Always expose VRAM provisioning data on discrete GPUs Michal Wajdeczko
2025-10-17 10:43   ` Laguna, Lukasz [this message]
2025-10-17 11:45 ` ✓ Xe.CI.Full: success for drm/xe/pf: Always expose VRAM provisioning data on discrete GPUs (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dbaa050e-696d-4938-b192-e0456f1f0a29@intel.com \
    --to=lukasz.laguna@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    --cc=piotr.piorkowski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox