VirtualBox

Changeset 47341 in vbox


Ignore:
Timestamp:
Jul 23, 2013 12:54:56 PM (11 years ago)
Author:
vboxsync
Message:

Additions/linux/drm: more kernel version magic and a small additional code drop.

Location:
trunk/src/VBox/Additions/linux/drm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_crtc.c

    r44529 r47341  
    7676
    7777static bool vboxvideo_crtc_mode_fixup(struct drm_crtc *crtc,
    78                   struct drm_display_mode *mode,
    79                   struct drm_display_mode *adjusted_mode)
     78#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
     79                                     const struct drm_display_mode *mode,
     80#else
     81                                     struct drm_display_mode *mode,
     82#endif
     83                                     struct drm_display_mode *adjusted_mode)
    8084{
    8185    return true;
     
    127131
    128132static void vboxvideo_crtc_gamma_set(struct drm_crtc *crtc, u16 *red,
    129                                      u16 *green, u16 *blue, uint32_t size)
     133                                     u16 *green, u16 *blue,
     134#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
     135                                     uint32_t start,
     136#endif
     137                                     uint32_t size)
    130138{
    131139    /* Dummy */
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_dac.c

    r44529 r47341  
    7474
    7575static bool vboxvideo_dac_mode_fixup(struct drm_encoder *encoder,
     76#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
     77                                     const struct drm_display_mode *mode,
     78#else
    7679                                     struct drm_display_mode *mode,
     80#endif
    7781                                     struct drm_display_mode *adjusted_mode)
    7882{
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_display.c

    r44529 r47341  
    8080        return -1;
    8181    }
     82
     83    drm_mode_connector_attach_encoder(connector, encoder);
     84
    8285    return 0;
    8386}
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_drv.c

    r47088 r47341  
    6565MODULE_DEVICE_TABLE(pci, pciidlist);
    6666
     67#if defined(DRM_UNLOCKED) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
     68# define IOCTL_MEMBER unlocked_ioctl
     69#else
     70# define IOCTL_MEMBER ioctl
     71#endif
     72
     73#define DRIVER_FOPS \
     74    { \
     75        .owner = THIS_MODULE, \
     76        .open = drm_open, \
     77        .release = drm_release, \
     78        /* This was changed with Linux 2.6.33 but Fedora backported this \
     79         * change to their 2.6.32 kernel. */ \
     80        .IOCTL_MEMBER = drm_ioctl, \
     81        .mmap = drm_mmap, \
     82        .poll = drm_poll, \
     83        .fasync = drm_fasync, \
     84    }
     85
     86#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) || defined(DRM_RHEL63) || defined(DRM_DEBIAN_34ON32)
     87/* since linux-3.3.0-rc1 drm_driver::fops is pointer */
     88static struct file_operations driver_fops = DRIVER_FOPS;
     89#endif
     90
    6791static struct drm_driver driver =
    6892{
     
    7094    .load = vboxvideo_driver_load,
    7195    .unload = vboxvideo_driver_unload,
     96    /* As of Linux 2.6.37, always the internal functions are used. */
     97#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 37) && !defined(DRM_RHEL61)
    7298    .reclaim_buffers = drm_core_reclaim_buffers,
    73     /* As of Linux 2.6.37, always the internal functions are used. */
    74 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) && !defined(DRM_RHEL61)
    7599    .get_map_ofs = drm_core_get_map_ofs,
    76100    .get_reg_ofs = drm_core_get_reg_ofs,
    77101#endif
    78102    .ioctls = vboxvideo_ioctls,
    79     .fops =
    80     {
    81         .owner = THIS_MODULE,
    82         .open = drm_open,
    83         .release = drm_release,
    84         /* This was changed with Linux 2.6.33 but Fedora backported this
    85          * change to their 2.6.32 kernel. */
    86 #if defined(DRM_UNLOCKED) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
    87         .unlocked_ioctl = drm_ioctl,
    88 #else
    89         .ioctl = drm_ioctl,
     103# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) && !defined(DRM_RHEL63) && !defined(DRM_DEBIAN_34ON32)
     104    .fops = DRIVER_FOPS,
     105#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) || defined(DRM_RHEL63) || defined(DRM_DEBIAN_34ON32) */
     106    .fops = &driver_fops,
    90107#endif
    91         .mmap = drm_mmap,
    92         .poll = drm_poll,
    93         .fasync = drm_fasync,
    94     },
    95108#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
    96109    .pci_driver =
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_vga.c

    r44529 r47341  
    8282
    8383static enum drm_connector_status vboxvideo_vga_detect(struct drm_connector
    84                                                             *connector)
     84                                                            *connector
     85#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
     86                                                      , bool force
     87#endif
     88                                                      )
    8589{
    8690    return connector_status_connected;
Note: See TracChangeset for help on using the changeset viewer.

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