summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_file.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-11-07 19:05:58 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-11-07 22:22:15 +0100
commit4748aa16d5273bf4b42d3581e5e33da1faa69722 (patch)
tree077cac1ed5c75183a55bff188647da813b27204e /include/drm/drm_file.h
parentdrm: Move EXPORT_SYMBOL_FOR_TESTS_ONLY under a separate Kconfig (diff)
downloadlinux-4748aa16d5273bf4b42d3581e5e33da1faa69722.tar.xz
linux-4748aa16d5273bf4b42d3581e5e33da1faa69722.zip
drm: Expose a method for creating anonymous struct file around drm_minor
Sometimes we need to create a struct file to wrap a drm_device, as it the user were to have opened /dev/dri/card0 but to do so anonymously (i.e. for internal use). Provide a utility method to create a struct file with the drm_device->driver.fops, that wrap the drm_device. v2: Restrict usage to selftests Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20191107180601.30815-2-chris@chris-wilson.co.uk
Diffstat (limited to 'include/drm/drm_file.h')
-rw-r--r--include/drm/drm_file.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 67af60bb527a..8b099b347817 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -42,6 +42,7 @@ struct dma_fence;
struct drm_file;
struct drm_device;
struct device;
+struct file;
/*
* FIXME: Not sure we want to have drm_minor here in the end, but to avoid
@@ -387,4 +388,6 @@ void drm_event_cancel_free(struct drm_device *dev,
void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e);
void drm_send_event(struct drm_device *dev, struct drm_pending_event *e);
+struct file *mock_drm_getfile(struct drm_minor *minor, unsigned int flags);
+
#endif /* _DRM_FILE_H_ */