publish adding a new resolution

(cherry picked from commit 7693d4153c)
This commit is contained in:
Vadim Rozenfeld 2015-02-18 20:57:00 +11:00
parent 8d33c3072e
commit fa8291cf37
3 changed files with 43 additions and 24 deletions

View File

@ -219,7 +219,7 @@ NTSTATUS QxlDod::DispatchIoRequest(_In_ ULONG VidPnSourceId,
UNREFERENCED_PARAMETER(VidPnSourceId);
UNREFERENCED_PARAMETER(pVideoRequestPacket);
DbgPrint(TRACE_LEVEL_FATAL, ("---> %s\n", __FUNCTION__));
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
return STATUS_SUCCESS;
}
@ -460,11 +460,27 @@ NTSTATUS QxlDod::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointer
NTSTATUS QxlDod::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
{
PAGED_CODE();
NTSTATUS Status = STATUS_SUCCESS;
QXL_ASSERT(pEscape != NULL);
DbgPrint(TRACE_LEVEL_FATAL, ("<---> %s Flags = %d\n", __FUNCTION__, pEscape->Flags));
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s Flags = %d\n", __FUNCTION__, pEscape->Flags));
return m_pHWDevice->Escape(pEscape);
Status = m_pHWDevice->Escape(pEscape);
if (Status == STATUS_SUCCESS)
{
DXGK_CHILD_STATUS ChildStatus;
ChildStatus.Type = StatusConnection;
ChildStatus.ChildUid = 0;
ChildStatus.HotPlug.Connected = FALSE;
Status = m_DxgkInterface.DxgkCbIndicateChildStatus(m_DxgkInterface.DeviceHandle, &ChildStatus);
if (Status == STATUS_SUCCESS)
{
ChildStatus.HotPlug.Connected = TRUE;
Status = m_DxgkInterface.DxgkCbIndicateChildStatus(m_DxgkInterface.DeviceHandle, &ChildStatus);
}
}
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s Status = %x\n", __FUNCTION__, Status));
return Status;
}
@ -2526,7 +2542,7 @@ NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
DbgPrint(TRACE_LEVEL_INFORMATION, ("ModeCount filtered %d\n", m_ModeCount));
for (ULONG idx = 0; idx < m_ModeCount; idx++)
{
DbgPrint(TRACE_LEVEL_ERROR, ("type %x, XRes = %d, YRes = %d, BPP = %d\n",
DbgPrint(TRACE_LEVEL_INFORMATION, ("type %x, XRes = %d, YRes = %d, BPP = %d\n",
m_ModeNumbers[idx],
m_ModeInfo[idx].VisScreenWidth,
m_ModeInfo[idx].VisScreenHeight,
@ -2979,15 +2995,13 @@ BOOL QxlDevice::SetVideoModeInfo(UINT Idx, QXLMode* pModeInfo)
return TRUE;
}
BOOL QxlDevice::UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp)
void QxlDevice::UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp)
{
PVIDEO_MODE_INFORMATION pMode = NULL;
UINT bytes_pp = (bpp + 7) / 8;
ULONG color_bits;
PAGED_CODE();
if (xres < MIN_WIDTH_SIZE || yres < MIN_HEIGHT_SIZE || bpp != 32)
return FALSE;
pMode = &m_ModeInfo[Idx];
pMode->VisScreenWidth = xres;
pMode->VisScreenHeight = yres;
@ -3001,7 +3015,6 @@ BOOL QxlDevice::UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp)
pMode->BlueMask = (1 << color_bits) - 1;
pMode->GreenMask = pMode->BlueMask << color_bits;
pMode->RedMask = pMode->GreenMask << color_bits;
return TRUE;
}
NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
@ -3022,7 +3035,7 @@ NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
return STATUS_UNSUCCESSFUL;
}
DbgPrint(TRACE_LEVEL_ERROR, ("%s: ModeCount = %d\n", __FUNCTION__, ModeCount));
DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: ModeCount = %d\n", __FUNCTION__, ModeCount));
ModeCount += 2;
m_ModeInfo = reinterpret_cast<PVIDEO_MODE_INFORMATION> (new (PagedPool) BYTE[sizeof (VIDEO_MODE_INFORMATION) * ModeCount]);
@ -3039,11 +3052,11 @@ NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
QXLMode* tmpModeInfo = &modes->modes[CurrentMode];
DbgPrint(TRACE_LEVEL_ERROR, ("%s: modes[%d] x_res = %d, y_res = %d, bits = %d BitsPerPixel = %d\n", __FUNCTION__, CurrentMode, tmpModeInfo->x_res, tmpModeInfo->y_res, tmpModeInfo->bits, BitsPerPixel));
DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: modes[%d] x_res = %d, y_res = %d, bits = %d BitsPerPixel = %d\n", __FUNCTION__, CurrentMode, tmpModeInfo->x_res, tmpModeInfo->y_res, tmpModeInfo->bits, BitsPerPixel));
if (tmpModeInfo->x_res >= Width &&
tmpModeInfo->y_res >= Height &&
tmpModeInfo->bits == 32)
tmpModeInfo->bits == QXL_BPP)
{
m_ModeNumbers[SuitableModeCount] = SuitableModeCount;//CurrentMode;
SetVideoModeInfo(SuitableModeCount, tmpModeInfo);
@ -3072,10 +3085,10 @@ NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
memcpy(&m_ModeInfo[CurrentMode], &m_ModeInfo[m_CurrentMode], sizeof(VIDEO_MODE_INFORMATION));
}
m_ModeCount = SuitableModeCount + 2;
DbgPrint(TRACE_LEVEL_ERROR, ("ModeCount filtered %d\n", m_ModeCount));
DbgPrint(TRACE_LEVEL_INFORMATION, ("ModeCount filtered %d\n", m_ModeCount));
for (ULONG idx = 0; idx < GetModeCount(); idx++)
{
DbgPrint(TRACE_LEVEL_ERROR, ("type %x, XRes = %d, YRes = %d, BPP = %d\n",
DbgPrint(TRACE_LEVEL_INFORMATION, ("type %x, XRes = %d, YRes = %d, BPP = %d\n",
m_ModeNumbers[idx],
m_ModeInfo[idx].VisScreenWidth,
m_ModeInfo[idx].VisScreenHeight,
@ -4447,8 +4460,16 @@ NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscap)
xres = custom_display->xres;
yres = custom_display->yres;
bpp = custom_display->bpp;
if (bpp != QXL_BPP)
{
bpp = QXL_BPP;
}
if (xres < MIN_WIDTH_SIZE || yres < MIN_HEIGHT_SIZE)
{
DbgPrint(TRACE_LEVEL_FATAL, ("%s: xres = %d, yres = %d\n", __FUNCTION__, xres, yres));
return ERROR_INVALID_DATA;
}
/* alternate custom mode index */
if (m_CustomMode == (m_ModeCount - 1))
m_CustomMode = (USHORT)(m_ModeCount - 2);
else
@ -4459,12 +4480,9 @@ NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscap)
__FUNCTION__, xres, yres, bpp, m_RomHdr->surface0_area_size));
return ERROR_NOT_ENOUGH_MEMORY;
}
if (!UpdateVideoModeInfo(m_CustomMode, xres, yres, bpp)) {
return ERROR_INVALID_DATA;
}
DbgPrint(TRACE_LEVEL_FATAL, ("<--> %s xres %d yres %d bpp %d\n", __FUNCTION__, xres, yres, bpp));
UpdateVideoModeInfo(m_CustomMode, xres, yres, bpp);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
return STATUS_SUCCESS;// SetCurrentMode(m_CustomMode);
return STATUS_SUCCESS;
}
VOID QxlDevice::WaitForCmdRing()
@ -4569,15 +4587,15 @@ VOID QxlDevice::DpcRoutine(PVOID ptr)
ASSERT(Status == STATUS_SUCCESS);
if (ctx.data & QXL_INTERRUPT_DISPLAY) {
DbgPrint(TRACE_LEVEL_FATAL, ("---> %s m_DisplayEvent\n", __FUNCTION__));
DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s m_DisplayEvent\n", __FUNCTION__));
KeSetEvent (&m_DisplayEvent, IO_NO_INCREMENT, FALSE);
}
if (ctx.data & QXL_INTERRUPT_CURSOR) {
DbgPrint(TRACE_LEVEL_FATAL, ("---> %s m_CursorEvent\n", __FUNCTION__));
DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s m_CursorEvent\n", __FUNCTION__));
KeSetEvent (&m_CursorEvent, IO_NO_INCREMENT, FALSE);
}
if (ctx.data & QXL_INTERRUPT_IO_CMD) {
DbgPrint(TRACE_LEVEL_FATAL, ("---> %s m_IoCmdEvent\n", __FUNCTION__));
DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s m_IoCmdEvent\n", __FUNCTION__));
KeSetEvent (&m_IoCmdEvent, IO_NO_INCREMENT, FALSE);
}
m_RamHdr->int_mask = QXL_INTERRUPT_MASK;

View File

@ -10,6 +10,7 @@
#define POINTER_SIZE 64
#define MIN_WIDTH_SIZE 1024
#define MIN_HEIGHT_SIZE 768
#define QXL_BPP 32
typedef struct _QXL_FLAGS
{
@ -471,7 +472,7 @@ private:
void QxlClose(void);
void UnmapMemory(void);
BOOL SetVideoModeInfo(UINT Idx, QXLMode* pModeInfo);
BOOL UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp);
void UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp);
BOOL InitMemSlots(void);
BOOL CreateMemSlots(void);
void DestroyMemSlots(void);

View File

@ -465,7 +465,7 @@ DodEnumVidPnCofuncModality(
{
PAGED_CODE();
QXL_ASSERT_CHK(hAdapter != NULL);
DbgPrint(TRACE_LEVEL_FATAL, ("<---> %s\n", __FUNCTION__));
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
if (!pQxl->IsDriverActive())