- Timestamp:
- May 31, 2017 12:43:59 PM (8 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/Makefile.module.kms
r67148 r67169 35 35 MOD_NAME = vboxvideo 36 36 37 MOD_OBJS = HGSMIBase.o HGSMIBuffers.o HGSMICommon.o HGSMIMemAlloc.o\37 MOD_OBJS = HGSMIBase.o \ 38 38 Modesetting.o vbox_drv.o vbox_fb.o vbox_irq.o vbox_main.o \ 39 vbox_mode.o vbox_ttm.o VBVABase.o vbox_prime.o 39 vbox_mode.o vbox_ttm.o VBVABase.o vbox_prime.o vbox_hgsmi.o 40 40 41 41 MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -fno-pie -
trunk/src/VBox/Additions/linux/drm/VBoxVideoIPRT.h
r66707 r67169 29 29 #define ___VBox_VBoxVideoIPRT_h 30 30 31 #include <asm/atomic.h>32 31 #include <asm/io.h> 33 32 #include <iprt/cdefs.h> 34 #include <iprt/list.h>35 33 #include <iprt/stdarg.h> 36 34 #include <iprt/stdint.h> 35 #include <iprt/types.h> 37 36 38 37 #include <linux/string.h> … … 63 62 * @{ */ 64 63 65 #define RT_ZERO(x) memset(&(x), 0, sizeof(x))66 #define ASMAtomicCmpXchgBool(b, new_val, old_val) \67 (cmpxchg(b, old_val, new_val) == old_val)68 #define ASMAtomicWriteBool(b, val) xchg(b, val)69 64 #define ASMCompilerBarrier() mb() 70 65 … … 113 108 /** @} */ 114 109 110 /** @name types for VirtualBox OS-independent code 111 * @{ */ 112 113 /* HGSMI uses 32 bit offsets and sizes. */ 114 typedef uint32_t HGSMISIZE; 115 typedef uint32_t HGSMIOFFSET; 116 117 /** @} */ 118 115 119 #endif /* ___VBox_VBoxVideoIPRT_h */ -
trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv
r67145 r67169 22 22 ${PATH_OUT}/product-generated.h=>product-generated.h \ 23 23 ${PATH_ROOT}/include/iprt/cdefs.h=>include/iprt/cdefs.h \ 24 ${PATH_ROOT}/include/iprt/list.h=>include/iprt/list.h \25 24 ${PATH_ROOT}/include/iprt/stdarg.h=>include/iprt/stdarg.h \ 26 25 ${PATH_ROOT}/include/iprt/stdint.h=>include/iprt/stdint.h \ … … 28 27 ${PATH_ROOT}/include/VBox/Graphics/VBoxVideo.h=>include/VBoxVideo.h \ 29 28 ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoGuest.h=>include/VBoxVideoGuest.h \ 30 ${PATH_ROOT}/include/VBox/Graphics/HGSMI.h=>include/HGSMI.h \31 ${PATH_ROOT}/include/VBox/Graphics/HGSMIBase.h=>include/HGSMIBase.h \32 29 ${PATH_ROOT}/include/VBox/Graphics/HGSMIChannels.h=>include/HGSMIChannels.h \ 33 30 ${PATH_ROOT}/include/VBox/Graphics/HGSMIChSetup.h=>include/HGSMIChSetup.h \ 34 31 ${PATH_ROOT}/include/VBox/Graphics/HGSMIContext.h=>include/HGSMIContext.h \ 35 32 ${PATH_ROOT}/include/VBox/Graphics/HGSMIDefs.h=>include/HGSMIDefs.h \ 36 ${PATH_ROOT}/include/VBox/Graphics/HGSMIMemAlloc.h=>include/HGSMIMemAlloc.h \37 33 ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoVBE.h=>include/VBoxVideoVBE.h \ 38 34 ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp=>HGSMIBase.c \ … … 40 36 ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp=>Modesetting.c \ 41 37 ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp=>VBVABase.c \ 38 ${PATH_ROOT}/src/VBox/Additions/linux/drm/HGSMIBase.h=>include/HGSMIBase.h \ 42 39 ${PATH_ROOT}/src/VBox/Additions/linux/drm/VBoxVideoIPRT.h=>include/VBoxVideoIPRT.h \ 43 40 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_drv.c=>vbox_drv.c \ … … 49 46 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_prime.c=>vbox_prime.c \ 50 47 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_ttm.c=>vbox_ttm.c \ 51 ${PATH_ROOT}/src/VBox/GuestHost/HGSMI/HGSMICommon.cpp=>HGSMICommon.c \ 52 ${PATH_ROOT}/src/VBox/GuestHost/HGSMI/HGSMIMemAlloc.cpp=>HGSMIMemAlloc.c \ 48 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_hgsmi.c=>vbox_hgsmi.c \ 53 49 ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.header=>Makefile.include.header \ 54 50 ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.footer=>Makefile.include.footer \ -
trunk/src/VBox/Additions/linux/drm/vbox_main.c
r66544 r67169 259 259 } 260 260 261 /** Allocation function for the HGSMI heap and data. */262 static DECLCALLBACK(void *) alloc_hgsmi_environ(void *environ, HGSMISIZE size)263 {264 NOREF(environ);265 return kmalloc(size, GFP_KERNEL);266 }267 268 269 /** Free function for the HGSMI heap and data. */270 static DECLCALLBACK(void) free_hgsmi_environ(void *environ, void *ptr)271 {272 NOREF(environ);273 kfree(ptr);274 }275 276 277 /** Pointers to the HGSMI heap and data manipulation functions. */278 static HGSMIENV hgsmi_environ =279 {280 NULL,281 alloc_hgsmi_environ,282 free_hgsmi_environ283 };284 285 286 261 /** Do we support the 4.3 plus mode hint reporting interface? */ 287 262 static bool have_hgsmi_mode_hints(struct vbox_private *vbox) … … 301 276 vbox->full_vram_size = VBoxVideoGetVRAMSize(); 302 277 vbox->any_pitch = VBoxVideoAnyWidthAllowed(); 278 int ret; 279 303 280 DRM_INFO("VRAM %08x\n", vbox->full_vram_size); 304 281 … … 309 286 return -ENOMEM; 310 287 311 if (RT_FAILURE(VBoxHGSMISetupGuestContext(&vbox->submit_info, vbox->guest_heap,312 GUEST_HEAP_USABLE_SIZE, GUEST_HEAP_OFFSET(vbox),313 &hgsmi_environ)))288 /* Create guest-heap mem-pool use 2^4 = 16 byte chunks */ 289 vbox->submit_info.guest_pool = gen_pool_create(4, -1); 290 if (!vbox->submit_info.guest_pool) 314 291 return -ENOMEM; 292 293 ret = gen_pool_add_virt(vbox->submit_info.guest_pool, 294 (unsigned long)vbox->guest_heap, 295 GUEST_HEAP_OFFSET(vbox), 296 GUEST_HEAP_USABLE_SIZE, -1); 297 if (ret) 298 return ret; 299 315 300 /* Reduce available VRAM size to reflect the guest heap. */ 316 301 vbox->available_vram_size = GUEST_HEAP_OFFSET(vbox); … … 400 385 vbox_hw_fini(vbox); 401 386 vbox_mm_fini(vbox); 387 if (vbox->submit_info.guest_pool) 388 gen_pool_destroy(vbox->submit_info.guest_pool); 402 389 if (vbox->guest_heap) 403 390 pci_iounmap(dev->pdev, vbox->guest_heap);
Note:
See TracChangeset
for help on using the changeset viewer.