I'm torn on whether drm_minor really should be here or somewhere else.
Maybe with more clarity after untangling drmP.h more this is easier to
decide, for now I've put a FIXME comment right next to it. Right now
we need struct drm_minor for the inline drm_file type helpers, and so
it does kinda make sense to have them here.
Next patch will kerneldoc-ify the entire pile.
Signed-off-by: Daniel Vetter
---
drivers/gpu/drm/drm_file.c | 5 +-
include/drm/drmP.h | 127 +
include/drm/drm_file.h | 172 +
include/drm/drm_prime.h| 1 +
4 files changed, 178 insertions(+), 127 deletions(-)
create mode 100644 include/drm/drm_file.h
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 83e8c96ec4ab..d9e63d73d3ec 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -31,10 +31,13 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-#include
#include
#include
#include
+
+#include
+#include
+
#include "drm_legacy.h"
#include "drm_internal.h"
#include "drm_crtc_internal.h"
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 7bd6752683a4..4a0260e2b067 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -77,10 +77,10 @@
#include
#include
#include
+#include
struct module;
-struct drm_file;
struct drm_device;
struct drm_agp_head;
struct drm_local_map;
@@ -360,76 +360,6 @@ struct drm_ioctl_desc {
.name = #ioctl \
}
-/* Event queued up for userspace to read */
-struct drm_pending_event {
- struct completion *completion;
- void (*completion_release)(struct completion *completion);
- struct drm_event *event;
- struct dma_fence *fence;
- struct list_head link;
- struct list_head pending_link;
- struct drm_file *file_priv;
- pid_t pid; /* pid of requester, no guarantee it's valid by the time
- we deliver the event, for tracing only */
-};
-
-/** File private data */
-struct drm_file {
- unsigned authenticated :1;
- /* true when the client has asked us to expose stereo 3D mode flags */
- unsigned stereo_allowed :1;
- /*
-* true if client understands CRTC primary planes and cursor planes
-* in the plane list
-*/
- unsigned universal_planes:1;
- /* true if client understands atomic properties */
- unsigned atomic:1;
- /*
-* This client is the creator of @master.
-* Protected by struct drm_device::master_mutex.
-*/
- unsigned is_master:1;
-
- struct pid *pid;
- drm_magic_t magic;
- struct list_head lhead;
- struct drm_minor *minor;
- unsigned long lock_count;
-
- /** Mapping of mm object handles to object pointers. */
- struct idr object_idr;
- /** Lock for synchronization of access to object_idr. */
- spinlock_t table_lock;
-
- struct file *filp;
- void *driver_priv;
-
- struct drm_master *master; /* master this node is currently associated
with
- N.B. not always dev->master */
- /**
-* fbs - List of framebuffers associated with this file.
-*
-* Protected by fbs_lock. Note that the fbs list holds a reference on
-* the fb object to prevent it from untimely disappearing.
-*/
- struct list_head fbs;
- struct mutex fbs_lock;
-
- /** User-created blob properties; this retains a reference on the
-* property. */
- struct list_head blobs;
-
- wait_queue_head_t event_wait;
- struct list_head pending_event_list;
- struct list_head event_list;
- int event_space;
-
- struct mutex event_read_lock;
-
- struct drm_prime_file_private prime;
-};
-
/* Flags and return codes for get_vblank_timestamp() driver function. */
#define DRM_CALLED_FROM_VBLIRQ 1
#define DRM_VBLANKTIME_SCANOUTPOS_METHOD (1 << 0)
@@ -440,12 +370,6 @@ struct drm_file {
#define DRM_SCANOUTPOS_IN_VBLANK(1 << 1)
#define DRM_SCANOUTPOS_ACCURATE (1 << 2)
-enum drm_minor_type {
- DRM_MINOR_PRIMARY,
- DRM_MINOR_CONTROL,
- DRM_MINOR_RENDER,
-};
-
/**
* Info file list entry. This structure represents a debugfs or proc file to
* be created by the drm core
@@ -468,21 +392,6 @@ struct drm_info_node {
};
/**
- * DRM minor structure. This structure represents a drm minor number.
- */
-struct drm_minor {
- int index; /**< Minor device number */
- int type; /**< Control or render */
- struct device *kdev;/**< Linux device */
- struct drm_device *dev;
-
- struct dentry *debugfs_root;
-
- struct list_head debugfs_list;
- struct mutex debugfs_lock; /* Protects debugfs_list. */
-};
-
-/**
* DRM device