summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2013-05-21 13:50:09 -0400
committerYonit Halperin <yhalperi@redhat.com>2013-05-21 13:50:09 -0400
commitfa0e3cbff8fe0af559322ad975c03d065028aec6 (patch)
tree4d60c67925a2a3f7b73e9c3f5aed2b0390f656c8
parentbcfd94b7346e54cc485881fa31f114e93b2bd178 (diff)
fix pitch of the frame buffer when the resolution changes
-rw-r--r--C++/bdd_dmm.cxx19
1 files changed, 5 insertions, 14 deletions
diff --git a/C++/bdd_dmm.cxx b/C++/bdd_dmm.cxx
index dd3baaa..15d21e1 100644
--- a/C++/bdd_dmm.cxx
+++ b/C++/bdd_dmm.cxx
@@ -754,28 +754,19 @@ NTSTATUS BASIC_DISPLAY_DRIVER::SetSourceModeAndPath(CONST D3DKMDT_VIDPN_SOURCE_M
LogMessage("%s: New message\n", __FUNCTION__);
pCurrentBddMode->Scaling = pPath->ContentTransformation.Scaling;
// 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__,
+ LogMessage("%s: set mode size: SurfSize %ux%u visible %ux%u pixel format %d stride %ld\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;*/
+ pSourceMode->Format.Graphics.PixelFormat,
+ pSourceMode->Format.Graphics.Stride);
+
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);*/
-
+ pCurrentBddMode->DispInfo.Pitch = pSourceMode->Format.Graphics.PrimSurfSize.cx * BPPFromPixelFormat(pCurrentBddMode->DispInfo.ColorFormat)/8;
if (!pCurrentBddMode->Flags.DoNotMapOrUnmap)
{