Changeset 59194 in vbox
- Timestamp:
- Dec 18, 2015 6:59:14 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104817
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
r58944 r59194 27 27 vboxvideo_15_DEFS := \ 28 28 $(vboxvideo_13_DEFS) NO_ANSIC PCIACCESS XSERVER_LIBPCIACCESS _XORG_SERVER_H_ _DIX_CONFIG_H_ 29 if1of ($(KBUILD_TARGET), linux solaris)30 vboxvideo_15_DEFS += \31 VBOX_DRI32 endif33 29 vboxvideo_xorg_INCS = \ 34 $(VBOX_PATH_X11_ROOT)/dri2proto-2.8 \35 30 $(VBOX_PATH_X11_ROOT)/fontsproto-2.1.0 \ 36 31 $(VBOX_PATH_X11_ROOT)/glproto-1.4.10 \ … … 38 33 $(VBOX_PATH_X11_ROOT)/inputproto-1.9.99.902 \ 39 34 $(VBOX_PATH_X11_ROOT)/kbproto-1.0.6 \ 40 $(VBOX_PATH_X11_ROOT)/libdrm-2.4.13 \41 35 $(VBOX_PATH_X11_ROOT)/libpciaccess-0.10.8 \ 42 36 $(VBOX_PATH_X11_ROOT)/libXext-1.3.1 \ … … 45 39 $(VBOX_PATH_X11_ROOT)/renderproto-0.11 \ 46 40 $(VBOX_PATH_X11_ROOT)/xextproto-7.1.1 \ 47 $(VBOX_PATH_X11_ROOT)/xf86driproto-2.1.0 \48 41 $(VBOX_PATH_X11_ROOT)/xproto-7.0.18 49 42 … … 194 187 vboxvideo_drv_15_CFLAGS := $(vboxvideo_drv_70_CFLAGS) 195 188 vboxvideo_drv_15_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10503000 196 if1of ($(KBUILD_TARGET), linux solaris)197 vboxvideo_drv_15_DEFS += \198 VBOX_DRI_OLD199 endif200 189 vboxvideo_drv_15_INCS = \ 201 190 $(vboxvideo_xorg_INCS) \ … … 203 192 vboxvideo_drv_15_INCS += $(PATH_ROOT)/src/VBox/Runtime/include 204 193 vboxvideo_drv_15_SOURCES = $(vboxvideo_drv_13_SOURCES) 205 if1of ($(KBUILD_TARGET), linux solaris)206 vboxvideo_drv_15_SOURCES += \207 vboxvideo_dri.c208 endif209 194 210 195 … … 216 201 vboxvideo_drv_16_CFLAGS := $(vboxvideo_drv_70_CFLAGS) 217 202 vboxvideo_drv_16_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10600000 218 if1of ($(KBUILD_TARGET), linux solaris)219 vboxvideo_drv_16_DEFS += \220 VBOX_DRI_OLD221 endif222 203 vboxvideo_drv_16_INCS = \ 223 204 $(vboxvideo_xorg_INCS) \ … … 239 220 vboxvideo_drv_17_INCS += $(PATH_ROOT)/src/VBox/Runtime/include 240 221 vboxvideo_drv_17_SOURCES := $(vboxvideo_drv_13_SOURCES) 241 if1of ($(KBUILD_TARGET), linux solaris)242 vboxvideo_drv_17_SOURCES += \243 vboxvideo_dri2.c244 endif245 222 246 223 … … 409 386 $(PATH_ROOT)/src/VBox/Runtime/include \ 410 387 /usr/include/x11 \ 411 /usr/include/X11/dri \412 /usr/include/libdrm \413 388 /usr/include/xorg \ 414 389 /usr/include/pixman-1 -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r58130 r59194 79 79 /* VGA hardware functions for setting and restoring text mode */ 80 80 #include "vgaHW.h" 81 #ifdef VBOX_DRI82 # include "xf86drm.h"83 # include "xf86drmMode.h"84 #endif85 81 #ifdef VBOXVIDEO_13 86 82 /* X.org 1.3+ mode setting */ … … 286 282 pScrn->displayWidth = pScrn->virtualX = adjustedWidth; 287 283 pScrn->virtualY = height; 288 #ifdef VBOX_DRI_OLD289 if (pVBox->useDRI)290 VBOXDRIUpdateStride(pScrn, pVBox);291 #endif292 284 return TRUE; 293 285 } … … 863 855 return FALSE; 864 856 865 #ifdef VBOX_DRI_OLD866 /* Load the dri module. */867 if (!xf86LoadSubModule(pScrn, "dri"))868 return FALSE;869 #else870 # ifdef VBOX_DRI871 /* Load the dri module. */872 if (!xf86LoadSubModule(pScrn, "dri2"))873 return FALSE;874 # endif875 #endif876 877 857 #ifndef PCIACCESS 878 858 if (pVBox->pEnt->location.type != BUS_PCI) … … 947 927 #endif /* !VBOXVIDEO_13 */ 948 928 949 /* Needed before we initialise DRI. */950 929 pScrn->displayWidth = pScrn->virtualX; 951 930 … … 1208 1187 if (!miSetPixmapDepths()) 1209 1188 return (FALSE); 1210 1211 #ifdef VBOX_DRI1212 pVBox->useDRI = VBOXDRIScreenInit(pScrn, pScreen, pVBox);1213 # ifndef VBOX_DRI_OLD /* DRI2 */1214 if (pVBox->drmFD >= 0)1215 /* Tell the kernel driver, if present, that we are taking over. */1216 drmIoctl(pVBox->drmFD, VBOXVIDEO_IOCTL_DISABLE_HGSMI, NULL);1217 # endif1218 #endif1219 1189 1220 1190 if (!fbScreenInit(pScreen, pVBox->base, … … 1367 1337 "Unable to start the VirtualBox mouse pointer integration with the host system.\n"); 1368 1338 1369 #ifdef VBOX_DRI_OLD1370 if (pVBox->useDRI)1371 pVBox->useDRI = VBOXDRIFinishScreenInit(pScreen);1372 #endif1373 1374 1339 return (TRUE); 1375 1340 } … … 1390 1355 TRACE_ENTRY(); 1391 1356 updateGraphicsCapability(pScrn, TRUE); 1392 #ifdef VBOX_DRI_OLD1393 if (pVBox->useDRI)1394 DRIUnlock(xf86ScrnToScreen(pScrn));1395 #elif defined(VBOX_DRI) /* DRI2 */1396 if (pVBox->drmFD >= 0)1397 {1398 /* Tell the kernel driver, if present, that we are taking over. */1399 drmSetMaster(pVBox->drmFD);1400 }1401 #endif1402 1357 vbvxSetUpHGSMIHeapInGuest(pVBox, pScrn->videoRam * 1024); 1403 1358 vboxEnableVbva(pScrn); … … 1433 1388 vboxDisableVbva(pScrn); 1434 1389 vbvxClearVRAM(pScrn, ((size_t)pScrn->virtualX) * pScrn->virtualY * (pScrn->bitsPerPixel / 8), 0); 1435 #ifdef VBOX_DRI_OLD1436 if (pVBox->useDRI)1437 DRILock(xf86ScrnToScreen(pScrn), 0);1438 #elif defined(VBOX_DRI) /* DRI2 */1439 if (pVBox->drmFD >= 0)1440 drmDropMaster(pVBox->drmFD);1441 #endif1442 1390 VBOXRestoreMode(pScrn); 1443 1391 TRACE_EXIT(); … … 1448 1396 ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); 1449 1397 VBOXPtr pVBox = VBOXGetRec(pScrn); 1450 #if defined(VBOX_DRI) && !defined(VBOX_DRI_OLD) /* DRI2 */1451 BOOL fRestore = TRUE;1452 #endif1453 1398 BOOL ret; 1454 1399 … … 1464 1409 vbvxClearVRAM(pScrn, ((size_t)pScrn->virtualX) * pScrn->virtualY * (pScrn->bitsPerPixel / 8), 0); 1465 1410 } 1466 #ifdef VBOX_DRI 1467 # ifndef VBOX_DRI_OLD /* DRI2 */ 1468 if ( pVBox->drmFD >= 0 1469 /* Tell the kernel driver, if present, that we are going away. */ 1470 && drmIoctl(pVBox->drmFD, VBOXVIDEO_IOCTL_ENABLE_HGSMI, NULL) >= 0) 1471 fRestore = false; 1472 # endif 1473 if (pVBox->useDRI) 1474 VBOXDRICloseScreen(pScreen, pVBox); 1475 pVBox->useDRI = false; 1476 #endif 1477 #if defined(VBOX_DRI) && !defined(VBOX_DRI_OLD) /* DRI2 */ 1478 if (fRestore) 1479 #endif 1480 if (pScrn->vtSema) 1481 VBOXRestoreMode(pScrn); 1411 if (pScrn->vtSema) 1412 VBOXRestoreMode(pScrn); 1482 1413 if (pScrn->vtSema) 1483 1414 VBOXUnmapVidMem(pScrn); … … 1602 1533 VBOXPtr pVBox = VBOXGetRec(pScrn); 1603 1534 vgaRegPtr vgaReg; 1604 #ifdef VBOX_DRI1605 drmModeResPtr pRes;1606 #endif1607 1535 1608 1536 TRACE_ENTRY(); 1609 #ifdef VBOX_DRI1610 /* Do not try to re-set the VGA state if a mode-setting driver is loaded. */1611 if ( pVBox->drmFD >= 01612 && LoaderSymbol("drmModeGetResources") != NULL1613 && (pRes = drmModeGetResources(pVBox->drmFD)) != NULL)1614 {1615 drmModeFreeResources(pRes);1616 return;1617 }1618 #endif1619 1537 vgaReg = &VGAHWPTR(pScrn)->SavedReg; 1620 1538 vgaHWRestore(pScrn, vgaReg, VGA_SR_ALL); -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r58130 r59194 112 112 #define VBOX_DRIVER_NAME "vboxvideo" 113 113 114 #ifdef VBOX_DRI_OLD115 /* DRI support */116 #define _XF86DRI_SERVER_117 /* Hack to work around a libdrm header which is broken on Solaris */118 #define u_int64_t uint64_t119 /* Get rid of a warning due to a broken header file */120 enum drm_bo_type { DRM_BO_TYPE };121 #include "dri.h"122 #undef u_int64_t123 #include "sarea.h"124 #include "GL/glxint.h"125 126 /* For some reason this is not in the header files. */127 extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,128 void **configprivs);129 #endif130 131 114 #define VBOX_VIDEO_MAJOR VBOX_VERSION_MAJOR 132 115 #define VBOX_VIDEO_MINOR VBOX_VERSION_MINOR 133 #define VBOX_DRM_DRIVER_NAME "vboxvideo" /* For now, as this driver is basically a stub. */134 #define VBOX_DRI_DRIVER_NAME "vboxvideo" /* For starters. */135 #define VBOX_MAX_DRAWABLES 256 /* At random. */136 116 137 117 #define VBOX_VIDEO_MIN_SIZE 64 … … 226 206 /** Unrestricted horizontal resolution flag. */ 227 207 Bool fAnyX; 228 #ifdef VBOX_DRI229 Bool useDRI;230 #ifdef VBOX_DRI_OLD231 int cVisualConfigs;232 __GLXvisualConfig *pVisualConfigs;233 DRIInfoRec *pDRIInfo;234 # endif235 int drmFD;236 #endif237 208 } VBOXRec, *VBOXPtr; 238 209 … … 287 258 extern void vbvxCleanUpLinuxACPI(ScreenPtr pScreen); 288 259 289 /* DRI stuff */290 extern Bool VBOXDRIScreenInit(ScrnInfoPtr pScrn, ScreenPtr pScreen,291 VBOXPtr pVBox);292 extern Bool VBOXDRIFinishScreenInit(ScreenPtr pScreen);293 extern void VBOXDRIUpdateStride(ScrnInfoPtr pScrn, VBOXPtr pVBox);294 extern void VBOXDRICloseScreen(ScreenPtr pScreen, VBOXPtr pVBox);295 296 260 #endif /* _VBOXVIDEO_H_ */ 297 261
Note:
See TracChangeset
for help on using the changeset viewer.