mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 21:43:40 +00:00
[all] align the frame data to the page boundary
This commit is contained in:
parent
17df1ebc6b
commit
9846762991
@ -109,6 +109,7 @@ static int frameThread(void * opaque)
|
||||
bool repeatFrame = false;
|
||||
int frameIndex = 0;
|
||||
CaptureFrame frame = { 0 };
|
||||
const long pageSize = sysinfo_getPageSize();
|
||||
|
||||
(void)frameIndex;
|
||||
(void)repeatFrame;
|
||||
@ -182,9 +183,12 @@ static int frameThread(void * opaque)
|
||||
fi->height = frame.height;
|
||||
fi->stride = frame.stride;
|
||||
fi->pitch = frame.pitch;
|
||||
fi->offset = pageSize - sizeof(FrameBuffer);
|
||||
frameValid = true;
|
||||
|
||||
FrameBuffer fb = (FrameBuffer)(fi + 1);
|
||||
// put the framebuffer on the border of the next page
|
||||
// this is to allow for aligned DMA transfers by the receiver
|
||||
FrameBuffer fb = (FrameBuffer)(((uint8_t*)fi) + fi->offset);
|
||||
framebuffer_prepare(fb);
|
||||
|
||||
/* we post and then get the frame, this is intentional! */
|
||||
|
@ -440,7 +440,7 @@ static int frameThread(void * unused)
|
||||
updatePositionInfo();
|
||||
}
|
||||
|
||||
FrameBuffer fb = (FrameBuffer)(frame + 1);
|
||||
FrameBuffer fb = (FrameBuffer)(((uint8_t*)frame) + frame->offset);
|
||||
if (!state.lgr->on_frame_event(state.lgrData, lgrFormat, fb))
|
||||
{
|
||||
DEBUG_ERROR("renderer on frame event returned failure");
|
||||
|
@ -60,5 +60,6 @@ typedef struct KVMFRFrame
|
||||
uint32_t height; // the height
|
||||
uint32_t stride; // the row stride (zero if compressed data)
|
||||
uint32_t pitch; // the row pitch (stride in bytes or the compressed frame size)
|
||||
uint32_t offset; // offset from the start of this header to the FrameBuffer header
|
||||
}
|
||||
KVMFRFrame;
|
Loading…
Reference in New Issue
Block a user