All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/4] vgaarb: Add support for setting the default video device
@ 2012-04-16 20:26 Matthew Garrett
  2012-04-16 20:26 ` [PATCH V2 2/4] vga-switcheroo: Use vga_default_device() Matthew Garrett
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Matthew Garrett @ 2012-04-16 20:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matthew Garrett, benh, airlied

The default VGA device is a somewhat fluid concept on platforms with
multiple GPUs. Add support for setting it so switching code can update
things appropriately, and make sure that the sysfs code returns the right
device if it's changed.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: benh@kernel.crashing.org
Cc: airlied@redhat.com
---
Updated to fix builds when __ARCH_HAS_VGA_DEFAULT_DEVICE is false.

 drivers/gpu/vga/vgaarb.c |    7 +++++++
 drivers/pci/pci-sysfs.c  |    5 +++++
 include/linux/vgaarb.h   |    2 ++
 3 files changed, 14 insertions(+)

diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index 111d956..e223b96 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -136,6 +136,11 @@ struct pci_dev *vga_default_device(void)
 {
 	return vga_default;
 }
+
+void vga_set_default_device(struct pci_dev *pdev)
+{
+	vga_default = pdev;
+}
 #endif
 
 static inline void vga_irq_set_state(struct vga_device *vgadev, bool state)
@@ -605,10 +610,12 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
 		goto bail;
 	}
 
+#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
 	if (vga_default == pdev) {
 		pci_dev_put(vga_default);
 		vga_default = NULL;
 	}
+#endif
 
 	if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM))
 		vga_decode_count--;
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index a3cd8ca..7dd9f2b 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -27,6 +27,7 @@
 #include <linux/security.h>
 #include <linux/pci-aspm.h>
 #include <linux/slab.h>
+#include <linux/vgaarb.h>
 #include "pci.h"
 
 static int sysfs_initialized;	/* = 0 */
@@ -414,6 +415,10 @@ static ssize_t
 boot_vga_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
+	struct pci_dev *vga_dev = vga_default_device();
+
+	if (vga_dev)
+		return sprintf(buf, "%u\n", (pdev == vga_dev));
 
 	return sprintf(buf, "%u\n",
 		!!(pdev->resource[PCI_ROM_RESOURCE].flags &
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 9c3120d..759a25b 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -31,6 +31,7 @@
 #ifndef LINUX_VGA_H
 #define LINUX_VGA_H
 
+#include <video/vga.h>
 
 /* Legacy VGA regions */
 #define VGA_RSRC_NONE	       0x00
@@ -181,6 +182,7 @@ extern void vga_put(struct pci_dev *pdev, unsigned int rsrc);
 
 #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
 extern struct pci_dev *vga_default_device(void);
+extern void vga_set_default_device(struct pci_dev *pdev);
 #endif
 
 /**
-- 
1.7.10


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

* [PATCH V2 2/4] vga-switcheroo: Use vga_default_device()
  2012-04-16 20:26 [PATCH V2 1/4] vgaarb: Add support for setting the default video device Matthew Garrett
@ 2012-04-16 20:26 ` Matthew Garrett
  2012-04-16 20:26 ` [PATCH V2 3/4] x86: Use vga_default_device() when determining whether an fb is primary Matthew Garrett
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Matthew Garrett @ 2012-04-16 20:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matthew Garrett, airlied

vga-switcheroo currently changes the default VGA device by fiddling with
the IORESOURCE_ROM_SHADOW flag on the device. This isn't strictly accurate,
since there's no guarantee that switching also changes the ROM decoding.
Switch over to using the vgaarb functions for this.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: airlied@redhat.com
---
 drivers/gpu/vga/vga_switcheroo.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 9a2c805..44c664e 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -28,6 +28,8 @@
 #include <linux/pci.h>
 #include <linux/vga_switcheroo.h>
 
+#include <linux/vgaarb.h>
+
 struct vga_switcheroo_client {
 	struct pci_dev *pdev;
 	struct fb_info *fb_info;
@@ -140,7 +142,7 @@ int vga_switcheroo_register_client(struct pci_dev *pdev,
 	vgasr_priv.clients[index].reprobe = reprobe;
 	vgasr_priv.clients[index].can_switch = can_switch;
 	vgasr_priv.clients[index].id = -1;
-	if (pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW)
+	if (pdev == vga_default_device())
 		vgasr_priv.clients[index].active = true;
 
 	vgasr_priv.registered_clients |= (1 << index);
@@ -248,9 +250,8 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
 	if (new_client->pwr_state == VGA_SWITCHEROO_OFF)
 		vga_switchon(new_client);
 
-	/* swap shadow resource to denote boot VGA device has changed so X starts on new device */
-	active->pdev->resource[PCI_ROM_RESOURCE].flags &= ~IORESOURCE_ROM_SHADOW;
-	new_client->pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
+	vga_set_default_device(new_client->pdev);
+
 	return 0;
 }
 
-- 
1.7.10


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

* [PATCH V2 3/4] x86: Use vga_default_device() when determining whether an fb is primary
  2012-04-16 20:26 [PATCH V2 1/4] vgaarb: Add support for setting the default video device Matthew Garrett
  2012-04-16 20:26 ` [PATCH V2 2/4] vga-switcheroo: Use vga_default_device() Matthew Garrett
