All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rpi: Conditionally add simple-framebuffer node
@ 2021-08-10 14:31 Ivan T. Ivanov
  2021-08-13  7:04 ` Ivan T. Ivanov
  2021-09-15 11:35 ` Matthias Brugger
  0 siblings, 2 replies; 3+ messages in thread
From: Ivan T. Ivanov @ 2021-08-10 14:31 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Nicolas Saenz Julienne, Peter Robinson, Marek Szyprowski,
	Jaehoon Chung, Ivan T . Ivanov, u-boot

It appears that RPi firmware has already added framebuffer
node under /chosen, at least on RPi 2 versions. So check
for this and don't add duplicate node.

Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
---
 board/raspberrypi/rpi/rpi.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index df52a4689f..372b26b6f2 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -497,12 +497,11 @@ void *board_fdt_blob_setup(void)
 
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
-	/*
-	 * For now, we simply always add the simplefb DT node. Later, we
-	 * should be more intelligent, and e.g. only do this if no enabled DT
-	 * node exists for the "real" graphics driver.
-	 */
-	lcd_dt_simplefb_add_node(blob);
+	int node;
+
+	node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
+	if (node < 0)
+		lcd_dt_simplefb_add_node(blob);
 
 #ifdef CONFIG_EFI_LOADER
 	/* Reserve the spin table */
-- 
2.32.0


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

* Re: [PATCH] rpi: Conditionally add simple-framebuffer node
  2021-08-10 14:31 [PATCH] rpi: Conditionally add simple-framebuffer node Ivan T. Ivanov
@ 2021-08-13  7:04 ` Ivan T. Ivanov
  2021-09-15 11:35 ` Matthias Brugger
  1 sibling, 0 replies; 3+ messages in thread
From: Ivan T. Ivanov @ 2021-08-13  7:04 UTC (permalink / raw)
  To: Nicolas Saenz Julienne
  Cc: Matthias Brugger, Peter Robinson, Marek Szyprowski,
	Jaehoon Chung, u-boot

Hi,

Quoting Ivan T. Ivanov (2021-08-10 17:31:14)
> It appears that RPi firmware has already added framebuffer
> node under /chosen, at least on RPi 2 versions. So check
> for this and don't add duplicate node.
> 
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> ---
>  board/raspberrypi/rpi/rpi.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
> index df52a4689f..372b26b6f2 100644
> --- a/board/raspberrypi/rpi/rpi.c
> +++ b/board/raspberrypi/rpi/rpi.c
> @@ -497,12 +497,11 @@ void *board_fdt_blob_setup(void)
>  
>  int ft_board_setup(void *blob, struct bd_info *bd)
>  {
> -       /*
> -        * For now, we simply always add the simplefb DT node. Later, we
> -        * should be more intelligent, and e.g. only do this if no enabled DT
> -        * node exists for the "real" graphics driver.
> -        */
> -       lcd_dt_simplefb_add_node(blob);
> +       int node;
> +
> +       node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
> +       if (node < 0)
> +               lcd_dt_simplefb_add_node(blob);
>  
>  #ifdef CONFIG_EFI_LOADER
>         /* Reserve the spin table */

Could someone take a look into this fix, please.

BTW, original message still awaits list moderator approval.

Thank you!
Ivan

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

* Re: [PATCH] rpi: Conditionally add simple-framebuffer node
  2021-08-10 14:31 [PATCH] rpi: Conditionally add simple-framebuffer node Ivan T. Ivanov
  2021-08-13  7:04 ` Ivan T. Ivanov
@ 2021-09-15 11:35 ` Matthias Brugger
  1 sibling, 0 replies; 3+ messages in thread
From: Matthias Brugger @ 2021-09-15 11:35 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Nicolas Saenz Julienne, Peter Robinson, Marek Szyprowski,
	Jaehoon Chung, u-boot



On 10/08/2021 16:31, Ivan T. Ivanov wrote:
> It appears that RPi firmware has already added framebuffer
> node under /chosen, at least on RPi 2 versions. So check
> for this and don't add duplicate node.
> 
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>

Applied to rpi-next now.

Thanks,
Matthias

> ---
>   board/raspberrypi/rpi/rpi.c | 11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
> index df52a4689f..372b26b6f2 100644
> --- a/board/raspberrypi/rpi/rpi.c
> +++ b/board/raspberrypi/rpi/rpi.c
> @@ -497,12 +497,11 @@ void *board_fdt_blob_setup(void)
>   
>   int ft_board_setup(void *blob, struct bd_info *bd)
>   {
> -	/*
> -	 * For now, we simply always add the simplefb DT node. Later, we
> -	 * should be more intelligent, and e.g. only do this if no enabled DT
> -	 * node exists for the "real" graphics driver.
> -	 */
> -	lcd_dt_simplefb_add_node(blob);
> +	int node;
> +
> +	node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
> +	if (node < 0)
> +		lcd_dt_simplefb_add_node(blob);
>   
>   #ifdef CONFIG_EFI_LOADER
>   	/* Reserve the spin table */
> 


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

end of thread, other threads:[~2021-09-15 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 14:31 [PATCH] rpi: Conditionally add simple-framebuffer node Ivan T. Ivanov
2021-08-13  7:04 ` Ivan T. Ivanov
2021-09-15 11:35 ` Matthias Brugger

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.