* [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little
@ 2021-07-31 13:16 Bin Meng
2021-07-31 13:16 ` [PATCH 2/2] x86: crownbay: Use external graphics card by default Bin Meng
2021-08-01 19:19 ` [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little Simon Glass
0 siblings, 2 replies; 5+ messages in thread
From: Bin Meng @ 2021-07-31 13:16 UTC (permalink / raw)
To: Simon Glass, u-boot; +Cc: Bin Meng
Initialize igd and sdvo to NULL so that we don't need to test the
return value of dm_pci_bus_find_bdf() later.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---
arch/x86/cpu/queensbay/tnc.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/x86/cpu/queensbay/tnc.c b/arch/x86/cpu/queensbay/tnc.c
index 782ed863fe..e38c0198e4 100644
--- a/arch/x86/cpu/queensbay/tnc.c
+++ b/arch/x86/cpu/queensbay/tnc.c
@@ -18,18 +18,15 @@
static int __maybe_unused disable_igd(void)
{
- struct udevice *igd, *sdvo;
+ struct udevice *igd = NULL;
+ struct udevice *sdvo = NULL;
int ret;
ret = dm_pci_bus_find_bdf(TNC_IGD, &igd);
- if (ret)
- return ret;
if (!igd)
return 0;
ret = dm_pci_bus_find_bdf(TNC_SDVO, &sdvo);
- if (ret)
- return ret;
if (!sdvo)
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] x86: crownbay: Use external graphics card by default
2021-07-31 13:16 [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little Bin Meng
@ 2021-07-31 13:16 ` Bin Meng
2021-08-01 19:19 ` Simon Glass
2021-08-01 19:19 ` [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little Simon Glass
1 sibling, 1 reply; 5+ messages in thread
From: Bin Meng @ 2021-07-31 13:16 UTC (permalink / raw)
To: Simon Glass, u-boot; +Cc: Bin Meng
The board routes the Integrated Graphics Device (IGD) to an LVDS
panel, which is less popular than a PCIe based graphics card.
Disable the IGD so that it does not show up in the PCI configuration
space as a VGA display controller, so we can use an external PCIe
graphics card with whatever cable we have.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---
configs/crownbay_defconfig | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/configs/crownbay_defconfig b/configs/crownbay_defconfig
index 1208aad42f..d7ee0fe45e 100644
--- a/configs/crownbay_defconfig
+++ b/configs/crownbay_defconfig
@@ -8,9 +8,8 @@ CONFIG_MAX_CPUS=2
CONFIG_DEFAULT_DEVICE_TREE="crownbay"
CONFIG_VENDOR_INTEL=y
CONFIG_TARGET_CROWNBAY=y
+CONFIG_DISABLE_IGD=y
CONFIG_SMP=y
-CONFIG_HAVE_VGA_BIOS=y
-CONFIG_VGA_BIOS_ADDR=0xfffa0000
CONFIG_GENERATE_PIRQ_TABLE=y
CONFIG_GENERATE_MP_TABLE=y
CONFIG_FIT=y
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little
2021-07-31 13:16 [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little Bin Meng
2021-07-31 13:16 ` [PATCH 2/2] x86: crownbay: Use external graphics card by default Bin Meng
@ 2021-08-01 19:19 ` Simon Glass
2021-08-02 3:14 ` Bin Meng
1 sibling, 1 reply; 5+ messages in thread
From: Simon Glass @ 2021-08-01 19:19 UTC (permalink / raw)
To: Bin Meng; +Cc: U-Boot Mailing List
Hi Bin,
On Sat, 31 Jul 2021 at 07:17, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Initialize igd and sdvo to NULL so that we don't need to test the
> return value of dm_pci_bus_find_bdf() later.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
> arch/x86/cpu/queensbay/tnc.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/cpu/queensbay/tnc.c b/arch/x86/cpu/queensbay/tnc.c
> index 782ed863fe..e38c0198e4 100644
> --- a/arch/x86/cpu/queensbay/tnc.c
> +++ b/arch/x86/cpu/queensbay/tnc.c
> @@ -18,18 +18,15 @@
>
> static int __maybe_unused disable_igd(void)
> {
> - struct udevice *igd, *sdvo;
> + struct udevice *igd = NULL;
> + struct udevice *sdvo = NULL;
> int ret;
>
> ret = dm_pci_bus_find_bdf(TNC_IGD, &igd);
> - if (ret)
> - return ret;
> if (!igd)
> return 0;
This is backwards. If ret returns 0 then we know igd is non-NULL. So
check the return value. That is what it is for. You can drop the check
of igd. Same below.
>
> ret = dm_pci_bus_find_bdf(TNC_SDVO, &sdvo);
> - if (ret)
> - return ret;
> if (!sdvo)
> return 0;
>
> --
> 2.25.1
>
Regards,
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] x86: crownbay: Use external graphics card by default
2021-07-31 13:16 ` [PATCH 2/2] x86: crownbay: Use external graphics card by default Bin Meng
@ 2021-08-01 19:19 ` Simon Glass
0 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2021-08-01 19:19 UTC (permalink / raw)
To: Bin Meng; +Cc: U-Boot Mailing List
On Sat, 31 Jul 2021 at 07:17, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> The board routes the Integrated Graphics Device (IGD) to an LVDS
> panel, which is less popular than a PCIe based graphics card.
>
> Disable the IGD so that it does not show up in the PCI configuration
> space as a VGA display controller, so we can use an external PCIe
> graphics card with whatever cable we have.
>
> diff --git a/configs/crownbay_defconfig b/configs/crownbay_defconfig
> index 1208aad42f..d7ee0fe45e 100644
> --- a/configs/crownbay_defconfig
> +++ b/configs/crownbay_defconfig
> @@ -8,9 +8,8 @@ CONFIG_MAX_CPUS=2
> CONFIG_DEFAULT_DEVICE_TREE="crownbay"
> CONFIG_VENDOR_INTEL=y
> CONFIG_TARGET_CROWNBAY=y
> +CONFIG_DISABLE_IGD=y
> CONFIG_SMP=y
> -CONFIG_HAVE_VGA_BIOS=y
> -CONFIG_VGA_BIOS_ADDR=0xfffa0000
> CONFIG_GENERATE_PIRQ_TABLE=y
> CONFIG_GENERATE_MP_TABLE=y
> CONFIG_FIT=y
> --
> 2.25.1
>
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
> configs/crownbay_defconfig | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little
2021-08-01 19:19 ` [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little Simon Glass
@ 2021-08-02 3:14 ` Bin Meng
0 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2021-08-02 3:14 UTC (permalink / raw)
To: Simon Glass; +Cc: U-Boot Mailing List
Hi Simon,
On Mon, Aug 2, 2021 at 3:19 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Bin,
>
> On Sat, 31 Jul 2021 at 07:17, Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > Initialize igd and sdvo to NULL so that we don't need to test the
> > return value of dm_pci_bus_find_bdf() later.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
> >
> > arch/x86/cpu/queensbay/tnc.c | 7 ++-----
> > 1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/x86/cpu/queensbay/tnc.c b/arch/x86/cpu/queensbay/tnc.c
> > index 782ed863fe..e38c0198e4 100644
> > --- a/arch/x86/cpu/queensbay/tnc.c
> > +++ b/arch/x86/cpu/queensbay/tnc.c
> > @@ -18,18 +18,15 @@
> >
> > static int __maybe_unused disable_igd(void)
> > {
> > - struct udevice *igd, *sdvo;
> > + struct udevice *igd = NULL;
> > + struct udevice *sdvo = NULL;
> > int ret;
> >
> > ret = dm_pci_bus_find_bdf(TNC_IGD, &igd);
> > - if (ret)
> > - return ret;
> > if (!igd)
> > return 0;
>
> This is backwards. If ret returns 0 then we know igd is non-NULL. So
> check the return value. That is what it is for. You can drop the check
> of igd. Same below.
>
Ah, yes. I remembered why the original codes were written like this.
Actually the codes tried to be compatible that if the device is
already disabled it should not return error. I will reword the commit
message and add some comments here.
Regards,
Bin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-02 3:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-31 13:16 [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little Bin Meng
2021-07-31 13:16 ` [PATCH 2/2] x86: crownbay: Use external graphics card by default Bin Meng
2021-08-01 19:19 ` Simon Glass
2021-08-01 19:19 ` [PATCH 1/2] x86: queensbay: Optimize disable_igd() a little Simon Glass
2021-08-02 3:14 ` Bin Meng
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.