All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "vgaarb: Keep adding VGA device in queue"
@ 2019-05-10 14:29 Alex Deucher
       [not found] ` <20190510142958.28017-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2019-05-10 15:43 ` Michel Dänzer
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Deucher @ 2019-05-10 14:29 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Alex Deucher, Aaron Ma

This breaks multiple graphics cards in the Amigaone x5000
on PPC.

This reverts commit 3d42f1ddc47a69c0ce155f9f30d764c4d689a5fa.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109345
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/gpu/vga/vgaarb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index f2f3ef8af271..8a3c45219a2a 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -725,7 +725,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
 	vga_arbiter_check_bridge_sharing(vgadev);
 
 	/* Add to the list */
-	list_add_tail(&vgadev->list, &vga_list);
+	list_add(&vgadev->list, &vga_list);
 	vga_count++;
 	vgaarb_info(&pdev->dev, "VGA device added: decodes=%s,owns=%s,locks=%s\n",
 		vga_iostate_to_str(vgadev->decodes),
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "vgaarb: Keep adding VGA device in queue"
       [not found] ` <20190510142958.28017-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2019-05-10 15:42   ` Daniel Vetter
       [not found]     ` <20190510154208.GL17751-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2019-05-10 15:42 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Alex Deucher, Aaron Ma,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Fri, May 10, 2019 at 09:29:58AM -0500, Alex Deucher wrote:
> This breaks multiple graphics cards in the Amigaone x5000
> on PPC.
> 
> This reverts commit 3d42f1ddc47a69c0ce155f9f30d764c4d689a5fa.
> 
> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109345
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> CC: Aaron Ma <aaron.ma@canonical.com>

Given that the bug is a bit a mess I think we need to add a bit more
context here in the commit message. My understanding:

Goal of the revert commit was to make the integrated boot device the
primary one, if we can't detect which one is the boot device, instead of
the last one. Which makes some sense.

Now people have relied on the kernel picking the last one, which usually
is an add-on card, and therefore simply plugging in an add-on card allows
them to overwrite the default choice. Which also makes sense, and since
it's the older behaviour, wins.

I think it'd be good to add a comment here that this behaviour has become
uapi, e.g.

	/* Add at the front so that we pick the last device as fallback
	 * default, with the usual result that plug in cards are preferred
	 * over integrated graphics. */

With that (or similar) and more commit message context:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/vga/vgaarb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
> index f2f3ef8af271..8a3c45219a2a 100644
> --- a/drivers/gpu/vga/vgaarb.c
> +++ b/drivers/gpu/vga/vgaarb.c
> @@ -725,7 +725,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
>  	vga_arbiter_check_bridge_sharing(vgadev);
>  
>  	/* Add to the list */
> -	list_add_tail(&vgadev->list, &vga_list);
> +	list_add(&vgadev->list, &vga_list);
>  	vga_count++;
>  	vgaarb_info(&pdev->dev, "VGA device added: decodes=%s,owns=%s,locks=%s\n",
>  		vga_iostate_to_str(vgadev->decodes),
> -- 
> 2.20.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "vgaarb: Keep adding VGA device in queue"
  2019-05-10 14:29 [PATCH] Revert "vgaarb: Keep adding VGA device in queue" Alex Deucher
       [not found] ` <20190510142958.28017-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2019-05-10 15:43 ` Michel Dänzer
  1 sibling, 0 replies; 7+ messages in thread
From: Michel Dänzer @ 2019-05-10 15:43 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Alex Deucher, Aaron Ma, dri-devel, amd-gfx

On 2019-05-10 4:29 p.m., Alex Deucher wrote:
> This breaks multiple graphics cards in the Amigaone x5000
> on PPC.
> 
> This reverts commit 3d42f1ddc47a69c0ce155f9f30d764c4d689a5fa.
> 
> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109345

It's not clear to me yet that this was really a regression that requires
a revert.

It looks like the bug reporter was relying on Xorg with no xorg.conf
picking one particular graphics card out of two in the system, and this
change resulted in it using the other one instead. I asked for the
corresponding Xorg log files to see if they show why Xorg picks one card
or the other in each case.


-- 
Earthling Michel Dänzer               |              https://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "vgaarb: Keep adding VGA device in queue"
       [not found]     ` <20190510154208.GL17751-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
@ 2019-05-10 15:46       ` Michel Dänzer
       [not found]         ` <58ea5dae-be17-af97-0066-48feab80497e-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Michel Dänzer @ 2019-05-10 15:46 UTC (permalink / raw)
  To: Daniel Vetter, Alex Deucher
  Cc: Alex Deucher, Aaron Ma, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2019-05-10 5:42 p.m., Daniel Vetter wrote:
> On Fri, May 10, 2019 at 09:29:58AM -0500, Alex Deucher wrote:
>> This breaks multiple graphics cards in the Amigaone x5000
>> on PPC.
>>
>> This reverts commit 3d42f1ddc47a69c0ce155f9f30d764c4d689a5fa.
>>
>> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109345
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>> CC: Aaron Ma <aaron.ma@canonical.com>
> 
> Given that the bug is a bit a mess I think we need to add a bit more
> context here in the commit message. My understanding:
> 
> Goal of the revert commit was to make the integrated boot device the
> primary one, if we can't detect which one is the boot device, instead of
> the last one. Which makes some sense.
> 
> Now people have relied on the kernel picking the last one, which usually
> is an add-on card, and therefore simply plugging in an add-on card allows
> them to overwrite the default choice. Which also makes sense, and since
> it's the older behaviour, wins.
> 
> I think it'd be good to add a comment here that this behaviour has become
> uapi, e.g.
> 
> 	/* Add at the front so that we pick the last device as fallback
> 	 * default, with the usual result that plug in cards are preferred
> 	 * over integrated graphics. */
> 
> With that (or similar) and more commit message context:

The bug reporter's system doesn't have integrated graphics though, just
two plug-in cards. It's not clear to me yet that their expectation of
Xorg to pick any particular one of them without configuration was justified.


-- 
Earthling Michel Dänzer               |              https://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "vgaarb: Keep adding VGA device in queue"
       [not found]         ` <58ea5dae-be17-af97-0066-48feab80497e-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2019-05-10 18:01           ` Aaron Ma
  2019-05-13 10:14             ` Michel Dänzer
  0 siblings, 1 reply; 7+ messages in thread
From: Aaron Ma @ 2019-05-10 18:01 UTC (permalink / raw)
  To: Michel Dänzer, Daniel Vetter, Alex Deucher
  Cc: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 5/10/19 11:46 PM, Michel Dänzer wrote:
>> Given that the bug is a bit a mess I think we need to add a bit more
>> context here in the commit message. My understanding:
>>
>> Goal of the revert commit was to make the integrated boot device the
>> primary one, if we can't detect which one is the boot device, instead of
>> the last one. Which makes some sense.
>>
>> Now people have relied on the kernel picking the last one, which usually
>> is an add-on card, and therefore simply plugging in an add-on card allows
>> them to overwrite the default choice. Which also makes sense, and since
>> it's the older behaviour, wins.
>>
>> I think it'd be good to add a comment here that this behaviour has become
>> uapi, e.g.
>>
>> 	/* Add at the front so that we pick the last device as fallback
>> 	 * default, with the usual result that plug in cards are preferred
>> 	 * over integrated graphics. */
>>
>> With that (or similar) and more commit message context:
> The bug reporter's system doesn't have integrated graphics though, just
> two plug-in cards. It's not clear to me yet that their expectation of
> Xorg to pick any particular one of them without configuration was justified.


This code is kind of fail safe.

When in hybrid graphic mode.
It should fallback to integrated GPU, which should always be primary fb.
So picking 1st (minor PCI ID number) GPU should make more sense.

When with multiple d-GPUs, we can't say which card should be the right
one for users when no Xorg conf set.
Usually BIOS will set the 1st (minor PCI ID number) d-GPU as primary.
So aligning with BIOS setting will be better I think.

Aaron
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "vgaarb: Keep adding VGA device in queue"
  2019-05-10 18:01           ` Aaron Ma
@ 2019-05-13 10:14             ` Michel Dänzer
  2019-05-13 15:11               ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Michel Dänzer @ 2019-05-13 10:14 UTC (permalink / raw)
  To: Aaron Ma, Daniel Vetter, Alex Deucher; +Cc: Alex Deucher, dri-devel, amd-gfx

On 2019-05-10 8:01 p.m., Aaron Ma wrote:
> On 5/10/19 11:46 PM, Michel Dänzer wrote:
>>> Given that the bug is a bit a mess I think we need to add a bit more
>>> context here in the commit message. My understanding:
>>>
>>> Goal of the revert commit was to make the integrated boot device the
>>> primary one, if we can't detect which one is the boot device, instead of
>>> the last one. Which makes some sense.
>>>
>>> Now people have relied on the kernel picking the last one, which usually
>>> is an add-on card, and therefore simply plugging in an add-on card allows
>>> them to overwrite the default choice. Which also makes sense, and since
>>> it's the older behaviour, wins.
>>>
>>> I think it'd be good to add a comment here that this behaviour has become
>>> uapi, e.g.
>>>
>>> 	/* Add at the front so that we pick the last device as fallback
>>> 	 * default, with the usual result that plug in cards are preferred
>>> 	 * over integrated graphics. */
>>>
>>> With that (or similar) and more commit message context:
>> The bug reporter's system doesn't have integrated graphics though, just
>> two plug-in cards. It's not clear to me yet that their expectation of
>> Xorg to pick any particular one of them without configuration was justified.
> 
> 
> This code is kind of fail safe.
> 
> When in hybrid graphic mode.
> It should fallback to integrated GPU, which should always be primary fb.
> So picking 1st (minor PCI ID number) GPU should make more sense.
> 
> When with multiple d-GPUs, we can't say which card should be the right
> one for users when no Xorg conf set.
> Usually BIOS will set the 1st (minor PCI ID number) d-GPU as primary.
> So aligning with BIOS setting will be better I think.

Right. The bug description even says that the card the reporter expected
Xorg to come up on is the "secondary" card in a PCIe 1x slot (whereas
the primary is in PCIe 16x). It seems pretty clear that your change
actually made things better, and the reporter was just relying on the
previous wrong behaviour. Therefore I resolved the report as not a bug,
and this patch should be dropped.


-- 
Earthling Michel Dänzer               |              https://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "vgaarb: Keep adding VGA device in queue"
  2019-05-13 10:14             ` Michel Dänzer
@ 2019-05-13 15:11               ` Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2019-05-13 15:11 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: dri-devel, amd-gfx, Aaron Ma, Alex Deucher

On Mon, May 13, 2019 at 12:14:29PM +0200, Michel Dänzer wrote:
> On 2019-05-10 8:01 p.m., Aaron Ma wrote:
> > On 5/10/19 11:46 PM, Michel Dänzer wrote:
> >>> Given that the bug is a bit a mess I think we need to add a bit more
> >>> context here in the commit message. My understanding:
> >>>
> >>> Goal of the revert commit was to make the integrated boot device the
> >>> primary one, if we can't detect which one is the boot device, instead of
> >>> the last one. Which makes some sense.
> >>>
> >>> Now people have relied on the kernel picking the last one, which usually
> >>> is an add-on card, and therefore simply plugging in an add-on card allows
> >>> them to overwrite the default choice. Which also makes sense, and since
> >>> it's the older behaviour, wins.
> >>>
> >>> I think it'd be good to add a comment here that this behaviour has become
> >>> uapi, e.g.
> >>>
> >>> 	/* Add at the front so that we pick the last device as fallback
> >>> 	 * default, with the usual result that plug in cards are preferred
> >>> 	 * over integrated graphics. */
> >>>
> >>> With that (or similar) and more commit message context:
> >> The bug reporter's system doesn't have integrated graphics though, just
> >> two plug-in cards. It's not clear to me yet that their expectation of
> >> Xorg to pick any particular one of them without configuration was justified.
> > 
> > 
> > This code is kind of fail safe.
> > 
> > When in hybrid graphic mode.
> > It should fallback to integrated GPU, which should always be primary fb.
> > So picking 1st (minor PCI ID number) GPU should make more sense.
> > 
> > When with multiple d-GPUs, we can't say which card should be the right
> > one for users when no Xorg conf set.
> > Usually BIOS will set the 1st (minor PCI ID number) d-GPU as primary.
> > So aligning with BIOS setting will be better I think.
> 
> Right. The bug description even says that the card the reporter expected
> Xorg to come up on is the "secondary" card in a PCIe 1x slot (whereas
> the primary is in PCIe 16x). It seems pretty clear that your change
> actually made things better, and the reporter was just relying on the
> previous wrong behaviour. Therefore I resolved the report as not a bug,
> and this patch should be dropped.

Hm I missed that this is about 2 external pci slots. Agreeing with you
reasoning here now, retracting my r-b.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-13 15:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10 14:29 [PATCH] Revert "vgaarb: Keep adding VGA device in queue" Alex Deucher
     [not found] ` <20190510142958.28017-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-05-10 15:42   ` Daniel Vetter
     [not found]     ` <20190510154208.GL17751-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-05-10 15:46       ` Michel Dänzer
     [not found]         ` <58ea5dae-be17-af97-0066-48feab80497e-otUistvHUpPR7s880joybQ@public.gmane.org>
2019-05-10 18:01           ` Aaron Ma
2019-05-13 10:14             ` Michel Dänzer
2019-05-13 15:11               ` Daniel Vetter
2019-05-10 15:43 ` Michel Dänzer

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.