Changeset 50946 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Apr 1, 2014 3:40:11 PM (11 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/Makefile.kmk
r50901 r50946 62 62 KBUILD_BASENAME=KBUILD_STR\(vboxvideo\) \ 63 63 DEBUG_HASH=2 DEBUG_HASH2=3 64 # detect fc6 2.6.1865 vboxvideo_drm_DEFS += \66 $(foreach inc,$(VBOX_LINUX_INCS),\67 $(if $(wildcard $(inc)/linux/utsrelease.h),\68 $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\69 then echo yes; fi),KERNEL_FC6,),))70 # detect rhel5 2.6.1871 vboxvideo_drm_DEFS += \72 $(foreach inc,$(VBOX_LINUX_INCS),\73 $(if $(wildcard $(inc)/linux/utsrelease.h),\74 $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\75 then echo yes; fi),KERNEL_FC6,),))76 64 if !defined(VBOX_WITH_GUEST_KMS_DRIVER) 77 65 vboxvideo_drm_SOURCES = vboxvideo_drm.c -
trunk/src/VBox/Additions/linux/drm/vboxvideo_drm.c
r49428 r50946 50 50 */ 51 51 52 #include <linux/version.h>53 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)54 # include <generated/autoconf.h>55 #else56 # ifndef AUTOCONF_INCLUDED57 # include <linux/autoconf.h>58 # endif59 #endif60 #include <linux/module.h>61 52 #include "version-generated.h" 62 53 63 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) 64 65 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) 66 # ifdef RHEL_RELEASE_CODE 67 # if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6, 1) 68 # define DRM_RHEL61 69 # endif 70 # if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6, 3) 71 # define DRM_FOPS_AS_POINTER 72 # endif 73 # if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6, 4) 74 # define DRM_NO_RECLAIM_BUFFERS 75 # endif 76 # endif 77 # endif 78 79 #include "drm/drmP.h" 54 #include <linux/module.h> 55 #include <drm/drmP.h> 80 56 #include "vboxvideo_drm.h" 81 57 82 # ifndef RHEL_RELEASE_CODE 83 # if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 39) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) 84 # if defined(DRM_MODE_OBJECT_PLANE) && defined(DRM_IOCTL_MODE_ADDFB2) 85 # define DRM_FOPS_AS_POINTER 86 # endif 87 # endif 88 # endif 89 90 #ifdef CONFIG_SUSE_KERNEL 91 /* This is to cover the SLES 11 SP3 kernel back-ports. */ 92 # if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,61) 93 # if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0) 94 # define DRM_FOPS_AS_POINTER 95 # define DRM_NO_RECLAIM_BUFFERS 96 # endif 97 # endif 58 /* This definition and the file-operations-as-pointer change were both added in 59 * kernel 3.3. All back-ports of the structure change to distribution kernels 60 * that I have checked also back-ported the definition at the same time. */ 61 #ifdef DRM_IOCTL_MODE_ADDFB2 62 # define DRM_FOPS_AS_POINTER 98 63 #endif 99 64 … … 106 71 int vboxvideo_driver_load(struct drm_device * dev, unsigned long flags) 107 72 { 108 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)109 return drm_vblank_init(dev, 1);110 #else111 73 return 0; 112 #endif113 74 } 114 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) || defined(DRM_FOPS_AS_POINTER) 75 76 #ifdef DRM_FOPS_AS_POINTER 115 77 /* since linux-3.3.0-rc1 drm_driver::fops is pointer */ 116 78 static struct file_operations driver_fops = … … 129 91 /* .driver_features = DRIVER_USE_MTRR, */ 130 92 .load = vboxvideo_driver_load, 131 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0) && !defined(DRM_NO_RECLAIM_BUFFERS) 132 .reclaim_buffers = drm_core_reclaim_buffers, 133 #endif 134 /* As of Linux 2.6.37, always the internal functions are used. */ 135 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) && !defined(DRM_RHEL61) 136 .get_map_ofs = drm_core_get_map_ofs, 137 .get_reg_ofs = drm_core_get_reg_ofs, 138 #endif 139 # if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) && !defined(DRM_FOPS_AS_POINTER) 93 # ifndef DRM_FOPS_AS_POINTER 140 94 .fops = 141 95 { … … 145 99 /* This was changed with Linux 2.6.33 but Fedora backported this 146 100 * change to their 2.6.32 kernel. */ 147 #if defined(DRM_UNLOCKED) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)101 #if defined(DRM_UNLOCKED) 148 102 .unlocked_ioctl = drm_ioctl, 149 103 #else … … 153 107 .poll = drm_poll, 154 108 }, 155 #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) ||defined(DRM_FOPS_AS_POINTER) */109 #else /* defined(DRM_FOPS_AS_POINTER) */ 156 110 .fops = &driver_fops, 157 111 #endif … … 202 156 MODULE_AUTHOR(DRIVER_AUTHOR); 203 157 MODULE_DESCRIPTION(DRIVER_DESC); 204 205 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */206 207 158 #ifdef MODULE_VERSION 208 159 MODULE_VERSION(VBOX_VERSION_STRING);
Note:
See TracChangeset
for help on using the changeset viewer.