All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/kms: Make i2c buses faster
@ 2012-01-28 10:07 Jean Delvare
  2012-01-28 14:46 ` Alex Deucher
  2012-01-29  1:26 ` Keith Packard
  0 siblings, 2 replies; 11+ messages in thread
From: Jean Delvare @ 2012-01-28 10:07 UTC (permalink / raw)
  To: dri-devel; +Cc: Eugeni Dodonov

A udelay value of 20 leads to an I2C bus running at only 25 kbps. I2C
devices can typically operate faster than this, 50 kbps should be fine
for all devices (and compliant devices can always stretch the clock if
needed.)

FWIW, the vast majority of framebuffer drivers set udelay to 10
already. So set it to 10 in DRM drivers too, this will make EDID block
reads faster. We might even lower the udelay value later if no problem
is reported.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Cc: Dave Airlie <airlied@gmail.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
---
Already sent on: 2011-10-21.

 drivers/gpu/drm/i915/intel_i2c.c    |    2 +-
 drivers/gpu/drm/radeon/radeon_i2c.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-3.3-rc1.orig/drivers/gpu/drm/i915/intel_i2c.c	2012-01-28 10:12:16.554480007 +0100
+++ linux-3.3-rc1/drivers/gpu/drm/i915/intel_i2c.c	2012-01-28 10:28:16.884668894 +0100
@@ -37,7 +37,7 @@
 
 /* Intel GPIO access functions */
 
-#define I2C_RISEFALL_TIME 20
+#define I2C_RISEFALL_TIME 10
 
 static inline struct intel_gmbus *
 to_intel_gmbus(struct i2c_adapter *i2c)
--- linux-3.3-rc1.orig/drivers/gpu/drm/radeon/radeon_i2c.c	2012-01-28 10:12:16.555480007 +0100
+++ linux-3.3-rc1/drivers/gpu/drm/radeon/radeon_i2c.c	2012-01-28 10:28:16.886668894 +0100
@@ -924,7 +924,7 @@ struct radeon_i2c_chan *radeon_i2c_creat
 		i2c->algo.bit.setscl = set_clock;
 		i2c->algo.bit.getsda = get_data;
 		i2c->algo.bit.getscl = get_clock;
-		i2c->algo.bit.udelay = 20;
+		i2c->algo.bit.udelay = 10;
 		/* vesa says 2.2 ms is enough, 1 jiffy doesn't seem to always
 		 * make this, 2 jiffies is a lot more reliable */
 		i2c->algo.bit.timeout = 2;

-- 
Jean Delvare
Suse L3

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 1/2] drm/kms: Make i2c buses faster
@ 2011-10-21  7:08 Jean Delvare
  2011-10-21 13:32 ` Alan Cox
  0 siblings, 1 reply; 11+ messages in thread
From: Jean Delvare @ 2011-10-21  7:08 UTC (permalink / raw)
  To: dri-devel

A udelay value of 20 leads to an I2C bus running at only 25 kbps. A
value of 40 as the nouveau driver has is even slower at 12.5 kbps. I2C
devices can typically operate faster than this, 50 kbps should be fine
for all devices (and compliant devices can always stretch the clock is
needed.)

FWIW, the vast majority of framebuffer drivers set udelay to 10
already. So set it to 10 in DRM drivers too, this will make EDID block
reads faster. We might even lower the udelay value later if no problem
is reported.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Eugeni Dodonov <eugeni@dodonov.net>
Cc: Dave Airlie <airlied@gmail.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/i915/intel_i2c.c      |    2 +-
 drivers/gpu/drm/nouveau/nouveau_i2c.c |    2 +-
 drivers/gpu/drm/radeon/radeon_i2c.c   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--- linux-3.1-rc10.orig/drivers/gpu/drm/i915/intel_i2c.c	2011-07-22 04:17:23.000000000 +0200
+++ linux-3.1-rc10/drivers/gpu/drm/i915/intel_i2c.c	2011-10-20 14:59:11.000000000 +0200
@@ -36,7 +36,7 @@
 
 /* Intel GPIO access functions */
 
-#define I2C_RISEFALL_TIME 20
+#define I2C_RISEFALL_TIME 10
 
 static inline struct intel_gmbus *
 to_intel_gmbus(struct i2c_adapter *i2c)
--- linux-3.1-rc10.orig/drivers/gpu/drm/nouveau/nouveau_i2c.c	2011-07-22 04:17:23.000000000 +0200
+++ linux-3.1-rc10/drivers/gpu/drm/nouveau/nouveau_i2c.c	2011-10-20 15:14:36.000000000 +0200
@@ -217,7 +217,7 @@ nouveau_i2c_init(struct drm_device *dev,
 
 	if (entry->port_type < 6) {
 		i2c->adapter.algo_data = &i2c->bit;
-		i2c->bit.udelay = 40;
+		i2c->bit.udelay = 10;
 		i2c->bit.timeout = usecs_to_jiffies(5000);
 		i2c->bit.data = i2c;
 		ret = i2c_bit_add_bus(&i2c->adapter);
--- linux-3.1-rc10.orig/drivers/gpu/drm/radeon/radeon_i2c.c	2011-10-20 14:41:33.000000000 +0200
+++ linux-3.1-rc10/drivers/gpu/drm/radeon/radeon_i2c.c	2011-10-20 14:58:17.000000000 +0200
@@ -928,7 +928,7 @@ struct radeon_i2c_chan *radeon_i2c_creat
 		i2c->algo.bit.setscl = set_clock;
 		i2c->algo.bit.getsda = get_data;
 		i2c->algo.bit.getscl = get_clock;
-		i2c->algo.bit.udelay = 20;
+		i2c->algo.bit.udelay = 10;
 		/* vesa says 2.2 ms is enough, 1 jiffy doesn't seem to always
 		 * make this, 2 jiffies is a lot more reliable */
 		i2c->algo.bit.timeout = 2;

-- 
Jean Delvare
Suse L3

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

end of thread, other threads:[~2012-03-21 10:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-28 10:07 [PATCH 1/2] drm/kms: Make i2c buses faster Jean Delvare
2012-01-28 14:46 ` Alex Deucher
2012-01-29  1:26 ` Keith Packard
2012-03-21 10:45   ` Jean Delvare
  -- strict thread matches above, loose matches on Subject: below --
2011-10-21  7:08 Jean Delvare
2011-10-21 13:32 ` Alan Cox
2011-10-21 14:16   ` Jean Delvare
2011-10-21 18:05     ` Alex Deucher
2011-10-21 19:29       ` Jean Delvare
2011-10-22 14:38         ` Alex Deucher
2011-10-24 14:19           ` Eugeni Dodonov

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.