VirtualBox

Changeset 100800 in vbox for trunk


Ignore:
Timestamp:
Aug 4, 2023 6:12:46 PM (17 months ago)
Author:
vboxsync
Message:

Additions: Linux: vboxvideo: Introduce initial support for kernel 6.5, bugref:10482.

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

Legend:

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

    r100677 r100800  
    198198        .fb_set_par = drm_fb_helper_set_par,
    199199#if RTLNX_VER_MIN(6,5,0)
    200         __FB_DEFAULT_SYS_OPS_DRAW,
     200        FB_DEFAULT_SYS_OPS,
    201201#else
    202202        .fb_fillrect = drm_fb_helper_sys_fillrect,
     
    375375#endif
    376376
     377#if RTLNX_VER_MIN(6,5,0)
     378        info->screen_buffer = (char *)bo->kmap.virtual;
     379        info->fix.smem_start = page_to_phys(vmalloc_to_page(bo->kmap.virtual));
     380#endif
    377381        info->screen_base = (char __iomem *)bo->kmap.virtual;
    378382        info->screen_size = size;
     
    383387# endif
    384388        info->fbdefio = &vbox_defio;
     389# if RTLNX_VER_MIN(5,19,0)
     390        ret = fb_deferred_io_init(info);
     391        if (ret)
     392        {
     393                DRM_ERROR("failed to initialize deferred io: %d\n", ret);
     394                return ret;
     395        }
     396# endif
    385397        fb_deferred_io_init(info);
    386398#endif
     
    513525
    514526#if RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_MAJ_PREREQ(9,3)
    515     fbdev->fix.smem_start =
    516 pci_resource_start(VBOX_DRM_TO_PCI_DEV(vbox->fbdev->helper.dev), 0) + gpu_addr;
     527        fbdev->fix.smem_start = pci_resource_start(VBOX_DRM_TO_PCI_DEV(vbox->fbdev->helper.dev), 0) + gpu_addr;
    517528#else
    518529        fbdev->fix.smem_start = fbdev->apertures->ranges[0].base + gpu_addr;
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r100677 r100800  
    870870        dst = vbox->cursor_data;
    871871
     872#if RTLNX_VER_MIN(6,4,0)
     873        /* Make sure bo is in SYSTEM (main) memory, so we can access it directly. */
     874        ret = vbox_bo_pin(bo, VBOX_MEM_TYPE_SYSTEM, NULL);
     875        if (ret)
     876        {
     877                DRM_ERROR("cannot pin bo to main memory\n");
     878                goto out_bo_unpin;
     879        }
     880#endif
     881
    872882#if RTLNX_VER_MIN(5,14,0) || RTLNX_RHEL_RANGE(8,6, 8,99)
    873883        ret = ttm_bo_kmap(&bo->bo, 0, VBOX_BO_RESOURCE_NUM_PAGES(bo->bo.resource), &uobj_map);
     
    901911out_unmap_bo:
    902912        ttm_bo_kunmap(&uobj_map);
     913#if RTLNX_VER_MIN(6,4,0)
     914out_bo_unpin:
     915        vbox_bo_unpin(bo);
     916#endif
    903917out_unreserve_bo:
    904918        vbox_bo_unreserve(bo);
  • trunk/src/VBox/Additions/linux/drm/vbox_ttm.c

    r100677 r100800  
    364364        struct ttm_place *hop)
    365365{
     366# if RTLNX_VER_MIN(6,4,0)
     367        if (!bo->resource)
     368        {
     369                if (new_mem->mem_type != TTM_PL_SYSTEM)
     370                {
     371                        hop->mem_type = TTM_PL_SYSTEM;
     372                        hop->flags = TTM_PL_FLAG_TEMPORARY;
     373                        return -EMULTIHOP;
     374                }
     375                ttm_bo_move_null(bo, new_mem);
     376                return 0;
     377        }
     378# endif
    366379        return ttm_bo_move_memcpy(bo, ctx, new_mem);
    367380}
     
    577590        .free   = vbox_gem_free_object,
    578591        .print_info = drm_gem_ttm_print_info,
     592# if RTLNX_VER_MIN(6,5,0)
     593        .vmap   = drm_gem_ttm_vmap,
     594        .vunmap = drm_gem_ttm_vunmap,
     595# endif
    579596# if RTLNX_VER_MIN(5,14,0) || RTLNX_RHEL_RANGE(8,6, 8,99)
    580597        .mmap = drm_gem_ttm_mmap,
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