Skip to contentSkip to conversation

drm: give up on edid retries when i2c bus is not responding

PATCH Applied Eugeni Dodonov 4 participants 8 messages Jan 5, 2012 – Jan 20, 2012

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

PATCH 1/2 drm: give up on edid retries when i2c bus is not responding

This allows to avoid talking to a non-responding bus repeatedly until we finally timeout after 15 attempts. We can do this by catching the -ENXIO error, provided by i2c_algo_bit:bit_doAddress call.

Within the bit_doAddress we already try 3 times to get the edid data, so if the routine tells us that bus is not responding, it is mostly pointless to keep re-trying those attempts over and over again until we reach final number of retries.

This change should fix https://bugs.freedesktop.org/show_bug.cgi?id=41059
and improve overall edid detection timing by 10-30% in most cases, and by a much larger margin in case of phantom outputs (up to 30x in one worst case).

Timing results for i915-powered machines for 'time xrandr' command:
Machine 1: from 0.840s to 0.290s
Machine 2: from 0.315s to 0.280s
Machine 3: from +/- 4s to 0.184s

Timing results for HD5770 with 'time xrandr' command:
Machine 4: from 3.210s to 1.060s

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41059

---
 drivers/gpu/drm/drm_edid.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/drm_edid.c +5 -0
index 3e927ce..fb6c26c 100644
@@ -266,6 +266,11 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
 			}
 		};
 		ret = i2c_transfer(adapter, msgs, 2);
+		if (ret == -ENXIO) {
+			DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n",
+					adapter->name);
+			break;
+		}
 	} while (ret != 2 && --retries);
 
 	return ret == 2 ? 0 : -1;
Signature · 1 line
1.7.8
#1 lore raw

PATCH 2/2 drm/i915: there is no pipe CxSR on ironlake

After checking the specs and discussing with Jesse, turns out CxSR is not available on Ironlake and gen5, and its advertisement on the device description is misleading.

---
 drivers/gpu/drm/i915/i915_drv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +1 -1
index a1103fc..4795edd 100644
@@ -198,7 +198,7 @@ static const struct intel_device_info intel_pineview_info = {
 
 static const struct intel_device_info intel_ironlake_d_info = {
 	.gen = 5,
-	.need_gfx_hws = 1, .has_pipe_cxsr = 1, .has_hotplug = 1,
+	.need_gfx_hws = 1, .has_hotplug = 1,
 	.has_bsd_ring = 1,
 };
 
Signature · 1 line
1.7.8
#2 lore raw

Re: [PATCH 2/2] drm/i915: there is no pipe CxSR on ironlake

Quoted 6 lines · Eugeni Dodonov

After checking the specs and discussing with Jesse, turns out CxSR is not available on Ironlake and gen5, and its advertisement on the device description is misleading.

Queued for -next, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48
#3 lore raw
In reply to Eugeni Dodonov
Quoted 22 lines · Eugeni Dodonov

This allows to avoid talking to a non-responding bus repeatedly until we finally timeout after 15 attempts. We can do this by catching the -ENXIO error, provided by i2c_algo_bit:bit_doAddress call.

Within the bit_doAddress we already try 3 times to get the edid data, so if the routine tells us that bus is not responding, it is mostly pointless to keep re-trying those attempts over and over again until we reach final number of retries.

This change should fix https://bugs.freedesktop.org/show_bug.cgi?id=41059
and improve overall edid detection timing by 10-30% in most cases, and by a much larger margin in case of phantom outputs (up to 30x in one worst case).

Timing results for i915-powered machines for 'time xrandr' command:
Machine 1: from 0.840s to 0.290s
Machine 2: from 0.315s to 0.280s
Machine 3: from +/- 4s to 0.184s

Timing results for HD5770 with 'time xrandr' command:
Machine 4: from 3.210s to 1.060s

Quoted 8 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41059

Imo it's too late for such a change with decent potential to blow up to land in 3.3. I think this needs some decent shakeout time in Dave's drm-next tree (despite all r-b's and tested-bys it already gathered) and hence is imo 3.4 material at this stage.
-Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48
#4 lore raw
Quoted 34 lines · Daniel Vetter
Quoted 6 lines · Eugeni Dodonov

This allows to avoid talking to a non-responding bus repeatedly until we finally timeout after 15 attempts. We can do this by catching the -ENXIO error, provided by i2c_algo_bit:bit_doAddress call.

Within the bit_doAddress we already try 3 times to get the edid data, so if the routine tells us that bus is not responding, it is mostly

pointless

Quoted 4 lines

to keep re-trying those attempts over and over again until we reach final number of retries.

This change should fix

https://bugs.freedesktop.org/show_bug.cgi?id=41059

Quoted 12 lines

and improve overall edid detection timing by 10-30% in most cases, and by a much larger margin in case of phantom outputs (up to 30x in one worst case).

Timing results for i915-powered machines for 'time xrandr' command:
Machine 1: from 0.840s to 0.290s
Machine 2: from 0.315s to 0.280s
Machine 3: from +/- 4s to 0.184s

Timing results for HD5770 with 'time xrandr' command:
Machine 4: from 3.210s to 1.060s

Quoted 8 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41059

Quoted 5 lines

Imo it's too late for such a change with decent potential to blow up to land in 3.3. I think this needs some decent shakeout time in Dave's drm-next tree (despite all r-b's and tested-bys it already gathered) and hence is imo 3.4 material at this stage.

I'd be happy to include it into any kernel out there, 3.4 would be fine. I originally sent it for 3.1 merge though, and so far it haven't been picked up by any tree. So I am a bit lost about what to do with this next, besides re-sending the same patch over and over again...

Signature · 2 lines
Eugeni Dodonov
<http://eugeni.dodonov.net/>

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

#5 lore raw
Quoted 4 lines · Eugeni Dodonov

I'd be happy to include it into any kernel out there, 3.4 would be fine. I originally sent it for 3.1 merge though, and so far it haven't been picked up by any tree. So I am a bit lost about what to do with this next, besides re-sending the same patch over and over again...

I'll stick it in drm-intel-next, once Dave pulls for 3.3.

Signature · 1 line
[email protected]

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

#6 lore raw
In reply to Eugeni Dodonov

Hi Dave,

Is it ok if I merge this through my -next tree? Otherwise please consider merging this for 3.4.

Yours, Daniel

Quoted 57 lines · Eugeni Dodonov

This allows to avoid talking to a non-responding bus repeatedly until we finally timeout after 15 attempts. We can do this by catching the -ENXIO error, provided by i2c_algo_bit:bit_doAddress call.

Within the bit_doAddress we already try 3 times to get the edid data, so if the routine tells us that bus is not responding, it is mostly pointless to keep re-trying those attempts over and over again until we reach final number of retries.

This change should fix https://bugs.freedesktop.org/show_bug.cgi?id=41059
and improve overall edid detection timing by 10-30% in most cases, and by a much larger margin in case of phantom outputs (up to 30x in one worst case).

Timing results for i915-powered machines for 'time xrandr' command:
Machine 1: from 0.840s to 0.290s
Machine 2: from 0.315s to 0.280s
Machine 3: from +/- 4s to 0.184s

Timing results for HD5770 with 'time xrandr' command:
Machine 4: from 3.210s to 1.060s

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41059

---
 drivers/gpu/drm/drm_edid.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/drm_edid.c +5 -0
index 3e927ce..fb6c26c 100644
@@ -266,6 +266,11 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
 			}
 		};
 		ret = i2c_transfer(adapter, msgs, 2);
+		if (ret == -ENXIO) {
+			DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n",
+					adapter->name);
+			break;
+		}
 	} while (ret != 2 && --retries);
 
 	return ret == 2 ? 0 : -1;
