mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:12:45 +00:00 
			
		
		
		
	Kernel: Protect FramebufferDevice with spinlock instead of mutex
This commit is contained in:
		
							parent
							
								
									ddde9e7ee5
								
							
						
					
					
						commit
						ca42621be1
					
				
					 5 changed files with 18 additions and 19 deletions
				
			
		|  | @ -25,7 +25,7 @@ ErrorOr<size_t> FramebufferDevice::buffer_length(size_t head) const | |||
|     // We take care to verify this at the GenericFramebufferDevice::ioctl method
 | ||||
|     // so if we happen to accidentally have a value different than 0, assert.
 | ||||
|     VERIFY(head == 0); | ||||
|     MutexLocker locker(m_resolution_lock); | ||||
|     SpinlockLocker locker(m_resolution_lock); | ||||
|     return display_info().rect.width * display_info().rect.height * 4; | ||||
| } | ||||
| ErrorOr<size_t> FramebufferDevice::pitch(size_t head) const | ||||
|  | @ -34,7 +34,7 @@ ErrorOr<size_t> FramebufferDevice::pitch(size_t head) const | |||
|     // We take care to verify this at the GenericFramebufferDevice::ioctl method
 | ||||
|     // so if we happen to accidentally have a value different than 0, assert.
 | ||||
|     VERIFY(head == 0); | ||||
|     MutexLocker locker(m_resolution_lock); | ||||
|     SpinlockLocker locker(m_resolution_lock); | ||||
|     return display_info().rect.width * 4; | ||||
| } | ||||
| ErrorOr<size_t> FramebufferDevice::height(size_t head) const | ||||
|  | @ -43,7 +43,7 @@ ErrorOr<size_t> FramebufferDevice::height(size_t head) const | |||
|     // We take care to verify this at the GenericFramebufferDevice::ioctl method
 | ||||
|     // so if we happen to accidentally have a value different than 0, assert.
 | ||||
|     VERIFY(head == 0); | ||||
|     MutexLocker locker(m_resolution_lock); | ||||
|     SpinlockLocker locker(m_resolution_lock); | ||||
|     return display_info().rect.height; | ||||
| } | ||||
| ErrorOr<size_t> FramebufferDevice::width(size_t head) const | ||||
|  | @ -52,7 +52,7 @@ ErrorOr<size_t> FramebufferDevice::width(size_t head) const | |||
|     // We take care to verify this at the GenericFramebufferDevice::ioctl method
 | ||||
|     // so if we happen to accidentally have a value different than 0, assert.
 | ||||
|     VERIFY(head == 0); | ||||
|     MutexLocker locker(m_resolution_lock); | ||||
|     SpinlockLocker locker(m_resolution_lock); | ||||
|     return display_info().rect.width; | ||||
| } | ||||
| ErrorOr<size_t> FramebufferDevice::vertical_offset(size_t head) const | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling