VirtualBox

Changeset 56467 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Jun 17, 2015 7:02:41 AM (9 years ago)
Author:
vboxsync
Message:

Additions/linux/drm: build fixes to the KMS driver for recent kernels.

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

Legend:

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

    r56354 r56467  
    6363#include <drm/ttm/ttm_memory.h>
    6464#include <drm/ttm/ttm_module.h>
     65
     66#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     67# include <drm/drm_gem.h>
     68#endif
    6569
    6670/* #include "vboxvideo.h" */
     
    206210    struct ttm_bo_kmap_obj kmap;
    207211    struct drm_gem_object gem;
     212#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
    208213    u32 placements[3];
     214#else
     215    struct ttm_place placements[3];
     216#endif
    209217    int pin_count;
    210218};
  • trunk/src/VBox/Additions/linux/drm/vbox_fb.c

    r55808 r56467  
    446446
    447447    vbox->fbdev = afbdev;
     448#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
    448449    afbdev->helper.funcs = &vbox_fb_helper_funcs;
     450#else
     451    drm_fb_helper_prepare(dev, &afbdev->helper, &vbox_fb_helper_funcs);
     452#endif
    449453    ret = drm_fb_helper_init(dev, &afbdev->helper, vbox->cCrtcs, vbox->cCrtcs);
    450454    if (ret)
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r55808 r56467  
    5454#include <linux/export.h>
    5555#include <drm/drm_crtc_helper.h>
     56#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     57# include <drm/drm_plane_helper.h>
     58#endif
    5659
    5760static int vbox_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
     
    443446    pVBoxConnector = to_vbox_connector(pConnector);
    444447    device_remove_file(pConnector->dev->dev, &pVBoxConnector->deviceAttribute);
     448#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
    445449    drm_sysfs_connector_remove(pConnector);
     450#else
     451    drm_connector_unregister(pConnector);
     452#endif
    446453    drm_connector_cleanup(pConnector);
    447454    kfree(pConnector);
     
    537544    pConnector->doublescan_allowed = 0;
    538545
     546#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
    539547    drm_sysfs_connector_add(pConnector);
     548#else
     549    drm_connector_register(pConnector);
     550#endif
    540551
    541552    /* The connector supports hot-plug detection: we promise to call
  • trunk/src/VBox/Additions/linux/drm/vbox_ttm.c

    r53793 r56467  
    4848#include "vbox_drv.h"
    4949#include <ttm/ttm_page_alloc.h>
     50
     51#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
     52# define PLACEMENT_FLAGS(placement) (placement)
     53#else
     54# define PLACEMENT_FLAGS(placement) (placement).flags
     55#endif
    5056
    5157static inline struct vbox_private *
     
    345351{
    346352    u32 c = 0;
     353#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
    347354    bo->placement.fpfn = 0;
    348355    bo->placement.lpfn = 0;
     356#else
     357    unsigned i;
     358#endif
     359
    349360    bo->placement.placement = bo->placements;
    350361    bo->placement.busy_placement = bo->placements;
    351362    if (domain & TTM_PL_FLAG_VRAM)
    352         bo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM;
     363        PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM;
    353364    if (domain & TTM_PL_FLAG_SYSTEM)
    354         bo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
     365        PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
    355366    if (!c)
    356         bo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
     367        PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
    357368    bo->placement.num_placement = c;
    358369    bo->placement.num_busy_placement = c;
     370#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     371    for (i = 0; i < c; ++i)
     372    {
     373        bo->placements[i].fpfn = 0;
     374        bo->placements[i].lpfn = 0;
     375    }
     376#endif
    359377}
    360378
     
    410428              ttm_bo_type_device, &vboxbo->placement,
    411429              align >> PAGE_SHIFT, false, NULL, acc_size,
     430#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
     431              NULL,
     432#endif
    412433              NULL, vbox_bo_ttm_destroy);
    413434    if (ret)
     
    437458    vbox_ttm_placement(bo, pl_flag);
    438459    for (i = 0; i < bo->placement.num_placement; i++)
    439         bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
     460        PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT;
    440461    ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
    441462    if (ret)
     
    461482
    462483    for (i = 0; i < bo->placement.num_placement ; i++)
    463         bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT;
     484        PLACEMENT_FLAGS(bo->placements[i]) &= ~TTM_PL_FLAG_NO_EVICT;
    464485    ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
    465486    if (ret)
     
    489510    vbox_ttm_placement(bo, TTM_PL_FLAG_SYSTEM);
    490511    for (i = 0; i < bo->placement.num_placement ; i++)
    491         bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
     512        PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT;
    492513
    493514    ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
     
    506527
    507528    if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
    508         return drm_mmap(filp, vma);
     529        return -EINVAL;
    509530
    510531    file_priv = filp->private_data;
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