All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] acpi_video: fix leaking PCI references
@ 2012-04-25 13:33 Alan Cox
  2012-04-25 13:33 ` [PATCH 2/3] acpi_video: Intel video is not always i915 Alan Cox
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Alan Cox @ 2012-04-25 13:33 UTC (permalink / raw)
  To: airlied, dri-devel, linux-acpi

From: Alan Cox <alan@linux.intel.com>

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/acpi/video.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 9577b6f..66e8f73 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1745,6 +1745,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
 
 static int __init intel_opregion_present(void)
 {
+	int i915 = 0;
 #if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE)
 	struct pci_dev *dev = NULL;
 	u32 address;
@@ -1757,10 +1758,10 @@ static int __init intel_opregion_present(void)
 		pci_read_config_dword(dev, 0xfc, &address);
 		if (!address)
 			continue;
-		return 1;
+		i915 = 1;
 	}
 #endif
-	return 0;
+	return i915;
 }
 
 int acpi_video_register(void)


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

* [PATCH 2/3] acpi_video: Intel video is not always i915
  2012-04-25 13:33 [PATCH 1/3] acpi_video: fix leaking PCI references Alan Cox
@ 2012-04-25 13:33 ` Alan Cox
  2012-04-25 13:34 ` [PATCH 3/3] gma500: don't register the ACPI video bus Alan Cox
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2012-04-25 13:33 UTC (permalink / raw)
  To: airlied, dri-devel, linux-acpi

From: Alan Cox <alan@linux.intel.com>

Stop it poking at random registers on the i740 cards that may be out there
still.

As per Matthew's feedback remove the conditional checks and never enable the
opregion handling unless an appropriate driver has been loaded.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/acpi/video.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 66e8f73..609262d 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1743,10 +1743,18 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
 	return 0;
 }
 
+static int __init is_i740(struct pci_dev *dev)
+{
+	if (dev->device == 0x00D1)
+		return 1;
+	if (dev->device == 0x7000)
+		return 1;
+	return 0;
+}
+
 static int __init intel_opregion_present(void)
 {
-	int i915 = 0;
-#if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE)
+	int opregion = 0;
 	struct pci_dev *dev = NULL;
 	u32 address;
 
@@ -1755,13 +1763,15 @@ static int __init intel_opregion_present(void)
 			continue;
 		if (dev->vendor != PCI_VENDOR_ID_INTEL)
 			continue;
+		/* We don't want to poke around undefined i740 registers */
+		if (is_i740(dev))
+			continue;
 		pci_read_config_dword(dev, 0xfc, &address);
 		if (!address)
 			continue;
-		i915 = 1;
+		opregion = 1;
 	}
-#endif
-	return i915;
+	return opregion;
 }
 
 int acpi_video_register(void)


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

* [PATCH 3/3] gma500: don't register the ACPI video bus
  2012-04-25 13:33 [PATCH 1/3] acpi_video: fix leaking PCI references Alan Cox
  2012-04-25 13:33 ` [PATCH 2/3] acpi_video: Intel video is not always i915 Alan Cox
@ 2012-04-25 13:34 ` Alan Cox
  2012-04-25 14:09 ` [PATCH 1/3] acpi_video: fix leaking PCI references Matthew Garrett
  2012-05-08  6:10 ` Len Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2012-04-25 13:34 UTC (permalink / raw)
  To: airlied, dri-devel, linux-acpi

From: Alan Cox <alan@linux.intel.com>

We are not yet ready for this and it makes a mess on some devices.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/gpu/drm/gma500/psb_drv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index c34adf9..09af2ff 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -349,7 +349,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
 	PSB_WSGX32(0x30000000, PSB_CR_BIF_3D_REQ_BASE);
 
 /*	igd_opregion_init(&dev_priv->opregion_dev); */
-	acpi_video_register();
+/*	acpi_video_register(); */
 	if (dev_priv->lid_state)
 		psb_lid_timer_init(dev_priv);
 


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

* Re: [PATCH 1/3] acpi_video: fix leaking PCI references
  2012-04-25 13:33 [PATCH 1/3] acpi_video: fix leaking PCI references Alan Cox
  2012-04-25 13:33 ` [PATCH 2/3] acpi_video: Intel video is not always i915 Alan Cox
  2012-04-25 13:34 ` [PATCH 3/3] gma500: don't register the ACPI video bus Alan Cox
@ 2012-04-25 14:09 ` Matthew Garrett
  2012-05-08  6:10 ` Len Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Matthew Garrett @ 2012-04-25 14:09 UTC (permalink / raw)
  To: Alan Cox; +Cc: airlied, dri-devel, linux-acpi

Acked-by: Matthew Garrett <mjg@redhat.com>

for the set.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH 1/3] acpi_video: fix leaking PCI references
  2012-04-25 13:33 [PATCH 1/3] acpi_video: fix leaking PCI references Alan Cox
                   ` (2 preceding siblings ...)
  2012-04-25 14:09 ` [PATCH 1/3] acpi_video: fix leaking PCI references Matthew Garrett
@ 2012-05-08  6:10 ` Len Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Len Brown @ 2012-05-08  6:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: airlied, dri-devel, linux-acpi

series applied to ACPI next branch

thanks,
Len Brown, Intel Open Source Technology Center

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

* [PATCH 1/3] acpi_video: fix leaking PCI references
@ 2012-04-24 15:44 Alan Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2012-04-24 15:44 UTC (permalink / raw)
  To: airlied, dri-devel, linux-acpi

From: Alan Cox <alan@linux.intel.com>

Otherwise we keep a bogus pci reference to the GPU

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/acpi/video.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 9577b6f..66e8f73 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1745,6 +1745,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
 
 static int __init intel_opregion_present(void)
 {
+	int i915 = 0;
 #if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE)
 	struct pci_dev *dev = NULL;
 	u32 address;
@@ -1757,10 +1758,10 @@ static int __init intel_opregion_present(void)
 		pci_read_config_dword(dev, 0xfc, &address);
 		if (!address)
 			continue;
-		return 1;
+		i915 = 1;
 	}
 #endif
-	return 0;
+	return i915;
 }
 
 int acpi_video_register(void)


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

end of thread, other threads:[~2012-05-08  6:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-25 13:33 [PATCH 1/3] acpi_video: fix leaking PCI references Alan Cox
2012-04-25 13:33 ` [PATCH 2/3] acpi_video: Intel video is not always i915 Alan Cox
2012-04-25 13:34 ` [PATCH 3/3] gma500: don't register the ACPI video bus Alan Cox
2012-04-25 14:09 ` [PATCH 1/3] acpi_video: fix leaking PCI references Matthew Garrett
2012-05-08  6:10 ` Len Brown
  -- strict thread matches above, loose matches on Subject: below --
2012-04-24 15:44 Alan Cox

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.