Skip to contentSkip to conversation

video: Add an option to skip video initialization

PATCH New Stefan Roese 4 participants 18 messages May 15, 2009 – May 16, 2009 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: Add an option to skip video initialization

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Cc Anatolij Gustschin <[email protected]>

---
This patch replaces the previous one [video: ct6900: Add an option to skip video initialization]. The test is now moved out of the ct6900 file into the generic video init routine drv_video_init() as suggested by Anatolij.

Thanks,
Stefan

 drivers/video/cfb_console.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
drivers/video/cfb_console.c +16 -0
index 5ee2314..d3d5a6d 100644
@@ -1330,11 +1330,27 @@ static int video_init (void)
 
 /*****************************************************************************/
 
+/*
+ * Implement a weak default function for boards that optionally
+ * need to skip the video initialization.
+ */
+int __board_video_skip(void)
+{
+	/* As default, don't skip test */
+	return 0;
+}
+int board_video_skip(void) __attribute__((weak, alias("__board_video_skip")));
+
+
 int drv_video_init (void)
 {
 	int skip_dev_init;
 	device_t console_dev;
 
+	/* Check if video initialization should be skipped */
+	if (board_video_skip())
+		return 0;
+
 	skip_dev_init = 0;
 
 	/* Init video chip - returns with framebuffer cleared */
Signature · 1 line
1.6.2.5
#1 lore raw

cover drv_video_init() cleanup / extension

Quoted 4 lines · In message <[email protected]> Stefan Roese wrote:

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

I think we should use this opportunity to clean up the logic of drv_video_init() a bit:

Patch 1/2: drv_video_init(): simplify logic

Make drv_video_init() easier to read.

Patch 2/2: video: Add an option to skip video initialization

Stefan's patch rebased against the simplified code.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The lesser of two evils -- is evil."             - Seymour (Sy) Leon
#2 lore raw

PATCH 1/2 drv_video_init(): simplify logic

In reply to Stefan Roese

Simplify nesting of drv_video_init() and use a consistent way of indicating failure / success. Before, it took me some time to realize which of the returns was due to an error condition and which of them indicated success.

Cc Anatolij Gustschin <[email protected]>
---
 drivers/video/cfb_console.c |   69 ++++++++++++++++++-------------------------
 1 files changed, 29 insertions(+), 40 deletions(-)
drivers/video/cfb_console.c +29 -40
index 5ee2314..f744d57 100644
@@ -1335,48 +1335,37 @@ int drv_video_init (void)
 	int skip_dev_init;
 	device_t console_dev;
 
-	skip_dev_init = 0;
-
 	/* Init video chip - returns with framebuffer cleared */
-	if (video_init () == -1)
-		skip_dev_init = 1;
+	skip_dev_init = (video_init () == -1)
 
-#ifdef CONFIG_VGA_AS_SINGLE_DEVICE
-	/* Devices VGA and Keyboard will be assigned seperately */
-	/* Init vga device */
-	if (!skip_dev_init) {
-		memset (&console_dev, 0, sizeof (console_dev));
-		strcpy (console_dev.name, "vga");
-		console_dev.ext = DEV_EXT_VIDEO;	/* Video extensions */
-		console_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
-		console_dev.putc = video_putc;	/* 'putc' function */
-		console_dev.puts = video_puts;	/* 'puts' function */
-		console_dev.tstc = NULL;	/* 'tstc' function */
-		console_dev.getc = NULL;	/* 'getc' function */
-
-		if (device_register (&console_dev) == 0)
-			return 1;
-	}
-#else
+#if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
 	PRINTD ("KBD: Keyboard init ...\n");
-	if (VIDEO_KBD_INIT_FCT == -1)
-		skip_dev_init = 1;
-
-	/* Init console device */
-	if (!skip_dev_init) {
-		memset (&console_dev, 0, sizeof (console_dev));
-		strcpy (console_dev.name, "vga");
-		console_dev.ext = DEV_EXT_VIDEO;	/* Video extensions */
-		console_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-		console_dev.putc = video_putc;	/* 'putc' function */
-		console_dev.puts = video_puts;	/* 'puts' function */
-		console_dev.tstc = VIDEO_TSTC_FCT;	/* 'tstc' function */
-		console_dev.getc = VIDEO_GETC_FCT;	/* 'getc' function */
-
-		if (device_register (&console_dev) == 0)
-			return 1;
-	}
+	skip_dev_init |= (VIDEO_KBD_INIT_FCT == -1);
+#endif
+
+	if (skip_dev_init)
+		return 0;
+
+	/* Init vga device */
+	memset (&console_dev, 0, sizeof (console_dev));
+	strcpy (console_dev.name, "vga");
+	console_dev.ext = DEV_EXT_VIDEO;	/* Video extensions */
+	console_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
+	console_dev.putc = video_putc;	/* 'putc' function */
+	console_dev.puts = video_puts;	/* 'puts' function */
+	console_dev.tstc = NULL;	/* 'tstc' function */
+	console_dev.getc = NULL;	/* 'getc' function */
+
+#if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
+	/* Also init console device */
+	console_dev.flags |= DEV_FLAGS_INPUT;
+	console_dev.tstc = VIDEO_TSTC_FCT;	/* 'tstc' function */
+	console_dev.getc = VIDEO_GETC_FCT;	/* 'getc' function */
 #endif /* CONFIG_VGA_AS_SINGLE_DEVICE */
-	/* No console dev available */
-	return 0;
+
+	if (device_register (&console_dev) != 0)
+		return 0;
+
+	/* Return success */
+	return 1;
 }
