From e6aba41c04d86a2b7ca54af32cfa9da2c1ed3982 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Thu, 24 Oct 2024 02:07:59 -0700 Subject: [PATCH] viogpu: Cosmetic changes for CtrlQueue functions Based on https://github.com/virtio-win/kvm-guest-drivers-windows/pull/943 Signed-off-by: Max Ramanouski Signed-off-by: Kostiantyn Kostiuk --- viogpu/common/viogpu_queue.cpp | 4 ++-- viogpu/common/viogpu_queue.h | 5 +++-- viogpu/viogpudo/viogpudo.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/viogpu/common/viogpu_queue.cpp b/viogpu/common/viogpu_queue.cpp index c8a5f89d3..c5593770b 100755 --- a/viogpu/common/viogpu_queue.cpp +++ b/viogpu/common/viogpu_queue.cpp @@ -411,7 +411,7 @@ void CtrlQueue::AttachBacking(UINT res_id, PGPU_MEM_ENTRY ents, UINT nents) PAGED_CODE_SEG_END -void CtrlQueue::UnrefResource(UINT res_id) +void CtrlQueue::DestroyResource(UINT res_id) { DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__)); @@ -428,7 +428,7 @@ void CtrlQueue::UnrefResource(UINT res_id) DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__)); } -void CtrlQueue::InvalBacking(UINT res_id) +void CtrlQueue::DetachBacking(UINT res_id) { DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__)); diff --git a/viogpu/common/viogpu_queue.h b/viogpu/common/viogpu_queue.h index 656791225..449a2d777 100755 --- a/viogpu/common/viogpu_queue.h +++ b/viogpu/common/viogpu_queue.h @@ -190,12 +190,13 @@ class CtrlQueue : public VioGpuQueue PGPU_VBUFFER DequeueBuffer(_Out_ UINT* len); void CreateResource(UINT res_id, UINT format, UINT width, UINT height); - void UnrefResource(UINT id); - void InvalBacking(UINT id); + void DestroyResource(UINT id); void SetScanout(UINT scan_id, UINT res_id, UINT width, UINT height, UINT x, UINT y); void ResFlush(UINT res_id, UINT width, UINT height, UINT x, UINT y); void TransferToHost2D(UINT res_id, ULONG offset, UINT width, UINT height, UINT x, UINT y); void AttachBacking(UINT res_id, PGPU_MEM_ENTRY ents, UINT nents); + void DetachBacking(UINT id); + BOOLEAN GetDisplayInfo(PGPU_VBUFFER buf, UINT id, PULONG xres, PULONG yres); BOOLEAN AskDisplayInfo(PGPU_VBUFFER* buf); BOOLEAN AskEdidInfo(PGPU_VBUFFER* buf, UINT id); diff --git a/viogpu/viogpudo/viogpudo.cpp b/viogpu/viogpudo/viogpudo.cpp index b08f9ee9d..7e850202c 100755 --- a/viogpu/viogpudo/viogpudo.cpp +++ b/viogpu/viogpudo/viogpudo.cpp @@ -3168,8 +3168,8 @@ void VioGpuAdapter::DestroyFrameBufferObj(BOOLEAN bReset) if (m_pFrameBuf != NULL) { resid = (UINT)m_pFrameBuf->GetId(); - m_CtrlQueue.InvalBacking(resid); - m_CtrlQueue.UnrefResource(resid); + m_CtrlQueue.DetachBacking(resid); + m_CtrlQueue.DestroyResource(resid); if (bReset == TRUE) { m_CtrlQueue.SetScanout(0, 0, 0, 0, 0, 0); } @@ -3498,8 +3498,8 @@ void VioGpuAdapter::DestroyCursor() if (m_pCursorBuf != NULL) { UINT id = (UINT)m_pCursorBuf->GetId(); - m_CtrlQueue.InvalBacking(id); - m_CtrlQueue.UnrefResource(id); + m_CtrlQueue.DetachBacking(id); + m_CtrlQueue.DestroyResource(id); delete m_pCursorBuf; m_pCursorBuf = NULL; m_Idr.PutId(id);