nouveau_debugfs.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2009 Red Hat <bskeggs@redhat.com>
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining
  5. * a copy of this software and associated documentation files (the
  6. * "Software"), to deal in the Software without restriction, including
  7. * without limitation the rights to use, copy, modify, merge, publish,
  8. * distribute, sublicense, and/or sell copies of the Software, and to
  9. * permit persons to whom the Software is furnished to do so, subject to
  10. * the following conditions:
  11. *
  12. * The above copyright notice and this permission notice (including the
  13. * next paragraph) shall be included in all copies or substantial
  14. * portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  19. * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
  20. * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  21. * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. */
  25. /*
  26. * Authors:
  27. * Ben Skeggs <bskeggs@redhat.com>
  28. */
  29. #include "nouveau_debugfs.h"
  30. #include "nouveau_drm.h"
  31. static int
  32. nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
  33. {
  34. struct drm_info_node *node = (struct drm_info_node *) m->private;
  35. struct nouveau_drm *drm = nouveau_drm(node->minor->dev);
  36. int i;
  37. for (i = 0; i < drm->vbios.length; i++)
  38. seq_printf(m, "%c", drm->vbios.data[i]);
  39. return 0;
  40. }
  41. static struct drm_info_list nouveau_debugfs_list[] = {
  42. { "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL },
  43. };
  44. #define NOUVEAU_DEBUGFS_ENTRIES ARRAY_SIZE(nouveau_debugfs_list)
  45. int
  46. nouveau_debugfs_init(struct drm_minor *minor)
  47. {
  48. drm_debugfs_create_files(nouveau_debugfs_list, NOUVEAU_DEBUGFS_ENTRIES,
  49. minor->debugfs_root, minor);
  50. return 0;
  51. }
  52. void
  53. nouveau_debugfs_takedown(struct drm_minor *minor)
  54. {
  55. drm_debugfs_remove_files(nouveau_debugfs_list, NOUVEAU_DEBUGFS_ENTRIES,
  56. minor);
  57. }