mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
Merge tag 'amd-drm-next-5.8-2020-05-12' of git://people.freedesktop.org/~agd5f/linux into drm-next
amd-drm-next-5.8-2020-05-12: amdgpu: - Misc cleanups - RAS fixes - Expose FP16 for modesetting - DP 1.4 compliance test fixes - Clockgating fixes - MAINTAINERS update - Soft recovery for gfx10 - Runtime PM cleanups - PSP code cleanups amdkfd: - Track GPU memory utilization per process - Report PCI domain in topology Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexdeucher@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200512213703.4039-1-alexander.deucher@amd.com
This commit is contained in:
@@ -149,6 +149,15 @@ static DEVICE_ATTR(mem_info_vis_vram_used, S_IRUGO,
|
||||
static DEVICE_ATTR(mem_info_vram_vendor, S_IRUGO,
|
||||
amdgpu_mem_info_vram_vendor, NULL);
|
||||
|
||||
static const struct attribute *amdgpu_vram_mgr_attributes[] = {
|
||||
&dev_attr_mem_info_vram_total.attr,
|
||||
&dev_attr_mem_info_vis_vram_total.attr,
|
||||
&dev_attr_mem_info_vram_used.attr,
|
||||
&dev_attr_mem_info_vis_vram_used.attr,
|
||||
&dev_attr_mem_info_vram_vendor.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
* amdgpu_vram_mgr_init - init VRAM manager and DRM MM
|
||||
*
|
||||
@@ -173,31 +182,9 @@ static int amdgpu_vram_mgr_init(struct ttm_mem_type_manager *man,
|
||||
man->priv = mgr;
|
||||
|
||||
/* Add the two VRAM-related sysfs files */
|
||||
ret = device_create_file(adev->dev, &dev_attr_mem_info_vram_total);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to create device file mem_info_vram_total\n");
|
||||
return ret;
|
||||
}
|
||||
ret = device_create_file(adev->dev, &dev_attr_mem_info_vis_vram_total);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to create device file mem_info_vis_vram_total\n");
|
||||
return ret;
|
||||
}
|
||||
ret = device_create_file(adev->dev, &dev_attr_mem_info_vram_used);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to create device file mem_info_vram_used\n");
|
||||
return ret;
|
||||
}
|
||||
ret = device_create_file(adev->dev, &dev_attr_mem_info_vis_vram_used);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to create device file mem_info_vis_vram_used\n");
|
||||
return ret;
|
||||
}
|
||||
ret = device_create_file(adev->dev, &dev_attr_mem_info_vram_vendor);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to create device file mem_info_vram_vendor\n");
|
||||
return ret;
|
||||
}
|
||||
ret = sysfs_create_files(&adev->dev->kobj, amdgpu_vram_mgr_attributes);
|
||||
if (ret)
|
||||
DRM_ERROR("Failed to register sysfs\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -220,11 +207,7 @@ static int amdgpu_vram_mgr_fini(struct ttm_mem_type_manager *man)
|
||||
spin_unlock(&mgr->lock);
|
||||
kfree(mgr);
|
||||
man->priv = NULL;
|
||||
device_remove_file(adev->dev, &dev_attr_mem_info_vram_total);
|
||||
device_remove_file(adev->dev, &dev_attr_mem_info_vis_vram_total);
|
||||
device_remove_file(adev->dev, &dev_attr_mem_info_vram_used);
|
||||
device_remove_file(adev->dev, &dev_attr_mem_info_vis_vram_used);
|
||||
device_remove_file(adev->dev, &dev_attr_mem_info_vram_vendor);
|
||||
sysfs_remove_files(&adev->dev->kobj, amdgpu_vram_mgr_attributes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user