bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/4] Disable GRUB video support for IBM power machines


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH 2/4] Disable GRUB video support for IBM power machines
Date: Wed, 22 Jan 2014 15:50:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.2.0

On 20.01.2014 22:29, Lubomir Rintel wrote:
> From: Paulo Flabiano Smorigo <address@hidden>
> 
> A 64bit address property exposed via Matrox card's FCode to openfirmware is of
> no use in 32bit GRUB and attempting to access the truncated address results in
> a crash.
> 
As IBM says itself, it's not problem with IBM hardware but with the card
in question. GRUB should instead detect this condition by reading PCI
config space.
> Link: https://bugzilla.redhat.com/show_bug.cgi?id=973205
> 
> address@hidden: Clarify the commit message]
> address@hidden: Add Changelog]
> ---
>  ChangeLog                        | 10 ++++++++++
>  grub-core/kern/ieee1275/cmain.c  |  5 ++++-
>  grub-core/video/ieee1275.c       |  9 ++++++---
>  include/grub/ieee1275/ieee1275.h |  2 ++
>  4 files changed, 22 insertions(+), 4 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index c1b22f5..8bbb59f 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,5 +1,15 @@
>  2014-01-20  Paulo Flabiano Smorigo  <address@hidden>
>  
> +     * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set
> +     GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT flag if "model" property is
> +     "IBM".
> +     * grub-core/video/ieee1275.c (GRUB_MOD_INIT(ieee1275_fb)): Skip video
> +     initialization if GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT is set.
> +     * include/grub/ieee1275/ieee1275.h: Declare
> +     GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT.
> +
> +2014-01-20  Paulo Flabiano Smorigo  <address@hidden>
> +
>       * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_cas_reboot): Add.
>       * (grub_ieee1275_set_boot_last_label): Add.
>       * grub-core/normal/main.c [GRUB_MACHINE_IEEE1275]: Include
> diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c
> index d92ae14..409c922 100644
> --- a/grub-core/kern/ieee1275/cmain.c
> +++ b/grub-core/kern/ieee1275/cmain.c
> @@ -88,7 +88,10 @@ grub_ieee1275_find_options (void)
>      is_qemu = 1;
>  
>    if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0)
> -    grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS);
> +    {
> +      grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS);
> +      grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT);
> +    }
>  
>    /* Old Macs have no key repeat, newer ones have fully working one.
>       The ones inbetween when repeated key generates an escaoe sequence
> diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c
> index 0b150ec..813ab38 100644
> --- a/grub-core/video/ieee1275.c
> +++ b/grub-core/video/ieee1275.c
> @@ -351,9 +351,12 @@ static struct grub_video_adapter 
> grub_video_ieee1275_adapter =
>  
>  GRUB_MOD_INIT(ieee1275_fb)
>  {
> -  find_display ();
> -  if (display)
> -    grub_video_register (&grub_video_ieee1275_adapter);
> +  if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT))
> +    {
> +      find_display ();
> +      if (display)
> +        grub_video_register (&grub_video_ieee1275_adapter);
> +    }
>  }
>  
>  GRUB_MOD_FINI(ieee1275_fb)
> diff --git a/include/grub/ieee1275/ieee1275.h 
> b/include/grub/ieee1275/ieee1275.h
> index 35618f4..d31e1db 100644
> --- a/include/grub/ieee1275/ieee1275.h
> +++ b/include/grub/ieee1275/ieee1275.h
> @@ -145,6 +145,8 @@ enum grub_ieee1275_flag
>    GRUB_IEEE1275_FLAG_BROKEN_REPEAT,
>  
>    GRUB_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN,
> +
> +  GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT
>  };
>  
>  extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag 
> flag);
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]