summaryrefslogtreecommitdiff
path: root/Kernel/API
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-06-26 11:04:01 -0600
committerAndreas Kling <kling@serenityos.org>2021-06-27 09:46:27 +0200
commit38af4c29e69326c5aa7fab82f4870d03bc4f71f6 (patch)
tree88401a4952482bca628c52f46b5712151b64006a /Kernel/API
parent56cd0f929ef19fc19f50d9d45e2e1f43ef8ac755 (diff)
downloadserenity-38af4c29e69326c5aa7fab82f4870d03bc4f71f6.zip
WindowServer: Coalesce flushing buffers into one ioctl() call
We regularily need to flush many rectangles, so instead of making many expensive ioctl() calls to the framebuffer driver, collect the rectangles and only make one call. And if we have too many rectangles then it may be cheaper to just update the entire region, in which case we simply convert them all into a union and just flush that one rectangle instead.
Diffstat (limited to 'Kernel/API')
-rw-r--r--Kernel/API/FB.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/Kernel/API/FB.h b/Kernel/API/FB.h
index 94b6c07677..25b00e8809 100644
--- a/Kernel/API/FB.h
+++ b/Kernel/API/FB.h
@@ -38,9 +38,12 @@ ALWAYS_INLINE int fb_set_buffer(int fd, int index)
return ioctl(fd, FB_IOCTL_SET_BUFFER, index);
}
-ALWAYS_INLINE int fb_flush_buffer(int fd, FBRect* rect)
+ALWAYS_INLINE int fb_flush_buffers(int fd, FBRect const* rects, unsigned count)
{
- return ioctl(fd, FB_IOCTL_FLUSH_BUFFER, rect);
+ FBRects fb_rects;
+ fb_rects.count = count;
+ fb_rects.rects = rects;
+ return ioctl(fd, FB_IOCTL_FLUSH_BUFFERS, &fb_rects);
}
__END_DECLS