Skip to content

Commit 671dccd

Browse files
Devices/Graphics: Allow video acceleration disabling via CFGM bugref:10529
svn:sync-xref-src-repo-rev: r174555
1 parent 779a12a commit 671dccd

3 files changed

Lines changed: 23 additions & 6 deletions

File tree

src/VBox/Devices/Graphics/DevVGA-SVGA.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: DevVGA-SVGA.h 114638 2026-07-07 17:03:05Z vitali.pelenjow@oracle.com $ */
1+
/* $Id: DevVGA-SVGA.h 114719 2026-07-16 15:46:04Z aleksey.ilyushin@oracle.com $ */
22
/** @file
33
* VMware SVGA device
44
*/
@@ -468,7 +468,7 @@ typedef struct VMSVGAState
468468
/** Whether MSAA support is enabled. */
469469
bool fVMSVGA3dMSAA;
470470
bool fVMSVGA2dGBO;
471-
bool afPadding[1];
471+
bool fVMSVGA3dVideoAcceleration;
472472
uint32_t uWidth;
473473
uint32_t uHeight;
474474
uint32_t uBpp;

src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: DevVGA-SVGA3d-dx-dx11.cpp 114361 2026-06-15 14:47:34Z vitali.pelenjow@oracle.com $ */
1+
/* $Id: DevVGA-SVGA3d-dx-dx11.cpp 114719 2026-07-16 15:46:04Z aleksey.ilyushin@oracle.com $ */
22
/** @file
33
* DevVMWare - VMWare SVGA device
44
*/
@@ -439,6 +439,10 @@ typedef struct VMSVGA3DBACKEND
439439
* resources just in case. It works on AMD and Intel graphics without the workaround.
440440
*/
441441
bool fAlwaysSetShaderResourceViewsForCompute : 1;
442+
443+
/* Do not create ID3D11VideoDevice.
444+
*/
445+
bool fDisableVideoAcceleration : 1;
442446
} workarounds;
443447
} VMSVGA3DBACKEND;
444448

@@ -1514,10 +1518,16 @@ static int dxDeviceCreate(PVMSVGA3DBACKEND pBackend, DXDEVICE *pDXDevice)
15141518
}
15151519

15161520
/* Failure to query VideoDevice should be ignored. */
1517-
hr2 = pDXDevice->pDevice->QueryInterface(__uuidof(ID3D11VideoDevice), (void**)&pDXDevice->pVideoDevice);
1521+
if (!pBackend->workarounds.fDisableVideoAcceleration)
1522+
{
1523+
hr2 = pDXDevice->pDevice->QueryInterface(__uuidof(ID3D11VideoDevice), (void**)&pDXDevice->pVideoDevice);
15181524
#ifndef VBOX_WITH_DXMT /* DXMT has no video support, so failing is expected here. */
1519-
Assert(SUCCEEDED(hr2));
1525+
Assert(SUCCEEDED(hr2));
15201526
#endif
1527+
}
1528+
else
1529+
hr2 = E_NOTIMPL;
1530+
15211531
if (SUCCEEDED(hr2))
15221532
{
15231533
hr2 = pDXDevice->pImmediateContext->QueryInterface(__uuidof(ID3D11VideoContext), (void**)&pDXDevice->pVideoContext);
@@ -3407,6 +3417,8 @@ static DECLCALLBACK(int) vmsvga3dBackPowerOn(PPDMDEVINS pDevIns, PVGASTATE pThis
34073417
PVMSVGA3DBACKEND pBackend = pState->pBackend;
34083418
AssertReturn(pBackend, VERR_INVALID_STATE);
34093419

3420+
pBackend->workarounds.fDisableVideoAcceleration = !pThis->svga.fVMSVGA3dVideoAcceleration;
3421+
34103422
int rc = dxDeviceCreate(pBackend, &pBackend->dxDevice);
34113423
if (RT_SUCCESS(rc))
34123424
{

src/VBox/Devices/Graphics/DevVGA.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: DevVGA.cpp 114638 2026-07-07 17:03:05Z vitali.pelenjow@oracle.com $ */
1+
/* $Id: DevVGA.cpp 114719 2026-07-16 15:46:04Z aleksey.ilyushin@oracle.com $ */
22
/** @file
33
* DevVGA - VBox VGA/VESA device.
44
*/
@@ -6849,6 +6849,7 @@ static DECLCALLBACK(int) vgaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCF
68496849
"|VMSVGA3dMSAA"
68506850
"|VMSVGA2dGBO"
68516851
"|VMSVGA3dGraphicsMemSizeGB"
6852+
"|VMSVGA3dVideoAcceleration"
68526853
# endif
68536854
"|SuppressNewYearSplash"
68546855
"|3DEnabled";
@@ -6935,6 +6936,10 @@ static DECLCALLBACK(int) vgaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCF
69356936
rc = pHlp->pfnCFGMQueryU64Def(pCfg, "VMSVGA3dGraphicsMemSizeGB", &u64VMSVGA3dGraphicsMemSizeGB, 4);
69366937
AssertLogRelRCReturn(rc, rc);
69376938
pThis->svga.cbGBObjectMemSize = RT_MIN(u64VMSVGA3dGraphicsMemSizeGB, 32) * _1G;
6939+
6940+
rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "VMSVGA3dVideoAcceleration", &pThis->svga.fVMSVGA3dVideoAcceleration, true);
6941+
AssertLogRelRCReturn(rc, rc);
6942+
Log(("VMSVGA: VMSVGA3dVideoAcceleration = %d\n", pThis->svga.fVMSVGA3dVideoAcceleration));
69386943
# endif
69396944

69406945
# ifdef VBOX_WITH_VMSVGA

0 commit comments

Comments
 (0)