From a8c9a7f52ec5a4b36ce183efd5fda4e4fd90ec45 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 7 Nov 2019 21:39:29 +0000 Subject: drm/i915/selftests: Complete transition to a real struct file mock Since drm provided us with a real struct file we can use for our anonymous internal clients (mock_file), complete our transition to using that as the primary interface (and not the mocked up struct drm_file we previous were using). Signed-off-by: Chris Wilson Cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20191107213929.23286-1-chris@chris-wilson.co.uk --- drivers/gpu/drm/i915/selftests/mock_drm.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/drm/i915/selftests/mock_drm.h') diff --git a/drivers/gpu/drm/i915/selftests/mock_drm.h b/drivers/gpu/drm/i915/selftests/mock_drm.h index dc4190bd3f5a..d7f49e149f0c 100644 --- a/drivers/gpu/drm/i915/selftests/mock_drm.h +++ b/drivers/gpu/drm/i915/selftests/mock_drm.h @@ -25,13 +25,20 @@ #ifndef __MOCK_DRM_H #define __MOCK_DRM_H -struct drm_file; +#include + struct drm_i915_private; +struct drm_file; +struct file; + +static inline struct file *mock_file(struct drm_i915_private *i915) +{ + return mock_drm_getfile(i915->drm.primary, O_RDWR); +} -struct drm_file *mock_file(struct drm_i915_private *i915); -static inline void mock_file_put(struct drm_file *file) +static inline struct drm_file *to_drm_file(struct file *f) { - fput(file->filp); + return f->private_data; } #endif /* !__MOCK_DRM_H */ -- cgit