diff mbox series

[02/14] video: nokia_rx51: Drop obsolete video code

Message ID 20220123140415.3091482-3-sjg@chromium.org
State Superseded
Delegated to: Anatolij Gustschin
Headers show
Series video: Drop old CFB code | expand

Commit Message

Simon Glass Jan. 23, 2022, 2:04 p.m. UTC
Drop this code which uses a header that is about to be deleted.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 board/nokia/rx51/rx51.c      | 19 -------------------
 configs/nokia_rx51_defconfig |  1 -
 include/configs/nokia_rx51.h | 11 -----------
 3 files changed, 31 deletions(-)

Comments

Pali Rohár Jan. 23, 2022, 2:08 p.m. UTC | #1
+ Maemo

On Sunday 23 January 2022 07:04:03 Simon Glass wrote:
> Drop this code which uses a header that is about to be deleted.

And what / where is the replacement?

> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  board/nokia/rx51/rx51.c      | 19 -------------------
>  configs/nokia_rx51_defconfig |  1 -
>  include/configs/nokia_rx51.h | 11 -----------
>  3 files changed, 31 deletions(-)
> 
> diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
> index 99ca36fbbea..45c569f83a3 100644
> --- a/board/nokia/rx51/rx51.c
> +++ b/board/nokia/rx51/rx51.c
> @@ -30,7 +30,6 @@
>  #include <malloc.h>
>  #include <twl4030.h>
>  #include <i2c.h>
> -#include <video_fb.h>
>  #include <asm/global_data.h>
>  #include <asm/io.h>
>  #include <asm/setup.h>
> @@ -61,8 +60,6 @@ struct emu_hal_params_rx51 {
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> -GraphicDevice gdev;
> -
>  const omap3_sysinfo sysinfo = {
>  	DDR_STACKED,
>  	"Nokia RX-51",
> @@ -341,22 +338,6 @@ void setup_board_tags(struct tag **in_params)
>  	*in_params = params;
>  }
>  
> -/*
> - * Routine: video_hw_init
> - * Description: Set up the GraphicDevice depending on sys_boot.
> - */
> -void *video_hw_init(void)
> -{
> -	/* fill in Graphic Device */
> -	gdev.frameAdrs = 0x8f9c0000;
> -	gdev.winSizeX = 800;
> -	gdev.winSizeY = 480;
> -	gdev.gdfBytesPP = 2;
> -	gdev.gdfIndex = GDF_16BIT_565RGB;
> -	memset((void *)gdev.frameAdrs, 0, 0xbb800);
> -	return (void *) &gdev;
> -}
> -
>  /*
>   * Routine: twl4030_regulator_set_mode
>   * Description: Set twl4030 regulator mode over i2c powerbus.
> diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig
> index 71b0b95c672..0ef5a84b3f3 100644
> --- a/configs/nokia_rx51_defconfig
> +++ b/configs/nokia_rx51_defconfig
> @@ -76,7 +76,6 @@ CONFIG_SPI=y
>  CONFIG_USB=y
>  CONFIG_USB_MUSB_UDC=y
>  CONFIG_USB_OMAP3=y
> -# CONFIG_VGA_AS_SINGLE_DEVICE is not set
>  CONFIG_SPLASH_SCREEN=y
>  CONFIG_WATCHDOG_TIMEOUT_MSECS=31000
>  CONFIG_WDT=y
> diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
> index adfc055a2c9..0163f3b9852 100644
> --- a/include/configs/nokia_rx51.h
> +++ b/include/configs/nokia_rx51.h
> @@ -70,17 +70,6 @@
>  
>  #define CONFIG_SYS_ONENAND_BASE		ONENAND_MAP
>  
> -/*
> - * Framebuffer
> - */
> -/* Video console */
> -#define VIDEO_FB_16BPP_PIXEL_SWAP
> -#define VIDEO_FB_16BPP_WORD_SWAP
> -
> -/* functions for cfb_console */
> -#define VIDEO_KBD_INIT_FCT		rx51_kp_init()
> -#define VIDEO_TSTC_FCT			rx51_kp_tstc
> -#define VIDEO_GETC_FCT			rx51_kp_getc
>  #ifndef __ASSEMBLY__
>  struct stdio_dev;
>  int rx51_kp_init(void);
> -- 
> 2.35.0.rc0.227.g00780c9af4-goog
>
Simon Glass Jan. 23, 2022, 2:36 p.m. UTC | #2
Hi Pali,

On Sun, 23 Jan 2022 at 07:08, Pali Rohár <pali@kernel.org> wrote:
>
> + Maemo
>
> On Sunday 23 January 2022 07:04:03 Simon Glass wrote:
> > Drop this code which uses a header that is about to be deleted.
>
> And what / where is the replacement?

This is DM_VIDEO. There are quite a few example drivers in
drivers/video - perhaps the mxsfb.c one is a reasonable example. See
the top of video_uclass.c for how frame-buffer allocation works.

Regards,
Simon
Pali Rohár Jan. 23, 2022, 2:57 p.m. UTC | #3
On Sunday 23 January 2022 07:36:22 Simon Glass wrote:
> Hi Pali,
> 
> On Sun, 23 Jan 2022 at 07:08, Pali Rohár <pali@kernel.org> wrote:
> >
> > + Maemo
> >
> > On Sunday 23 January 2022 07:04:03 Simon Glass wrote:
> > > Drop this code which uses a header that is about to be deleted.
> >
> > And what / where is the replacement?
> 
> This is DM_VIDEO. There are quite a few example drivers in
> drivers/video - perhaps the mxsfb.c one is a reasonable example. See
> the top of video_uclass.c for how frame-buffer allocation works.

I have already WIP patches for usage of video-uclass.c but because
reviewing of N900 patches is slow, I have not sent them yet.

So could you please do NOT remove N900 support? I would really
appreciative for reviewing pending patches instead of sending patches
with board removal.

Note that there is some issue with video_post_bind(), it throws
false-positive error "Video device '%s' cannot allocate frame buffer
memory" with "return -ENOSPC". If I remove that "return -ENOSPC" it is
working fine.
Simon Glass Jan. 23, 2022, 3:54 p.m. UTC | #4
Hi Pali,

On Sun, 23 Jan 2022 at 07:57, Pali Rohár <pali@kernel.org> wrote:
>
> On Sunday 23 January 2022 07:36:22 Simon Glass wrote:
> > Hi Pali,
> >
> > On Sun, 23 Jan 2022 at 07:08, Pali Rohár <pali@kernel.org> wrote:
> > >
> > > + Maemo
> > >
> > > On Sunday 23 January 2022 07:04:03 Simon Glass wrote:
> > > > Drop this code which uses a header that is about to be deleted.
> > >
> > > And what / where is the replacement?
> >
> > This is DM_VIDEO. There are quite a few example drivers in
> > drivers/video - perhaps the mxsfb.c one is a reasonable example. See
> > the top of video_uclass.c for how frame-buffer allocation works.
>
> I have already WIP patches for usage of video-uclass.c but because
> reviewing of N900 patches is slow, I have not sent them yet.

Who is reviewing them? If you send the patches I can review them and
we can get them applied for this release.

>
> So could you please do NOT remove N900 support? I would really
> appreciative for reviewing pending patches instead of sending patches
> with board removal.

This is not a board removal, just dropping a feature.

>
> Note that there is some issue with video_post_bind(), it throws
> false-positive error "Video device '%s' cannot allocate frame buffer
> memory" with "return -ENOSPC". If I remove that "return -ENOSPC" it is
> working fine.

Do you need U-Boot to allocate the frame buffer. If so, this is likely
because your driver is not bound before relocation. See the comment
around that message in the code.

Regards,
Simon
Pali Rohár Jan. 23, 2022, 4:01 p.m. UTC | #5
Hello!

On Sunday 23 January 2022 08:54:24 Simon Glass wrote:
> Hi Pali,
> 
> On Sun, 23 Jan 2022 at 07:57, Pali Rohár <pali@kernel.org> wrote:
> >
> > On Sunday 23 January 2022 07:36:22 Simon Glass wrote:
> > > Hi Pali,
> > >
> > > On Sun, 23 Jan 2022 at 07:08, Pali Rohár <pali@kernel.org> wrote:
> > > >
> > > > + Maemo
> > > >
> > > > On Sunday 23 January 2022 07:04:03 Simon Glass wrote:
> > > > > Drop this code which uses a header that is about to be deleted.
> > > >
> > > > And what / where is the replacement?
> > >
> > > This is DM_VIDEO. There are quite a few example drivers in
> > > drivers/video - perhaps the mxsfb.c one is a reasonable example. See
> > > the top of video_uclass.c for how frame-buffer allocation works.
> >
> > I have already WIP patches for usage of video-uclass.c but because
> > reviewing of N900 patches is slow, I have not sent them yet.
> 
> Who is reviewing them?

Lokesh is reviewing omap3 and n900 patches.

> If you send the patches I can review them and
> we can get them applied for this release.

I have already wrote in other thread I do not want to send too many
patches if I see that review process is slow. And also because I totally
lost the track what was send, what was not and what depends on what. And
I do not want to work on too many things in paralel if I see that it
took half year or more to make patches in acceptable form.

> >
> > So could you please do NOT remove N900 support? I would really
> > appreciative for reviewing pending patches instead of sending patches
> > with board removal.
> 
> This is not a board removal, just dropping a feature.

... feature which is essential and without which board is unusable.

> >
> > Note that there is some issue with video_post_bind(), it throws
> > false-positive error "Video device '%s' cannot allocate frame buffer
> > memory" with "return -ENOSPC". If I remove that "return -ENOSPC" it is
> > working fine.
> 
> Do you need U-Boot to allocate the frame buffer. If so, this is likely
> because your driver is not bound before relocation. See the comment
> around that message in the code.
> 
> Regards,
> Simon

I did not spend too much time for investigation. I just saw that
removing that comment and returning makes it fully working.
Simon Glass Jan. 23, 2022, 8:13 p.m. UTC | #6
Hi Pali,

On Sun, 23 Jan 2022 at 09:01, Pali Rohár <pali@kernel.org> wrote:
>
> Hello!
>
> On Sunday 23 January 2022 08:54:24 Simon Glass wrote:
> > Hi Pali,
> >
> > On Sun, 23 Jan 2022 at 07:57, Pali Rohár <pali@kernel.org> wrote:
> > >
> > > On Sunday 23 January 2022 07:36:22 Simon Glass wrote:
> > > > Hi Pali,
> > > >
> > > > On Sun, 23 Jan 2022 at 07:08, Pali Rohár <pali@kernel.org> wrote:
> > > > >
> > > > > + Maemo
> > > > >
> > > > > On Sunday 23 January 2022 07:04:03 Simon Glass wrote:
> > > > > > Drop this code which uses a header that is about to be deleted.
> > > > >
> > > > > And what / where is the replacement?
> > > >
> > > > This is DM_VIDEO. There are quite a few example drivers in
> > > > drivers/video - perhaps the mxsfb.c one is a reasonable example. See
> > > > the top of video_uclass.c for how frame-buffer allocation works.
> > >
> > > I have already WIP patches for usage of video-uclass.c but because
> > > reviewing of N900 patches is slow, I have not sent them yet.
> >
> > Who is reviewing them?
>
> Lokesh is reviewing omap3 and n900 patches.
>
> > If you send the patches I can review them and
> > we can get them applied for this release.
>
> I have already wrote in other thread I do not want to send too many
> patches if I see that review process is slow. And also because I totally
> lost the track what was send, what was not and what depends on what. And
> I do not want to work on too many things in paralel if I see that it
> took half year or more to make patches in acceptable form.
>
> > >
> > > So could you please do NOT remove N900 support? I would really
> > > appreciative for reviewing pending patches instead of sending patches
> > > with board removal.
> >
> > This is not a board removal, just dropping a feature.
>
> ... feature which is essential and without which board is unusable.
>
> > >
> > > Note that there is some issue with video_post_bind(), it throws
> > > false-positive error "Video device '%s' cannot allocate frame buffer
> > > memory" with "return -ENOSPC". If I remove that "return -ENOSPC" it is
> > > working fine.
> >
> > Do you need U-Boot to allocate the frame buffer. If so, this is likely
> > because your driver is not bound before relocation. See the comment
> > around that message in the code.
> >
> > Regards,
> > Simon
>
> I did not spend too much time for investigation. I just saw that
> removing that comment and returning makes it fully working.

Sure, but it is indicating a bug, so needs to be figured out. If you
read the top of video-uclass.c you can probably see what is going on.

Regards,
Simon
diff mbox series

Patch

diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 99ca36fbbea..45c569f83a3 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -30,7 +30,6 @@ 
 #include <malloc.h>
 #include <twl4030.h>
 #include <i2c.h>
-#include <video_fb.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/setup.h>
@@ -61,8 +60,6 @@  struct emu_hal_params_rx51 {
 
 DECLARE_GLOBAL_DATA_PTR;
 
-GraphicDevice gdev;
-
 const omap3_sysinfo sysinfo = {
 	DDR_STACKED,
 	"Nokia RX-51",
@@ -341,22 +338,6 @@  void setup_board_tags(struct tag **in_params)
 	*in_params = params;
 }
 
-/*
- * Routine: video_hw_init
- * Description: Set up the GraphicDevice depending on sys_boot.
- */
-void *video_hw_init(void)
-{
-	/* fill in Graphic Device */
-	gdev.frameAdrs = 0x8f9c0000;
-	gdev.winSizeX = 800;
-	gdev.winSizeY = 480;
-	gdev.gdfBytesPP = 2;
-	gdev.gdfIndex = GDF_16BIT_565RGB;
-	memset((void *)gdev.frameAdrs, 0, 0xbb800);
-	return (void *) &gdev;
-}
-
 /*
  * Routine: twl4030_regulator_set_mode
  * Description: Set twl4030 regulator mode over i2c powerbus.
diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig
index 71b0b95c672..0ef5a84b3f3 100644
--- a/configs/nokia_rx51_defconfig
+++ b/configs/nokia_rx51_defconfig
@@ -76,7 +76,6 @@  CONFIG_SPI=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
-# CONFIG_VGA_AS_SINGLE_DEVICE is not set
 CONFIG_SPLASH_SCREEN=y
 CONFIG_WATCHDOG_TIMEOUT_MSECS=31000
 CONFIG_WDT=y
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index adfc055a2c9..0163f3b9852 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -70,17 +70,6 @@ 
 
 #define CONFIG_SYS_ONENAND_BASE		ONENAND_MAP
 
-/*
- * Framebuffer
- */
-/* Video console */
-#define VIDEO_FB_16BPP_PIXEL_SWAP
-#define VIDEO_FB_16BPP_WORD_SWAP
-
-/* functions for cfb_console */
-#define VIDEO_KBD_INIT_FCT		rx51_kp_init()
-#define VIDEO_TSTC_FCT			rx51_kp_tstc
-#define VIDEO_GETC_FCT			rx51_kp_getc
 #ifndef __ASSEMBLY__
 struct stdio_dev;
 int rx51_kp_init(void);