mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:52:45 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									56cd0f929e
								
							
						
					
					
						commit
						38af4c29e6
					
				
					 7 changed files with 123 additions and 31 deletions
				
			
		|  | @ -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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Tom
						Tom