Skip to contentSkip to conversation

i915: slow acpi_lid_open() causes flickering

PATCH In review Thomas Meyer 5 participants 7 messages Feb 1, 2010 – Feb 4, 2010

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

PATCH 1/1 i915: slow acpi_lid_open() causes flickering

acpi_lid_open() could take up to 10ms on my computer.
Some component is calling the drm GETCONNECTOR ioctl many times in a row. This results in flickering (for example, when starting a video). Fix it by assuming an always connected lid status.

This fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=14670

---
 drivers/gpu/drm/i915/intel_lvds.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +14 -1
index aa74e59..0f0779c 100644
@@ -632,6 +632,18 @@ static const struct dmi_system_id bad_lid_status[] = {
 	{ }
 };
 
+/* Some lid devices take a long time to report the lid status, assume they're connected*/
+static const struct dmi_system_id slow_lid_status[] = {
+	{
+		.ident = "Aspire 1810T",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1810T"),
+		},
+	},
+	{ }
+};
+
 /**
  * Detect the LVDS connection.
  *
@@ -643,7 +655,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect
 {
 	enum drm_connector_status status = connector_status_connected;
 
-	if (!acpi_lid_open() && !dmi_check_system(bad_lid_status))
+	if (!dmi_check_system(slow_lid_status) && !dmi_check_system(bad_lid_status))
+	    if (!acpi_lid_open())
 		status = connector_status_disconnected;
 
 	return status;
Signature · 1 line
1.6.6
#1 lore raw
Quoted 35 lines · On Mon, 01 Feb 2010 19:20:53 +0100 Thomas Meyer <[email protected]> wrote:

acpi_lid_open() could take up to 10ms on my computer.
Some component is calling the drm GETCONNECTOR ioctl many times in a row. This results in flickering (for example, when starting a video). Fix it by assuming an always connected lid status.

This fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=14670

---
 drivers/gpu/drm/i915/intel_lvds.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +12 -0
index aa74e59..0f0779c 100644
@@ -632,6 +632,18 @@ static const struct dmi_system_id bad_lid_status[] = {
 	{ }
 };
 
+/* Some lid devices take a long time to report the lid status, assume they're connected*/
+static const struct dmi_system_id slow_lid_status[] = {
+	{
+		.ident = "Aspire 1810T",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1810T"),
+		},
+	},
+	{ }
+};
+
 /**
  * Detect the LVDS connection.
  *

drivers/gpu/drm/i915/intel_lvds.c static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect · line 662

Quoted 9 lines
drivers/gpu/drm/i915/intel_lvds.c +2 -1
@@ -643,7 +655,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect
 {
 	enum drm_connector_status status = connector_status_connected;
 
-	if (!acpi_lid_open() && !dmi_check_system(bad_lid_status))
+	if (!dmi_check_system(slow_lid_status) && !dmi_check_system(bad_lid_status))
+	    if (!acpi_lid_open())
 		status = connector_status_disconnected;
 
 	return status;

The patch is missing your Signed-off-by: line. I cheekily added it. Please check Documentation/SubmittingPatches, let me know if you disagree with this, thanks.

#2 lore raw
Quoted 52 lines · Andrew Morton
Quoted 35 lines · On Mon, 01 Feb 2010 19:20:53 +0100 Thomas Meyer<[email protected]> wrote:

acpi_lid_open() could take up to 10ms on my computer.
Some component is calling the drm GETCONNECTOR ioctl many times in a row. This results in flickering (for example, when starting a video). Fix it by assuming an always connected lid status.

This fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=14670

---
  drivers/gpu/drm/i915/intel_lvds.c |   15 ++++++++++++++-
  1 files changed, 14 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +12 -0
index aa74e59..0f0779c 100644
@@ -632,6 +632,18 @@ static const struct dmi_system_id bad_lid_status[] = {
  	{ }
  };
 
+/* Some lid devices take a long time to report the lid status, assume they're connected*/
+static const struct dmi_system_id slow_lid_status[] = {
+	{
+		.ident = "Aspire 1810T",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1810T"),
+		},
+	},
+	{ }
+};
+
  /**
   * Detect the LVDS connection.
   *

drivers/gpu/drm/i915/intel_lvds.c static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect · line 662

Quoted 9 lines
drivers/gpu/drm/i915/intel_lvds.c +2 -1
@@ -643,7 +655,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect
  {
  	enum drm_connector_status status = connector_status_connected;
 
-	if (!acpi_lid_open()&&  !dmi_check_system(bad_lid_status))
+	if (!dmi_check_system(slow_lid_status)&&  !dmi_check_system(bad_lid_status))
+	    if (!acpi_lid_open())
  		status = connector_status_disconnected;
 
  	return status;

The patch is missing your Signed-off-by: line. I cheekily added it. Please check Documentation/SubmittingPatches, let me know if you disagree with this, thanks.

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

I'm wondering if just adding your DMI entry to
bad_lid_status[] is all that is really needed.
(this way it saves bits in the kernel).

Justin P. Mattock

#3 lore raw

Am Montag, den 01.02.2010, 16:00 -0800 schrieb Justin P. Mattock:

Quoted 60 lines · Andrew Morton
Quoted 52 lines
Quoted 35 lines · On Mon, 01 Feb 2010 19:20:53 +0100 Thomas Meyer<[email protected]> wrote:

acpi_lid_open() could take up to 10ms on my computer.
Some component is calling the drm GETCONNECTOR ioctl many times in a row. This results in flickering (for example, when starting a video). Fix it by assuming an always connected lid status.

This fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=14670

---
  drivers/gpu/drm/i915/intel_lvds.c |   15 ++++++++++++++-
  1 files changed, 14 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +12 -0
index aa74e59..0f0779c 100644
@@ -632,6 +632,18 @@ static const struct dmi_system_id bad_lid_status[] = {
  	{ }
  };
 
+/* Some lid devices take a long time to report the lid status, assume they're connected*/
+static const struct dmi_system_id slow_lid_status[] = {
+	{
+		.ident = "Aspire 1810T",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1810T"),
+		},
+	},
+	{ }
+};
+
  /**
   * Detect the LVDS connection.
   *

drivers/gpu/drm/i915/intel_lvds.c static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect · line 662

Quoted 9 lines
drivers/gpu/drm/i915/intel_lvds.c +2 -1
@@ -643,7 +655,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect
  {
  	enum drm_connector_status status = connector_status_connected;
 
-	if (!acpi_lid_open()&&  !dmi_check_system(bad_lid_status))
+	if (!dmi_check_system(slow_lid_status)&&  !dmi_check_system(bad_lid_status))
+	    if (!acpi_lid_open())
  		status = connector_status_disconnected;
 
  	return status;

The patch is missing your Signed-off-by: line. I cheekily added it. Please check Documentation/SubmittingPatches, let me know if you disagree with this, thanks.

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Quoted 3 lines

I'm wondering if just adding your DMI entry to
bad_lid_status[] is all that is really needed.
(this way it saves bits in the kernel).

I tried that with no success. I guess to execute the if statement the functions acpi_lid_open() and dmi_check_system() needs to be executed and that leads to the flickering.

maybe it helps to just reorder the if statement? first execute dmi_check_system() and then execute acpi_lid_open(), but as both conditions are connected via an "AND" I guess the acpi_lid_open() still will be executed each time dmi_check_system() is executed.

mfg
thomas

#4 lore raw
In reply to Andrew Morton
Quoted 9 lines · Andrew Morton
Quoted 7 lines · On Mon, 01 Feb 2010 19:20:53 +0100 Thomas Meyer <[email protected]> wrote:

acpi_lid_open() could take up to 10ms on my computer.
Some component is calling the drm GETCONNECTOR ioctl many times in a row. This results in flickering (for example, when starting a video). Fix it by assuming an always connected lid status.

This fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=14670

Quoted 8 lines

drivers/gpu/drm/i915/intel_lvds.c

Quoted 8 lines
---
 drivers/gpu/drm/i915/intel_lvds.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +0 -0
index aa74e59..0f0779c 100644

[]

Quoted 10 lines

drivers/gpu/drm/i915/intel_lvds.c static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect · line 662

Quoted 10 lines
drivers/gpu/drm/i915/intel_lvds.c +2 -1
@@ -643,7 +655,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect
 {
 	enum drm_connector_status status = connector_status_connected;
 
-	if (!acpi_lid_open() && !dmi_check_system(bad_lid_status))
+	if (!dmi_check_system(slow_lid_status) && !dmi_check_system(bad_lid_status))
+	    if (!acpi_lid_open())
 		status = connector_status_disconnected;
 
 	return status;

Shouldn't this use an && test instead of a 4 space indent of a new statement?

+ if (!dmi_check_system(slow_lid_status) && !dmi_check_system(bad_lid_status) &&
+ !acpi_lid_open())

#5 lore raw

Am Montag, den 01.02.2010, 16:07 -0800 schrieb Joe Perches:

Quoted 33 lines · Andrew Morton
Quoted 9 lines
Quoted 7 lines · On Mon, 01 Feb 2010 19:20:53 +0100 Thomas Meyer <[email protected]> wrote:

acpi_lid_open() could take up to 10ms on my computer.
Some component is calling the drm GETCONNECTOR ioctl many times in a row. This results in flickering (for example, when starting a video). Fix it by assuming an always connected lid status.

This fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=14670

Quoted 8 lines

drivers/gpu/drm/i915/intel_lvds.c

Quoted 8 lines
---
 drivers/gpu/drm/i915/intel_lvds.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +0 -0
index aa74e59..0f0779c 100644

[]

Quoted 10 lines

drivers/gpu/drm/i915/intel_lvds.c static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect · line 662

Quoted 10 lines
drivers/gpu/drm/i915/intel_lvds.c +2 -1
@@ -643,7 +655,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect
 {
 	enum drm_connector_status status = connector_status_connected;
 
-	if (!acpi_lid_open() && !dmi_check_system(bad_lid_status))
+	if (!dmi_check_system(slow_lid_status) && !dmi_check_system(bad_lid_status))
+	    if (!acpi_lid_open())
 		status = connector_status_disconnected;
 
 	return status;

Shouldn't this use an && test instead of a 4 space indent of a new statement?

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (!dmi_check_system(slow_lid_status) && !dmi_check_system(bad_lid_status) &&
+	    !acpi_lid_open())

Won't this lead to the execution of dmi_check_system() AND dmi_check_system() AND acpi_lid_open() every time the intel_lvds_detect() function is called?

And this is what I want to prevent: Do not call acpi_lid_open(), when the system is found in the dmi table.

What do you think?

mfg
thomas

#6 lore raw
In reply to Thomas Meyer
Quoted 6 lines · Thomas Meyer

acpi_lid_open() could take up to 10ms on my computer.
Some component is calling the drm GETCONNECTOR ioctl many times in a row. This results in flickering (for example, when starting a video). Fix it by assuming an always connected lid status.

This fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=14670

If it's that unusable, this should just be put in bad_lid_status and bad_lid_status checked before asking ACPI.