public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Antonino Daplas <adaplas@pol.net>
To: Dave Jones <davej@codemonkey.org.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG]: agpgart for i810 chipsets broken in 2.5.51
Date: 11 Dec 2002 02:00:47 +0500	[thread overview]
Message-ID: <1039553986.1054.7.camel@localhost.localdomain> (raw)
In-Reply-To: <20021210170542.GB577@codemonkey.org.uk>

On Tue, 2002-12-10 at 22:05, Dave Jones wrote:
> On Tue, Dec 10, 2002 at 05:06:17PM +0000, Alan Cox wrote:
>  > Given how fragile the AGP code can be I would much rather we had the AGP
>  > continue to initialize late. If the AGP init function is something like
>  > 
>  > 
>  > int agp_required(void)
>  > {
>  > 	static int agp_inited = 0;
>  > 
>  > 	if(!agp_inited)
>  > 	{
>  > 		agp_inited = 1;
>  > 		agp_do_real_init();
>  > 	}
>  > }
>  > 
>  > module_init(agp_required);
>  > 
>  > 
>  > Then the i810 fb driver can do
>  > 
>  > 	agp_required();
>  > 
>  > and force the order change only if necessary.
> 
> That works for me. It's not ideal, but it's the cleanest
> solution suggested so far. I'll hack a check into
> agp_init() to do this, which should allow us to close bug #20 [*]
> 

Oops, Alan beat me into it. It's basically the same as what I've got
except I had an i810fb specific macro.  I guess the one without the
macro is cleaner.

Tony

diff -Naur linux-2.5.51/drivers/char/agp/backend.c linux/drivers/char/agp/backend.c
--- linux-2.5.51/drivers/char/agp/backend.c	2002-12-10 20:46:58.000000000 +0000
+++ linux/drivers/char/agp/backend.c	2002-12-10 20:46:26.000000000 +0000
@@ -269,7 +269,7 @@
 	return 0;
 }
 
-int __init agp_init(void)
+int __init do_agp_init(void)
 {
 	memset(&agp_bridge, 0, sizeof(struct agp_bridge_data));
 	agp_bridge.type = NOT_SUPPORTED;
@@ -279,6 +279,25 @@
 	return 0;
 }
 
+#ifdef CONFIG_FB_I810
+int __init agp_init(void) 
+{
+	static int agp_has_init = 0;
+
+	if (agp_has_init)
+		return 0;
+
+	agp_has_init = 1;
+
+	return do_agp_init();
+}
+#else
+static int __init agp_init(void)
+{
+	return do_agp_init();
+}
+#endif
+
 #ifndef CONFIG_GART_IOMMU
 module_init(agp_init);
 #endif
diff -Naur linux-2.5.51/drivers/char/agp/intel-agp.c linux/drivers/char/agp/intel-agp.c
--- linux-2.5.51/drivers/char/agp/intel-agp.c	2002-12-10 20:47:03.000000000 +0000
+++ linux/drivers/char/agp/intel-agp.c	2002-12-10 20:46:23.000000000 +0000
@@ -1470,7 +1470,7 @@
 	.probe		= agp_intel_probe,
 };
 
-static int __init agp_intel_init(void)
+static int __init do_agp_intel_init(void)
 {
 	int ret_val;
 
@@ -1487,6 +1487,25 @@
 	pci_unregister_driver(&agp_intel_pci_driver);
 }
 
+#ifdef CONFIG_FB_I810
+int __init agp_intel_init(void) 
+{
+	static int intel_agp_has_init = 0;
+
+	if (intel_agp_has_init)
+		return 0;
+
+	intel_agp_has_init = 1;
+
+	return do_agp_intel_init();
+}
+#else
+static int __init agp_intel_init(void)
+{
+	return do_agp_intel_init();
+}
+#endif
+
 module_init(agp_intel_init);
 module_exit(agp_intel_cleanup);
 


  reply	other threads:[~2002-12-10 18:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-10 12:21 [BUG]: agpgart for i810 chipsets broken in 2.5.51 Antonino Daplas
2002-12-10 13:11 ` Dave Jones
2002-12-10 16:47   ` Antonino Daplas
2002-12-10 14:03     ` Dave Jones
2002-12-10 17:34       ` Antonino Daplas
2002-12-10 19:08       ` Antonino Daplas
2002-12-10 16:23         ` Dave Jones
2002-12-10 17:06           ` Alan Cox
2002-12-10 17:05             ` Dave Jones
2002-12-10 21:00               ` Antonino Daplas [this message]
2002-12-10 18:21                 ` Dave Jones
2002-12-10 21:23                   ` Antonino Daplas
2002-12-10 19:36           ` Antonino Daplas
2002-12-10 14:48     ` Dave Jones
2002-12-10 19:07       ` Antonino Daplas
2002-12-10 16:17         ` Dave Jones
2002-12-10 19:37           ` Antonino Daplas
2002-12-10 21:01           ` Antonino Daplas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1039553986.1054.7.camel@localhost.localdomain \
    --to=adaplas@pol.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox