Skip to content

Commit 4834442

Browse files
committed
drm: Extract drm_debugfs.h
Doc polish will follow in the next patch. v2: Put the include guard #endif at the end (Ville). Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170322205336.24549-1-daniel.vetter@ffwll.ch
1 parent 91faa04 commit 4834442

3 files changed

Lines changed: 82 additions & 44 deletions

File tree

‎drivers/gpu/drm/drm_debugfs.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@
3434
#include <linux/seq_file.h>
3535
#include <linux/slab.h>
3636
#include <linux/export.h>
37-
#include <drm/drmP.h>
37+
38+
#include <drm/drm_debugfs.h>
3839
#include <drm/drm_edid.h>
3940
#include <drm/drm_atomic.h>
41+
#include <drm/drmP.h>
42+
4043
#include "drm_internal.h"
4144
#include "drm_crtc_internal.h"
4245

‎include/drm/drmP.h‎

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#include <drm/drm_prime.h>
7979
#include <drm/drm_pci.h>
8080
#include <drm/drm_file.h>
81+
#include <drm/drm_debugfs.h>
8182

8283
struct module;
8384

@@ -370,27 +371,6 @@ struct drm_ioctl_desc {
370371
#define DRM_SCANOUTPOS_IN_VBLANK (1 << 1)
371372
#define DRM_SCANOUTPOS_ACCURATE (1 << 2)
372373

373-
/**
374-
* Info file list entry. This structure represents a debugfs or proc file to
375-
* be created by the drm core
376-
*/
377-
struct drm_info_list {
378-
const char *name; /** file name */
379-
int (*show)(struct seq_file*, void*); /** show callback */
380-
u32 driver_features; /**< Required driver features for this entry */
381-
void *data;
382-
};
383-
384-
/**
385-
* debugfs node structure. This structure represents a debugfs file.
386-
*/
387-
struct drm_info_node {
388-
struct list_head list;
389-
struct drm_minor *minor;
390-
const struct drm_info_list *info_ent;
391-
struct dentry *dent;
392-
};
393-
394374
/**
395375
* DRM device structure. This structure represent a complete card that
396376
* may contain multiple heads.
@@ -592,28 +572,6 @@ int drm_invalid_op(struct drm_device *dev, void *data,
592572
* DMA quiscent + idle. DMA quiescent usually requires the hardware lock.
593573
*/
594574

595-
/* Debugfs support */
596-
#if defined(CONFIG_DEBUG_FS)
597-
extern int drm_debugfs_create_files(const struct drm_info_list *files,
598-
int count, struct dentry *root,
599-
struct drm_minor *minor);
600-
extern int drm_debugfs_remove_files(const struct drm_info_list *files,
601-
int count, struct drm_minor *minor);
602-
#else
603-
static inline int drm_debugfs_create_files(const struct drm_info_list *files,
604-
int count, struct dentry *root,
605-
struct drm_minor *minor)
606-
{
607-
return 0;
608-
}
609-
610-
static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
611-
int count, struct drm_minor *minor)
612-
{
613-
return 0;
614-
}
615-
#endif
616-
617575
/* sysfs support (drm_sysfs.c) */
618576
extern void drm_sysfs_hotplug_event(struct drm_device *dev);
619577

‎include/drm/drm_debugfs.h‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Internal Header for the Direct Rendering Manager
3+
*
4+
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5+
* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
6+
* Copyright (c) 2009-2010, Code Aurora Forum.
7+
* All rights reserved.
8+
*
9+
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
10+
* Author: Gareth Hughes <gareth@valinux.com>
11+
*
12+
* Permission is hereby granted, free of charge, to any person obtaining a
13+
* copy of this software and associated documentation files (the "Software"),
14+
* to deal in the Software without restriction, including without limitation
15+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
16+
* and/or sell copies of the Software, and to permit persons to whom the
17+
* Software is furnished to do so, subject to the following conditions:
18+
*
19+
* The above copyright notice and this permission notice (including the next
20+
* paragraph) shall be included in all copies or substantial portions of the
21+
* Software.
22+
*
23+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26+
* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27+
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29+
* OTHER DEALINGS IN THE SOFTWARE.
30+
*/
31+
32+
#ifndef _DRM_DEBUGFS_H_
33+
#define _DRM_DEBUGFS_H_
34+
35+
/**
36+
* Info file list entry. This structure represents a debugfs or proc file to
37+
* be created by the drm core
38+
*/
39+
struct drm_info_list {
40+
const char *name; /** file name */
41+
int (*show)(struct seq_file*, void*); /** show callback */
42+
u32 driver_features; /**< Required driver features for this entry */
43+
void *data;
44+
};
45+
46+
/**
47+
* debugfs node structure. This structure represents a debugfs file.
48+
*/
49+
struct drm_info_node {
50+
struct list_head list;
51+
struct drm_minor *minor;
52+
const struct drm_info_list *info_ent;
53+
struct dentry *dent;
54+
};
55+
56+
#if defined(CONFIG_DEBUG_FS)
57+
int drm_debugfs_create_files(const struct drm_info_list *files,
58+
int count, struct dentry *root,
59+
struct drm_minor *minor);
60+
int drm_debugfs_remove_files(const struct drm_info_list *files,
61+
int count, struct drm_minor *minor);
62+
#else
63+
static inline int drm_debugfs_create_files(const struct drm_info_list *files,
64+
int count, struct dentry *root,
65+
struct drm_minor *minor)
66+
{
67+
return 0;
68+
}
69+
70+
static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
71+
int count, struct drm_minor *minor)
72+
{
73+
return 0;
74+
}
75+
#endif
76+
77+
#endif /* _DRM_DEBUGFS_H_ */

0 commit comments

Comments
 (0)