VirtualBox

Ticket #11984: vboxvideo_drm.c-sles11sp3.diff

File vboxvideo_drm.c-sles11sp3.diff, 2.7 KB (added by Fate, 11 years ago)

Patch to make vboxvideo_drm.c compile under SLES11 SP3

  • vboxvideo_drm.c

    old new  
    6060#include <linux/module.h>
    6161#include "version-generated.h"
    6262
     63/* Taken from the igb driver's kcompat.h (http://sf.net/projects/e1000) */
     64/* SuSE version macro is the same as Linux kernel version */
     65#ifndef SLE_VERSION
     66#define SLE_VERSION(a,b,c) KERNEL_VERSION(a,b,c)
     67#endif
     68#ifdef CONFIG_SUSE_KERNEL
     69#if ( LINUX_VERSION_CODE == KERNEL_VERSION(2,6,27) )
     70/* SLES11 GA is 2.6.27 based */
     71#define SLE_VERSION_CODE SLE_VERSION(11,0,0)
     72#elif ( LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32) )
     73/* SLES11 SP1 is 2.6.32 based */
     74#define SLE_VERSION_CODE SLE_VERSION(11,1,0)
     75#elif ((LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,61)) && \
     76(LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)))
     77/* SLES11 SP3 is at least 3.0.61+ based */
     78#define SLE_VERSION_CODE SLE_VERSION(11,3,0)
     79#endif /* LINUX_VERSION_CODE == KERNEL_VERSION(x,y,z) */
     80#endif /* CONFIG_SUSE_KERNEL */
     81#ifndef SLE_VERSION_CODE
     82#define SLE_VERSION_CODE 0
     83#endif /* SLE_VERSION_CODE */
     84
    6385#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
    6486
    6587# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
     
    79101#include "drm/drmP.h"
    80102#include "vboxvideo_drm.h"
    81103
     104# if SLE_VERSION_CODE >= SLE_VERSION(11,3,0)
     105#  define DRM_SLES11SP3
     106# endif
     107
    82108# ifndef RHEL_RELEASE_CODE
    83109#  if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 39) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
    84110#   if defined(DRM_MODE_OBJECT_PLANE) && defined(DRM_IOCTL_MODE_ADDFB2)
     
    99125    return 0;
    100126#endif
    101127}
    102 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) || defined(DRM_RHEL63) || defined(DRM_DEBIAN_34ON32)
     128#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) || defined(DRM_RHEL63) || defined(DRM_SLES11SP3) || defined(DRM_DEBIAN_34ON32)
    103129/* since linux-3.3.0-rc1 drm_driver::fops is pointer */
    104130static struct file_operations driver_fops =
    105131{
     
    117143{
    118144    /* .driver_features = DRIVER_USE_MTRR, */
    119145    .load = vboxvideo_driver_load,
    120 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0) && !defined(DRM_RHEL64)
     146#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0) && !defined(DRM_SLES11SP3) && !defined(DRM_RHEL64)
    121147    .reclaim_buffers = drm_core_reclaim_buffers,
    122148#endif
    123149    /* As of Linux 2.6.37, always the internal functions are used. */
     
    125151    .get_map_ofs = drm_core_get_map_ofs,
    126152    .get_reg_ofs = drm_core_get_reg_ofs,
    127153#endif
    128 # if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) && !defined(DRM_RHEL63) && !defined(DRM_DEBIAN_34ON32)
     154# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) && !defined(DRM_RHEL63) && !defined(DRM_SLES11SP3) && !defined(DRM_DEBIAN_34ON32)
    129155    .fops =
    130156    {
    131157        .owner = THIS_MODULE,

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy