[U-Boot] [PATCH 09/22] x86: ivybridge: Only run the Video BIOS when video is enabled

Bin Meng bmeng.cn at gmail.com
Wed Dec 31 04:14:39 CET 2014


Hi Simon,

On Sun, Dec 28, 2014 at 10:20 AM, Simon Glass <sjg at chromium.org> wrote:
> This takes about about 700ms on link when running natively and 900ms when
> running using the emulator. It is a waste of time if video is not enabled,
> so don't bother running the video BIOS in that case.
>
> We could add a command to run the video BIOS later when needed, but this is
> not considered at present.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  arch/x86/cpu/ivybridge/gma.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/ivybridge/gma.c b/arch/x86/cpu/ivybridge/gma.c
> index 3d7f740..125021b 100644
> --- a/arch/x86/cpu/ivybridge/gma.c
> +++ b/arch/x86/cpu/ivybridge/gma.c
> @@ -15,6 +15,13 @@
>  #include <asm/pci.h>
>  #include <asm/arch/pch.h>
>  #include <asm/arch/sandybridge.h>
> +#include <linux/kconfig.h>
> +
> +#ifdef CONFIG_VIDEO
> +#define RUN_VIDEO_BIOS         1
> +#else
> +#define RUN_VIDEO_BIOS         1

Intentional? Should this be 0?

> +#endif
>
>  struct gt_powermeter {
>         u16 reg;
> @@ -745,7 +752,15 @@ int gma_func0_init(pci_dev_t dev, struct pci_controller *hose,
>         if (ret)
>                 return ret;
>
> -       ret = pci_run_vga_bios(dev, int15_handler, false);
> +       /*
> +        * TODO: Change to IS_ENABLED(CONFIG_VIDEO) when Kconfig supports
> +        * CONFIG_VIDEO.
> +        */

Or maybe just simply do this? The "if (RUN_VIDEO_BIOS)" looks strange.

#ifdef CONFIG_VIDEO
               start = get_timer(0);
               ret = pci_run_vga_bios(dev, int15_handler, false);
               debug("BIOS ran in %lums\n", get_timer(start));
#endif

> +       if (RUN_VIDEO_BIOS) {
> +               start = get_timer(0);
> +               ret = pci_run_vga_bios(dev, int15_handler, false);
> +               debug("BIOS ran in %lums\n", get_timer(start));
> +       }
>
>         /* Post VBIOS init */
>         ret = gma_pm_init_post_vbios(gtt_bar, blob, node);
> --

Regards,
Bin


More information about the U-Boot mailing list