linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] vgaarb: Add support for 64-bit frame buffer address
@ 2018-08-31 18:19 Aaron Ma
  2018-08-31 18:20 ` [PATCH 2/2] vgaarb: Keep adding VGA device in queue Aaron Ma
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ma @ 2018-08-31 18:19 UTC (permalink / raw)
  To: aaron.ma, airlied, dri-devel, linux-kernel, gustavo

EFI GOP uses 64-bit frame buffer address when some BIOS
disabled CSM support. vgaarb only stores lfb_base,
this will lead boot framebuffer to wrong device.

Add ext_lfb_base support to use 64-bit fb address.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/gpu/vga/vgaarb.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index c61b04555779..8d90e66994b0 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -1408,6 +1408,18 @@ static void __init vga_arb_select_default_device(void)
 	struct vga_device *vgadev;
 
 #if defined(CONFIG_X86) || defined(CONFIG_IA64)
+	u64 base = screen_info.lfb_base;
+	u64 size = screen_info.lfb_size;
+	u64 limit;
+	resource_size_t start, end;
+	unsigned long flags;
+	int i;
+
+	if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
+		base |= (u64)screen_info.ext_lfb_base << 32;
+
+	limit = base + size;
+
 	list_for_each_entry(vgadev, &vga_list, list) {
 		struct device *dev = &vgadev->pdev->dev;
 		/*
@@ -1418,11 +1430,6 @@ static void __init vga_arb_select_default_device(void)
 		 * Select the device owning the boot framebuffer if there is
 		 * one.
 		 */
-		resource_size_t start, end, limit;
-		unsigned long flags;
-		int i;
-
-		limit = screen_info.lfb_base + screen_info.lfb_size;
 
 		/* Does firmware framebuffer belong to us? */
 		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
@@ -1437,7 +1444,7 @@ static void __init vga_arb_select_default_device(void)
 			if (!start || !end)
 				continue;
 
-			if (screen_info.lfb_base < start || limit >= end)
+			if (base < start || limit >= end)
 				continue;
 
 			if (!vga_default_device())
-- 
2.17.1


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

* [PATCH 2/2] vgaarb: Keep adding VGA device in queue
  2018-08-31 18:19 [PATCH 1/2] vgaarb: Add support for 64-bit frame buffer address Aaron Ma
@ 2018-08-31 18:20 ` Aaron Ma
  2018-09-12 20:21   ` Alex Deucher
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ma @ 2018-08-31 18:20 UTC (permalink / raw)
  To: aaron.ma, airlied, dri-devel, linux-kernel, gustavo

If failed to find the deivice owning the boot framebuffer,
try to use the first VGA device instead of the last one.

Usually the 1st device is integrated GPU who owns the boot framebuffer.

Signed-off-by: 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 8d90e66994b0..dc8e039bfab5 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -676,7 +676,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
 	vga_arbiter_check_bridge_sharing(vgadev);
 
 	/* Add to the list */
-	list_add(&vgadev->list, &vga_list);
+	list_add_tail(&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.17.1


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

* Re: [PATCH 2/2] vgaarb: Keep adding VGA device in queue
  2018-08-31 18:20 ` [PATCH 2/2] vgaarb: Keep adding VGA device in queue Aaron Ma
@ 2018-09-12 20:21   ` Alex Deucher
  2018-10-13 16:09     ` Aaron Ma
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Deucher @ 2018-09-12 20:21 UTC (permalink / raw)
  To: aaron.ma; +Cc: Dave Airlie, Maling list - DRI developers, LKML, Gustavo Padovan

On Fri, Aug 31, 2018 at 5:39 PM Aaron Ma <aaron.ma@canonical.com> wrote:
>
> If failed to find the deivice owning the boot framebuffer,
> try to use the first VGA device instead of the last one.
>
> Usually the 1st device is integrated GPU who owns the boot framebuffer.
>
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>

Series is:
Acked-by: Alex Deucher <alexander.deucher@amd.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 8d90e66994b0..dc8e039bfab5 100644
> --- a/drivers/gpu/vga/vgaarb.c
> +++ b/drivers/gpu/vga/vgaarb.c
> @@ -676,7 +676,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
>         vga_arbiter_check_bridge_sharing(vgadev);
>
>         /* Add to the list */
> -       list_add(&vgadev->list, &vga_list);
> +       list_add_tail(&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.17.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 2/2] vgaarb: Keep adding VGA device in queue
  2018-09-12 20:21   ` Alex Deucher
@ 2018-10-13 16:09     ` Aaron Ma
  2018-10-20  6:56       ` Aaron Ma
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ma @ 2018-10-13 16:09 UTC (permalink / raw)
  To: Dave Airlie, Maling list - DRI developers, LKML
  Cc: Alex Deucher, Gustavo Padovan, maarten.lankhorst

Hi David:

Could you review and apply these 2 patches?

Regards,
Aaron

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

* Re: [PATCH 2/2] vgaarb: Keep adding VGA device in queue
  2018-10-13 16:09     ` Aaron Ma
@ 2018-10-20  6:56       ` Aaron Ma
  2018-10-23  5:23         ` Daniel Vetter
  0 siblings, 1 reply; 6+ messages in thread
From: Aaron Ma @ 2018-10-20  6:56 UTC (permalink / raw)
  To: Dave Airlie, Maling list - DRI developers, LKML, airlied, sean, seanpaul
  Cc: Alex Deucher, Gustavo Padovan, maarten.lankhorst

Hi David:

get_maintainer.pl still got your old e-mail.

Add airlied@redhat.com.

Loop Sean too.

Please review and apply these 2 patches.

Thanks,
Aaron

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

* Re: [PATCH 2/2] vgaarb: Keep adding VGA device in queue
  2018-10-20  6:56       ` Aaron Ma
@ 2018-10-23  5:23         ` Daniel Vetter
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2018-10-23  5:23 UTC (permalink / raw)
  To: Aaron Ma
  Cc: Dave Airlie, Maling list - DRI developers, LKML, airlied, sean, seanpaul

On Sat, Oct 20, 2018 at 02:56:36PM +0800, Aaron Ma wrote:
> Hi David:
> 
> get_maintainer.pl still got your old e-mail.
> 
> Add airlied@redhat.com.
> 
> Loop Sean too.
> 
> Please review and apply these 2 patches.

Both pushed to drm-misc-next.
-Daniel

> 
> Thanks,
> Aaron
> _______________________________________________
> 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

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

end of thread, other threads:[~2018-10-23  5:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 18:19 [PATCH 1/2] vgaarb: Add support for 64-bit frame buffer address Aaron Ma
2018-08-31 18:20 ` [PATCH 2/2] vgaarb: Keep adding VGA device in queue Aaron Ma
2018-09-12 20:21   ` Alex Deucher
2018-10-13 16:09     ` Aaron Ma
2018-10-20  6:56       ` Aaron Ma
2018-10-23  5:23         ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).