[Spice-devel] [PATCH qxl-wddm-dod 18/26] Replacing <#ifdef USE_FRAMEBUFFER> with runtime logic
Sameeh Jubran
sameeh at daynix.com
Mon Sep 5 07:48:10 UTC 2016
On Tue, Aug 30, 2016 at 6:54 PM, Christophe Fergeau <cfergeau at redhat.com <mailto:cfergeau at redhat.com> > wrote:
Shouldn't this be merged with patch 14 somehow as it is introducing
these #ifdef USE_FRAMEBUFFER in the first place?
Ture, thanks!
Christophe
On Tue, Aug 09, 2016 at 06:31:06PM +0300, Sameeh Jubran wrote:
> From: Dmitry Fleytman <dmitry at daynix.com <mailto:dmitry at daynix.com> >
>
> Framebuffer should only be used in VGA mode,
> however the mode is only known at runtime therefore
> framebuffer logic should be active when the driver
> is operating in vga mode only.
>
> Signed-off-by: Sameeh Jubran <sameeh at daynix.com <mailto:sameeh at daynix.com> >
> Signed-off-by: Dmitry Fleytman <dmitry at daynix.com <mailto:dmitry at daynix.com> >
> ---
> qxldod/QxlDod.cpp | 21 +++++++++++----------
> qxldod/QxlDod.h | 1 +
> 2 files changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
> index 74cd259..557d796 100755
> --- a/qxldod/QxlDod.cpp
> +++ b/qxldod/QxlDod.cpp
> @@ -218,9 +218,10 @@ VOID QxlDod::CleanUp(VOID)
> {
> if (m_CurrentModes[Source].FrameBuffer.Ptr)
> {
> -#ifdef USE_FRAMEBUFFER
> - UnmapFrameBuffer(m_CurrentModes[Source].FrameBuffer.Ptr, m_CurrentModes[Source].DispInfo.Height * m_CurrentModes[Source].DispInfo.Pitch);
> -#endif
> + if (m_pHWDevice->GetType() == VGA_DEVICE)
> + {
> + UnmapFrameBuffer(m_CurrentModes[Source].FrameBuffer.Ptr, m_CurrentModes[Source].DispInfo.Height * m_CurrentModes[Source].DispInfo.Pitch);
> + }
> m_CurrentModes[Source].FrameBuffer.Ptr = NULL;
> m_CurrentModes[Source].Flags.FrameBufferIsActive = FALSE;
> }
> @@ -1395,10 +1396,11 @@ NTSTATUS QxlDod::CommitVidPn(_In_ CONST DXGKARG_COMMITVIDPN* CONST pCommitVidPn)
> if (m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr &&
> !m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].Flags.DoNotMapOrUnmap)
> {
> -#ifdef USE_FRAMEBUFFER
> - Status = UnmapFrameBuffer(m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr,
> - m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Pitch * m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Height);
> -#endif
> + if (m_pHWDevice->GetType() == VGA_DEVICE)
> + {
> + Status = UnmapFrameBuffer(m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr,
> + m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Pitch * m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Height);
> + }
> m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr = NULL;
> m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].Flags.FrameBufferIsActive = FALSE;
>
> @@ -1525,8 +1527,7 @@ NTSTATUS QxlDod::SetSourceModeAndPath(CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMo
> pCurrentBddMode->DispInfo.Height = pSourceMode->Format.Graphics. <http://Format.Graphics.PrimSurfSize.cy> PrimSurfSize.cy;
> pCurrentBddMode->DispInfo.Pitch = pSourceMode->Format.Graphics. <http://Format.Graphics.PrimSurfSize.cx> PrimSurfSize.cx * BPPFromPixelFormat(pCurrentBddMode->DispInfo.ColorFormat) / BITS_PER_BYTE;
>
> -#ifdef USE_FRAMEBUFFER
> - if (!pCurrentBddMode->Flags.DoNotMapOrUnmap)
> + if (m_pHWDevice->GetType() == VGA_DEVICE && !pCurrentBddMode->Flags.DoNotMapOrUnmap)
> {
> // Map the new frame buffer
> QXL_ASSERT(pCurrentBddMode->FrameBuffer.Ptr == NULL);
> @@ -1534,7 +1535,7 @@ NTSTATUS QxlDod::SetSourceModeAndPath(CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMo
> pCurrentBddMode->DispInfo.Pitch * pCurrentBddMode->DispInfo.Height,
> &(pCurrentBddMode->FrameBuffer.Ptr));
> }
> -#endif
> +
> if (NT_SUCCESS(Status))
> {
>
> diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
> index 19d172f..e5cb410 100755
> --- a/qxldod/QxlDod.h
> +++ b/qxldod/QxlDod.h
> @@ -263,6 +263,7 @@ public:
> virtual NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition) = 0;
> virtual NTSTATUS Escape(_In_ CONST DXGKARG_ESCAPE* pEscap) = 0;
> ULONG GetId(void) { return m_Id; }
> + WIN_QXL_DEVICE_TYPE GetType(void) { return m_type; }
> protected:
> virtual NTSTATUS GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo) = 0;
> protected:
> --
> 2.7.0.windows.1
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop. <mailto:Spice-devel at lists.freedesktop.org> org
> https://lists.freedesktop.org/ <https://lists.freedesktop.org/mailman/listinfo/spice-devel> mailman/listinfo/spice-devel
--
Respectfully,
Sameeh Jubran
Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>
Junior Software Engineer @ Daynix <http://www.daynix.com> .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160905/413697ef/attachment-0004.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001.txt
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160905/413697ef/attachment-0002.txt>
More information about the Spice-devel
mailing list