@ 2012-04-16 20:26 ` Matthew Garrett
  2012-04-16 20:26 ` [PATCH V2 4/4] efifb: Implement vga_default_device() Matthew Garrett
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Matthew Garrett @ 2012-04-16 20:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matthew Garrett, mingo, hpa

IORESOURCE_ROM_SHADOW is not necessarily an indication that the hardware
is the primary device. Add support for using the vgaarb functions and
fall back if nothing's set them.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: mingo@redhat.com
Cc: hpa@zytor.com
---
 arch/x86/video/fbdev.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/fbdev.c
index c5ffb6a..d5644bb 100644
--- a/arch/x86/video/fbdev.c
+++ b/arch/x86/video/fbdev.c
@@ -9,24 +9,34 @@
 #include <linux/fb.h>
 #include <linux/pci.h>
 #include <linux/module.h>
+#include <linux/vgaarb.h>
 
 int fb_is_primary_device(struct fb_info *info)
 {
 	struct device *device = info->device;
 	struct pci_dev *pci_dev = NULL;
+	struct pci_dev *default_device = vga_default_device();
 	struct resource *res = NULL;
-	int retval = 0;
 
 	if (device)
 		pci_dev = to_pci_dev(device);
 
-	if (pci_dev)
-		res = &pci_dev->resource[PCI_ROM_RESOURCE];
+	if (!pci_dev)
+		return 0;
+
+	if (default_device) {
+		if (pci_dev == default_device)
+			return 1;
+		else
+			return 0;
+	}
+
+	res = &pci_dev->resource[PCI_ROM_RESOURCE];
 
 	if (res && res->flags & IORESOURCE_ROM_SHADOW)
-		retval = 1;
+		return 1;
 
-	return retval;
+	return 0;
 }
 EXPORT_SYMBOL(fb_is_primary_device);
 MODULE_LICENSE("GPL");
-- 
1.7.10


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

* [PATCH V2 4/4] efifb: Implement vga_default_device()
  2012-04-16 20:26 [PATCH V2 1/4] vgaarb: Add support for setting the default video device Matthew Garrett
  2012-04-16 20:26 ` [PATCH V2 2/4] vga-switcheroo: Use vga_default_device() Matthew Garrett
  2012-04-16 20:26 ` [PATCH V2 3/4] x86: Use vga_default_device() when determining whether an fb is primary Matthew Garrett
@ 2012-04-16 20:26 ` Matthew Garrett
  2012-04-20 11:13   ` Dave Airlie
  2012-04-16 20:52 ` [PATCH V2 1/4] vgaarb: Add support for setting the default video device H. Peter Anvin
  2012-04-18  9:37 ` Geert Uytterhoeven
  4 siblings, 1 reply; 11+ messages in thread
From: Matthew Garrett @ 2012-04-16 20:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matthew Garrett, hpa, matt.fleming

