All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] video: arm: rpi: Bail out early if querying video information fails
@ 2019-07-11 14:56 matthias.bgg at kernel.org
  2019-07-26 13:59 ` Andre Przywara
  2019-07-29  9:21 ` Anatolij Gustschin
  0 siblings, 2 replies; 3+ messages in thread
From: matthias.bgg at kernel.org @ 2019-07-11 14:56 UTC (permalink / raw)
  To: u-boot

From: Fabian Vogt <fvogt@suse.com>

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>
---
 drivers/video/bcm2835.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
index bc41090aed..1d2eda084c 100644
--- a/drivers/video/bcm2835.c
+++ b/drivers/video/bcm2835.c
@@ -19,13 +19,15 @@ static int bcm2835_video_probe(struct udevice *dev)
 
 	debug("bcm2835: Query resolution...\n");
 	ret = bcm2835_get_video_size(&w, &h);
-	if (ret)
+	if (ret || w == 0 || h == 0)
 		return -EIO;
 
 	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,
 				       BCM2835_MBOX_ALPHA_MODE_IGNORED,
 				       &fb_base, &fb_size, &pitch);
+	if (ret)
+		return -EIO;
 
 	debug("bcm2835: Final resolution is %d x %d\n", w, h);
 
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] video: arm: rpi: Bail out early if querying video information fails
  2019-07-11 14:56 [U-Boot] [PATCH] video: arm: rpi: Bail out early if querying video information fails matthias.bgg at kernel.org
@ 2019-07-26 13:59 ` Andre Przywara
  2019-07-29  9:21 ` Anatolij Gustschin
  1 sibling, 0 replies; 3+ messages in thread
From: Andre Przywara @ 2019-07-26 13:59 UTC (permalink / raw)
  To: u-boot

On Thu, 11 Jul 2019 16:56:24 +0200
matthias.bgg at kernel.org wrote:

Hi,

> From: Fabian Vogt <fvogt@suse.com>
> 
> 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>

We could just propagate the value of ret instead of coalescing every error
to EIO, but that's just a nit, so:

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>

I think this should be merged now, as on the RPi4 this is somewhat of a
showstopper, because we don't have PCIe yet, so no USB, and no keyboard
support. Which means serial console is the only way to control U-Boot.

Cheers,
Andre.

> ---
>  drivers/video/bcm2835.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
> index bc41090aed..1d2eda084c 100644
> --- a/drivers/video/bcm2835.c
> +++ b/drivers/video/bcm2835.c
> @@ -19,13 +19,15 @@ static int bcm2835_video_probe(struct udevice *dev)
>  
>  	debug("bcm2835: Query resolution...\n");
>  	ret = bcm2835_get_video_size(&w, &h);
> -	if (ret)
> +	if (ret || w == 0 || h == 0)
>  		return -EIO;
>  
>  	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,
>  				       BCM2835_MBOX_ALPHA_MODE_IGNORED,
>  				       &fb_base, &fb_size, &pitch);
> +	if (ret)
> +		return -EIO;
>  
>  	debug("bcm2835: Final resolution is %d x %d\n", w, h);
>  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] video: arm: rpi: Bail out early if querying video information fails
  2019-07-11 14:56 [U-Boot] [PATCH] video: arm: rpi: Bail out early if querying video information fails matthias.bgg at kernel.org
  2019-07-26 13:59 ` Andre Przywara
@ 2019-07-29  9:21 ` Anatolij Gustschin
  1 sibling, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2019-07-29  9:21 UTC (permalink / raw)
  To: u-boot

On Thu, 11 Jul 2019 16:56:24 +0200
matthias.bgg at kernel.org matthias.bgg at kernel.org wrote:
...
>  drivers/video/bcm2835.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied to u-boot-video/master, thanks!

--
Anatolij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-29  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 14:56 [U-Boot] [PATCH] video: arm: rpi: Bail out early if querying video information fails matthias.bgg at kernel.org
2019-07-26 13:59 ` Andre Przywara
2019-07-29  9:21 ` Anatolij Gustschin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.