Signature · 1 line
1.6.0.6
#3 lore raw

PATCH 1/2 drv_video_init(): simplify logic

Quoted 10 lines

Simplify nesting of drv_video_init() and use a consistent way of indicating failure / success. Before, it took me some time to realize which of the returns was due to an error condition and which of them indicated success.

Cc Anatolij Gustschin <[email protected]>
---
 drivers/video/cfb_console.c |   69 ++++++++++++++++++-------------------------
 1 files changed, 29 insertions(+), 40 deletions(-)

Applied to u-boot-video/next, Thanks!

Note that i also fixed a missing semicolon after 'skip_dev_init = (video_init () == -1)' statement in both patches before applying.

Anatolij

#4 lore raw

PATCH 1/2 drv_video_init(): simplify logic

Dear Anatolij Gustschin,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 5 lines

Simplify nesting of drv_video_init() and use a consistent way of indicating failure / success. Before, it took me some time to realize which of the returns was due to an error condition and which of them indicated success.

Quoted 7 lines
Quoted 5 lines
Cc Anatolij Gustschin <[email protected]>
---
 drivers/video/cfb_console.c |   69 ++++++++++++++++++-------------------------
 1 files changed, 29 insertions(+), 40 deletions(-)

Applied to u-boot-video/next, Thanks!

Thank you.

Quoted 3 lines

Note that i also fixed a missing semicolon after 'skip_dev_init = (video_init () == -1)' statement in both patches before applying.

Ouch. Thanks for catching this.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Being schizophrenic is better than living alone.
#5 lore raw

PATCH 2/2 video: Add an option to skip video initialization

In reply to Stefan Roese

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Cc Anatolij Gustschin <[email protected]>

Rebased against simplifying patch.

---
 drivers/video/cfb_console.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
drivers/video/cfb_console.c +15 -0
index f744d57..81b3131 100644
@@ -1330,11 +1330,26 @@ static int video_init (void)
 
 /*****************************************************************************/
 
