All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Select CONFIG_AGP and CONFIG_AGP_INTEL
@ 2013-11-01  8:38 ville.syrjala
  2013-11-01  8:54 ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: ville.syrjala @ 2013-11-01  8:38 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

i915 depends on CONFIG_AGP and CONFIG_AGP_INTEL. Since AGP is a thing
of the past, it's somewhat likely that a user would not realize that
they need to enable those to get i915. So let's just select CONFIG_AGP
and CONFIG_AGP_INTEL instead of depending on them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 6199d0b..0602e65 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -1,8 +1,8 @@
 config DRM_I915
 	tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics"
 	depends on DRM
-	depends on AGP
-	depends on AGP_INTEL
+	select AGP
+	select AGP_INTEL
 	# we need shmfs for the swappable backing store, and in particular
 	# the shmem_readpage() which depends upon tmpfs
 	select SHMEM
-- 
1.8.1.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Select CONFIG_AGP and CONFIG_AGP_INTEL
  2013-11-01  8:38 [PATCH] drm/i915: Select CONFIG_AGP and CONFIG_AGP_INTEL ville.syrjala
@ 2013-11-01  8:54 ` Daniel Vetter
  2013-11-01  9:00   ` Ville Syrjälä
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2013-11-01  8:54 UTC (permalink / raw)
  To: Syrjala, Ville; +Cc: intel-gfx

On Fri, Nov 1, 2013 at 9:38 AM,  <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> i915 depends on CONFIG_AGP and CONFIG_AGP_INTEL. Since AGP is a thing
> of the past, it's somewhat likely that a user would not realize that
> they need to enable those to get i915. So let's just select CONFIG_AGP
> and CONFIG_AGP_INTEL instead of depending on them.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

We don't actually need agp, at least for the kms driver. So I'd go the
other direction and make it fully optional. UMS won't work if someone
misconfigures their kernel, but meh.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH] drm/i915: Select CONFIG_AGP and CONFIG_AGP_INTEL
  2013-11-01  8:54 ` Daniel Vetter
@ 2013-11-01  9:00   ` Ville Syrjälä
  2013-11-01  9:22     ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2013-11-01  9:00 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

On Fri, Nov 01, 2013 at 09:54:39AM +0100, Daniel Vetter wrote:
> On Fri, Nov 1, 2013 at 9:38 AM,  <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > i915 depends on CONFIG_AGP and CONFIG_AGP_INTEL. Since AGP is a thing
> > of the past, it's somewhat likely that a user would not realize that
> > they need to enable those to get i915. So let's just select CONFIG_AGP
> > and CONFIG_AGP_INTEL instead of depending on them.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> We don't actually need agp, at least for the kms driver. So I'd go the
> other direction and make it fully optional. UMS won't work if someone
> misconfigures their kernel, but meh.

Don't we still need the AGP backend code for GTT frobbing on older gens?

-- 
Ville Syrjälä
Intel OTC

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

* Re: [PATCH] drm/i915: Select CONFIG_AGP and CONFIG_AGP_INTEL
  2013-11-01  9:00   ` Ville Syrjälä
@ 2013-11-01  9:22     ` Daniel Vetter
  2013-11-01 13:18       ` [PATCH] drm/i915: Make AGP support optional ville.syrjala
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2013-11-01  9:22 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

On Fri, Nov 1, 2013 at 10:00 AM, Ville Syrjälä
<ville.syrjala@linux.intel.com> wrote:
> On Fri, Nov 01, 2013 at 09:54:39AM +0100, Daniel Vetter wrote:
>> On Fri, Nov 1, 2013 at 9:38 AM,  <ville.syrjala@linux.intel.com> wrote:
>> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >
>> > i915 depends on CONFIG_AGP and CONFIG_AGP_INTEL. Since AGP is a thing
>> > of the past, it's somewhat likely that a user would not realize that
>> > they need to enable those to get i915. So let's just select CONFIG_AGP
>> > and CONFIG_AGP_INTEL instead of depending on them.
>> >
>> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> We don't actually need agp, at least for the kms driver. So I'd go the
>> other direction and make it fully optional. UMS won't work if someone
>> misconfigures their kernel, but meh.
>
> Don't we still need the AGP backend code for GTT frobbing on older gens?

We have the intel-gtt.ko module, which we need on pre-gen6. We could
add a hidden config symbol for that which is selected by both i915.ko
and the intel agp driver.

On i945g we also need the real apg driver in kms mode to keep really
old XvMC working. But imo we could switch that to a flexible depency
(i.e. only enforce it if CONFIG_AGP_INTEL is defined). Iirc there's
1-2 other places that could be treated similarly. And of course
without the AGP driver the ums driver will fail to load, but that's
already enforced in the drm core with the AGP_REQUIRE flag.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* [PATCH] drm/i915: Make AGP support optional
  2013-11-01  9:22     ` Daniel Vetter
