]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - ubuntu/vbox/vboxvideo/vbox_drv.h
UBUNTU: ubuntu: vbox -- update to 5.1.28-dfsg-1
[mirror_ubuntu-artful-kernel.git] / ubuntu / vbox / vboxvideo / vbox_drv.h
index 6f89d3bd963774aa6def2ad5c6473dfa9df8aa87..b7c9f4de959f7d90174739734bcc746e9c50bbf9 100644 (file)
 #include <drm/ttm/ttm_memory.h>
 #include <drm/ttm/ttm_module.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
+#if defined(RHEL_MAJOR) && defined(RHEL_MINOR)
+# if RHEL_MAJOR == 7 && RHEL_MINOR >= 4
+#  define RHEL_73
+#  define RHEL_74
+# elif RHEL_MAJOR == 7 && RHEL_MINOR >= 3
+#  define RHEL_73
+# endif
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_73)
 # include <drm/drm_gem.h>
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
@@ -213,7 +222,7 @@ extern void vbox_mode_fini(struct drm_device *dev);
 # define DRM_MODE_FB_CMD drm_mode_fb_cmd2
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && !defined(RHEL_73)
 # define CRTC_FB(crtc) (crtc)->fb
 #else
 # define CRTC_FB(crtc) (crtc)->primary->fb
@@ -229,7 +238,7 @@ void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
 
 int vbox_framebuffer_init(struct drm_device *dev,
              struct vbox_framebuffer *vbox_fb,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_73)
              const
 #endif
              struct DRM_MODE_FB_CMD *mode_cmd,
@@ -245,7 +254,7 @@ struct vbox_bo {
     struct ttm_placement placement;
     struct ttm_bo_kmap_obj kmap;
     struct drm_gem_object gem;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_73)
     u32 placements[3];
 #else
     struct ttm_place placements[3];
@@ -266,7 +275,7 @@ vbox_bo(struct ttm_buffer_object *bo)
 extern int vbox_dumb_create(struct drm_file *file,
                struct drm_device *dev,
                struct drm_mode_create_dumb *args);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_73)
 extern int vbox_dumb_destroy(struct drm_file *file,
                 struct drm_device *dev,
                 uint32_t handle);
@@ -297,7 +306,7 @@ static inline int vbox_bo_reserve(struct vbox_bo *bo, bool no_wait)
 {
     int ret;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) || defined(RHEL_74)
     ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL);
 #else
     ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0);
@@ -326,7 +335,7 @@ void vbox_gem_prime_unpin(struct drm_gem_object *obj);
 struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj);
 struct drm_gem_object *vbox_gem_prime_import_sg_table(
         struct drm_device *dev,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_73)
         size_t size,
 #else
         struct dma_buf_attachment *attach,