14834442dSDaniel Vetter /* 24834442dSDaniel Vetter * Internal Header for the Direct Rendering Manager 34834442dSDaniel Vetter * 44834442dSDaniel Vetter * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 54834442dSDaniel Vetter * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 64834442dSDaniel Vetter * Copyright (c) 2009-2010, Code Aurora Forum. 74834442dSDaniel Vetter * All rights reserved. 84834442dSDaniel Vetter * 94834442dSDaniel Vetter * Author: Rickard E. (Rik) Faith <faith@valinux.com> 104834442dSDaniel Vetter * Author: Gareth Hughes <gareth@valinux.com> 114834442dSDaniel Vetter * 124834442dSDaniel Vetter * Permission is hereby granted, free of charge, to any person obtaining a 134834442dSDaniel Vetter * copy of this software and associated documentation files (the "Software"), 144834442dSDaniel Vetter * to deal in the Software without restriction, including without limitation 154834442dSDaniel Vetter * the rights to use, copy, modify, merge, publish, distribute, sublicense, 164834442dSDaniel Vetter * and/or sell copies of the Software, and to permit persons to whom the 174834442dSDaniel Vetter * Software is furnished to do so, subject to the following conditions: 184834442dSDaniel Vetter * 194834442dSDaniel Vetter * The above copyright notice and this permission notice (including the next 204834442dSDaniel Vetter * paragraph) shall be included in all copies or substantial portions of the 214834442dSDaniel Vetter * Software. 224834442dSDaniel Vetter * 234834442dSDaniel Vetter * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 244834442dSDaniel Vetter * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 254834442dSDaniel Vetter * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 264834442dSDaniel Vetter * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 274834442dSDaniel Vetter * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 284834442dSDaniel Vetter * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 294834442dSDaniel Vetter * OTHER DEALINGS IN THE SOFTWARE. 304834442dSDaniel Vetter */ 314834442dSDaniel Vetter 324834442dSDaniel Vetter #ifndef _DRM_DEBUGFS_H_ 334834442dSDaniel Vetter #define _DRM_DEBUGFS_H_ 344834442dSDaniel Vetter 35*a7d469ccSSam Ravnborg #include <linux/types.h> 36*a7d469ccSSam Ravnborg #include <linux/seq_file.h> 374834442dSDaniel Vetter /** 380cad7f71SDaniel Vetter * struct drm_info_list - debugfs info list entry 390cad7f71SDaniel Vetter * 400cad7f71SDaniel Vetter * This structure represents a debugfs file to be created by the drm 410cad7f71SDaniel Vetter * core. 424834442dSDaniel Vetter */ 434834442dSDaniel Vetter struct drm_info_list { 440cad7f71SDaniel Vetter /** @name: file name */ 450cad7f71SDaniel Vetter const char *name; 460cad7f71SDaniel Vetter /** 470cad7f71SDaniel Vetter * @show: 480cad7f71SDaniel Vetter * 490cad7f71SDaniel Vetter * Show callback. &seq_file->private will be set to the &struct 500cad7f71SDaniel Vetter * drm_info_node corresponding to the instance of this info on a given 510cad7f71SDaniel Vetter * &struct drm_minor. 520cad7f71SDaniel Vetter */ 530cad7f71SDaniel Vetter int (*show)(struct seq_file*, void*); 540cad7f71SDaniel Vetter /** @driver_features: Required driver features for this entry */ 550cad7f71SDaniel Vetter u32 driver_features; 560cad7f71SDaniel Vetter /** @data: Driver-private data, should not be device-specific. */ 574834442dSDaniel Vetter void *data; 584834442dSDaniel Vetter }; 594834442dSDaniel Vetter 604834442dSDaniel Vetter /** 610cad7f71SDaniel Vetter * struct drm_info_node - Per-minor debugfs node structure 620cad7f71SDaniel Vetter * 630cad7f71SDaniel Vetter * This structure represents a debugfs file, as an instantiation of a &struct 640cad7f71SDaniel Vetter * drm_info_list on a &struct drm_minor. 650cad7f71SDaniel Vetter * 660cad7f71SDaniel Vetter * FIXME: 670cad7f71SDaniel Vetter * 680cad7f71SDaniel Vetter * No it doesn't make a hole lot of sense that we duplicate debugfs entries for 690cad7f71SDaniel Vetter * both the render and the primary nodes, but that's how this has organically 700cad7f71SDaniel Vetter * grown. It should probably be fixed, with a compatibility link, if needed. 714834442dSDaniel Vetter */ 724834442dSDaniel Vetter struct drm_info_node { 730cad7f71SDaniel Vetter /** @minor: &struct drm_minor for this node. */ 744834442dSDaniel Vetter struct drm_minor *minor; 750cad7f71SDaniel Vetter /** @info_ent: template for this node. */ 764834442dSDaniel Vetter const struct drm_info_list *info_ent; 770cad7f71SDaniel Vetter /* private: */ 780cad7f71SDaniel Vetter struct list_head list; 794834442dSDaniel Vetter struct dentry *dent; 804834442dSDaniel Vetter }; 814834442dSDaniel Vetter 824834442dSDaniel Vetter #if defined(CONFIG_DEBUG_FS) 834834442dSDaniel Vetter int drm_debugfs_create_files(const struct drm_info_list *files, 844834442dSDaniel Vetter int count, struct dentry *root, 854834442dSDaniel Vetter struct drm_minor *minor); 864834442dSDaniel Vetter int drm_debugfs_remove_files(const struct drm_info_list *files, 874834442dSDaniel Vetter int count, struct drm_minor *minor); 884834442dSDaniel Vetter #else 894834442dSDaniel Vetter static inline int drm_debugfs_create_files(const struct drm_info_list *files, 904834442dSDaniel Vetter int count, struct dentry *root, 914834442dSDaniel Vetter struct drm_minor *minor) 924834442dSDaniel Vetter { 934834442dSDaniel Vetter return 0; 944834442dSDaniel Vetter } 954834442dSDaniel Vetter 964834442dSDaniel Vetter static inline int drm_debugfs_remove_files(const struct drm_info_list *files, 974834442dSDaniel Vetter int count, struct drm_minor *minor) 984834442dSDaniel Vetter { 994834442dSDaniel Vetter return 0; 1004834442dSDaniel Vetter } 1014834442dSDaniel Vetter #endif 1024834442dSDaniel Vetter 1034834442dSDaniel Vetter #endif /* _DRM_DEBUGFS_H_ */ 104