mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 02:15:45 +01:00 
			
		
		
		
	video: arm: rpi: Bail out early if querying video information fails
When probing we query for the width and hight of the display. If the firmware does not report any connected display the system will crash. See https://github.com/raspberrypi/firmware/issues/1157 for details. Signed-off-by: Fabian Vogt <fvogt@suse.com> [mb: update commit message] Signed-off-by: Matthias Brugger <mbrugger@suse.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Andre Przywara <andre.przywara@arm.com>
This commit is contained in:
		
				
					committed by
					
						 Anatolij Gustschin
						Anatolij Gustschin
					
				
			
			
				
	
			
			
			
						parent
						
							60a62acfb0
						
					
				
				
					commit
					970baf16d1
				
			| @@ -19,13 +19,15 @@ static int bcm2835_video_probe(struct udevice *dev) | |||||||
|  |  | ||||||
| 	debug("bcm2835: Query resolution...\n"); | 	debug("bcm2835: Query resolution...\n"); | ||||||
| 	ret = bcm2835_get_video_size(&w, &h); | 	ret = bcm2835_get_video_size(&w, &h); | ||||||
| 	if (ret) | 	if (ret || w == 0 || h == 0) | ||||||
| 		return -EIO; | 		return -EIO; | ||||||
|  |  | ||||||
| 	debug("bcm2835: Setting up display for %d x %d\n", w, h); | 	debug("bcm2835: Setting up display for %d x %d\n", w, h); | ||||||
| 	ret = bcm2835_set_video_params(&w, &h, 32, BCM2835_MBOX_PIXEL_ORDER_RGB, | 	ret = bcm2835_set_video_params(&w, &h, 32, BCM2835_MBOX_PIXEL_ORDER_RGB, | ||||||
| 				       BCM2835_MBOX_ALPHA_MODE_IGNORED, | 				       BCM2835_MBOX_ALPHA_MODE_IGNORED, | ||||||
| 				       &fb_base, &fb_size, &pitch); | 				       &fb_base, &fb_size, &pitch); | ||||||
|  | 	if (ret) | ||||||
|  | 		return -EIO; | ||||||
|  |  | ||||||
| 	debug("bcm2835: Final resolution is %d x %d\n", w, h); | 	debug("bcm2835: Final resolution is %d x %d\n", w, h); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user