VirtualBox

Changeset 68297 in vbox


Ignore:
Timestamp:
Aug 4, 2017 10:25:39 AM (7 years ago)
Author:
vboxsync
Message:

Additions/linux/drm: support custom EL7 Linux 3.10 kernel

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

Legend:

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

    r67395 r68297  
    205205        .mmap = vbox_mmap,
    206206        .poll = drm_poll,
    207 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
     207#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7)
    208208        .fasync = drm_fasync,
    209209#endif
     
    272272        .master_set = vbox_master_set,
    273273        .master_drop = vbox_master_drop,
    274 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     274#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_7)
    275275        .set_busid = drm_pci_set_busid,
    276276#endif
     
    288288        .dumb_create = vbox_dumb_create,
    289289        .dumb_map_offset = vbox_dumb_mmap_offset,
    290 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
     290#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7)
    291291        .dumb_destroy = vbox_dumb_destroy,
    292292#else
  • trunk/src/VBox/Additions/linux/drm/vbox_drv.h

    r67396 r68297  
    4949#include <drm/ttm/ttm_module.h>
    5050
    51 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     51#if defined(RHEL_MAJOR) && defined(RHEL_MINOR)
     52# if RHEL_MAJOR == 7 && RHEL_MINOR >= 3
     53#  define RHEL_7
     54# endif
     55#endif
     56
     57#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_7)
    5258#include <drm/drm_gem.h>
    5359#endif
     
    207213#endif
    208214
    209 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
     215#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && !defined(RHEL_7)
    210216#define CRTC_FB(crtc) ((crtc)->fb)
    211217#else
     
    223229int vbox_framebuffer_init(struct drm_device *dev,
    224230                          struct vbox_framebuffer *vbox_fb,
    225 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
     231#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_7)
    226232                          const
    227233#endif
     
    239245        struct ttm_bo_kmap_obj kmap;
    240246        struct drm_gem_object gem;
    241 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
     247#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7)
    242248        u32 placements[3];
    243249#else
     
    259265                     struct drm_device *dev,
    260266                     struct drm_mode_create_dumb *args);
    261 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
     267#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7)
    262268int vbox_dumb_destroy(struct drm_file *file,
    263269                      struct drm_device *dev, u32 handle);
     
    314320struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj);
    315321struct drm_gem_object *vbox_gem_prime_import_sg_table(struct drm_device *dev,
    316 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
     322#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7)
    317323                                                      size_t size,
    318324#else
  • trunk/src/VBox/Additions/linux/drm/vbox_fb.c

    r67397 r68297  
    409409        spin_lock_init(&fbdev->dirty_lock);
    410410
    411 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
     411#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && !defined(RHEL_7)
    412412        fbdev->helper.funcs = &vbox_fb_helper_funcs;
    413413#else
  • trunk/src/VBox/Additions/linux/drm/vbox_irq.c

    r67402 r68297  
    200200
    201201        vbox_update_mode_hints(vbox);
    202 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
     202#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(RHEL_7)
    203203        ret = drm_irq_install(vbox->dev, vbox->dev->pdev->irq);
    204204#else
  • trunk/src/VBox/Additions/linux/drm/vbox_main.c

    r67403 r68297  
    165165int vbox_framebuffer_init(struct drm_device *dev,
    166166                          struct vbox_framebuffer *vbox_fb,
    167 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
     167#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_7)
    168168                          const
    169169#endif
     
    191191                struct drm_device *dev,
    192192                struct drm_file *filp,
    193 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
     193#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_7)
    194194                const struct drm_mode_fb_cmd2 *mode_cmd)
    195195#else
     
    242242}
    243243
    244 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
     244#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0) && !defined(RHEL_7)
    245245#define pci_iomap_range(dev, bar, offset, maxlen) \
    246246        ioremap(pci_resource_start(dev, bar) + (offset), maxlen)
     
    440440        struct vbox_private *vbox = dev->dev_private;
    441441
    442 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
     442#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(RHEL_7)
    443443        if (vbox->fbdev)
    444444                drm_fb_helper_restore_fbdev_mode_unlocked(&vbox->fbdev->helper);
     
    499499}
    500500
    501 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
     501#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7)
    502502int vbox_dumb_destroy(struct drm_file *file,
    503503                      struct drm_device *dev, u32 handle)
     
    529529static inline u64 vbox_bo_mmap_offset(struct vbox_bo *bo)
    530530{
    531 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
     531#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7)
    532532        return bo->bo.addr_space_offset;
    533533#else
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r67404 r68297  
    4343#include <linux/export.h>
    4444#include <drm/drm_crtc_helper.h>
    45 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     45#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) && defined(RHEL_7)
    4646#include <drm/drm_plane_helper.h>
    4747#endif
     
    396396}
    397397
    398 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
     398#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && !defined(RHEL_7)
    399399static struct drm_encoder *drm_encoder_find(struct drm_device *dev, u32 id)
    400400{
     
    466466        drm_encoder_init(dev, &vbox_encoder->base, &vbox_enc_funcs,
    467467                         DRM_MODE_ENCODER_DAC
    468 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
     468#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_7)
    469469                         , NULL
    470470#endif
     
    593593        }
    594594        vbox_set_edid(connector, preferred_width, preferred_height);
    595 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
     595#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) || defined(RHEL_7)
    596596        drm_object_property_set_value(
    597597                &connector->base, vbox->dev->mode_config.suggested_x_property,
     
    616616
    617617        vbox_connector = to_vbox_connector(connector);
    618 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
     618#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && !defined(RHEL_7)
    619619        drm_sysfs_connector_remove(connector);
    620620#else
     
    688688        connector->doublescan_allowed = 0;
    689689
    690 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
     690#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) || defined(RHEL_7)
    691691        drm_mode_create_suggested_offset_properties(dev);
    692692        drm_object_attach_property(&connector->base,
     
    695695                                   dev->mode_config.suggested_y_property, -1);
    696696#endif
    697 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
     697#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && !defined(RHEL_7)
    698698        drm_sysfs_connector_add(connector);
    699699#else
  • trunk/src/VBox/Additions/linux/drm/vbox_prime.c

    r67405 r68297  
    5050
    5151struct drm_gem_object *vbox_gem_prime_import_sg_table(struct drm_device *dev,
    52 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
     52#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7)
    5353                                                      size_t size,
    5454#else
  • trunk/src/VBox/Additions/linux/drm/vbox_ttm.c

    r67406 r68297  
    3636#include <ttm/ttm_page_alloc.h>
    3737
    38 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
     38#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7)
    3939#define PLACEMENT_FLAGS(placement) (placement)
    4040#else
     
    290290                                 vbox->ttm.bo_global_ref.ref.object,
    291291                                 &vbox_bo_driver,
    292 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
     292#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) || defined(RHEL_7)
    293293                                 dev->anon_inode->i_mapping,
    294294#endif
     
    342342{
    343343        u32 c = 0;
    344 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
     344#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7)
    345345        bo->placement.fpfn = 0;
    346346        bo->placement.lpfn = 0;
     
    364364        bo->placement.num_placement = c;
    365365        bo->placement.num_busy_placement = c;
    366 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     366#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_7)
    367367        for (i = 0; i < c; ++i) {
    368368                bo->placements[i].fpfn = 0;
     
    391391
    392392        vboxbo->bo.bdev = &vbox->ttm.bdev;
    393 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
     393#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && !defined(RHEL_7)
    394394        vboxbo->bo.bdev->dev_mapping = dev->dev_mapping;
    395395#endif
     
    403403                          ttm_bo_type_device, &vboxbo->placement,
    404404                          align >> PAGE_SHIFT, false, NULL, acc_size,
    405 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     405#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_7)
    406406                          NULL,
    407407#endif
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