This patch should be merged to "Compute dynamically slot_id in PA and VA functions" but I kept split for now to not conflict with other patchset currently in review progress. Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- qxldod/QxlDod.cpp | 30 +++++++++++++++--------------- qxldod/QxlDod.h | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp index 7b28090..4191525 100755 --- a/qxldod/QxlDod.cpp +++ b/qxldod/QxlDod.cpp @@ -3560,7 +3560,7 @@ void QxlDevice::CreatePrimarySurface(PVIDEO_MODE_INFORMATION pModeInfo) primary_surface_create->height = pModeInfo->VisScreenHeight; primary_surface_create->stride = pModeInfo->ScreenStride; - primary_surface_create->mem = PA( m_RamStart, m_MainMemSlot); + primary_surface_create->mem = PA(m_RamStart); primary_surface_create->flags = 0; primary_surface_create->type = QXL_SURF_TYPE_PRIMARY; @@ -3580,7 +3580,7 @@ void QxlDevice::DestroyPrimarySurface(void) DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__)); } -inline QXLPHYSICAL QxlDevice::PA(PVOID virt, UINT8) +inline QXLPHYSICAL QxlDevice::PA(PVOID virt) { PAGED_CODE(); DbgPrint(TRACE_LEVEL_VERBOSE, ("<--> %s\n", __FUNCTION__)); @@ -3591,7 +3591,7 @@ inline QXLPHYSICAL QxlDevice::PA(PVOID virt, UINT8) return pSlot->high_bits | ((UINT8*)virt - pSlot->start_virt_addr); } -inline UINT8 *QxlDevice::VA(QXLPHYSICAL paddr, UINT8) +inline UINT8 *QxlDevice::VA(QXLPHYSICAL paddr) { PAGED_CODE(); DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__)); @@ -3734,7 +3734,7 @@ void QxlDevice::InitMonitorConfig(void) RtlZeroMemory(m_monitor_config, config_size); m_monitor_config_pa = &m_RamHdr->monitors_config; - *m_monitor_config_pa = PA(m_monitor_config, m_MainMemSlot); + *m_monitor_config_pa = PA(m_monitor_config); } void QxlDevice::InitMspace(UINT32 mspace_type, UINT8 *start, size_t capacity) @@ -4155,7 +4155,7 @@ BOOL QxlDevice::SetClip(const RECT *clip, QXLDrawable *drawable) DrawableAddRes(drawable, rects_res); drawable->clip.type = SPICE_CLIP_TYPE_RECTS; - drawable->clip.data = PA(rects_res->res, m_SurfaceMemSlot); + drawable->clip.data = PA(rects_res->res); return TRUE; } @@ -4200,7 +4200,7 @@ void QxlDevice::FreeClipRects(Resource *res) chunk_phys = ((QXLClipRects *)res->res)->chunk.next_chunk; while (chunk_phys) { - QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_SurfaceMemSlot); + QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys); chunk_phys = chunk->next_chunk; FreeMem(chunk); } @@ -4227,7 +4227,7 @@ void QxlDevice::FreeBitmapImage(Resource *res) chunk_phys = ((QXLDataChunk *)(&internal->image.bitmap + 1))->next_chunk; while (chunk_phys) { - QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_SurfaceMemSlot); + QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys); chunk_phys = chunk->next_chunk; FreeMem(chunk); } @@ -4252,7 +4252,7 @@ void QxlDevice::FreeCursor(Resource *res) DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__)); chunk_phys = ((InternalCursor *)res->res)->cursor.chunk.next_chunk; while (chunk_phys) { - QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_SurfaceMemSlot); + QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys); chunk_phys = chunk->next_chunk; FreeMem(chunk); } @@ -4300,7 +4300,7 @@ void QxlDevice::PushDrawable(QXLDrawable *drawable) WaitForCmdRing(); cmd = SPICE_RING_PROD_ITEM(m_CommandRing); cmd->type = QXL_CMD_DRAW; - cmd->data = PA(drawable, m_SurfaceMemSlot); + cmd->data = PA(drawable); PushCmd(); ReleaseMutex(&m_CmdLock, locked); DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__)); @@ -4318,7 +4318,7 @@ void QxlDevice::PushCursorCmd(QXLCursorCmd *cursor_cmd) WaitForCursorRing(); cmd = SPICE_RING_PROD_ITEM(m_CursorRing); cmd->type = QXL_CMD_CURSOR; - cmd->data = PA(cursor_cmd, m_SurfaceMemSlot); + cmd->data = PA(cursor_cmd); PushCursor(); ReleaseMutex(&m_CrsLock, locked); DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__)); @@ -4426,7 +4426,7 @@ QXLDrawable *QxlDevice::PrepareBltBits ( chunk->data_size = 0; chunk->prev_chunk = 0; chunk->next_chunk = 0; - internal->image.bitmap.data = PA(chunk, m_SurfaceMemSlot); + internal->image.bitmap.data = PA(chunk); internal->image.bitmap.flags = 0; internal->image.descriptor.width = internal->image.bitmap.x = width; internal->image.descriptor.height = internal->image.bitmap.y = height; @@ -4449,7 +4449,7 @@ QXLDrawable *QxlDevice::PrepareBltBits ( internal->image.bitmap.palette = 0; - drawable->u.copy.src_bitmap = PA(&internal->image, m_SurfaceMemSlot); + drawable->u.copy.src_bitmap = PA(&internal->image); CopyRect(&drawable->surfaces_rects[1], pRect); DrawableAddRes(drawable, image_res); @@ -4483,8 +4483,8 @@ VOID QxlDevice::PutBytesAlign(QXLDataChunk **chunk_ptr, UINT8 **now_ptr, aligned_size -= aligned_size % alignment; void *ptr = AllocMem(MSPACE_TYPE_VRAM, size + sizeof(QXLDataChunk), TRUE); - chunk->next_chunk = PA(ptr, m_SurfaceMemSlot); - ((QXLDataChunk *)ptr)->prev_chunk = PA(chunk, m_SurfaceMemSlot); + chunk->next_chunk = PA(ptr); + ((QXLDataChunk *)ptr)->prev_chunk = PA(chunk); chunk = (QXLDataChunk *)ptr; chunk->data_size = 0; chunk->next_chunk = 0; @@ -4614,7 +4614,7 @@ NTSTATUS QxlDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPoi } CursorCmdAddRes(cursor_cmd, res); RELEASE_RES(res); - cursor_cmd->u.set.shape = PA(&internal->cursor, m_SurfaceMemSlot); + cursor_cmd->u.set.shape = PA(&internal->cursor); PushCursorCmd(cursor_cmd); DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__)); diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h index 6eef85d..ac70208 100755 --- a/qxldod/QxlDod.h +++ b/qxldod/QxlDod.h @@ -577,8 +577,8 @@ private: void SetupMemSlot(UINT8 Idx, UINT64 pastart, UINT64 paend, UINT8 *vastart, UINT8 *valast); BOOL CreateEvents(void); BOOL CreateRings(void); - inline UINT8 *VA(QXLPHYSICAL paddr, UINT8 slot_id); - inline QXLPHYSICAL PA(PVOID virt, UINT8 slot_id); + inline UINT8 *VA(QXLPHYSICAL paddr); + inline QXLPHYSICAL PA(PVOID virt); void InitDeviceMemoryResources(void); void InitMonitorConfig(); void InitMspace(UINT32 mspace_type, UINT8 *start, size_t capacity); -- 2.9.3 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel