Fixing framebuffer usage logic
This patch fixes 2 issues: 1. Framebuffer should only be used in vga mode, therefore when QxlDevice is active FrameBufferIsActive flag shouldn't be checked; 2. FrameBufferIsActive flag should be set true on successfull frame buffer allocation only. Signed-off-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
This commit is contained in:
parent
2ab3b7a1fc
commit
54e2f808c9
@ -509,9 +509,6 @@ NTSTATUS QxlDod::PresentDisplayOnly(_In_ CONST DXGKARG_PRESENT_DISPLAYONLY* pPre
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].Flags.FrameBufferIsActive)
|
|
||||||
{
|
|
||||||
|
|
||||||
// If actual pixels are coming through, will need to completely zero out physical address next time in BlackOutScreen
|
// If actual pixels are coming through, will need to completely zero out physical address next time in BlackOutScreen
|
||||||
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].ZeroedOutStart.QuadPart = 0;
|
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].ZeroedOutStart.QuadPart = 0;
|
||||||
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].ZeroedOutEnd.QuadPart = 0;
|
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].ZeroedOutEnd.QuadPart = 0;
|
||||||
@ -542,7 +539,6 @@ NTSTATUS QxlDod::PresentDisplayOnly(_In_ CONST DXGKARG_PRESENT_DISPLAYONLY* pPre
|
|||||||
pPresentDisplayOnly->pDirtyRect,
|
pPresentDisplayOnly->pDirtyRect,
|
||||||
RotationNeededByFb,
|
RotationNeededByFb,
|
||||||
&m_CurrentModes[0]);
|
&m_CurrentModes[0]);
|
||||||
}
|
|
||||||
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -1521,9 +1517,6 @@ NTSTATUS QxlDod::SetSourceModeAndPath(CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMo
|
|||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
||||||
pCurrentBddMode->Flags.FrameBufferIsActive = TRUE;
|
|
||||||
|
|
||||||
// Mark that the next present should be fullscreen so the screen doesn't go from black to actual pixels one dirty rect at a time.
|
// Mark that the next present should be fullscreen so the screen doesn't go from black to actual pixels one dirty rect at a time.
|
||||||
pCurrentBddMode->Flags.FullscreenPresent = TRUE;
|
pCurrentBddMode->Flags.FullscreenPresent = TRUE;
|
||||||
for (USHORT ModeIndex = 0; ModeIndex < m_pHWDevice->GetModeCount(); ++ModeIndex)
|
for (USHORT ModeIndex = 0; ModeIndex < m_pHWDevice->GetModeCount(); ++ModeIndex)
|
||||||
@ -2921,11 +2914,19 @@ VOID VgaDevice::ResetDevice(VOID)
|
|||||||
|
|
||||||
NTSTATUS VgaDevice::AcquireFrameBuffer(CURRENT_BDD_MODE* pCurrentBddMode)
|
NTSTATUS VgaDevice::AcquireFrameBuffer(CURRENT_BDD_MODE* pCurrentBddMode)
|
||||||
{
|
{
|
||||||
|
if (pCurrentBddMode->Flags.DoNotMapOrUnmap) {
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
|
||||||
// Map the new frame buffer
|
// Map the new frame buffer
|
||||||
QXL_ASSERT(pCurrentBddMode->FrameBuffer.Ptr == NULL);
|
QXL_ASSERT(pCurrentBddMode->FrameBuffer.Ptr == NULL);
|
||||||
NTSTATUS status = MapFrameBuffer(pCurrentBddMode->DispInfo.PhysicAddress,
|
NTSTATUS status = MapFrameBuffer(pCurrentBddMode->DispInfo.PhysicAddress,
|
||||||
pCurrentBddMode->DispInfo.Pitch * pCurrentBddMode->DispInfo.Height,
|
pCurrentBddMode->DispInfo.Pitch * pCurrentBddMode->DispInfo.Height,
|
||||||
&(pCurrentBddMode->FrameBuffer.Ptr));
|
&(pCurrentBddMode->FrameBuffer.Ptr));
|
||||||
|
if (NT_SUCCESS(status))
|
||||||
|
{
|
||||||
|
pCurrentBddMode->Flags.FrameBufferIsActive = TRUE;
|
||||||
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4336,8 +4337,6 @@ VOID QxlDevice::BlackOutScreen(CURRENT_BDD_MODE* pCurrentBddMod)
|
|||||||
QXLDrawable *drawable;
|
QXLDrawable *drawable;
|
||||||
RECT Rect;
|
RECT Rect;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
if (pCurrentBddMod->Flags.FrameBufferIsActive)
|
|
||||||
{
|
|
||||||
Rect.bottom = pCurrentBddMod->SrcModeHeight;
|
Rect.bottom = pCurrentBddMod->SrcModeHeight;
|
||||||
Rect.top = 0;
|
Rect.top = 0;
|
||||||
Rect.left = 0;
|
Rect.left = 0;
|
||||||
@ -4355,7 +4354,6 @@ VOID QxlDevice::BlackOutScreen(CURRENT_BDD_MODE* pCurrentBddMod)
|
|||||||
drawable->u.fill.mask.pos.y = 0;
|
drawable->u.fill.mask.pos.y = 0;
|
||||||
drawable->u.fill.mask.bitmap = 0;
|
drawable->u.fill.mask.bitmap = 0;
|
||||||
PushDrawable(drawable);
|
PushDrawable(drawable);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS QxlDevice::HWClose(void)
|
NTSTATUS QxlDevice::HWClose(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user