Re: [PATCH 3/3] drm/amdgpu: do not use drm middle layer for debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2/15/21 12:03 PM, Nirmoy wrote:
<snip>

amdgpu_debugfs_autodump_init(adev);
-
      amdgpu_rap_debugfs_init(adev);
-
      amdgpu_securedisplay_debugfs_init(adev);
-
      amdgpu_fw_attestation_debugfs_init(adev);
  -    return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list,
-                    ARRAY_SIZE(amdgpu_debugfs_list));
+    debugfs_create_file("amdgpu_evict_vram", S_IFREG | S_IRUGO, root, adev,
+                &amdgpu_evict_vram_fops);
+    debugfs_create_file("amdgpu_evict_gtt", S_IFREG | S_IRUGO, root, adev,
+                &amdgpu_evict_gtt_fops);
+    debugfs_create_file("amdgpu_test_ib", S_IFREG | S_IRUGO, root, adev,
+                &amdgpu_debugfs_test_ib_fops);
+    debugfs_create_file("amdgpu_vm_info", S_IFREG | S_IRUGO, root, adev,
+                &amdgpu_debugfs_vm_info_fops);
+
+    vbios = devm_kzalloc(adev_to_drm(adev)->dev, sizeof(*vbios), GFP_KERNEL);
+    if (!vbios)
+        return -ENOMEM;
+
+    vbios->data = adev->bios;
+    vbios->size = adev->bios_size;
+    debugfs_create_blob("amdgpu_vbios", S_IFREG | S_IRUGO, root, vbios);

Is that vbios allocation ever freed? Maybe just change adev->bios and adev->bios_dize into a debugfs_blob_wrapper structure.


devm_kzalloc will get freed on driver removal.


Sorry, this requires a devm_kfree() call at the end.




Or at least keep the debugfs_blob_wrapper structure inside adev.


I will update with above suggestion.


Regards,

Nirmoy



+
+    return 0;
  }
    #else
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h index 2803884d338d..0ed866da865e 100644
<snip>
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux