Skip to contentSkip to conversation

drm/i915: Select CONFIG_AGP and CONFIG_AGP_INTEL

PATCH In review [email protected] 2 participants 5 messages Nov 1, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Select CONFIG_AGP and CONFIG_AGP_INTEL

From: Ville Syrjälä <[email protected]>

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.

---
 drivers/gpu/drm/i915/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/Kconfig +2 -2
index 6199d0b..0602e65 100644
@@ -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
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 8 lines · On Fri, Nov 1, 2013 at 9:38 AM, <[email protected]> wrote:

From: Ville Syrjälä <[email protected]>

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.

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

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#2 lore raw
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · On Fri, Nov 1, 2013 at 9:38 AM, <[email protected]> wrote:

From: Ville Syrjälä <[email protected]>

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.

Quoted 5 lines
Quoted 1 line

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?

Signature · 2 lines
Ville Syrjälä
Intel OTC
#3 lore raw
Quoted 9 lines · Ville Syrjälä
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · On Fri, Nov 1, 2013 at 9:38 AM, <[email protected]> wrote:

From: Ville Syrjälä <[email protected]>

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.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

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

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw

PATCH 1/1 drm/i915: Make AGP support optional

From: Ville Syrjälä <[email protected]>

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.

---
 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(-)
drivers/char/Makefile +1 -1
index 7ff1d0d..2d68054 100644
@@ -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
drivers/char/agp/Kconfig +5 -0
index d8b1b57..77ae9bd 100644
@@ -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
+
drivers/char/agp/Makefile +1 -1
index 8eb56e2..604489b 100644
@@ -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
drivers/char/agp/intel-gtt.c +18 -0
index b8e2014..078968d 100644
@@ -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);
 
drivers/gpu/drm/i915/Kconfig +3 -2
index 6199d0b..536e5d3 100644
@@ -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
drivers/gpu/drm/i915/i915_drv.c +4 -0
index a0804fa..2857069 100644
@@ -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,
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx