From 93a6bfbef3c85c3449826d1fbdc9aa08faa1dc20 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 31 Jul 2012 11:20:11 +0800 Subject: [PATCH] Kernel - Fixed screen not updating in VT framebuffer mode --- KernelLand/Kernel/drvutil_video.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/KernelLand/Kernel/drvutil_video.c b/KernelLand/Kernel/drvutil_video.c index 05fa1026..2bee791f 100644 --- a/KernelLand/Kernel/drvutil_video.c +++ b/KernelLand/Kernel/drvutil_video.c @@ -265,12 +265,16 @@ int DrvUtil_Video_WriteLFB(tDrvUtil_Video_BufInfo *FBInfo, size_t Offset, size_t px = (void*)dest; } } + if( x > 0 ) { + dest += FBInfo->Pitch; + } } else { ofs = Offset; dest += ofs; memcpy(dest, Buffer, Length); + dest += Length; } break; default: @@ -293,9 +297,11 @@ int DrvUtil_Video_WriteLFB(tDrvUtil_Video_BufInfo *FBInfo, size_t Offset, size_t return -1; } if( FBInfo->BackBuffer && dest ) { - memcpy((char*)FBInfo->Framebuffer + ofs, (char*)FBInfo->BackBuffer + ofs, - ((tVAddr)dest - (tVAddr)FBInfo->BackBuffer) - ofs - ); + void *_dst = (char*)FBInfo->Framebuffer + ofs; + void *_src = (char*)FBInfo->BackBuffer + ofs; + size_t len = ((tVAddr)dest - (tVAddr)FBInfo->BackBuffer) - ofs; + // Log_Debug("DrvUtil", "Copy from BB %p to FB %p 0x%x bytes", _src, _dst, len); + memcpy(_dst, _src, len); } DrvUtil_Video_DrawCursor(FBInfo, csr_x, csr_y); -- 2.20.1