Commit 89a7c0bd authored by Lijo Lazar's avatar Lijo Lazar Committed by Alex Deucher

drm/amdgpu: Show vram vendor only if available

Ony if vram vendor info is available, show in sysfs.
Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.7.x
parent 30269954
...@@ -221,8 +221,23 @@ static struct attribute *amdgpu_vram_mgr_attributes[] = { ...@@ -221,8 +221,23 @@ static struct attribute *amdgpu_vram_mgr_attributes[] = {
NULL NULL
}; };
static umode_t amdgpu_vram_attrs_is_visible(struct kobject *kobj,
struct attribute *attr, int i)
{
struct device *dev = kobj_to_dev(kobj);
struct drm_device *ddev = dev_get_drvdata(dev);
struct amdgpu_device *adev = drm_to_adev(ddev);
if (attr == &dev_attr_mem_info_vram_vendor.attr &&
!adev->gmc.vram_vendor)
return 0;
return attr->mode;
}
const struct attribute_group amdgpu_vram_mgr_attr_group = { const struct attribute_group amdgpu_vram_mgr_attr_group = {
.attrs = amdgpu_vram_mgr_attributes .attrs = amdgpu_vram_mgr_attributes,
.is_visible = amdgpu_vram_attrs_is_visible
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment