VirtualBox

Changeset 98034 in vbox


Ignore:
Timestamp:
Jan 9, 2023 6:41:48 PM (23 months ago)
Author:
vboxsync
Message:

Additions: Linux: vboxvideo: Introduce initial support for kernel 6.2, bugref:10345.

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

Legend:

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

    r97556 r98034  
    241241#else
    242242# define VBOX_DRM_TO_PCI_DEV(_dev) _dev->pdev
     243#endif
     244
     245/** Field "num_pages" of struct ttm_resource was renamed to "size" in 6.2 and
     246 * now represents number of bytes. This macro handles this change. Input
     247 * argument is a pointer to struct ttm_resource. */
     248#if RTLNX_VER_MIN(6,2,0)
     249# define VBOX_BO_RESOURCE_NUM_PAGES(_resource) PFN_UP(_resource->size)
     250#else
     251# define VBOX_BO_RESOURCE_NUM_PAGES(_resource) _resource->num_pages
    243252#endif
    244253
  • trunk/src/VBox/Additions/linux/drm/vbox_fb.c

    r96407 r98034  
    5151#include <VBoxVideo.h>
    5252
     53#if RTLNX_VER_MIN(6,2,0)
     54# define VBOX_FBDEV_INFO(_helper) _helper.info
     55#else
     56# define VBOX_FBDEV_INFO(_helper) _helper.fbdev
     57#endif
     58
    5359#if RTLNX_VER_MAX(4,7,0) && !RTLNX_RHEL_MAJ_PREREQ(7,4)
    5460/**
     
    303309
    304310#if RTLNX_VER_MIN(5,14,0) || RTLNX_RHEL_RANGE(8,6, 8,99)
    305         ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.resource->num_pages, &bo->kmap);
     311        ret = ttm_bo_kmap(&bo->bo, 0, VBOX_BO_RESOURCE_NUM_PAGES(bo->bo.resource), &bo->kmap);
    306312#elif RTLNX_VER_MIN(5,12,0) || RTLNX_RHEL_MAJ_PREREQ(8,5)
    307313        ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.mem.num_pages, &bo->kmap);
     
    316322        }
    317323
     324#if RTLNX_VER_MIN(6,2,0)
     325        info = drm_fb_helper_alloc_info(helper);
     326#else
    318327        info = drm_fb_helper_alloc_fbi(helper);
     328#endif
    319329        if (IS_ERR(info))
    320330                return -PTR_ERR(info);
     
    396406
    397407#ifdef CONFIG_FB_DEFERRED_IO
    398         if (fbdev->helper.fbdev && fbdev->helper.fbdev->fbdefio)
    399                 fb_deferred_io_cleanup(fbdev->helper.fbdev);
    400 #endif
    401 
     408        if (VBOX_FBDEV_INFO(fbdev->helper) && VBOX_FBDEV_INFO(fbdev->helper)->fbdefio)
     409                fb_deferred_io_cleanup(VBOX_FBDEV_INFO(fbdev->helper));
     410#endif
     411
     412#if RTLNX_VER_MIN(6,2,0)
     413        drm_fb_helper_unregister_info(&fbdev->helper);
     414#else
    402415        drm_fb_helper_unregister_fbi(&fbdev->helper);
     416#endif
    403417
    404418        if (afb->obj) {
     
    483497void vbox_fbdev_set_base(struct vbox_private *vbox, unsigned long gpu_addr)
    484498{
    485         struct fb_info *fbdev = vbox->fbdev->helper.fbdev;
     499        struct fb_info *fbdev = VBOX_FBDEV_INFO(vbox->fbdev->helper);
    486500
    487501        fbdev->fix.smem_start = fbdev->apertures->ranges[0].base + gpu_addr;
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r96407 r98034  
    866866
    867867#if RTLNX_VER_MIN(5,14,0) || RTLNX_RHEL_RANGE(8,6, 8,99)
    868         ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.resource->num_pages, &uobj_map);
     868        ret = ttm_bo_kmap(&bo->bo, 0, VBOX_BO_RESOURCE_NUM_PAGES(bo->bo.resource), &uobj_map);
    869869#elif RTLNX_VER_MIN(5,12,0) || RTLNX_RHEL_MAJ_PREREQ(8,5)
    870870        ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.mem.num_pages, &uobj_map);
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