Signature · 6 lines
1.7.8

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48
#7 lore raw

PATCH 1/2 drm: give up on edid retries when i2c bus is not responding

In reply to Eugeni Dodonov

Looks like a CC to dri-devel got forgotten originally, so forwarding it properly.

---------- Forwarded message ----------
From: Eugeni Dodonov <[email protected]>
Date: Thu, Jan 5, 2012 at 09:34
Subject: [Intel-gfx] [PATCH 1/2] drm: give up on edid retries when i2c bus is not responding
To: [email protected]
Cc: Eugeni Dodonov <[email protected]>

This allows to avoid talking to a non-responding bus repeatedly until we finally timeout after 15 attempts. We can do this by catching the -ENXIO error, provided by i2c_algo_bit:bit_doAddress call.

Within the bit_doAddress we already try 3 times to get the edid data, so if the routine tells us that bus is not responding, it is mostly pointless to keep re-trying those attempts over and over again until we reach final number of retries.

This change should fix https://bugs.freedesktop.org/show_bug.cgi?id=41059
and improve overall edid detection timing by 10-30% in most cases, and by a much larger margin in case of phantom outputs (up to 30x in one worst case).

Timing results for i915-powered machines for 'time xrandr' command:
Machine 1: from 0.840s to 0.290s
Machine 2: from 0.315s to 0.280s
Machine 3: from +/- 4s to 0.184s

Timing results for HD5770 with 'time xrandr' command:
Machine 4: from 3.210s to 1.060s

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41059

---
 drivers/gpu/drm/drm_edid.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/drm_edid.c +0 -0
index 3e927ce..fb6c26c 100644
@@ -266,6 +266,11 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter,

unsigned char *buf,

                       }
               };
               ret = i2c_transfer(adapter, msgs, 2);

+ if (ret == -ENXIO) {
+ DRM_DEBUG_KMS("drm: skipping non-existent adapter
%s\n",
+ adapter->name);
+ break;
+ }

       } while (ret != 2 && --retries);

       return ret == 2 ? 0 : -1;

--
1.7.8

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

Signature · 2 lines
Eugeni Dodonov
<http://eugeni.dodonov.net/>

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel