fix resolution mismatch when switching between VGA and QXL modes
(cherry picked from commit b2a0aef4a5
)
This commit is contained in:
parent
fa8291cf37
commit
f059ee240e
@ -2404,7 +2404,9 @@ NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
|
|||||||
VBE_INFO VbeInfo = {0};
|
VBE_INFO VbeInfo = {0};
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
VBE_MODEINFO tmpModeInfo;
|
VBE_MODEINFO tmpModeInfo;
|
||||||
|
UINT Height = pDispInfo->Height;
|
||||||
|
UINT Width = pDispInfo->Width;
|
||||||
|
UINT BitsPerPixel = BPPFromPixelFormat(pDispInfo->ColorFormat);
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
|
||||||
//Get VBE Mode List
|
//Get VBE Mode List
|
||||||
@ -2451,6 +2453,7 @@ NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
|
|||||||
DbgPrint(TRACE_LEVEL_INFORMATION, ("VBE BIOS Present (%d.%d, %8ld Kb)\n", VbeInfo.Version / 0x100, VbeInfo.Version & 0xFF, VbeInfo.TotalMemory * 64));
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("VBE BIOS Present (%d.%d, %8ld Kb)\n", VbeInfo.Version / 0x100, VbeInfo.Version & 0xFF, VbeInfo.TotalMemory * 64));
|
||||||
DbgPrint(TRACE_LEVEL_INFORMATION, ("Capabilities = 0x%x\n", VbeInfo.Capabilities));
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("Capabilities = 0x%x\n", VbeInfo.Capabilities));
|
||||||
DbgPrint(TRACE_LEVEL_INFORMATION, ("VideoModePtr = 0x%x (0x%x.0x%x)\n", VbeInfo.VideoModePtr, HIWORD( VbeInfo.VideoModePtr), LOWORD( VbeInfo.VideoModePtr)));
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("VideoModePtr = 0x%x (0x%x.0x%x)\n", VbeInfo.VideoModePtr, HIWORD( VbeInfo.VideoModePtr), LOWORD( VbeInfo.VideoModePtr)));
|
||||||
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("pDispInfo = %p %dx%d@%d\n", pDispInfo, Width, Height, BitsPerPixel));
|
||||||
|
|
||||||
for (ModeCount = 0; ; ModeCount++)
|
for (ModeCount = 0; ; ModeCount++)
|
||||||
{
|
{
|
||||||
@ -2479,6 +2482,12 @@ NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
|
|||||||
m_ModeNumbers = reinterpret_cast<PUSHORT> (new (PagedPool) BYTE [sizeof (USHORT) * ModeCount]);
|
m_ModeNumbers = reinterpret_cast<PUSHORT> (new (PagedPool) BYTE [sizeof (USHORT) * ModeCount]);
|
||||||
m_CurrentMode = 0;
|
m_CurrentMode = 0;
|
||||||
DbgPrint(TRACE_LEVEL_INFORMATION, ("m_ModeInfo = 0x%p, m_ModeNumbers = 0x%p\n", m_ModeInfo, m_ModeNumbers));
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("m_ModeInfo = 0x%p, m_ModeNumbers = 0x%p\n", m_ModeInfo, m_ModeNumbers));
|
||||||
|
if (Width == 0 || Height == 0 || BitsPerPixel != VGA_BPP)
|
||||||
|
{
|
||||||
|
Width = MIN_WIDTH_SIZE;
|
||||||
|
Height = MIN_HEIGHT_SIZE;
|
||||||
|
BitsPerPixel = VGA_BPP;
|
||||||
|
}
|
||||||
for (CurrentMode = 0, SuitableModeCount = 0;
|
for (CurrentMode = 0, SuitableModeCount = 0;
|
||||||
CurrentMode < ModeCount;
|
CurrentMode < ModeCount;
|
||||||
CurrentMode++)
|
CurrentMode++)
|
||||||
@ -2495,7 +2504,6 @@ NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgPrint(TRACE_LEVEL_INFORMATION, ("ModeTemp = 0x%X\n", ModeTemp));
|
|
||||||
RtlZeroMemory(®s, sizeof(regs));
|
RtlZeroMemory(®s, sizeof(regs));
|
||||||
regs.Eax = 0x4F01;
|
regs.Eax = 0x4F01;
|
||||||
regs.Ecx = ModeTemp;
|
regs.Ecx = ModeTemp;
|
||||||
@ -2512,9 +2520,7 @@ NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
|
|||||||
&tmpModeInfo,
|
&tmpModeInfo,
|
||||||
sizeof(VBE_MODEINFO));
|
sizeof(VBE_MODEINFO));
|
||||||
|
|
||||||
UINT Height = pDispInfo->Height;
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("ModeTemp = 0x%X %dx%d@%d\n", ModeTemp, tmpModeInfo.XResolution, tmpModeInfo.YResolution, tmpModeInfo.BitsPerPixel));
|
||||||
UINT Width = pDispInfo->Width;
|
|
||||||
UINT BitsPerPixel = BPPFromPixelFormat(pDispInfo->ColorFormat);
|
|
||||||
|
|
||||||
if (tmpModeInfo.XResolution >= Width &&
|
if (tmpModeInfo.XResolution >= Width &&
|
||||||
tmpModeInfo.YResolution >= Height &&
|
tmpModeInfo.YResolution >= Height &&
|
||||||
@ -3045,6 +3051,13 @@ NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
|
|||||||
UINT Height = pDispInfo->Height;
|
UINT Height = pDispInfo->Height;
|
||||||
UINT Width = pDispInfo->Width;
|
UINT Width = pDispInfo->Width;
|
||||||
UINT BitsPerPixel = BPPFromPixelFormat(pDispInfo->ColorFormat);
|
UINT BitsPerPixel = BPPFromPixelFormat(pDispInfo->ColorFormat);
|
||||||
|
if (Width == 0 || Height == 0 || BitsPerPixel != QXL_BPP)
|
||||||
|
{
|
||||||
|
Width = MIN_WIDTH_SIZE;
|
||||||
|
Height = MIN_HEIGHT_SIZE;
|
||||||
|
BitsPerPixel = QXL_BPP;
|
||||||
|
}
|
||||||
|
|
||||||
for (CurrentMode = 0, SuitableModeCount = 0;
|
for (CurrentMode = 0, SuitableModeCount = 0;
|
||||||
CurrentMode < modes->n_modes;
|
CurrentMode < modes->n_modes;
|
||||||
CurrentMode++)
|
CurrentMode++)
|
||||||
@ -3075,7 +3088,6 @@ NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
|
|||||||
Status = STATUS_UNSUCCESSFUL;
|
Status = STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_CurrentMode = m_ModeNumbers[0];
|
|
||||||
m_CustomMode = SuitableModeCount;
|
m_CustomMode = SuitableModeCount;
|
||||||
for (CurrentMode = SuitableModeCount;
|
for (CurrentMode = SuitableModeCount;
|
||||||
CurrentMode < SuitableModeCount + 2;
|
CurrentMode < SuitableModeCount + 2;
|
||||||
@ -4307,16 +4319,19 @@ VOID QxlDevice::BlackOutScreen(CURRENT_BDD_MODE* pCurrentBddMod)
|
|||||||
QXLDrawable *drawable;
|
QXLDrawable *drawable;
|
||||||
RECT Rect;
|
RECT Rect;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
return;
|
|
||||||
DbgPrint(TRACE_LEVEL_FATAL, ("---> %s\n", __FUNCTION__));
|
DbgPrint(TRACE_LEVEL_FATAL, ("---> %s\n", __FUNCTION__));
|
||||||
|
if (pCurrentBddMod->Flags.FrameBufferIsActive)
|
||||||
|
{
|
||||||
Rect.bottom = pCurrentBddMod->SrcModeHeight;
|
Rect.bottom = pCurrentBddMod->SrcModeHeight;
|
||||||
Rect.top = 0;
|
Rect.top = 0;
|
||||||
Rect.left = 0;
|
Rect.left = 0;
|
||||||
Rect.right = pCurrentBddMod->SrcModeWidth;
|
Rect.right = pCurrentBddMod->SrcModeWidth;
|
||||||
if (!(drawable = Drawable(QXL_DRAW_FILL, &Rect, NULL, 0))) {
|
if (!(drawable = Drawable(QXL_DRAW_FILL, &Rect, NULL, 0)))
|
||||||
|
{
|
||||||
DbgPrint(TRACE_LEVEL_ERROR, ("Cannot get Drawable.\n"));
|
DbgPrint(TRACE_LEVEL_ERROR, ("Cannot get Drawable.\n"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawable->u.fill.brush.type = SPICE_BRUSH_TYPE_SOLID;
|
drawable->u.fill.brush.type = SPICE_BRUSH_TYPE_SOLID;
|
||||||
drawable->u.fill.brush.u.color = 0;
|
drawable->u.fill.brush.u.color = 0;
|
||||||
drawable->u.fill.rop_descriptor = SPICE_ROPD_OP_PUT;
|
drawable->u.fill.rop_descriptor = SPICE_ROPD_OP_PUT;
|
||||||
@ -4325,7 +4340,7 @@ return;
|
|||||||
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);
|
||||||
|
}
|
||||||
DbgPrint(TRACE_LEVEL_FATAL, ("<--- %s\n", __FUNCTION__));
|
DbgPrint(TRACE_LEVEL_FATAL, ("<--- %s\n", __FUNCTION__));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#define MIN_WIDTH_SIZE 1024
|
#define MIN_WIDTH_SIZE 1024
|
||||||
#define MIN_HEIGHT_SIZE 768
|
#define MIN_HEIGHT_SIZE 768
|
||||||
#define QXL_BPP 32
|
#define QXL_BPP 32
|
||||||
|
#define VGA_BPP 24
|
||||||
|
|
||||||
typedef struct _QXL_FLAGS
|
typedef struct _QXL_FLAGS
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// Driver Entry point
|
// Driver Entry point
|
||||||
//
|
//
|
||||||
|
|
||||||
int nDebugLevel = TRACE_LEVEL_ERROR;
|
int nDebugLevel = TRACE_LEVEL_INFORMATION;
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
|
Loading…
Reference in New Issue
Block a user