| 1 | Index: src/VBox/Additions/linux/drm/vbox_drv.c
|
|---|
| 2 | ===================================================================
|
|---|
| 3 | --- src/VBox/Additions/linux/drm/vbox_drv.c (revision 140448)
|
|---|
| 4 | +++ src/VBox/Additions/linux/drm/vbox_drv.c (working copy)
|
|---|
| 5 | @@ -61,9 +61,7 @@
|
|---|
| 6 |
|
|---|
| 7 | static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|---|
| 8 | {
|
|---|
| 9 | -#if RTLNX_VER_MAX(4,19,0)
|
|---|
| 10 | - return drm_get_pci_dev(pdev, ent, &driver);
|
|---|
| 11 | -#else
|
|---|
| 12 | +#if RTLNX_VER_MIN(4,19,0) || RTLNX_RHEL_MIN(8,3)
|
|---|
| 13 | struct drm_device *dev = NULL;
|
|---|
| 14 | int ret = 0;
|
|---|
| 15 |
|
|---|
| 16 | @@ -90,6 +88,8 @@
|
|---|
| 17 | drm_dev_put(dev);
|
|---|
| 18 | err_drv_alloc:
|
|---|
| 19 | return ret;
|
|---|
| 20 | +#else /* < 4.19.0 || RHEL < 8.3 */
|
|---|
| 21 | + return drm_get_pci_dev(pdev, ent, &driver);
|
|---|
| 22 | #endif
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | @@ -303,19 +303,18 @@
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | static struct drm_driver driver = {
|
|---|
| 29 | -#if RTLNX_VER_MAX(5,4,0)
|
|---|
| 30 | - .driver_features =
|
|---|
| 31 | - DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ |
|
|---|
| 32 | +#if RTLNX_VER_MAX(5,4,0) && !RTLNX_RHEL_MAJ_PREREQ(8,3)
|
|---|
| 33 | + .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ |
|
|---|
| 34 | # if RTLNX_VER_MAX(5,1,0) && !RTLNX_RHEL_MAJ_PREREQ(8,1)
|
|---|
| 35 | DRIVER_IRQ_SHARED |
|
|---|
| 36 | # endif
|
|---|
| 37 | DRIVER_PRIME,
|
|---|
| 38 | -#else /* >= 5.4.0 */
|
|---|
| 39 | +#else /* >= 5.4.0 && RHEL >= 8.3 */
|
|---|
| 40 | .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ,
|
|---|
| 41 | #endif /* < 5.4.0 */
|
|---|
| 42 | .dev_priv_size = 0,
|
|---|
| 43 |
|
|---|
| 44 | -#if RTLNX_VER_MAX(4,19,0)
|
|---|
| 45 | +#if RTLNX_VER_MAX(4,19,0) && !RTLNX_RHEL_MAJ_PREREQ(8,3)
|
|---|
| 46 | /* Legacy hooks, but still supported. */
|
|---|
| 47 | .load = vbox_driver_load,
|
|---|
| 48 | .unload = vbox_driver_unload,
|
|---|
| 49 | Index: src/VBox/Additions/linux/drm/vbox_drv.h
|
|---|
| 50 | ===================================================================
|
|---|
| 51 | --- src/VBox/Additions/linux/drm/vbox_drv.h (revision 140448)
|
|---|
| 52 | +++ src/VBox/Additions/linux/drm/vbox_drv.h (working copy)
|
|---|
| 53 | @@ -151,9 +151,7 @@
|
|---|
| 54 | #define S64_MIN ((s64)(-S64_MAX - 1))
|
|---|
| 55 | #endif
|
|---|
| 56 |
|
|---|
| 57 | -#if RTLNX_VER_MAX(5,5,0)
|
|---|
| 58 | -# include <drm/drmP.h>
|
|---|
| 59 | -#else /* >= 5.5.0 */
|
|---|
| 60 | +#if RTLNX_VER_MIN(5,5,0) || RTLNX_RHEL_MIN(8,3)
|
|---|
| 61 | # include <drm/drm_file.h>
|
|---|
| 62 | # include <drm/drm_drv.h>
|
|---|
| 63 | # include <drm/drm_device.h>
|
|---|
| 64 | @@ -161,7 +159,9 @@
|
|---|
| 65 | # include <drm/drm_fourcc.h>
|
|---|
| 66 | # include <drm/drm_irq.h>
|
|---|
| 67 | # include <drm/drm_vblank.h>
|
|---|
| 68 | -#endif /* >= 5.5.0 */
|
|---|
| 69 | +#else /* < 5.5.0 || RHEL < 8.3 */
|
|---|
| 70 | +# include <drm/drmP.h>
|
|---|
| 71 | +#endif
|
|---|
| 72 | #if RTLNX_VER_MIN(4,11,0) || RTLNX_RHEL_MAJ_PREREQ(7,5)
|
|---|
| 73 | # include <drm/drm_encoder.h>
|
|---|
| 74 | #endif
|
|---|
| 75 | @@ -298,10 +298,10 @@
|
|---|
| 76 | #undef CURSOR_PIXEL_COUNT
|
|---|
| 77 | #undef CURSOR_DATA_SIZE
|
|---|
| 78 |
|
|---|
| 79 | -#if RTLNX_VER_MAX(4,19,0)
|
|---|
| 80 | -int vbox_driver_load(struct drm_device *dev, unsigned long flags);
|
|---|
| 81 | -#else
|
|---|
| 82 | +#if RTLNX_VER_MIN(4,19,0) || RTLNX_RHEL_MIN(8,3)
|
|---|
| 83 | int vbox_driver_load(struct drm_device *dev);
|
|---|
| 84 | +#else
|
|---|
| 85 | +int vbox_driver_load(struct drm_device *dev, unsigned long flags);
|
|---|
| 86 | #endif
|
|---|
| 87 | #if RTLNX_VER_MIN(4,11,0) || RTLNX_RHEL_MAJ_PREREQ(7,5)
|
|---|
| 88 | void vbox_driver_unload(struct drm_device *dev);
|
|---|
| 89 | Index: src/VBox/Additions/linux/drm/vbox_main.c
|
|---|
| 90 | ===================================================================
|
|---|
| 91 | --- src/VBox/Additions/linux/drm/vbox_main.c (revision 140448)
|
|---|
| 92 | +++ src/VBox/Additions/linux/drm/vbox_main.c (working copy)
|
|---|
| 93 | @@ -447,10 +447,10 @@
|
|---|
| 94 | pci_iounmap(vbox->dev->pdev, vbox->guest_heap);
|
|---|
| 95 | }
|
|---|
| 96 |
|
|---|
| 97 | -#if RTLNX_VER_MAX(4,19,0)
|
|---|
| 98 | -int vbox_driver_load(struct drm_device *dev, unsigned long flags)
|
|---|
| 99 | -#else
|
|---|
| 100 | +#if RTLNX_VER_MIN(4,19,0) || RTLNX_RHEL_MIN(8,3)
|
|---|
| 101 | int vbox_driver_load(struct drm_device *dev)
|
|---|
| 102 | +#else
|
|---|
| 103 | +int vbox_driver_load(struct drm_device *dev, unsigned long flags)
|
|---|
| 104 | #endif
|
|---|
| 105 | {
|
|---|
| 106 | struct vbox_private *vbox;
|
|---|
| 107 | @@ -621,7 +621,7 @@
|
|---|
| 108 |
|
|---|
| 109 | static inline u64 vbox_bo_mmap_offset(struct vbox_bo *bo)
|
|---|
| 110 | {
|
|---|
| 111 | -#if RTLNX_VER_MIN(5,4,0)
|
|---|
| 112 | +#if RTLNX_VER_MIN(5,4,0) || RTLNX_RHEL_MIN(8,3)
|
|---|
| 113 | return drm_vma_node_offset_addr(&bo->bo.base.vma_node);
|
|---|
| 114 | #elif RTLNX_VER_MAX(3,12,0) && !RTLNX_RHEL_MAJ_PREREQ(7,0)
|
|---|
| 115 | return bo->bo.addr_space_offset;
|
|---|
| 116 | Index: src/VBox/Additions/linux/drm/vbox_mode.c
|
|---|
| 117 | ===================================================================
|
|---|
| 118 | --- src/VBox/Additions/linux/drm/vbox_mode.c (revision 140448)
|
|---|
| 119 | +++ src/VBox/Additions/linux/drm/vbox_mode.c (working copy)
|
|---|
| 120 | @@ -398,13 +398,13 @@
|
|---|
| 121 | static struct drm_encoder *vbox_best_single_encoder(struct drm_connector
|
|---|
| 122 | *connector)
|
|---|
| 123 | {
|
|---|
| 124 | -#if RTLNX_VER_MIN(5,5,0)
|
|---|
| 125 | +#if RTLNX_VER_MIN(5,5,0) || RTLNX_RHEL_MIN(8,3)
|
|---|
| 126 | struct drm_encoder *encoder;
|
|---|
| 127 |
|
|---|
| 128 | /* There is only one encoder per connector */
|
|---|
| 129 | drm_connector_for_each_possible_encoder(connector, encoder)
|
|---|
| 130 | return encoder;
|
|---|
| 131 | -#else /* < 5.5 */
|
|---|
| 132 | +#else /* < 5.5 || RHEL < 8.3 */
|
|---|
| 133 | int enc_id = connector->encoder_ids[0];
|
|---|
| 134 |
|
|---|
| 135 | /* pick the encoder ids */
|
|---|
| 136 | @@ -414,7 +414,7 @@
|
|---|
| 137 | # else
|
|---|
| 138 | return drm_encoder_find(connector->dev, enc_id);
|
|---|
| 139 | # endif
|
|---|
| 140 | -#endif /* < 5.5 */
|
|---|
| 141 | +#endif /* < 5.5 || RHEL < 8.3 */
|
|---|
| 142 | return NULL;
|
|---|
| 143 | }
|
|---|
| 144 |
|
|---|
| 145 | Index: src/VBox/Additions/linux/drm/vbox_ttm.c
|
|---|
| 146 | ===================================================================
|
|---|
| 147 | --- src/VBox/Additions/linux/drm/vbox_ttm.c (revision 140448)
|
|---|
| 148 | +++ src/VBox/Additions/linux/drm/vbox_ttm.c (working copy)
|
|---|
| 149 | @@ -303,7 +303,7 @@
|
|---|
| 150 | #if RTLNX_VER_MIN(3,15,0) || RTLNX_RHEL_MAJ_PREREQ(7,1)
|
|---|
| 151 | dev->anon_inode->i_mapping,
|
|---|
| 152 | #endif
|
|---|
| 153 | -#if RTLNX_VER_MIN(5,5,0)
|
|---|
| 154 | +#if RTLNX_VER_MIN(5,5,0) || RTLNX_RHEL_MIN(8,3)
|
|---|
| 155 | dev->vma_offset_manager,
|
|---|
| 156 | #elif RTLNX_VER_MAX(5,2,0) && !RTLNX_RHEL_MAJ_PREREQ(8,2)
|
|---|
| 157 | DRM_FILE_PAGE_OFFSET,
|
|---|