aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-10-02 07:55:10 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-10-09 05:52:24 -0400
commit7ad9684721606efbfb9b347346816e1e6baff8bb (patch)
tree3cbc90799b0c613246fa22c8784f8241c0b9d0f0 /drivers/video
parent7831b2ae4a348144be95ccac49d67aa54d6f0dc0 (diff)
hyperv-fb: add pci stub
This patch adds a pci stub driver to hyper-fb. The hyperv framebuffer driver will bind to the pci device then, so linux kernel and userspace know there is a proper kernel driver for the device active. lspci shows this for example: [root@dhcp231 ~]# lspci -vs8 00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA (prog-if 00 [VGA controller]) Flags: bus master, fast devsel, latency 0, IRQ 11 Memory at f8000000 (32-bit, non-prefetchable) [size=64M] Expansion ROM at <unassigned> [disabled] Kernel driver in use: hyperv_fb Another effect is that the xorg vesa driver will not attach to the device and thus the Xorg server will automatically use the fbdev driver instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/hyperv_fb.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
index 8ac99b87c07e..8d456dc449b8 100644
--- a/drivers/video/hyperv_fb.c
+++ b/drivers/video/hyperv_fb.c
@@ -795,12 +795,21 @@ static int hvfb_remove(struct hv_device *hdev)
795} 795}
796 796
797 797
798static DEFINE_PCI_DEVICE_TABLE(pci_stub_id_table) = {
799 {
800 .vendor = PCI_VENDOR_ID_MICROSOFT,
801 .device = PCI_DEVICE_ID_HYPERV_VIDEO,
802 },
803 { /* end of list */ }
804};
805
798static const struct hv_vmbus_device_id id_table[] = { 806static const struct hv_vmbus_device_id id_table[] = {
799 /* Synthetic Video Device GUID */ 807 /* Synthetic Video Device GUID */
800 {HV_SYNTHVID_GUID}, 808 {HV_SYNTHVID_GUID},
801 {} 809 {}
802}; 810};
803 811
812MODULE_DEVICE_TABLE(pci, pci_stub_id_table);
804MODULE_DEVICE_TABLE(vmbus, id_table); 813MODULE_DEVICE_TABLE(vmbus, id_table);
805 814
806static struct hv_driver hvfb_drv = { 815static struct hv_driver hvfb_drv = {
@@ -810,14 +819,43 @@ static struct hv_driver hvfb_drv = {
810 .remove = hvfb_remove, 819 .remove = hvfb_remove,
811}; 820};
812 821
822static int hvfb_pci_stub_probe(struct pci_dev *pdev,
823 const struct pci_device_id *ent)
824{
825 return 0;
826}
827
828static void hvfb_pci_stub_remove(struct pci_dev *pdev)
829{
830}
831
832static struct pci_driver hvfb_pci_stub_driver = {
833 .name = KBUILD_MODNAME,
834 .id_table = pci_stub_id_table,
835 .probe = hvfb_pci_stub_probe,
836 .remove = hvfb_pci_stub_remove,
837};
813 838
814static int __init hvfb_drv_init(void) 839static int __init hvfb_drv_init(void)
815{ 840{
816 return vmbus_driver_register(&hvfb_drv); 841 int ret;
842
843 ret = vmbus_driver_register(&hvfb_drv);
844 if (ret != 0)
845 return ret;
846
847 ret = pci_register_driver(&hvfb_pci_stub_driver);
848 if (ret != 0) {
849 vmbus_driver_unregister(&hvfb_drv);
850 return ret;
851 }
852
853 return 0;
817} 854}
818 855
819static void __exit hvfb_drv_exit(void) 856static void __exit hvfb_drv_exit(void)
820{ 857{
858 pci_unregister_driver(&hvfb_pci_stub_driver);
821 vmbus_driver_unregister(&hvfb_drv); 859 vmbus_driver_unregister(&hvfb_drv);
822} 860}
823 861