VirtualBox

Changeset 49627 in vbox


Ignore:
Timestamp:
Nov 22, 2013 3:11:53 PM (11 years ago)
Author:
vboxsync
Message:

Additions/linux/drm: add IOCtls to disable and re-start HGSMI in the KMS driver.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuest.h

    r46197 r49627  
    509509#endif /* RT_OS_OS2 */
    510510
     511#ifdef RT_OS_LINUX
     512
     513/* Private IOCtls between user space and the kernel video driver.  DRM private
     514 * IOCtls always have the type 'd' and a number between 0x40 and 0x99 (0x9F?) */
     515
     516# define VBOX_DRM_IOCTL(a) (0x40 + DRM_VBOX_ ## a)
     517
     518/** Stop using HGSMI in the kernel driver until it is re-enabled, so that a
     519 *  user-space driver can use it.  It must be re-enabled before the kernel
     520 *  driver can be used again in a sensible way. */
     521# define DRM_VBOX_DISABLE_HGSMI    0
     522# define DRM_IOCTL_VBOX_DISABLE_HGSMI    VBOX_DRM_IOCTL(DISABLE_HGSMI)
     523# define VBOXVIDEO_IOCTL_DISABLE_HGSMI   _IO('d', DRM_IOCTL_VBOX_DISABLE_HGSMI)
     524/** Enable HGSMI in the kernel driver after it was previously disabled. */
     525# define DRM_VBOX_ENABLE_HGSMI     1
     526# define DRM_IOCTL_VBOX_ENABLE_HGSMI     VBOX_DRM_IOCTL(ENABLE_HGSMI)
     527# define VBOXVIDEO_IOCTL_ENABLE_HGSMI    _IO('d', DRM_IOCTL_VBOX_ENABLE_HGSMI)
     528
     529#endif /* RT_OS_LINUX */
     530
    511531/** @} */
    512532#endif /* !defined(IN_RC) && !defined(IN_RING0_AGNOSTIC) && !defined(IPRT_NO_CRT) */
  • trunk/src/VBox/Additions/linux/drm/vbox_drv.c

    r49518 r49627  
    4848#include "vbox_drv.h"
    4949
     50#include <VBox/VBoxGuest.h>
     51
    5052#include <linux/module.h>
    5153#include <linux/console.h>
     
    9193};
    9294
     95
     96static struct drm_ioctl_desc vbox_ioctls[] =
     97{
     98    DRM_IOCTL_DEF_DRV(VBOX_DISABLE_HGSMI, VBoxDisableHGSMI,
     99                      DRM_UNLOCKED|DRM_ROOT_ONLY),
     100    DRM_IOCTL_DEF_DRV(VBOX_ENABLE_HGSMI, VBoxEnableHGSMI,
     101                      DRM_UNLOCKED|DRM_ROOT_ONLY)
     102};
     103
     104
    93105static const struct file_operations vbox_fops =
    94106{
     
    114126    .unload = vbox_driver_unload,
    115127
     128    .ioctls = vbox_ioctls,
     129    .num_ioctls = RT_ELEMENTS(vbox_ioctls),
    116130    .fops = &vbox_fops,
    117131    .name = DRIVER_NAME,
  • trunk/src/VBox/Additions/linux/drm/vbox_drv.h

    r49518 r49627  
    9090    unsigned cCrtcs;
    9191    bool vga2_clone;
     92    /** Amount of available VRAM, including space used for buffers. */
     93    uint32_t full_vram_size;
     94    /** Amount of available VRAM, not including space used for buffers. */
    9295    uint32_t vram_size;
     96    /** Is HGSMI currently disabled? */
     97    bool fDisableHGSMI;
    9398
    9499    struct vbox_fbdev *fbdev;
     
    161166extern int vbox_mode_init(struct drm_device *dev);
    162167extern void vbox_mode_fini(struct drm_device *dev);
     168extern void VBoxRefreshModes(struct drm_device *pDev);
    163169
    164170#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
     
    222228          uint32_t flags, struct vbox_bo **pvboxbo);
    223229
     230/** IOCtl handler to stop this driver using HGSMI so that user space can. */
     231extern int VBoxDisableHGSMI(struct drm_device *dev, void *data,
     232                            struct drm_file *file_priv);
     233/** IOCtl handler to start this driver using HGSMI again. */
     234extern int VBoxEnableHGSMI(struct drm_device *dev, void *data,
     235                           struct drm_file *file_priv);
     236
    224237int vbox_gem_create(struct drm_device *dev,
    225238           u32 size, bool iskernel,
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