* [PATCH 2/2] drm/kms: Use the standard VESA timeout for DDC channels
@ 2011-10-21 7:10 Jean Delvare
2011-11-23 21:24 ` Keith Packard
0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2011-10-21 7:10 UTC (permalink / raw)
To: dri-devel
The VESA specification suggests a 2.2 ms timeout on DDC channels.
Only the intel DRM driver implements this properly today, align all
drivers to the proper implementation.
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 | 4 +---
3 files changed, 3 insertions(+), 5 deletions(-)
--- linux-3.1-rc10.orig/drivers/gpu/drm/i915/intel_i2c.c 2011-10-20 14:59:11.000000000 +0200
+++ linux-3.1-rc10/drivers/gpu/drm/i915/intel_i2c.c 2011-10-20 15:24:33.000000000 +0200
@@ -183,7 +183,7 @@ intel_gpio_create(struct drm_i915_privat
gpio->algo.getsda = get_data;
gpio->algo.getscl = get_clock;
gpio->algo.udelay = I2C_RISEFALL_TIME;
- gpio->algo.timeout = usecs_to_jiffies(2200);
+ gpio->algo.timeout = usecs_to_jiffies(2200); /* from VESA */
gpio->algo.data = gpio;
if (i2c_bit_add_bus(&gpio->adapter))
--- linux-3.1-rc10.orig/drivers/gpu/drm/nouveau/nouveau_i2c.c 2011-10-20 15:14:36.000000000 +0200
+++ linux-3.1-rc10/drivers/gpu/drm/nouveau/nouveau_i2c.c 2011-10-20 15:24:37.000000000 +0200
@@ -218,7 +218,7 @@ nouveau_i2c_init(struct drm_device *dev,
if (entry->port_type < 6) {
i2c->adapter.algo_data = &i2c->bit;
i2c->bit.udelay = 10;
- i2c->bit.timeout = usecs_to_jiffies(5000);
+ i2c->bit.timeout = usecs_to_jiffies(2200); /* from VESA */
i2c->bit.data = i2c;
ret = i2c_bit_add_bus(&i2c->adapter);
} else {
--- linux-3.1-rc10.orig/drivers/gpu/drm/radeon/radeon_i2c.c 2011-10-20 14:58:17.000000000 +0200
+++ linux-3.1-rc10/drivers/gpu/drm/radeon/radeon_i2c.c 2011-10-20 15:24:41.000000000 +0200
@@ -929,9 +929,7 @@ struct radeon_i2c_chan *radeon_i2c_creat
i2c->algo.bit.getsda = get_data;
i2c->algo.bit.getscl = get_clock;
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;
+ i2c->algo.bit.timeout = usecs_to_jiffies(2200); /* from VESA */
i2c->algo.bit.data = i2c;
ret = i2c_bit_add_bus(&i2c->adapter);
if (ret) {
--
Jean Delvare
Suse L3
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 2/2] drm/kms: Use the standard VESA timeout for DDC channels
2011-10-21 7:10 [PATCH 2/2] drm/kms: Use the standard VESA timeout for DDC channels Jean Delvare
@ 2011-11-23 21:24 ` Keith Packard
0 siblings, 0 replies; 2+ messages in thread
From: Keith Packard @ 2011-11-23 21:24 UTC (permalink / raw)
To: Jean Delvare, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 647 bytes --]
On Fri, 21 Oct 2011 09:10:12 +0200, Jean Delvare <jdelvare@suse.de> wrote:
> - /* 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;
> + i2c->algo.bit.timeout = usecs_to_jiffies(2200); /* from VESA */
From my reading of the usecs_to_jiffies code, it always returns a time
at least as long as requested, so this will ensure that you're waiting
at least 2.2ms, unlike 2 jiffies which is some random amount of time
depending on the HZ setting in the kernel.
Reviewed-by: Keith Packard <keithp@keithp.com>
--
keith.packard@intel.com
[-- Attachment #1.2: Type: application/pgp-signature, Size: 827 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-23 21:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 7:10 [PATCH 2/2] drm/kms: Use the standard VESA timeout for DDC channels Jean Delvare
2011-11-23 21:24 ` Keith Packard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox