<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 13, 2016 at 3:43 PM, Frediano Ziglio <span dir="ltr"><<a href="mailto:fziglio@redhat.com" target="_blank">fziglio@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">><br>
> When qxl revision is 3, the vga driver is the one that is running. When<br>
> installing the driver the function VgaDevice::HWInit with displayInfo<br>
> structure that is zeroed out. The displayInfo should be intialized using<br>
> DxgkCbAcquirePostDisplayOwners<wbr>hip and thus it should be called before<br>
> calling HWInit.<br>
><br>
> Please note that we can't just move the call to<br>
> "<wbr>DxgkCbAcquirePostDisplayOwners<wbr>hip"<br>
> before calling HWInit as the m_Id isn't iniatilized for QxlDevice untill the<br>
> call<br>
> to HWinit is over.<br>
><br>
> This patch fixies a bug similar to the one found here:<br>
> <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1202267" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/<wbr>show_bug.cgi?id=1202267</a><br>
> However this one occurs when installing the driver.<br>
><br>
<br>
</span>Minor typos<br>
intialized -> initialized<br>
iniatilized -> initialized<br>
untill -> until<br>
fixies -> fixes<br>
<br>
It's not clear to me the "However this one occurs when installing the driver."<br>
sentence. Do you mean that the bug refer to a problem similar but not<br>
occurring during installation?<br></blockquote><div>Yes, exactly. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
> Signed-off-by: Sameeh Jubran <<a href="mailto:sameeh@daynix.com">sameeh@daynix.com</a>><br>
> ---<br>
> qxldod/QxlDod.cpp | 68<br>
> +++++++++++++++++++++++++++---<wbr>-------------------------<br>
> qxldod/QxlDod.h | 2 ++<br>
> 2 files changed, 36 insertions(+), 34 deletions(-)<br>
><br>
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp<br>
> index 5cfff78..6ef57b8 100755<br>
> --- a/qxldod/QxlDod.cpp<br>
> +++ b/qxldod/QxlDod.cpp<br>
> @@ -124,7 +124,6 @@ NTSTATUS QxlDod::StartDevice(_In_ DXGK_START_INFO*<br>
> pDxgkStartInfo,<br>
> _Out_ ULONG* pNumberOfViews,<br>
> _Out_ ULONG* pNumberOfChildren)<br>
> {<br>
> - PHYSICAL_ADDRESS PhysicAddress;<br>
> PAGED_CODE();<br>
> QXL_ASSERT(pDxgkStartInfo != NULL);<br>
> QXL_ASSERT(pDxgkInterface != NULL);<br>
> @@ -176,32 +175,6 @@ NTSTATUS QxlDod::StartDevice(_In_ DXGK_START_INFO*<br>
> pDxgkStartInfo,<br>
> return Status;<br>
> }<br>
><br>
> - PhysicAddress.QuadPart =<br>
> m_CurrentModes[0].DispInfo.<wbr>PhysicAddress.QuadPart;<br>
> - if (m_pHWDevice->GetId() == 0)<br>
> - {<br>
> - Status =<br>
> m_DxgkInterface.<wbr>DxgkCbAcquirePostDisplayOwners<wbr>hip(m_DxgkInterface.<wbr>DeviceHandle,<br>
> &(m_CurrentModes[0].DispInfo))<wbr>;<br>
> - }<br>
> -<br>
> - if (!NT_SUCCESS(Status) )<br>
> - {<br>
> - DbgPrint(TRACE_LEVEL_ERROR, ("<wbr>DxgkCbAcquirePostDisplayOwners<wbr>hip<br>
> failed with status 0x%X Width = %d\n",<br>
> - Status, m_CurrentModes[0].DispInfo.<wbr>Width));<br>
> - return STATUS_UNSUCCESSFUL;<br>
> - }<br>
> -<br>
> - if (m_CurrentModes[0].DispInfo.<wbr>Width == 0)<br>
> - {<br>
> - m_CurrentModes[0].DispInfo.<wbr>Width = MIN_WIDTH_SIZE;<br>
> - m_CurrentModes[0].DispInfo.<wbr>Height = MIN_HEIGHT_SIZE;<br>
> - m_CurrentModes[0].DispInfo.<wbr>Pitch =<br>
> BPPFromPixelFormat(D3DDDIFMT_<wbr>R8G8B8) / 8;<br>
> - m_CurrentModes[0].DispInfo.<wbr>ColorFormat = D3DDDIFMT_R8G8B8;<br>
> - m_CurrentModes[0].DispInfo.<wbr>TargetId = 0;<br>
> - if (PhysicAddress.QuadPart != 0L) {<br>
> - m_CurrentModes[0].DispInfo.<wbr>PhysicAddress.QuadPart =<br>
> PhysicAddress.QuadPart;<br>
> - }<br>
> -<br>
> - }<br>
> -<br>
> *pNumberOfViews = MAX_VIEWS;<br>
> *pNumberOfChildren = MAX_CHILDREN;<br>
> m_Flags.DriverStarted = TRUE;<br>
> @@ -2488,12 +2461,6 @@ NTSTATUS<br>
> VgaDevice::GetModeList(DXGK_<wbr>DISPLAY_INFORMATION* pDispInfo)<br>
><br>
> m_CurrentMode = 0;<br>
> DbgPrint(TRACE_LEVEL_<wbr>INFORMATION, ("m_ModeInfo = 0x%p, m_ModeNumbers =<br>
> 0x%p\n", m_ModeInfo, m_ModeNumbers));<br>
> - if (Width == 0 || Height == 0 || BitsPerPixel != VGA_BPP)<br>
> - {<br>
> - Width = MIN_WIDTH_SIZE;<br>
> - Height = MIN_HEIGHT_SIZE;<br>
> - BitsPerPixel = VGA_BPP;<br>
> - }<br>
> for (CurrentMode = 0, SuitableModeCount = 0;<br>
> CurrentMode < ModeCount;<br>
> CurrentMode++)<br>
> @@ -2621,7 +2588,7 @@ NTSTATUS VgaDevice::HWInit(PCM_<wbr>RESOURCE_LIST pResList,<br>
> DXGK_DISPLAY_INFORMATION*<br>
><br>
> DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));<br>
> UNREFERENCED_PARAMETER(<wbr>pResList);<br>
> - UNREFERENCED_PARAMETER(<wbr>pDispInfo);<br>
> + AcquireDisplayInfo(*(<wbr>pDispInfo));<br>
> DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));<br>
> return GetModeList(pDispInfo);<br>
> }<br>
> @@ -3391,6 +3358,7 @@ NTSTATUS QxlDevice::QxlInit(DXGK_<wbr>DISPLAY_INFORMATION*<br>
> pDispInfo)<br>
> CreateMemSlots();<br>
> InitDeviceMemoryResources();<br>
> InitMonitorConfig();<br>
> + Status = AcquireDisplayInfo(*(<wbr>pDispInfo));<br>
> return Status;<br>
> }<br>
><br>
> @@ -4835,3 +4803,35 @@ UINT SpiceFromPixelFormat(<wbr>D3DDDIFORMAT Format)<br>
> default: QXL_LOG_ASSERTION1("Unknown D3DDDIFORMAT 0x%I64x", Format);<br>
> return 0;<br>
> }<br>
> }<br>
> +<br>
> +NTSTATUS HwDeviceInterface::<wbr>AcquireDisplayInfo(DXGK_<wbr>DISPLAY_INFORMATION&<br>
> DispInfo)<br>
> +{<br>
> + NTSTATUS Status = STATUS_SUCCESS;<br>
> + PHYSICAL_ADDRESS PhysicAddress;<br>
> + if (GetId() == 0)<br>
> + {<br>
> + Status = m_pQxlDod->AcquireDisplayInfo(<wbr>DispInfo);<br>
> + }<br>
> +<br>
> + if (!NT_SUCCESS(Status))<br>
> + {<br>
> + DbgPrint(TRACE_LEVEL_ERROR, ("<wbr>DxgkCbAcquirePostDisplayOwners<wbr>hip<br>
> failed with status 0x%X Width = %d\n",<br>
> + Status, DispInfo.Width));<br>
<br>
</div></div>In this function you don't call DxgkCbAcquirePostDisplayOwners<wbr>hip but<br>
QxlDod::AcquireDisplayInfo which calls DxgkCbAcquirePostDisplayOwners<wbr>hip.<br>
I would either change the message or rename QxlDod::AcquireDisplayInfo<br>
to QxlDod::<wbr>DxgkCbAcquirePostDisplayOwners<wbr>hip.<br>
<div><div class="h5"><br>
> + return STATUS_UNSUCCESSFUL;<br>
> + }<br>
> + PhysicAddress.QuadPart = DispInfo.PhysicAddress.<wbr>QuadPart;<br>
> +<br>
> + if (DispInfo.Width == 0)<br>
> + {<br>
> + DispInfo.Width = MIN_WIDTH_SIZE;<br>
> + DispInfo.Height = MIN_HEIGHT_SIZE;<br>
> + DispInfo.Pitch = BPPFromPixelFormat(D3DDDIFMT_<wbr>R8G8B8) / 8;<br>
> + DispInfo.ColorFormat = D3DDDIFMT_R8G8B8;<br>
> + DispInfo.TargetId = 0;<br>
> + if (PhysicAddress.QuadPart != 0L)<br>
> + {<br>
> + DispInfo.PhysicAddress.<wbr>QuadPart = PhysicAddress.QuadPart;<br>
> + }<br>
> + }<br>
> + return Status;<br>
> +}<br>
> diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h<br>
> index bf16724..cd2032c 100755<br>
> --- a/qxldod/QxlDod.h<br>
> +++ b/qxldod/QxlDod.h<br>
> @@ -250,6 +250,7 @@ public:<br>
> virtual NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE*<br>
> pSetPointerShape) = 0;<br>
> virtual NTSTATUS SetPointerPosition(_In_ CONST<br>
> DXGKARG_SETPOINTERPOSITION* pSetPointerPosition) = 0;<br>
> virtual NTSTATUS Escape(_In_ CONST DXGKARG_ESCAPE* pEscap) = 0;<br>
> + NTSTATUS AcquireDisplayInfo(DXGK_<wbr>DISPLAY_INFORMATION& DispInfo);<br>
> ULONG GetId(void) { return m_Id; }<br>
> protected:<br>
> virtual NTSTATUS GetModeList(DXGK_DISPLAY_<wbr>INFORMATION* pDispInfo) = 0;<br>
> @@ -704,6 +705,7 @@ public:<br>
> _In_<br>
> INT<br>
> PositionX,<br>
> _In_<br>
> INT<br>
> PositionY);<br>
> PDXGKRNL_INTERFACE GetDxgkInterface(void) { return &m_DxgkInterface;}<br>
> + NTSTATUS AcquireDisplayInfo(DXGK_<wbr>DISPLAY_INFORMATION& DispInfo) { return<br>
> m_DxgkInterface.<wbr>DxgkCbAcquirePostDisplayOwners<wbr>hip(m_DxgkInterface.<wbr>DeviceHandle,<br>
> &(DispInfo)); }<br>
<br>
</div></div>you could use &DispInfo instead of &(DispInfo), feel free to ignore, just<br>
minor style.<br>
<div class="HOEnZb"><div class="h5"><br>
> private:<br>
> VOID CleanUp(VOID);<br>
> NTSTATUS CheckHardware();<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">Frediano<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font size="4" color="#0b5394" face="times new roman, serif">Respectfully,<br></font><div style="font-size:12.8px;color:rgb(136,136,136)"><font size="4" color="#0b5394" face="times new roman, serif"><b><i>Sameeh Jubran</i></b></font></div><div style="font-size:12.8px;color:rgb(136,136,136)"><i style="color:rgb(7,55,99);font-family:"times new roman",serif;font-size:large"><span style="line-height:15px"><a href="https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a" title="View public profile" name="UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_14e2c1de96f8c195_UNIQUE_ID_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_webProfileURL" style="color:rgb(17,85,204);margin:0px;padding:0px;border-width:0px;outline:none;vertical-align:baseline;text-decoration:none" target="_blank">Linkedin</a></span></i><br></div><div style="font-size:12.8px;color:rgb(136,136,136)"><font size="4" face="times new roman, serif" color="#073763"><i>Software Engineer @ <a href="http://www.daynix.com" target="_blank">Daynix</a>.</i></font></div></div></div></div></div></div></div></div></div>
</div></div>