#include "vmwgfx_drv.h"
#include "vmwgfx_bo.h"
#include "vmwgfx_binding.h"
#include "vmwgfx_devcaps.h"
#include "vmwgfx_mksstat.h"
#include "vmwgfx_vkms.h"
#include "ttm_object.h"
#include <drm/drm_aperture.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_ttm.h>
#include <drm/drm_gem_ttm_helper.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_module.h>
#include <drm/drm_sysfs.h>
#include <drm/ttm/ttm_range_manager.h>
#include <drm/ttm/ttm_placement.h>
#include <generated/utsrelease.h>
#ifdef CONFIG_X86
#include <asm/hypervisor.h>
#endif
#include <linux/cc_platform.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/version.h>
#include <linux/vmalloc.h>
#define VMWGFX_DRIVER_DESC …
#define DRM_IOCTL_VMW_GET_PARAM …
#define DRM_IOCTL_VMW_ALLOC_DMABUF …
#define DRM_IOCTL_VMW_UNREF_DMABUF …
#define DRM_IOCTL_VMW_CURSOR_BYPASS …
#define DRM_IOCTL_VMW_CONTROL_STREAM …
#define DRM_IOCTL_VMW_CLAIM_STREAM …
#define DRM_IOCTL_VMW_UNREF_STREAM …
#define DRM_IOCTL_VMW_CREATE_CONTEXT …
#define DRM_IOCTL_VMW_UNREF_CONTEXT …
#define DRM_IOCTL_VMW_CREATE_SURFACE …
#define DRM_IOCTL_VMW_UNREF_SURFACE …
#define DRM_IOCTL_VMW_REF_SURFACE …
#define DRM_IOCTL_VMW_EXECBUF …
#define DRM_IOCTL_VMW_GET_3D_CAP …
#define DRM_IOCTL_VMW_FENCE_WAIT …
#define DRM_IOCTL_VMW_FENCE_SIGNALED …
#define DRM_IOCTL_VMW_FENCE_UNREF …
#define DRM_IOCTL_VMW_FENCE_EVENT …
#define DRM_IOCTL_VMW_PRESENT …
#define DRM_IOCTL_VMW_PRESENT_READBACK …
#define DRM_IOCTL_VMW_UPDATE_LAYOUT …
#define DRM_IOCTL_VMW_CREATE_SHADER …
#define DRM_IOCTL_VMW_UNREF_SHADER …
#define DRM_IOCTL_VMW_GB_SURFACE_CREATE …
#define DRM_IOCTL_VMW_GB_SURFACE_REF …
#define DRM_IOCTL_VMW_SYNCCPU …
#define DRM_IOCTL_VMW_CREATE_EXTENDED_CONTEXT …
#define DRM_IOCTL_VMW_GB_SURFACE_CREATE_EXT …
#define DRM_IOCTL_VMW_GB_SURFACE_REF_EXT …
#define DRM_IOCTL_VMW_MSG …
#define DRM_IOCTL_VMW_MKSSTAT_RESET …
#define DRM_IOCTL_VMW_MKSSTAT_ADD …
#define DRM_IOCTL_VMW_MKSSTAT_REMOVE …
static const struct drm_ioctl_desc vmw_ioctls[] = …;
static const struct pci_device_id vmw_pci_id_list[] = …;
MODULE_DEVICE_TABLE(pci, vmw_pci_id_list);
static int vmw_restrict_iommu;
static int vmw_force_coherent;
static int vmw_restrict_dma_mask;
static int vmw_assume_16bpp;
static int vmw_probe(struct pci_dev *, const struct pci_device_id *);
static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
void *ptr);
MODULE_PARM_DESC(…) …;
module_param_named(restrict_iommu, vmw_restrict_iommu, int, 0600);
MODULE_PARM_DESC(…) …;
module_param_named(force_coherent, vmw_force_coherent, int, 0600);
MODULE_PARM_DESC(…) …;
module_param_named(restrict_dma_mask, vmw_restrict_dma_mask, int, 0600);
MODULE_PARM_DESC(…) …;
module_param_named(assume_16bpp, vmw_assume_16bpp, int, 0600);
struct bitmap_name { … };
static const struct bitmap_name cap1_names[] = …;
static const struct bitmap_name cap2_names[] = …;
static void vmw_print_bitmap(struct drm_device *drm,
const char *prefix, uint32_t bitmap,
const struct bitmap_name *bnames,
uint32_t num_names)
{ … }
static void vmw_print_sm_type(struct vmw_private *dev_priv)
{ … }
static int vmw_dummy_query_bo_create(struct vmw_private *dev_priv)
{ … }
static int vmw_device_init(struct vmw_private *dev_priv)
{ … }
static void vmw_device_fini(struct vmw_private *vmw)
{ … }
static int vmw_request_device_late(struct vmw_private *dev_priv)
{ … }
static int vmw_request_device(struct vmw_private *dev_priv)
{ … }
static void vmw_release_device_early(struct vmw_private *dev_priv)
{ … }
static void vmw_release_device_late(struct vmw_private *dev_priv)
{ … }
static void vmw_get_initial_size(struct vmw_private *dev_priv)
{ … }
static int vmw_dma_select_mode(struct vmw_private *dev_priv)
{ … }
static int vmw_dma_masks(struct vmw_private *dev_priv)
{ … }
static int vmw_vram_manager_init(struct vmw_private *dev_priv)
{ … }
static void vmw_vram_manager_fini(struct vmw_private *dev_priv)
{ … }
static int vmw_setup_pci_resources(struct vmw_private *dev,
u32 pci_id)
{ … }
static int vmw_detect_version(struct vmw_private *dev)
{ … }
static void vmw_write_driver_id(struct vmw_private *dev)
{ … }
static void vmw_sw_context_init(struct vmw_private *dev_priv)
{ … }
static void vmw_sw_context_fini(struct vmw_private *dev_priv)
{ … }
static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id)
{ … }
static void vmw_driver_unload(struct drm_device *dev)
{ … }
static void vmw_postclose(struct drm_device *dev,
struct drm_file *file_priv)
{ … }
static int vmw_driver_open(struct drm_device *dev, struct drm_file *file_priv)
{ … }
static long vmw_generic_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg,
long (*ioctl_func)(struct file *, unsigned int,
unsigned long))
{ … }
static long vmw_unlocked_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{ … }
#ifdef CONFIG_COMPAT
static long vmw_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{ … }
#endif
static void vmw_master_set(struct drm_device *dev,
struct drm_file *file_priv,
bool from_open)
{ … }
static void vmw_master_drop(struct drm_device *dev,
struct drm_file *file_priv)
{ … }
bool vmwgfx_supported(struct vmw_private *vmw)
{ … }
static void __vmw_svga_enable(struct vmw_private *dev_priv)
{ … }
void vmw_svga_enable(struct vmw_private *dev_priv)
{ … }
static void __vmw_svga_disable(struct vmw_private *dev_priv)
{ … }
void vmw_svga_disable(struct vmw_private *dev_priv)
{ … }
static void vmw_remove(struct pci_dev *pdev)
{ … }
static void vmw_debugfs_resource_managers_init(struct vmw_private *vmw)
{ … }
static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
void *ptr)
{ … }
static int vmw_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{ … }
static int vmw_pci_resume(struct pci_dev *pdev)
{ … }
static int vmw_pm_suspend(struct device *kdev)
{ … }
static int vmw_pm_resume(struct device *kdev)
{ … }
static int vmw_pm_freeze(struct device *kdev)
{ … }
static int vmw_pm_restore(struct device *kdev)
{ … }
static const struct dev_pm_ops vmw_pm_ops = …;
static const struct file_operations vmwgfx_driver_fops = …;
static const struct drm_driver driver = …;
static struct pci_driver vmw_pci_driver = …;
static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
drm_module_pci_driver(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…) …;