Changeset 8531 in vbox
- Timestamp:
- May 2, 2008 3:20:27 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 30435
- Location:
- trunk/src/VBox/Additions/x11/xgraphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h
r8425 r8531 147 147 int nDGAMode; 148 148 CloseScreenProcPtr CloseScreen; 149 /** Default X server procedure for enabling and disabling framebuffer access */ 150 xf86EnableDisableFBAccessProc *EnableDisableFBAccess; 151 /** Is access to the framebuffer currently allowed? */ 152 Bool accessEnabled; 149 153 OptionInfoPtr Options; 150 154 IOADDRESS ioBase; … … 155 159 Bool pointerOffscreen; 156 160 Bool useDevice; 161 /** Are we currently switched to a virtual terminal? If so, it is not 162 * safe to touch the hardware. */ 163 Bool vtSwitch; 157 164 Bool useVbva; 158 165 VMMDevMemory *pVMMDevMemory; -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c
r8521 r8531 803 803 } 804 804 805 /** 806 * This function hooks into the chain that is called when framebuffer access 807 * is allowed or disallowed by a call to EnableDisableFBAccess in the server. 808 * In other words, it observes when the server wishes access to the 809 * framebuffer to be enabled and when it should be disabled. We need to know 810 * this because we disable access ourselves during mode switches (presumably 811 * the server should do this but it doesn't) and want to know whether to 812 * restore it or not afterwards. 813 */ 814 static void 815 vboxEnableDisableFBAccess(int scrnIndex, Bool enable) 816 { 817 ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; 818 VBOXPtr pVBox = VBOXGetRec(pScrn); 819 820 pVBox->accessEnabled = enable; 821 pVBox->EnableDisableFBAccess(scrnIndex, enable); 822 } 823 805 824 /* 806 825 * QUOTE from the XFree86 DESIGN document: … … 887 906 xf86SetBackingStore(pScreen); 888 907 908 /* We need to keep track of whether we are currently switched to a virtual 909 * terminal to know whether a mode set operation is currently safe to do. 910 */ 911 pVBox->vtSwitch = FALSE; 889 912 /* Initialise DGA. The cast is unfortunately correct - it gets cast back 890 913 to (unsigned char *) later. */ … … 916 939 VBOXLoadPalette, NULL, flags)) 917 940 return (FALSE); 941 942 /* Hook our observer function ito the chain which is called when 943 * framebuffer access is enabled or disabled in the server, and 944 * assume an initial state of enabled. */ 945 pVBox->accessEnabled = TRUE; 946 pVBox->EnableDisableFBAccess = pScrn->EnableDisableFBAccess; 947 pScrn->EnableDisableFBAccess = vboxEnableDisableFBAccess; 918 948 919 949 pVBox->CloseScreen = pScreen->CloseScreen; … … 946 976 { 947 977 ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; 948 978 VBOXPtr pVBox = VBOXGetRec(pScrn); 979 980 pVBox->vtSwitch = FALSE; 949 981 return xf86SetDesiredModes(pScrn); 950 982 } … … 960 992 vboxDisableVbva(pScrn); 961 993 vboxDisableGraphicsCap(pVBox); 994 pVBox->vtSwitch = TRUE; 962 995 } 963 996 … … 980 1013 pScrn->vtSema = FALSE; 981 1014 1015 /* Remove our observer functions from the X server call chains. */ 1016 pScrn->EnableDisableFBAccess = pVBox->EnableDisableFBAccess; 982 1017 pScreen->CloseScreen = pVBox->CloseScreen; 983 1018 return pScreen->CloseScreen(scrnIndex, pScreen); … … 1047 1082 { 1048 1083 ScrnInfoPtr pScrn; 1084 VBOXPtr pVBox; 1085 Bool rc; 1049 1086 1050 1087 pScrn = xf86Screens[scrnIndex]; /* Why does X have three ways of refering to the screen? */ 1051 return xf86SetSingleMode(pScrn, pMode, 0); 1088 pVBox = VBOXGetRec(pScrn); 1089 /* We want to disable access to the framebuffer before switching mode. 1090 * After doing the switch, we allow access if it was allowed before. */ 1091 if (pVBox->accessEnabled) 1092 pVBox->EnableDisableFBAccess(scrnIndex, FALSE); 1093 rc = xf86SetSingleMode(pScrn, pMode, 0); 1094 if (pVBox->accessEnabled) 1095 pVBox->EnableDisableFBAccess(scrnIndex, TRUE); 1096 return rc; 1052 1097 } 1053 1098 … … 1060 1105 int bpp = pScrn->depth == 24 ? 32 : 16; 1061 1106 pVBox = VBOXGetRec(pScrn); 1107 /* Don't fiddle with the hardware if we are switched 1108 * to a virtual terminal. */ 1109 if (pVBox->vtSwitch == TRUE) 1110 return TRUE; 1062 1111 if (pVBox->useVbva == TRUE) 1063 1112 if (vboxDisableVbva(pScrn) != TRUE) /* This would be bad. */ … … 1098 1147 VBOXPtr pVBox = VBOXGetRec(xf86Screens[scrnIndex]); 1099 1148 1149 /* Don't fiddle with the hardware if we are switched 1150 * to a virtual terminal. */ 1151 if (pVBox->vtSwitch == TRUE) 1152 return; 1100 1153 VBESetDisplayStart(pVBox->pVbe, x, y, TRUE); 1101 1154 }
Note:
See TracChangeset
for help on using the changeset viewer.