EFI doesn't typically make use of the legacy VGA ROM, but it may still be
configured to pass that through to a given video device. This may lead to
an inaccurate choice of default video device. Add support to efifb to pick
out the correct active video device.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: hpa@zytor.com
Cc: matt.fleming@intel.com
---
 arch/x86/include/asm/vga.h |    6 ++++
 drivers/video/efifb.c      |   77 ++++++++++++++++++++++++++++++++------------
 2 files changed, 63 insertions(+), 20 deletions(-)

diff --git a/arch/x86/include/asm/vga.h b/arch/x86/include/asm/vga.h
index c4b9dc2..2723c07 100644
--- a/arch/x86/include/asm/vga.h
+++ b/arch/x86/include/asm/vga.h
@@ -17,4 +17,10 @@
 #define vga_readb(x) (*(x))
 #define vga_writeb(x, y) (*(y) = (x))
 
+#if CONFIG_FB_EFI
+#define __ARCH_HAS_VGA_DEFAULT_DEVICE
+extern struct pci_dev *vga_default_device(void);
+extern void vga_set_default_device(struct pci_dev *pdev);
+#endif
+
 #endif /* _ASM_X86_VGA_H */
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index 784139a..66ed991 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -18,6 +18,8 @@
 
 static bool request_mem_succeeded = false;
 
