diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index e942465e4fb1..7bd46e915761 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -35,6 +35,7 @@
 #include <drm/drm_file.h>
 
 #include "virtgpu_drv.h"
+#include "virtgpu_gem.h"
 
 static struct drm_driver driver;
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index cd98df412cda..fa921f07c331 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -216,40 +216,6 @@ void virtio_gpu_deinit(struct drm_device *dev);
 int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file);
 void virtio_gpu_driver_postclose(struct drm_device *dev, struct drm_file *file);
 
-/* virtio_gem.c */
-void virtio_gpu_gem_free_object(struct drm_gem_object *gem_obj);
-int virtio_gpu_gem_init(struct virtio_gpu_device *vgdev);
-void virtio_gpu_gem_fini(struct virtio_gpu_device *vgdev);
-int virtio_gpu_gem_create(struct drm_file *file,
-			  struct drm_device *dev,
-			  struct virtio_gpu_object_params *params,
-			  struct drm_gem_object **obj_p,
-			  uint32_t *handle_p);
-int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
-			       struct drm_file *file);
-void virtio_gpu_gem_object_close(struct drm_gem_object *obj,
-				 struct drm_file *file);
-int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
-				struct drm_device *dev,
-				struct drm_mode_create_dumb *args);
-int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv,
-			      struct drm_device *dev,
-			      uint32_t handle, uint64_t *offset_p);
-
-struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents);
-struct virtio_gpu_object_array*
-virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents);
-void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs,
-			      struct drm_gem_object *obj);
-int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs);
-void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs);
-void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs,
-				struct dma_fence *fence);
-void virtio_gpu_array_put_free(struct virtio_gpu_object_array *objs);
-void virtio_gpu_array_put_free_delayed(struct virtio_gpu_device *vgdev,
-				       struct virtio_gpu_object_array *objs);
-void virtio_gpu_array_put_free_work(struct work_struct *work);
-
 /* virtio_gpu_display.c */
 void virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev);
 void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev);
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 409dd3863c7b..61cfc9e11f75 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -27,6 +27,7 @@
 #include <drm/drm_fourcc.h>
 
 #include "virtgpu_drv.h"
+#include "virtgpu_gem.h"
 #include "virtgpu_vq.h"
 
 int virtio_gpu_gem_create(struct drm_file *file,
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.h b/drivers/gpu/drm/virtio/virtgpu_gem.h
new file mode 100644
index 000000000000..2ee81980e384
--- /dev/null
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.h
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef VIRTIO_GEM_H
+#define VIRTIO_GEM_H
+
+#include <linux/types.h>
+
+struct dma_fence;
+struct drm_device;
+struct drm_file;
+struct drm_gem_object;
+
+struct virtio_gpu_device;
+struct virtio_gpu_object_array;
+struct virtio_gpu_object_params;
+
+struct work_struct;
+
+void virtio_gpu_gem_free_object(struct drm_gem_object *gem_obj);
+int virtio_gpu_gem_init(struct virtio_gpu_device *vgdev);
+void virtio_gpu_gem_fini(struct virtio_gpu_device *vgdev);
+int virtio_gpu_gem_create(struct drm_file *file,
+			  struct drm_device *dev,
+			  struct virtio_gpu_object_params *params,
+			  struct drm_gem_object **obj_p,
+			  uint32_t *handle_p);
+int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
+			       struct drm_file *file);
+void virtio_gpu_gem_object_close(struct drm_gem_object *obj,
+				 struct drm_file *file);
+int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
+				struct drm_device *dev,
+				struct drm_mode_create_dumb *args);
+int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv,
+			      struct drm_device *dev,
+			      uint32_t handle, uint64_t *offset_p);
+
+struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents);
+struct virtio_gpu_object_array*
+virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles,
+			      u32 nents);
+void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs,
+			      struct drm_gem_object *obj);
+int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs);
+void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs);
+void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs,
+				struct dma_fence *fence);
+void virtio_gpu_array_put_free(struct virtio_gpu_object_array *objs);
+void virtio_gpu_array_put_free_delayed(struct virtio_gpu_device *vgdev,
+				       struct virtio_gpu_object_array *objs);
+void virtio_gpu_array_put_free_work(struct work_struct *work);
+
+#endif /* VIRTGPU_GEM_H */
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 0108945b5cae..2dc394170566 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -32,6 +32,7 @@
 #include <drm/virtgpu_drm.h>
 
 #include "virtgpu_drv.h"
+#include "virtgpu_gem.h"
 #include "virtgpu_vq.h"
 
 static int virtio_gpu_map_ioctl(struct drm_device *dev, void *data,
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 2013002d3c2f..a8aaff30d021 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -29,6 +29,7 @@
 #include <drm/drm_file.h>
 
 #include "virtgpu_drv.h"
+#include "virtgpu_gem.h"
 #include "virtgpu_vq.h"
 
 static void virtio_gpu_config_changed_work_func(struct work_struct *work)
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
index 8df93f40d282..2060662e3f46 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ b/drivers/gpu/drm/virtio/virtgpu_object.c
@@ -26,6 +26,7 @@
 #include <linux/moduleparam.h>
 
 #include "virtgpu_drv.h"
+#include "virtgpu_gem.h"
 #include "virtgpu_vq.h"
 
 static int virtio_gpu_virglrenderer_workaround = 1;
diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 384796db9373..84156147d549 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -28,6 +28,7 @@
 #include <drm/drm_plane_helper.h>
 
 #include "virtgpu_drv.h"
+#include "virtgpu_gem.h"
 #include "virtgpu_vq.h"
 
 static const uint32_t virtio_gpu_formats[] = {
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
index 4d1c357ada07..00f17a40671d 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -32,6 +32,7 @@
 #include <linux/virtio_ring.h>
 
 #include "virtgpu_drv.h"
+#include "virtgpu_gem.h"
 #include "virtgpu_trace.h"
 #include "virtgpu_vq.h"
 