@ 2013-11-01 13:18       ` ville.syrjala
  0 siblings, 0 replies; 5+ messages in thread
From: ville.syrjala @ 2013-11-01 13:18 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We only depend on the intel-gtt module for GTT frobbign on older gens.
The intel_agp module is optional, except for UMS and some old XvMC
userland on gen3. So make AGP support optional. As before, we will
fail the i915 init for UMS and gen3 KMS the same as before if
intel_agp isn't around.

intel-gtt.c is left with a somewhat ugly ifdef mess, but I'm going
to save that for a later cleaning.

At least my gen2 still works with the patch and CONFIG_AGP=n.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/char/Makefile           |  2 +-
 drivers/char/agp/Kconfig        |  5 +++++
 drivers/char/agp/Makefile       |  2 +-
 drivers/char/agp/intel-gtt.c    | 18 ++++++++++++++++++
 drivers/gpu/drm/i915/Kconfig    |  5 +++--
 drivers/gpu/drm/i915/i915_drv.c |  4 ++++
 6 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 7ff1d0d..2d68054 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -50,7 +50,7 @@ obj-$(CONFIG_GPIO_TB0219)	+= tb0219.o
 obj-$(CONFIG_TELCLOCK)		+= tlclk.o
 
 obj-$(CONFIG_MWAVE)		+= mwave/
-obj-$(CONFIG_AGP)		+= agp/
+obj-y				+= agp/
 obj-$(CONFIG_PCMCIA)		+= pcmcia/
 
 obj-$(CONFIG_HANGCHECK_TIMER)	+= hangcheck-timer.o
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
index d8b1b57..77ae9bd 100644
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -68,6 +68,7 @@ config AGP_AMD64
 config AGP_INTEL
 	tristate "Intel 440LX/BX/GX, I8xx and E7x05 chipset support"
 	depends on AGP && X86
+	select INTEL_GTT
 	help
 	  This option gives you AGP support for the GLX component of X
 	  on Intel 440LX/BX/GX, 815, 820, 830, 840, 845, 850, 860, 875,
@@ -155,3 +156,7 @@ config AGP_SGI_TIOCA
           This option gives you AGP GART support for the SGI TIO chipset
           for IA64 processors.
 
+config INTEL_GTT
+	tristate
+	depends on X86
+
diff --git a/drivers/char/agp/Makefile b/drivers/char/agp/Makefile
index 8eb56e2..604489b 100644
--- a/drivers/char/agp/Makefile
+++ b/drivers/char/agp/Makefile
@@ -13,7 +13,7 @@ obj-$(CONFIG_AGP_HP_ZX1)	+= hp-agp.o
 obj-$(CONFIG_AGP_PARISC)	+= parisc-agp.o
 obj-$(CONFIG_AGP_I460)		+= i460-agp.o
 obj-$(CONFIG_AGP_INTEL)		+= intel-agp.o
-obj-$(CONFIG_AGP_INTEL)		+= intel-gtt.o
+obj-$(CONFIG_INTEL_GTT)		+= intel-gtt.o
 obj-$(CONFIG_AGP_NVIDIA)	+= nvidia-agp.o
 obj-$(CONFIG_AGP_SGI_TIOCA)	+= sgi-agp.o
 obj-$(CONFIG_AGP_SIS)		+= sis-agp.o
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index b8e2014..078968d 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -94,6 +94,7 @@ static struct _intel_private {
 #define IS_IRONLAKE	intel_private.driver->is_ironlake
 #define HAS_PGTBL_EN	intel_private.driver->has_pgtbl_enable
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 static int intel_gtt_map_memory(struct page **pages,
 				unsigned int num_entries,
 				struct sg_table *st)
@@ -168,6 +169,7 @@ static void i8xx_destroy_pages(struct page *page)
 	__free_pages(page, 2);
 	atomic_dec(&agp_bridge->current_memory_agp);
 }
+#endif
 
 #define I810_GTT_ORDER 4
 static int i810_setup(void)
@@ -209,6 +211,7 @@ static void i810_cleanup(void)
 	free_gatt_pages(intel_private.i81x_gtt_table, I810_GTT_ORDER);
 }
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 static int i810_insert_dcache_entries(struct agp_memory *mem, off_t pg_start,
 				      int type)
 {
@@ -289,6 +292,7 @@ static void intel_i810_free_by_type(struct agp_memory *curr)
 	}
 	kfree(curr);
 }
+#endif
 
 static int intel_gtt_setup_scratch_page(void)
 {
@@ -647,7 +651,9 @@ static int intel_gtt_init(void)
 		return -ENOMEM;
 	}
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 	global_cache_flush();   /* FIXME: ? */
+#endif
 
 	intel_private.stolen_size = intel_gtt_stolen_size();
 
@@ -671,6 +677,7 @@ static int intel_gtt_init(void)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 static int intel_fake_agp_fetch_size(void)
 {
 	int num_sizes = ARRAY_SIZE(intel_fake_agp_sizes);
@@ -689,6 +696,7 @@ static int intel_fake_agp_fetch_size(void)
 
 	return 0;
 }
+#endif
 
 static void i830_cleanup(void)
 {
@@ -801,6 +809,7 @@ static int i830_setup(void)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 static int intel_fake_agp_create_gatt_table(struct agp_bridge_data *bridge)
 {
 	agp_bridge->gatt_table_real = NULL;
@@ -825,6 +834,7 @@ static int intel_fake_agp_configure(void)
 
 	return 0;
 }
+#endif
 
 static bool i830_check_flags(unsigned int flags)
 {
@@ -863,6 +873,7 @@ void intel_gtt_insert_sg_entries(struct sg_table *st,
 }
 EXPORT_SYMBOL(intel_gtt_insert_sg_entries);
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 static void intel_gtt_insert_pages(unsigned int first_entry,
 				   unsigned int num_entries,
 				   struct page **pages,
@@ -928,6 +939,7 @@ out_err:
 	mem->is_flushed = true;
 	return ret;
 }
+#endif
 
 void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries)
 {
@@ -941,6 +953,7 @@ void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries)
 }
 EXPORT_SYMBOL(intel_gtt_clear_range);
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 static int intel_fake_agp_remove_entries(struct agp_memory *mem,
 					 off_t pg_start, int type)
 {
@@ -982,6 +995,7 @@ static struct agp_memory *intel_fake_agp_alloc_by_type(size_t pg_count,
 	/* always return NULL for other allocation types for now */
 	return NULL;
 }
+#endif
 
 static int intel_alloc_chipset_flush_resource(void)
 {
@@ -1138,6 +1152,7 @@ static int i9xx_setup(void)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 static const struct agp_bridge_driver intel_fake_agp_driver = {
 	.owner			= THIS_MODULE,
 	.size_type		= FIXED_APER_SIZE,
@@ -1159,6 +1174,7 @@ static const struct agp_bridge_driver intel_fake_agp_driver = {
 	.agp_destroy_page	= agp_generic_destroy_page,
 	.agp_destroy_pages      = agp_generic_destroy_pages,
 };
+#endif
 
 static const struct intel_gtt_driver i81x_gtt_driver = {
 	.gen = 1,
@@ -1376,11 +1392,13 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev,
 
 	intel_private.refcount++;
 
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 	if (bridge) {
 		bridge->driver = &intel_fake_agp_driver;
 		bridge->dev_private_data = &intel_private;
 		bridge->dev = bridge_pdev;
 	}
+#endif
 
 	intel_private.bridge_dev = pci_dev_get(bridge_pdev);
 
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 6199d0b..536e5d3 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -1,8 +1,9 @@
 config DRM_I915
 	tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics"
 	depends on DRM
-	depends on AGP
-	depends on AGP_INTEL
+	depends on (AGP || AGP=n)
+	select INTEL_GTT
+	select AGP_INTEL if AGP
 	# we need shmfs for the swappable backing store, and in particular
 	# the shmem_readpage() which depends upon tmpfs
 	select SHMEM
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index a0804fa..2857069 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -155,7 +155,11 @@ MODULE_PARM_DESC(prefault_disable,
 		"Disable page prefaulting for pread/pwrite/reloc (default:false). For developers only.");
 
 static struct drm_driver driver;
+#if IS_ENABLED(CONFIG_AGP_INTEL)
 extern int intel_agp_enabled;
+#else
+static int intel_agp_enabled;
+#endif
 
 static const struct intel_device_info intel_i830_info = {
 	.gen = 2, .is_mobile = 1, .cursor_needs_physical = 1, .num_pipes = 2,
-- 
1.8.1.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2013-11-01 13:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01  8:38 [PATCH] drm/i915: Select CONFIG_AGP and CONFIG_AGP_INTEL ville.syrjala
2013-11-01  8:54 ` Daniel Vetter
2013-11-01  9:00   ` Ville Syrjälä
2013-11-01  9:22     ` Daniel Vetter
2013-11-01 13:18       ` [PATCH] drm/i915: Make AGP support optional ville.syrjala

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.