+static struct pci_dev *default_vga;
+
 static struct fb_var_screeninfo efifb_defined __devinitdata = {
 	.activate		= FB_ACTIVATE_NOW,
 	.height			= -1,
@@ -298,35 +300,70 @@ static struct fb_ops efifb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
+struct pci_dev *vga_default_device(void)
+{
+	return default_vga;
+}
+
+void vga_set_default_device(struct pci_dev *pdev)
+{
+	default_vga = pdev;
+}
+
 static int __init efifb_setup(char *options)
 {
 	char *this_opt;
 	int i;
+	struct pci_dev *dev = NULL;
+
+	if (options && *options) {
+		while ((this_opt = strsep(&options, ",")) != NULL) {
+			if (!*this_opt) continue;
+
+			for (i = 0; i < M_UNKNOWN; i++) {
+				if (!strcmp(this_opt, dmi_list[i].optname) &&
+				    dmi_list[i].base != 0) {
+					screen_info.lfb_base = dmi_list[i].base;
+					screen_info.lfb_linelength = dmi_list[i].stride;
+					screen_info.lfb_width = dmi_list[i].width;
+					screen_info.lfb_height = dmi_list[i].height;
+				}
+			}
+			if (!strncmp(this_opt, "base:", 5))
+				screen_info.lfb_base = simple_strtoul(this_opt+5, NULL, 0);
+			else if (!strncmp(this_opt, "stride:", 7))
+				screen_info.lfb_linelength = simple_strtoul(this_opt+7, NULL, 0) * 4;
+			else if (!strncmp(this_opt, "height:", 7))
+				screen_info.lfb_height = simple_strtoul(this_opt+7, NULL, 0);
+			else if (!strncmp(this_opt, "width:", 6))
+				screen_info.lfb_width = simple_strtoul(this_opt+6, NULL, 0);
+		}
+	}
 
-	if (!options || !*options)
-		return 0;
+	for_each_pci_dev(dev) {
+		int i;
 
-	while ((this_opt = strsep(&options, ",")) != NULL) {
-		if (!*this_opt) continue;
+		if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
+			continue;
 
-		for (i = 0; i < M_UNKNOWN; i++) {
-			if (!strcmp(this_opt, dmi_list[i].optname) &&
-					dmi_list[i].base != 0) {
-				screen_info.lfb_base = dmi_list[i].base;
-				screen_info.lfb_linelength = dmi_list[i].stride;
-				screen_info.lfb_width = dmi_list[i].width;
-				screen_info.lfb_height = dmi_list[i].height;
-			}
+		for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
+			resource_size_t start, end;
+
+			if (!(pci_resource_flags(dev, i) & IORESOURCE_MEM))
+				continue;
+
+			start = pci_resource_start(dev, i);
+			end  = pci_resource_end(dev, i);
+
+			if (!start || !end)
+				continue;
+
+			if (screen_info.lfb_base >= start &&
+			    (screen_info.lfb_base + screen_info.lfb_size) < end)
+				default_vga = dev;
 		}
-		if (!strncmp(this_opt, "base:", 5))
-			screen_info.lfb_base = simple_strtoul(this_opt+5, NULL, 0);
-		else if (!strncmp(this_opt, "stride:", 7))
-			screen_info.lfb_linelength = simple_strtoul(this_opt+7, NULL, 0) * 4;
-		else if (!strncmp(this_opt, "height:", 7))
-			screen_info.lfb_height = simple_strtoul(this_opt+7, NULL, 0);
-		else if (!strncmp(this_opt, "width:", 6))
-			screen_info.lfb_width = simple_strtoul(this_opt+6, NULL, 0);
 	}
+
 	return 0;
 }
 
-- 
1.7.10


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

* Re: [PATCH V2 1/4] vgaarb: Add support for setting the default video device
  2012-04-16 20:26 [PATCH V2 1/4] vgaarb: Add support for setting the default video device Matthew Garrett
                   ` (2 preceding siblings ...)
  2012-04-16 20:26 ` [PATCH V2 4/4] efifb: Implement vga_default_device() Matthew Garrett
@ 2012-04-16 20:52 ` H. Peter Anvin
  2012-04-16 23:00   ` Benjamin Herrenschmidt
  2012-04-18  9:37 ` Geert Uytterhoeven
  4 siblings, 1 reply; 11+ messages in thread
From: H. Peter Anvin @ 2012-04-16 20:52 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, benh, airlied, Matt Fleming, Ingo Molnar

Acked-by: H. Peter Anvin <hpa@zytor.com>

... on this patchset.  I'd like to see it together though, so it's OK
for me if Dave wants to take it, or I can take it.

	-hpa


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

* Re: [PATCH V2 1/4] vgaarb: Add support for setting the default video device
  2012-04-16 20:52 ` [PATCH V2 1/4] vgaarb: Add support for setting the default video device H. Peter Anvin
@ 2012-04-16 23:00   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 11+ messages in thread
From: Benjamin Herrenschmidt @ 2012-04-16 23:00 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Matthew Garrett, linux-kernel, airlied, Matt Fleming, Ingo Molnar

On Mon, 2012-04-16 at 13:52 -0700, H. Peter Anvin wrote:
> Acked-by: H. Peter Anvin <hpa@zytor.com>
> 
> ... on this patchset.  I'd like to see it together though, so it's OK
> for me if Dave wants to take it, or I can take it.

Well, I was CCed so here's my Ack :-)

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

BTW. We should hack a version of vbetool that uses the arbiter
interfaces ... not that I want vbetool to live but it's proved handy
once or twice diagnosing problems...

Cheers,
Ben.



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

* Re: [PATCH V2 1/4] vgaarb: Add support for setting the default video device
  2012-04-16 20:26 [PATCH V2 1/4] vgaarb: Add support for setting the default video device Matthew Garrett
                   ` (3 preceding siblings ...)
  2012-04-16 20:52 ` [PATCH V2 1/4] vgaarb: Add support for setting the default video device H. Peter Anvin
@ 2012-04-18  9:37 ` Geert Uytterhoeven
  2012-04-18  9:44   ` Geert Uytterhoeven
  4 siblings, 1 reply; 11+ messages in thread
From: Geert Uytterhoeven @ 2012-04-18  9:37 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, benh, airlied

On Mon, Apr 16, 2012 at 22:26, Matthew Garrett <mjg@redhat.com> wrote:
> --- a/include/linux/vgaarb.h
> +++ b/include/linux/vgaarb.h
> @@ -31,6 +31,7 @@
>  #ifndef LINUX_VGA_H
>  #define LINUX_VGA_H
>
> +#include <video/vga.h>

Is this include really needed? x86_64/allmodconfig builds fine without it.

It causes m68k/allmodconfig to fail with:

In file included from include/linux/vgaarb.h:35,
                 from drivers/gpu/drm/drm_irq.c:43:
include/video/vga.h: In function ‘vga_mm_r’:
include/video/vga.h:242: error: implicit declaration of function ‘z_readb’
include/video/vga.h: In function ‘vga_mm_w’:
include/video/vga.h:247: error: implicit declaration of function ‘z_writeb’
include/video/vga.h: In function ‘vga_mm_w_fast’:
include/video/vga.h:253: error: implicit declaration of function ‘z_writew’
make[1]: *** [drivers/gpu/drm/drm_irq.o] Error 1

http://kisskb.ellerman.id.au/kisskb/buildresult/6127136/

Currently <video/vga.h> has a crude hack to make cirrusfb work on Amiga,
but that's the only VGA support m68k has.
There's also no <asm/vga.h>, so m68k/allmodconfig with CONFIG_AMIGA
disabled now fails with:

In file included from include/linux/vgaarb.h:34,
                 from drivers/gpu/drm/drm_irq.c:42:
include/video/vga.h:23:21: error: asm/vga.h: No such file or directory
make[1]: *** [drivers/gpu/drm/drm_irq.o] Error 1

Removing the #include <video/vga.h> fixes both cases.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH V2 1/4] vgaarb: Add support for setting the default video device
  2012-04-18  9:37 ` Geert Uytterhoeven
@ 2012-04-18  9:44   ` Geert Uytterhoeven
  2012-04-20 10:49     ` Dave Airlie
  0 siblings, 1 reply; 11+ messages in thread
From: Geert Uytterhoeven @ 2012-04-18  9:44 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, benh, airlied, Linux/m68k

On Wed, Apr 18, 2012 at 11:37, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Mon, Apr 16, 2012 at 22:26, Matthew Garrett <mjg@redhat.com> wrote:
>> --- a/include/linux/vgaarb.h
>> +++ b/include/linux/vgaarb.h
>> @@ -31,6 +31,7 @@
>>  #ifndef LINUX_VGA_H
>>  #define LINUX_VGA_H
>>
>> +#include <video/vga.h>
>
> Is this include really needed? x86_64/allmodconfig builds fine without it.
>
> It causes m68k/allmodconfig to fail with:
>
> In file included from include/linux/vgaarb.h:35,
>                 from drivers/gpu/drm/drm_irq.c:43:
> include/video/vga.h: In function ‘vga_mm_r’:
> include/video/vga.h:242: error: implicit declaration of function ‘z_readb’
> include/video/vga.h: In function ‘vga_mm_w’:
> include/video/vga.h:247: error: implicit declaration of function ‘z_writeb’
> include/video/vga.h: In function ‘vga_mm_w_fast’:
> include/video/vga.h:253: error: implicit declaration of function ‘z_writew’
> make[1]: *** [drivers/gpu/drm/drm_irq.o] Error 1
>
> http://kisskb.ellerman.id.au/kisskb/buildresult/6127136/
>
> Currently <video/vga.h> has a crude hack to make cirrusfb work on Amiga,
> but that's the only VGA support m68k has.
> There's also no <asm/vga.h>, so m68k/allmodconfig with CONFIG_AMIGA
> disabled now fails with:
>
> In file included from include/linux/vgaarb.h:34,
>                 from drivers/gpu/drm/drm_irq.c:42:
> include/video/vga.h:23:21: error: asm/vga.h: No such file or directory
> make[1]: *** [drivers/gpu/drm/drm_irq.o] Error 1
>
> Removing the #include <video/vga.h> fixes both cases.

Anyway, I'll move the hack for cirrusfb on Amiga to <asm/vga.h> on m68k.

You still may want to remove the include of <video/vga.h> if it's not needed.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH V2 1/4] vgaarb: Add support for setting the default video device
  2012-04-18  9:44   ` Geert Uytterhoeven
@ 2012-04-20 10:49     ` Dave Airlie
  2012-04-20 10:51       ` Dave Airlie
  0 siblings, 1 reply; 11+ messages in thread
From: Dave Airlie @ 2012-04-20 10:49 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Matthew Garrett, linux-kernel, benh, airlied, Linux/m68k

On Wed, Apr 18, 2012 at 10:44 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Wed, Apr 18, 2012 at 11:37, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> On Mon, Apr 16, 2012 at 22:26, Matthew Garrett <mjg@redhat.com> wrote:
>>> --- a/include/linux/vgaarb.h
>>> +++ b/include/linux/vgaarb.h
>>> @@ -31,6 +31,7 @@
>>>  #ifndef LINUX_VGA_H
>>>  #define LINUX_VGA_H
>>>
>>> +#include <video/vga.h>
>>
>> Is this include really needed? x86_64/allmodconfig builds fine without it.
>>
>> It causes m68k/allmodconfig to fail with:
>>
>> In file included from include/linux/vgaarb.h:35,
>>                 from drivers/gpu/drm/drm_irq.c:43:
>> include/video/vga.h: In function ‘vga_mm_r’:
>> include/video/vga.h:242: error: implicit declaration of function ‘z_readb’
>> include/video/vga.h: In function ‘vga_mm_w’:
>> include/video/vga.h:247: error: implicit declaration of function ‘z_writeb’
>> include/video/vga.h: In function ‘vga_mm_w_fast’:
>> include/video/vga.h:253: error: implicit declaration of function ‘z_writew’
>> make[1]: *** [drivers/gpu/drm/drm_irq.o] Error 1
>>
>> http://kisskb.ellerman.id.au/kisskb/buildresult/6127136/
>>
>> Currently <video/vga.h> has a crude hack to make cirrusfb work on Amiga,
>> but that's the only VGA support m68k has.
>> There's also no <asm/vga.h>, so m68k/allmodconfig with CONFIG_AMIGA
>> disabled now fails with:
>>
>> In file included from include/linux/vgaarb.h:34,
>>                 from drivers/gpu/drm/drm_irq.c:42:
>> include/video/vga.h:23:21: error: asm/vga.h: No such file or directory
>> make[1]: *** [drivers/gpu/drm/drm_irq.o] Error 1
>>
>> Removing the #include <video/vga.h> fixes both cases.
>
> Anyway, I'll move the hack for cirrusfb on Amiga to <asm/vga.h> on m68k.
>
> You still may want to remove the include of <video/vga.h> if it's not needed.

I don't think its necessary, I'm dropping it here. should be gone in
-next soon after.

Dave.

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

* Re: [PATCH V2 1/4] vgaarb: Add support for setting the default video device
  2012-04-20 10:49     ` Dave Airlie
@ 2012-04-20 10:51       ` Dave Airlie
  0 siblings, 0 replies; 11+ messages in thread
From: Dave Airlie @ 2012-04-20 10:51 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Matthew Garrett, linux-kernel, benh, airlied, Linux/m68k

On Fri, Apr 20, 2012 at 11:49 AM, Dave Airlie <airlied@gmail.com> wrote:
> On Wed, Apr 18, 2012 at 10:44 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
>> On Wed, Apr 18, 2012 at 11:37, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>> On Mon, Apr 16, 2012 at 22:26, Matthew Garrett <mjg@redhat.com> wrote:
>>>> --- a/include/linux/vgaarb.h
>>>> +++ b/include/linux/vgaarb.h
>>>> @@ -31,6 +31,7 @@
>>>>  #ifndef LINUX_VGA_H
>>>>  #define LINUX_VGA_H
>>>>
>>>> +#include <video/vga.h>
>>>
>>> Is this include really needed? x86_64/allmodconfig builds fine without it.
>>>
>>> It causes m68k/allmodconfig to fail with:
>>>
>>> In file included from include/linux/vgaarb.h:35,
>>>                 from drivers/gpu/drm/drm_irq.c:43:
>>> include/video/vga.h: In function ‘vga_mm_r’:
>>> include/video/vga.h:242: error: implicit declaration of function ‘z_readb’
>>> include/video/vga.h: In function ‘vga_mm_w’:
>>> include/video/vga.h:247: error: implicit declaration of function ‘z_writeb’
>>> include/video/vga.h: In function ‘vga_mm_w_fast’:
>>> include/video/vga.h:253: error: implicit declaration of function ‘z_writew’
>>> make[1]: *** [drivers/gpu/drm/drm_irq.o] Error 1
>>>
>>> http://kisskb.ellerman.id.au/kisskb/buildresult/6127136/
>>>
>>> Currently <video/vga.h> has a crude hack to make cirrusfb work on Amiga,
>>> but that's the only VGA support m68k has.
>>> There's also no <asm/vga.h>, so m68k/allmodconfig with CONFIG_AMIGA
>>> disabled now fails with:
>>>
>>> In file included from include/linux/vgaarb.h:34,
>>>                 from drivers/gpu/drm/drm_irq.c:42:
>>> include/video/vga.h:23:21: error: asm/vga.h: No such file or directory
>>> make[1]: *** [drivers/gpu/drm/drm_irq.o] Error 1
>>>
>>> Removing the #include <video/vga.h> fixes both cases.
>>
>> Anyway, I'll move the hack for cirrusfb on Amiga to <asm/vga.h> on m68k.
>>
>> You still may want to remove the include of <video/vga.h> if it's not needed.
>
> I don't think its necessary, I'm dropping it here. should be gone in
> -next soon after.
>

Of course then I read the rest of the patches, and yes patch 4/4 would need it
so we pick up the __ARCH_HAS define, unless we can think of a better
place to put that.

Dave.
> Dave.

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

* Re: [PATCH V2 4/4] efifb: Implement vga_default_device()
  2012-04-16 20:26 ` [PATCH V2 4/4] efifb: Implement vga_default_device() Matthew Garrett
@ 2012-04-20 11:13   ` Dave Airlie
  0 siblings, 0 replies; 11+ messages in thread
From: Dave Airlie @ 2012-04-20 11:13 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, hpa, matt.fleming

On Mon, Apr 16, 2012 at 9:26 PM, Matthew Garrett <mjg@redhat.com> wrote:
> EFI doesn't typically make use of the legacy VGA ROM, but it may still be
> configured to pass that through to a given video device. This may lead to
> an inaccurate choice of default video device. Add support to efifb to pick
> out the correct active video device.
>
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> Cc: hpa@zytor.com
> Cc: matt.fleming@intel.com
> ---
>  arch/x86/include/asm/vga.h |    6 ++++
>  drivers/video/efifb.c      |   77 ++++++++++++++++++++++++++++++++------------
>  2 files changed, 63 insertions(+), 20 deletions(-)
>
> diff --git a/arch/x86/include/asm/vga.h b/arch/x86/include/asm/vga.h
> index c4b9dc2..2723c07 100644
> --- a/arch/x86/include/asm/vga.h
> +++ b/arch/x86/include/asm/vga.h
> @@ -17,4 +17,10 @@
>  #define vga_readb(x) (*(x))
>  #define vga_writeb(x, y) (*(y) = (x))
>
> +#if CONFIG_FB_EFI

^ #ifdef?

Dave.

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

end of thread, other threads:[~2012-04-20 11:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 20:26 [PATCH V2 1/4] vgaarb: Add support for setting the default video device Matthew Garrett
2012-04-16 20:26 ` [PATCH V2 2/4] vga-switcheroo: Use vga_default_device() Matthew Garrett
2012-04-16 20:26 ` [PATCH V2 3/4] x86: Use vga_default_device() when determining whether an fb is primary Matthew Garrett
2012-04-16 20:26 ` [PATCH V2 4/4] efifb: Implement vga_default_device() Matthew Garrett
2012-04-20 11:13   ` Dave Airlie
2012-04-16 20:52 ` [PATCH V2 1/4] vgaarb: Add support for setting the default video device H. Peter Anvin
2012-04-16 23:00   ` Benjamin Herrenschmidt
2012-04-18  9:37 ` Geert Uytterhoeven
2012-04-18  9:44   ` Geert Uytterhoeven
2012-04-20 10:49     ` Dave Airlie
2012-04-20 10:51       ` Dave Airlie

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.