summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2013-05-16 15:12:47 -0400
committerYonit Halperin <yhalperi@redhat.com>2013-05-17 16:28:48 -0400
commita7ef119e61a85994734c0ad4857ba4e851756abd (patch)
tree9f49cdd34315229ab60a0511108dad8985900f5a
parent092b5609fd912bf069354b60f3237d21197c4f3a (diff)
Update DispInfo in SetSourceModeAndPath
otherwise blt operations will use wrong resolution and might crash after resolution changes
-rw-r--r--C++/bdd_dmm.cxx29
1 files changed, 25 insertions, 4 deletions
diff --git a/C++/bdd_dmm.cxx b/C++/bdd_dmm.cxx
index d2026e5..c2170fb 100644
--- a/C++/bdd_dmm.cxx
+++ b/C++/bdd_dmm.cxx
@@ -159,7 +159,7 @@ NTSTATUS BASIC_DISPLAY_DRIVER::EnumVidPnCofuncModality(_In_ CONST DXGKARG_ENUMVI
}
// Loop through all available paths.
- int i = 0;
+
while (Status != STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
{
@@ -751,17 +751,38 @@ NTSTATUS BASIC_DISPLAY_DRIVER::SetSourceModeAndPath(CONST D3DKMDT_VIDPN_SOURCE_M
CURRENT_BDD_MODE* pCurrentBddMode = &m_CurrentModes[pPath->VidPnSourceId];
NTSTATUS Status = STATUS_SUCCESS;
+ LogMessage("%s: New message\n", __FUNCTION__);
pCurrentBddMode->Scaling = pPath->ContentTransformation.Scaling;
- pCurrentBddMode->SrcModeWidth = pSourceMode->Format.Graphics.PrimSurfSize.cx;
- pCurrentBddMode->SrcModeHeight = pSourceMode->Format.Graphics.PrimSurfSize.cy;
+ // yonit: I changed it to be the visible region.
+ LogMessage("%s: set mode size: SurfSize %ux%u visible %ux%u pixel format %d\n", __FUNCTION__,
+ pSourceMode->Format.Graphics.PrimSurfSize.cx, pSourceMode->Format.Graphics.PrimSurfSize.cy,
+ pSourceMode->Format.Graphics.VisibleRegionSize.cx, pSourceMode->Format.Graphics.VisibleRegionSize.cy,
+ pSourceMode->Format.Graphics.PixelFormat);
+
+ /*pCurrentBddMode->SrcModeWidth = pSourceMode->Format.Graphics.PrimSurfSize.cx;
+ pCurrentBddMode->SrcModeHeight = pSourceMode->Format.Graphics.PrimSurfSize.cy; // ???
+ pCurrentBddMode->Rotation = pPath->ContentTransformation.Rotation;*/
+ pCurrentBddMode->SrcModeWidth = pSourceMode->Format.Graphics.VisibleRegionSize.cx; //pSourceMode->Format.Graphics.PrimSurfSize.cx;
+ pCurrentBddMode->SrcModeHeight = pSourceMode->Format.Graphics.VisibleRegionSize.cy; // ???
pCurrentBddMode->Rotation = pPath->ContentTransformation.Rotation;
+
+ pCurrentBddMode->DispInfo.Width = pSourceMode->Format.Graphics.PrimSurfSize.cx;
+ pCurrentBddMode->DispInfo.Height = pSourceMode->Format.Graphics.PrimSurfSize.cy;
+ pCurrentBddMode->DispInfo.Pitch = pSourceMode->Format.Graphics.Stride;
+ // don't copy pixel format. it is 32bit (A888), while the disp is 24-bit
+ //pCurrentBddMode->DispInfo.ColorFormat = pSourceMode->Format.Graphics.PixelFormat;
+ /*LogMessage("%s: set mode size: SurfSize %ux%u visible %ux%u pixel format %d\n", __FUNCTION__,
+ pCurrentBddMode->DispInfo.Width, pCurrentBddMode->DispInfo.Height,
+ pCurrentBddMode->SrcModeWidth, pCurrentBddMode->SrcModeHeight,
+ pCurrentBddMode->DispInfo.ColorFormat);*/
- LogMessage("%s set mode size %ux%u\n", __FUNCTION__, pCurrentBddMode->SrcModeWidth, pCurrentBddMode->SrcModeHeight);
if (!pCurrentBddMode->Flags.DoNotMapOrUnmap)
{
+ LogMessage("%s: mapping frame buffer\n", __FUNCTION__);
// Map the new frame buffer
BDD_ASSERT(pCurrentBddMode->FrameBuffer.Ptr == NULL);
+ // why dispInfo? and where do we update DispInfo?
Status = MapFrameBuffer(pCurrentBddMode->DispInfo.PhysicAddress,
pCurrentBddMode->DispInfo.Pitch * pCurrentBddMode->DispInfo.Height,
&(pCurrentBddMode->FrameBuffer.Ptr));