Skip to contentSkip to conversation

Test the first mode if there is no preferred mode.

PATCH In review Hai Lan 2 participants 4 messages May 31, 2011 – Jun 10, 2011

lore
Share & tools
lore

Hai Lan

author
#0 lore raw

PATCH 1/1 Test the first mode if there is no preferred mode.

For a TV device, there might be no preferred mode. In this case, we can test the first mode.

---
 tests/testdisplay.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
tests/testdisplay.c +10 -3
index 41a5753..ef194fe 100644
@@ -280,9 +280,16 @@ static void connector_find_preferred_mode(struct connector *c)
 	}
 
 	if (!c->mode_valid) {
-		fprintf(stderr, "failed to find any modes on connector %d\n",
-			c->id);
-		return;
+		if (connector->count_modes > 0) {
+			/* use the first mode as test mode */
+			c->mode = connector->modes[0];
+			c->mode_valid = 1;
+		}
+		else {
+			fprintf(stderr, "failed to find any modes on connector %d\n",
+				c->id);
+			return;
+		}
 	}
 
 	/* Now get the encoder */
Signature · 1 line
1.7.3.4
Reviewed-by on v1 1/1
#1 lore raw

Dear Hai,

Am Dienstag, den 31.05.2011, 17:24 -0400 schrieb Hai Lan:

Quoted 1 line

For a TV device, there might be no preferred mode.

is that an error of the device or is this a driver “feature”?

Quoted 1 line

In this case, we can test the first mode.

Is a Signed-off-by line needed to get your patch accepted? You can add it automatically passing -s to git commit or git format-patch.

Quoted 18 lines
---
 tests/testdisplay.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
tests/testdisplay.c +3 -3
index 41a5753..ef194fe 100644
@@ -280,9 +280,16 @@ static void connector_find_preferred_mode(struct connector *c)
 	}
 
 	if (!c->mode_valid) {
-		fprintf(stderr, "failed to find any modes on connector %d\n",
-			c->id);
-		return;
+		if (connector->count_modes > 0) {
+			/* use the first mode as test mode */
+			c->mode = connector->modes[0];

tests/testdisplay.c static void connector_find_preferred_mode(struct connector *c) · line 295

Quoted 10 lines
tests/testdisplay.c +7 -0
+			c->mode_valid = 1;
+		}
+		else {
+			fprintf(stderr, "failed to find any modes on connector %d\n",
+				c->id);
+			return;
+		}
 	}
 
 	/* Now get the encoder */

Thanks,

Paul

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

author
#2 lore raw

Dear Paul
Thanks for your advice. I am afraid there might be a i915 driver bug. We use the testdisplay to check the SDVO-TV and find the TV has no preferred mode. This will cause the testdisplay to quit. So I write this patch to make the testdisplay to go on.

Hai Lan

Quoted 50 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Paul Menzel
Sent: Tuesday, May 31, 2011 5:05 PM
To: [email protected]
Subject: Re: [Intel-gfx] [PATCH] Test the first mode if there is no preferred mode.

Dear Hai,

Am Dienstag, den 31.05.2011, 17:24 -0400 schrieb Hai Lan:

Quoted 1 line

For a TV device, there might be no preferred mode.

is that an error of the device or is this a driver “feature”?

Quoted 1 line

In this case, we can test the first mode.

Is a Signed-off-by line needed to get your patch accepted? You can add it automatically passing -s to git commit or git format-patch.

tests/testdisplay.c static void

Quoted 9 lines
---
 tests/testdisplay.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
tests/testdisplay.c index renamed from tests/testdisplay.c +0 -0

41a5753..ef194fe 100644

tests/testdisplay.c +0 -0
@@ -280,9 +280,16 @@ static void

connector_find_preferred_mode(struct connector *c)

Quoted 18 lines
tests/testdisplay.c +10 -3
 	}
 
 	if (!c->mode_valid) {
-		fprintf(stderr, "failed to find any modes on connector %d\n",
-			c->id);
-		return;
+		if (connector->count_modes > 0) {
+			/* use the first mode as test mode */
+			c->mode = connector->modes[0];
+			c->mode_valid = 1;
+		}
+		else {
+			fprintf(stderr, "failed to find any modes on connector %d\n",
+				c->id);
+			return;
+		}
 	}
 
Quoted 8 lines

tests/testdisplay.c static void connector_find_preferred_mode(struct connector *c) · line 295

Quoted 1 line
tests/testdisplay.c +0 -0
 	/* Now get the encoder */

Thanks,

Paul

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

author
#3 lore raw

This patch can make the testdisplay work if there is no preferred mode found. For example, if we use a 30 inch monitor(preferred mode is 2560x1600) with a single channel DVI cable, the driver will drop the mode of 2560x1600. In this case testdisplay won't work because it can't find the preferred Could anybody help to push this patch? Thanks.

Hai Lan

Quoted 73 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Lan, Hai
Sent: Tuesday, May 31, 2011 5:47 PM
To: Paul Menzel; [email protected]
Subject: Re: [Intel-gfx] [PATCH] Test the first mode if there is no preferred mode.

Dear Paul
Thanks for your advice. I am afraid there might be a i915 driver bug. We use the testdisplay to check the SDVO-TV and
find the TV has no preferred mode. This will cause the testdisplay to quit. So I write this patch to make the testdisplay to go on.

Hai Lan

Quoted 34 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Paul Menzel
Sent: Tuesday, May 31, 2011 5:05 PM
To: [email protected]
Subject: Re: [Intel-gfx] [PATCH] Test the first mode if there is no preferred mode.

Dear Hai,

Am Dienstag, den 31.05.2011, 17:24 -0400 schrieb Hai Lan:

Quoted 1 line

For a TV device, there might be no preferred mode.

is that an error of the device or is this a driver “feature”?

Quoted 1 line

In this case, we can test the first mode.

Is a Signed-off-by line needed to get your patch accepted? You can add it automatically passing -s to git commit or git format-patch.

tests/testdisplay.c static void

Quoted 9 lines
---
 tests/testdisplay.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
tests/testdisplay.c index renamed from tests/testdisplay.c +0 -0

41a5753..ef194fe 100644

tests/testdisplay.c +0 -0
@@ -280,9 +280,16 @@ static void

connector_find_preferred_mode(struct connector *c)

Quoted 2 lines
tests/testdisplay.c +0 -0
 	}
 
Quoted 11 lines

tests/testdisplay.c static void connector_find_preferred_mode(struct connector *c)

Quoted 11 lines
tests/testdisplay.c +7 -3
 	if (!c->mode_valid) {
-		fprintf(stderr, "failed to find any modes on connector %d\n",
-			c->id);
-		return;
+		if (connector->count_modes > 0) {
+			/* use the first mode as test mode */
+			c->mode = connector->modes[0];
+			c->mode_valid = 1;
+		}
+		else {
+			fprintf(stderr, "failed to find any modes on

connector %d\n",

Quoted 10 lines

tests/testdisplay.c static void connector_find_preferred_mode(struct connector *c) · line 295

Quoted 6 lines
tests/testdisplay.c +3 -0
+				c->id);
+			return;
+		}
 	}
 
 	/* Now get the encoder */
Quoted 7 lines
Quoted 3 lines

Thanks,

Paul

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

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