+/*
+ * Implement a weak default function for boards that optionally
+ * need to skip the video initialization.
+ */
+int __board_video_skip(void)
+{
+	/* As default, don't skip test */
+	return 0;
+}
+int board_video_skip(void) __attribute__((weak, alias("__board_video_skip")));
+
 int drv_video_init (void)
 {
 	int skip_dev_init;
 	device_t console_dev;
 
+	/* Check if video initialization should be skipped */
+	if (board_video_skip())
+		return 0;
+
 	/* Init video chip - returns with framebuffer cleared */
 	skip_dev_init = (video_init () == -1)
 
Signature · 1 line
1.6.0.6
#6 lore raw

PATCH 2/2 video: Add an option to skip video initialization

Quoted 11 lines · Wolfgang Denk

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Cc Anatolij Gustschin <[email protected]>

Rebased against simplifying patch.

---

It will be nice if you can base it against the stdio patch v4 I send some days agi
297 F May13 To u-boot at lists ??>[PATCH 2/4 v4] stdio/device: rework function naming convention

Best Regards,
J.

#7 lore raw

PATCH 2/2 video: Add an option to skip video initialization

Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 8 lines · Wolfgang Denk

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Cc Anatolij Gustschin <[email protected]>
Quoted 6 lines
Quoted 3 lines

Rebased against simplifying patch.

---

It will be nice if you can base it against the stdio patch v4 I send some days agi
297 F May13 To u-boot at lists ??>[PATCH 2/4 v4] stdio/device: rework function naming convention

but this patch doesn't apply, neither on top of the U-Boot tree nor on top of it's next branch. Sorry, but this can't be considered as a base because it doesn't apply any more.

Even if I try to apply it on top of following patches

[U-Boot] [PATCH 1_2] arm_dcc: use static support to allow to use it at anytime [U-Boot] [PATCH 2_2] arm_dcc: add xcale support
[U-Boot] [PATCH 1_4 v4] console.h: remove unused prototype 'console_realloc'

there are still some issues.

Anatolij

#8 lore raw

PATCH 2/2 video: Add an option to skip video initialization

Quoted 13 lines · Anatolij Gustschin
Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · Wolfgang Denk

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Cc Anatolij Gustschin <[email protected]>

Rebased against simplifying patch.

---

Quoted 7 lines
Quoted 3 lines

It will be nice if you can base it against the stdio patch v4 I send some days agi
297 F May13 To u-boot at lists ??>[PATCH 2/4 v4] stdio/device: rework function naming convention

but this patch doesn't apply, neither on top of the U-Boot tree nor on top of it's next branch. Sorry, but this can't be considered as a base because it doesn't apply any more.

it apply on the top of the arm-next

u-boot-arm stdio

Best Regards,
J.

#9 lore raw

PATCH 2/2 video: Add an option to skip video initialization

Quoted 17 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 16 lines · Anatolij Gustschin
Quoted 15 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · Wolfgang Denk

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Cc Anatolij Gustschin <[email protected]>

Rebased against simplifying patch.

---

It will be nice if you can base it against the stdio patch v4 I send some days agi
297 F May13 To u-boot at lists ??>[PATCH 2/4 v4] stdio/device: rework function naming convention

Quoted 6 lines
Quoted 3 lines

but this patch doesn't apply, neither on top of the U-Boot tree nor on top of it's next branch. Sorry, but this can't be considered as a base because it doesn't apply any more.

it apply on the top of the arm-next

u-boot-arm stdio

OK, Thanks for this info. I will rebase these patches after arm-next will be merged into u-boot/next.

Best regards,
Anatolij

#10 lore raw

PATCH 2/2 video: Add an option to skip video initialization

Dear Anatolij,

Quoted 3 lines · in message <[email protected]> you wrote:

OK, Thanks for this info. I will rebase these patches after arm-next will be merged into u-boot/next.

This makes no sense. Who knows when we will see any pull request for this, if ever.

Reference for postings are well-defined as the maste rbranch or, when it exists like now, the next branch of the maste repository.

Otherwise we will quickly have a maze of interdependent requests who will have to wait for whom.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If I have seen further it is by standing on the shoulders of  giants.
              - Isaac Newton, Letter to Robert Hooke, 5 February 1676
#11 lore raw

PATCH 2/2 video: Add an option to skip video initialization

Quoted 7 lines · Wolfgang Denk

Dear Anatolij,

Quoted 3 lines · in message <[email protected]> you wrote:

OK, Thanks for this info. I will rebase these patches after arm-next will be merged into u-boot/next.

Quoted 9 lines

This makes no sense. Who knows when we will see any pull request for this, if ever.

Reference for postings are well-defined as the maste rbranch or, when it exists like now, the next branch of the maste repository.

Otherwise we will quickly have a maze of interdependent requests who will have to wait for whom.

The arm-pull request is for to tommorow or to night

I've 2 patch apply before

Best Regards,
J.

#12 lore raw

PATCH 2/2 video: Add an option to skip video initialization

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 4 lines

Otherwise we will quickly have a maze of interdependent requests who will have to wait for whom.

The arm-pull request is for to tommorow or to night

I've 2 patch apply before

First come, first serve.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The goal of science is to build better mousetraps. The goal of nature
is to build better mice.
#13 lore raw

PATCH 2/2 video: Add an option to skip video initialization

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 6 lines
Quoted 2 lines

297 F May13 To u-boot at lists ??????>[PATCH 2/4 v4] stdio/device: rework function naming convention

but this patch doesn't apply, neither on top of the U-Boot tree nor on top of it's next branch. Sorry, but this can't be considered as a base because it doesn't apply any more.

it apply on the top of the arm-next

Sorry, but this is not a reference for any general U-Boot work. As long as it didn't make it at least into "next", you must care yourself to rebase your work against the master or next branches, like anybody else.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I think there's a world market for about five computers.
         -- attr. Thomas J. Watson (Chairman of the Board, IBM), 1943
#14 lore raw

PATCH 2/2 video: Add an option to skip video initialization

In reply to Wolfgang Denk

Hello Wolfgang, Stefan,

Quoted 10 lines · Wolfgang Denk

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Cc Anatolij Gustschin <[email protected]>

Rebased against simplifying patch.

should these patches go in for v2009.06 ?

Anatolij

#15 lore raw

PATCH 2/2 video: Add an option to skip video initialization

Quoted 5 lines · On Friday 15 May 2009 12:41:36 Anatolij Gustschin wrote:
Quoted 5 lines

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Quoted 7 lines
Quoted 5 lines
Cc Anatolij Gustschin <[email protected]>

Rebased against simplifying patch.

should these patches go in for v2009.06 ?

No. It's not really bug fixes, so let's queue them for the next release.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#16 lore raw

PATCH 2/2 video: Add an option to skip video initialization

In reply to Wolfgang Denk
Quoted 5 lines · Wolfgang Denk

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Quoted 8 lines
Cc Anatolij Gustschin <[email protected]>

Rebased against simplifying patch.

---
 drivers/video/cfb_console.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

Applied to u-boot-video/next, Thanks!

Best regards,
Anatolij

#17 lore raw

PATCH 1/1 video: Add an option to skip video initialization

In reply to Stefan Roese
Quoted 12 lines · Stefan Roese

This patch adds an option to skip the video initialization on for all video drivers. This is needed for the CPCI750 which can be built as CPCI host and adapter/target board. And the adapter board can't access the video cards located on the CompactPCI bus.

Cc Anatolij Gustschin <[email protected]>

---
This patch replaces the previous one [video: ct6900: Add an option to skip video initialization]. The test is now moved out of the ct6900 file into the generic video init routine drv_video_init() as suggested by Anatolij.

Quoted 5 lines

Thanks,
Stefan

 drivers/video/cfb_console.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

i replaced this patch by the same patch from Wolfgang which is rebased on top of his "drv_video_init(): simplify logic" patch. Thanks!

Best regards,
Anatolij