diff options
Diffstat (limited to 'drivers/gpu/drm/hyperv/hyperv_drm_drv.c')
| -rw-r--r-- | drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c index b6bf6412ae34..20f35c48c0b8 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c +++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c @@ -24,9 +24,9 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 -DEFINE_DRM_GEM_FOPS(hv_fops); +DEFINE_DRM_GEM_FOPS(hv_drm_fops); -static struct drm_driver hyperv_driver = { +static struct drm_driver hv_drm_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, .name = DRIVER_NAME, @@ -34,22 +34,22 @@ static struct drm_driver hyperv_driver = { .major = DRIVER_MAJOR, .minor = DRIVER_MINOR, - .fops = &hv_fops, + .fops = &hv_drm_fops, DRM_GEM_SHMEM_DRIVER_OPS, DRM_FBDEV_SHMEM_DRIVER_OPS, }; -static int hyperv_pci_probe(struct pci_dev *pdev, +static int hv_drm_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { return 0; } -static void hyperv_pci_remove(struct pci_dev *pdev) +static void hv_drm_pci_remove(struct pci_dev *pdev) { } -static const struct pci_device_id hyperv_pci_tbl[] = { +static const struct pci_device_id hv_drm_pci_tbl[] = { { .vendor = PCI_VENDOR_ID_MICROSOFT, .device = PCI_DEVICE_ID_HYPERV_VIDEO, @@ -60,14 +60,14 @@ static const struct pci_device_id hyperv_pci_tbl[] = { /* * PCI stub to support gen1 VM. */ -static struct pci_driver hyperv_pci_driver = { +static struct pci_driver hv_drm_pci_driver = { .name = KBUILD_MODNAME, - .id_table = hyperv_pci_tbl, - .probe = hyperv_pci_probe, - .remove = hyperv_pci_remove, + .id_table = hv_drm_pci_tbl, + .probe = hv_drm_pci_probe, + .remove = hv_drm_pci_remove, }; -static int hyperv_setup_vram(struct hyperv_drm_device *hv, +static int hv_drm_setup_vram(struct hv_drm_device *hv, struct hv_device *hdev) { struct drm_device *dev = &hv->dev; @@ -102,15 +102,15 @@ error: return ret; } -static int hyperv_vmbus_probe(struct hv_device *hdev, +static int hv_drm_vmbus_probe(struct hv_device *hdev, const struct hv_vmbus_device_id *dev_id) { - struct hyperv_drm_device *hv; + struct hv_drm_device *hv; struct drm_device *dev; int ret; - hv = devm_drm_dev_alloc(&hdev->device, &hyperv_driver, - struct hyperv_drm_device, dev); + hv = devm_drm_dev_alloc(&hdev->device, &hv_drm_driver, + struct hv_drm_device, dev); if (IS_ERR(hv)) return PTR_ERR(hv); @@ -119,15 +119,15 @@ static int hyperv_vmbus_probe(struct hv_device *hdev, hv_set_drvdata(hdev, hv); hv->hdev = hdev; - ret = hyperv_connect_vsp(hdev); + ret = hv_drm_connect_vsp(hdev); if (ret) { drm_err(dev, "Failed to connect to vmbus.\n"); goto err_hv_set_drv_data; } - aperture_remove_all_conflicting_devices(hyperv_driver.name); + aperture_remove_all_conflicting_devices(hv_drm_driver.name); - ret = hyperv_setup_vram(hv, hdev); + ret = hv_drm_setup_vram(hv, hdev); if (ret) goto err_vmbus_close; @@ -136,11 +136,11 @@ static int hyperv_vmbus_probe(struct hv_device *hdev, * vram location is not fatal. Device will update dirty area till * preferred resolution only. */ - ret = hyperv_update_vram_location(hdev, hv->fb_base); + ret = hv_drm_update_vram_location(hdev, hv->fb_base); if (ret) drm_warn(dev, "Failed to update vram location.\n"); - ret = hyperv_mode_config_init(hv); + ret = hv_drm_mode_config_init(hv); if (ret) goto err_free_mmio; @@ -168,10 +168,10 @@ err_hv_set_drv_data: return ret; } -static void hyperv_vmbus_remove(struct hv_device *hdev) +static void hv_drm_vmbus_remove(struct hv_device *hdev) { struct drm_device *dev = hv_get_drvdata(hdev); - struct hyperv_drm_device *hv = to_hv(dev); + struct hv_drm_device *hv = to_hv_drm(dev); vmbus_set_skip_unload(false); drm_dev_unplug(dev); @@ -183,12 +183,12 @@ static void hyperv_vmbus_remove(struct hv_device *hdev) vmbus_free_mmio(hv->mem->start, hv->fb_size); } -static void hyperv_vmbus_shutdown(struct hv_device *hdev) +static void hv_drm_vmbus_shutdown(struct hv_device *hdev) { drm_atomic_helper_shutdown(hv_get_drvdata(hdev)); } -static int hyperv_vmbus_suspend(struct hv_device *hdev) +static int hv_drm_vmbus_suspend(struct hv_device *hdev) { struct drm_device *dev = hv_get_drvdata(hdev); int ret; @@ -202,67 +202,67 @@ static int hyperv_vmbus_suspend(struct hv_device *hdev) return 0; } -static int hyperv_vmbus_resume(struct hv_device *hdev) +static int hv_drm_vmbus_resume(struct hv_device *hdev) { struct drm_device *dev = hv_get_drvdata(hdev); - struct hyperv_drm_device *hv = to_hv(dev); + struct hv_drm_device *hv = to_hv_drm(dev); int ret; - ret = hyperv_connect_vsp(hdev); + ret = hv_drm_connect_vsp(hdev); if (ret) return ret; - ret = hyperv_update_vram_location(hdev, hv->fb_base); + ret = hv_drm_update_vram_location(hdev, hv->fb_base); if (ret) return ret; return drm_mode_config_helper_resume(dev); } -static const struct hv_vmbus_device_id hyperv_vmbus_tbl[] = { +static const struct hv_vmbus_device_id hv_drm_vmbus_tbl[] = { /* Synthetic Video Device GUID */ {HV_SYNTHVID_GUID}, {} }; -static struct hv_driver hyperv_hv_driver = { +static struct hv_driver hv_drm_hv_driver = { .name = KBUILD_MODNAME, - .id_table = hyperv_vmbus_tbl, - .probe = hyperv_vmbus_probe, - .remove = hyperv_vmbus_remove, - .shutdown = hyperv_vmbus_shutdown, - .suspend = hyperv_vmbus_suspend, - .resume = hyperv_vmbus_resume, + .id_table = hv_drm_vmbus_tbl, + .probe = hv_drm_vmbus_probe, + .remove = hv_drm_vmbus_remove, + .shutdown = hv_drm_vmbus_shutdown, + .suspend = hv_drm_vmbus_suspend, + .resume = hv_drm_vmbus_resume, .driver = { .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, }; -static int __init hyperv_init(void) +static int __init hv_drm_init(void) { int ret; if (drm_firmware_drivers_only()) return -ENODEV; - ret = pci_register_driver(&hyperv_pci_driver); + ret = pci_register_driver(&hv_drm_pci_driver); if (ret != 0) return ret; - return vmbus_driver_register(&hyperv_hv_driver); + return vmbus_driver_register(&hv_drm_hv_driver); } -static void __exit hyperv_exit(void) +static void __exit hv_drm_exit(void) { - vmbus_driver_unregister(&hyperv_hv_driver); - pci_unregister_driver(&hyperv_pci_driver); + vmbus_driver_unregister(&hv_drm_hv_driver); + pci_unregister_driver(&hv_drm_pci_driver); } -module_init(hyperv_init); -module_exit(hyperv_exit); +module_init(hv_drm_init); +module_exit(hv_drm_exit); -MODULE_DEVICE_TABLE(pci, hyperv_pci_tbl); -MODULE_DEVICE_TABLE(vmbus, hyperv_vmbus_tbl); +MODULE_DEVICE_TABLE(pci, hv_drm_pci_tbl); +MODULE_DEVICE_TABLE(vmbus, hv_drm_vmbus_tbl); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Deepak Rawat <drawat.floss@gmail.com>"); MODULE_DESCRIPTION("DRM driver for Hyper-V synthetic video device"); |
