Changeset 47388 in vbox for trunk/src/VBox/Additions/linux/drm/vboxvideo_device.c
- Timestamp:
- Jul 25, 2013 12:12:10 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vboxvideo_device.c
r44529 r47388 53 53 #include <VBox/VBoxVideoGuest.h> 54 54 55 static int vboxvideo_vram_init(struct vboxvideo_device *gdev) 56 { 57 /* work out accessible VRAM */ 58 gdev->mc.aper_base = pci_resource_start(gdev->ddev->pdev, 1); 59 gdev->mc.aper_size = pci_resource_len(gdev->ddev->pdev, 1); 60 61 gdev->mc.vram = ioremap(gdev->mc.aper_base, gdev->mc.aper_size); 62 if (!gdev->mc.vram) { 63 VBOXVIDEO_ERROR("Unable to ioremap %lu MB of VRAM. Bailing out.\n", (unsigned long)gdev->mc.aper_size / MB); 64 return -1; 65 } 66 gdev->fAnyX = VBoxVideoAnyWidthAllowed(); 67 gdev->mc.vram_size = VBoxVideoGetVRAMSize(); 68 69 return 0; 70 } 71 72 static void vboxvideo_vram_fini(struct vboxvideo_device *gdev) 73 { 74 iounmap(gdev->mc.vram); 75 gdev->mc.vram = NULL; 76 } 77 55 78 int vboxvideo_device_init(struct vboxvideo_device *gdev, 56 79 struct drm_device *ddev, … … 58 81 uint32_t flags) 59 82 { 83 int ret; 84 60 85 gdev->dev = &pdev->dev; 61 86 gdev->ddev = ddev; … … 67 92 * stuff. 68 93 */ 69 gdev->fAnyX = VBoxVideoAnyWidthAllowed(); 70 gdev->mc.vram_size = VBoxVideoGetVRAMSize(); 94 ret = vboxvideo_vram_init(gdev); 95 if (ret) 96 return ret; 71 97 72 98 return 0; … … 75 101 void vboxvideo_device_fini(struct vboxvideo_device *gdev) 76 102 { 77 103 vboxvideo_vram_fini(gdev); 78 104 } 79 105 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
Note:
See TracChangeset
for help on using the changeset viewer.