diff -dupr VirtualBox-5.1.30.org/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c VirtualBox-5.1.30/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c
|
old
|
new
|
typedef struct
|
| 44 | 44 | #define WINDOW_NAME window->title |
| 45 | 45 | |
| 46 | 46 | static Bool WindowExistsFlag; |
| | 47 | static Bool CrRenderForcePresentMainThread = True; |
| 47 | 48 | |
| 48 | 49 | static int |
| 49 | 50 | WindowExistsErrorHandler( Display *dpy, XErrorEvent *xerr ) |
| … |
… |
createWindow( VisualInfo *visual, GLbool
|
| 1114 | 1115 | AssertRC(rc); |
| 1115 | 1116 | } |
| 1116 | 1117 | |
| | 1118 | /* |
| | 1119 | * Runtime CR_RENDER_FORCE_PRESENT_MAIN_THREAD flag |
| | 1120 | */ |
| | 1121 | const char *pEnvCrRenderForcePresentMainThread = crGetenv("CR_RENDER_FORCE_PRESENT_MAIN_THREAD"); |
| | 1122 | if (pEnvCrRenderForcePresentMainThread != NULL) |
| | 1123 | { |
| | 1124 | CrRenderForcePresentMainThread = crStrToInt(pEnvCrRenderForcePresentMainThread) != 0 ? True : False; |
| | 1125 | } |
| | 1126 | |
| 1117 | 1127 | return GL_TRUE; |
| 1118 | 1128 | } |
| 1119 | 1129 | |
| … |
… |
renderspu_SystemShowWindow( WindowInfo *
|
| 1924 | 1934 | } |
| 1925 | 1935 | } |
| 1926 | 1936 | |
| 1927 | | #define CR_RENDER_FORCE_PRESENT_MAIN_THREAD |
| 1928 | | |
| 1929 | 1937 | void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry ) |
| 1930 | 1938 | { |
| 1931 | 1939 | /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl, |
| 1932 | 1940 | * here it forces rendering in WinCmd thread rather than a Main thread. |
| 1933 | 1941 | * it is used for debugging only in any way actually. |
| 1934 | 1942 | * @todo: change to some more generic macro name */ |
| 1935 | | #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD |
| | 1943 | int rc = VERR_SEM_BUSY; |
| 1936 | 1944 | const struct VBOXVR_SCR_COMPOSITOR *pCompositor; |
| 1937 | | /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */ |
| 1938 | | int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor); |
| | 1945 | if (!CrRenderForcePresentMainThread) |
| | 1946 | { |
| | 1947 | /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */ |
| | 1948 | rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor); |
| | 1949 | } |
| 1939 | 1950 | if (RT_SUCCESS(rc)) |
| 1940 | 1951 | { |
| 1941 | | renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false); |
| 1942 | | renderspuVBoxCompositorRelease(window); |
| | 1952 | renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false); |
| | 1953 | renderspuVBoxCompositorRelease(window); |
| 1943 | 1954 | } |
| 1944 | 1955 | else if (rc == VERR_SEM_BUSY) |
| 1945 | | #endif |
| 1946 | 1956 | { |
| 1947 | 1957 | Status status; |
| 1948 | 1958 | XEvent event; |
| … |
… |
void renderspu_SystemVBoxPresentComposit
|
| 1961 | 1971 | } |
| 1962 | 1972 | XFlush(render_spu.pCommunicationDisplay); |
| 1963 | 1973 | } |
| 1964 | | #ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD |
| 1965 | 1974 | else |
| 1966 | 1975 | { |
| 1967 | 1976 | /* this is somewhat we do not expect */ |
| 1968 | 1977 | WARN(("renderspuVBoxCompositorTryAcquire failed rc %d", rc)); |
| 1969 | 1978 | } |
| 1970 | | #endif |
| 1971 | 1979 | } |
| 1972 | 1980 | |
| 1973 | 1981 | static void |