Re: [PATCH] drm/i915: Fix single msg gmbus_xfers writes

2012-02-20 Thread Daniel Kurtz
the former issue by using the same cycle selection as used in the I2C_M_RD for the write case. GMBUS_CYCLE_WAIT | (i + 1 == num ? GMBUS_CYCLE_STOP : 0) Fixed the latter by waiting on GMBUS_ACTIVE to deassert before disable. Signed-off-by: Benson Leung ble...@chromium.org Reviewed-by: Daniel

[PATCH 1/9] drm/i915/intel_i2c: cleanup

2012-03-07 Thread Daniel Kurtz
80 col, spaces around operators and other basic cleanup. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 24 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915

[PATCH 5/9] drm/i915/intel_i2c: add locking around i2c algorithm accesses

2012-03-07 Thread Daniel Kurtz
in the i2c-core using the i2c adapter lock. This patch adds a mutex to serialize access to the gmbus_xfer routine. Note: the same mutex serializes both bit banged and native xfers. Signed-off-by: Yufeng Shen mile...@chromium.org Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915

[PATCH 0/9] drm/i915/intel_i2c: fix gmbus writes and related issues

2012-03-07 Thread Daniel Kurtz
: intel_modeset_init() intel_setup_outputs() intel_lvds_init() drm_get_edid() Is there a way to switch the order of these to events? Or does it make more sense for the gmbus driver to check a bool irq_enabled, and choose whether to poll or use the GMBUS interrupt? ... or both? Daniel

[PATCH 2/9] drm/i915/intel_i2c: assign HDMI port D to pin pair 6

2012-03-07 Thread Daniel Kurtz
. However, the driver immediately falls back again to the bit-bang method, which correctly uses GPIOF, so again, transfers succeed. However, if gmbus mode is re-enabled and the GPIO fall-back mode is disabled, then reading an attached monitor's EDID fail. Signed-off-by: Daniel Kurtz djku

[PATCH 7/9] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-03-07 Thread Daniel Kurtz
for another patch. We return -ETIMEDOUT if the hardware doesn't deactivate after the STOP cycle. This patch also takes advantage (in the write path) of the double-buffered GMBUS3 data register by writing two 4-byte words before the first wait for HW_RDY. Signed-off-by: Daniel Kurtz djku

[PATCH 4/9] drm/i915/intel_i2c: cleanup gmbus/gpio pin assignments

2012-03-07 Thread Daniel Kurtz
. Tested on Sandybridge (gen 6, PCH == CougarPoint) hardware. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_reg.h |1 - drivers/gpu/drm/i915/intel_i2c.c | 64 ++ 2 files changed, 30 insertions(+), 35 deletions(-) diff --git

[PATCH 9/9] drm/i915/intel_i2c: reuse GMBUS2 value from polling loop

2012-03-07 Thread Daniel Kurtz
in if condition'), but it seems like the cleanest implementation. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915

[PATCH 8/9] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions

2012-03-07 Thread Daniel Kurtz
such a small write followed by a read. The INDEX can be either one or two bytes long. The advantage of using such a cycle is that the CPU has slightly less work to do once the read with INDEX cycle is started. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c

[PATCH 6/9] drm/i915/intel_i2c: return -ENXIO for device NAK

2012-03-07 Thread Daniel Kurtz
Return -ENXIO if a device NAKs a transaction. Note: We should return -ETIMEDOUT, too if the transaction times out, however, that error path is currently handled by the 'bit-bang fallback'. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |4 +++- 1 files

[PATCH 3/9] drm/i915/intel_i2c: refactor using intel_gmbus_get_bus

2012-03-07 Thread Daniel Kurtz
before intel_gmbus_get_bus(). Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h|4 +++- drivers/gpu/drm/i915/intel_bios.c | 10 ++ drivers/gpu/drm/i915/intel_crt.c | 13 ++--- drivers/gpu/drm/i915/intel_drv.h |3 ++- drivers

Re: [PATCH 6/9] drm/i915/intel_i2c: return -ENXIO for device NAK

2012-03-07 Thread Daniel Kurtz
On Wed, Mar 7, 2012 at 8:12 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed,  7 Mar 2012 19:50:47 +0800, Daniel Kurtz djku...@chromium.org wrote: Return -ENXIO if a device NAKs a transaction. Note: We should return -ETIMEDOUT, too if the transaction times out, however, that error path

Re: [PATCH 4/9] drm/i915/intel_i2c: cleanup gmbus/gpio pin assignments

2012-03-07 Thread Daniel Kurtz
On Wed, Mar 7, 2012 at 8:17 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed,  7 Mar 2012 19:50:45 +0800, Daniel Kurtz djku...@chromium.org wrote: There is no disabled port 0.  So, don't even try to initialize/scan it, etc.  This saves a bit of time when initializing the driver, since

Re: [PATCH 2/9] drm/i915/intel_i2c: assign HDMI port D to pin pair 6

2012-03-07 Thread Daniel Kurtz
On Wed, Mar 7, 2012 at 9:23 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed,  7 Mar 2012 19:50:43 +0800, Daniel Kurtz djku...@chromium.org wrote: According to i915 documentation [1], Port D (DP/HDMI Port D) is actually gmbus pin pair 6 (gmbus0.2:0 == 110b GPIOF), not 7 (111b). Pin

[PATCH 00/10 v2] fix gmbus writes and related issues

2012-03-10 Thread Daniel Kurtz
for the review, Chris!), and adds the interrupt patch. There weren't any review comments for patches 5, 7, or 8 of the first set. Hopefully they will get more love the second time around :). Daniel Kurtz (10): drm/i915/intel_i2c: cleanup drm/i915/intel_i2c: assign HDMI port D to pin pair 6

[PATCH 08/10 v2] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions

2012-03-10 Thread Daniel Kurtz
such a small write followed by a read. The INDEX can be either one or two bytes long. The advantage of using such a cycle is that the CPU has slightly less work to do once the read with INDEX cycle is started. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c

[PATCH 03/10 v2] drm/i915/intel_i2c: add intel_gmbus_get_adapter

2012-03-10 Thread Daniel Kurtz
called before intel_gmbus_get_adapter(). Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h|4 +++- drivers/gpu/drm/i915/intel_bios.c | 11 +++ drivers/gpu/drm/i915/intel_crt.c | 13 ++--- drivers/gpu/drm/i915/intel_drv.h |3

[PATCH 02/10 v2] drm/i915/intel_i2c: assign HDMI port D to pin pair 6

2012-03-10 Thread Daniel Kurtz
. However, the driver immediately falls back again to the bit-bang method, which correctly uses GPIOF, so again, transfers succeed. However, if gmbus mode is re-enabled and the GPIO fall-back mode is disabled, then reading an attached monitor's EDID fail. Signed-off-by: Daniel Kurtz djku

[PATCH 05/10 v2] drm/i915/intel_i2c: add locking around i2c algorithm accesses

2012-03-10 Thread Daniel Kurtz
in the i2c-core using the i2c adapter lock. This patch adds a mutex to serialize access to the gmbus_xfer routine. Note: the same mutex serializes both bit banged and native xfers. Signed-off-by: Yufeng Shen mile...@chromium.org Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915

[PATCH 04/10 v2] drm/i915/intel_i2c: cleanup gmbus/gpio pin assignments

2012-03-10 Thread Daniel Kurtz
on Sandybridge (gen 6, PCH == CougarPoint) hardware. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_reg.h |1 - drivers/gpu/drm/i915/intel_i2c.c | 64 + 2 files changed, 29 insertions(+), 36 deletions(-) diff --git

[PATCH 09/10 v2] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop

2012-03-10 Thread Daniel Kurtz
Save the GMBUS2 value read while polling for state changes, and then reuse this value when determining for which reason the loops were exited. This is a small optimization which saves a couple of bus accesses for memory mapped IO registers. Signed-off-by: Daniel Kurtz djku...@chromium.org

[PATCH 06/10 v2] drm/i915/intel_i2c: return -ENXIO for device NAK

2012-03-10 Thread Daniel Kurtz
Return -ENXIO if a device NAKs a transaction. Note: We should return -ETIMEDOUT, too if the transaction times out, however, that error path is currently handled by the 'bit-bang fallback'. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 12

[PATCH 01/10 v2] drm/i915/intel_i2c: cleanup

2012-03-10 Thread Daniel Kurtz
80 col, spaces around operators and other basic cleanup. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 19 +-- 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915

[PATCH 10/10 v2] drm/i915/intel_i2c: enable gmbus interrupts

2012-03-10 Thread Daniel Kurtz
from any active gmbus transactions, changing the interrupt enable is protected by the gmbus transaction mutex. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h |2 + drivers/gpu/drm/i915/i915_irq.c | 22 +- drivers/gpu/drm/i915/i915_reg.h |1

[PATCH 07/10 v2] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-03-10 Thread Daniel Kurtz
for another patch. We return -ETIMEDOUT if the hardware doesn't deactivate after the STOP cycle. This patch also takes advantage (in the write path) of the double-buffered GMBUS3 data register by writing two 4-byte words before the first wait for HW_RDY. Signed-off-by: Daniel Kurtz djku

[PATCH 02/11 v3] drm/i915/intel_i2c: assign HDMI port D to pin pair 6

2012-03-27 Thread Daniel Kurtz
. However, the driver immediately falls back again to the bit-bang method, which correctly uses GPIOF, so again, transfers succeed. However, if gmbus mode is re-enabled and the GPIO fall-back mode is disabled, then reading an attached monitor's EDID fail. Signed-off-by: Daniel Kurtz djku

[PATCH 04/11 v3] drm/i915/intel_i2c: cleanup gmbus/gpio pin assignments

2012-03-27 Thread Daniel Kurtz
== CougarPoint) hardware. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h |1 - drivers/gpu/drm/i915/i915_reg.h |2 +- drivers/gpu/drm/i915/intel_i2c.c | 63 ++--- 3 files changed, 25 insertions(+), 41 deletions(-) diff --git

[PATCH 00/11 v3] fix gmbus writes and related issues

2012-03-27 Thread Daniel Kurtz
for IDLE before clearing NAK Daniel Kurtz (11): drm/i915/intel_i2c: cleanup drm/i915/intel_i2c: assign HDMI port D to pin pair 6 drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio xfers drm/i915/intel_i2c: cleanup gmbus/gpio pin assignments drm/i915/intel_i2c: allocate

[PATCH 01/11 v3] drm/i915/intel_i2c: cleanup

2012-03-27 Thread Daniel Kurtz
80 col, spaces around operators and other basic cleanup. Some info message cleanup. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 32 +--- 1 files changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915

[PATCH 10/11 v3] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions

2012-03-27 Thread Daniel Kurtz
such a small write followed by a read. The INDEX can be either one or two bytes long. The advantage of using such a cycle is that the CPU has slightly less work to do once the read with INDEX cycle is started. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c

[PATCH 03/11 v3] drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio xfers

2012-03-27 Thread Daniel Kurtz
gmbus_func use .force_bit to determine which i2c functionalities are available, either i2c_bit_algo.functionality, or its own. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 72 +++-- 1 files changed, 45 insertions(+), 27 deletions

[PATCH 07/11 v3] drm/i915/intel_i2c: handle zero-length writes

2012-03-27 Thread Daniel Kurtz
there is device present on the bus with a given address. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index a04f773

[PATCH 05/11 v3] drm/i915/intel_i2c: allocate gmbus array as part of drm_i915_private

2012-03-27 Thread Daniel Kurtz
This memory is always allocated, and it is always a fixed size, so just allocate it along with the rest of the driver state. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h |2 +- drivers/gpu/drm/i915/intel_i2c.c | 10 -- 2 files changed, 1

[PATCH 11/11 v3] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop

2012-03-27 Thread Daniel Kurtz
Save the GMBUS2 value read while polling for state changes, and then reuse this value when determining for which reason the loops were exited. This is a small optimization which saves a couple of bus accesses for memory mapped IO registers. Signed-off-by: Daniel Kurtz djku...@chromium.org

[PATCH 09/11 v3] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-03-27 Thread Daniel Kurtz
for another patch. We return -ETIMEDOUT if the hardware doesn't deactivate after the STOP cycle. This patch also takes advantage (in the write path) of the double-buffered GMBUS3 data register by writing two 4-byte words before the first wait for HW_RDY. Signed-off-by: Daniel Kurtz djku

[PATCH 06/11 v3] drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter

2012-03-27 Thread Daniel Kurtz
a safer default pin pair. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h|7 +++ drivers/gpu/drm/i915/intel_bios.c |4 ++-- drivers/gpu/drm/i915/intel_crt.c | 14 -- drivers/gpu/drm/i915/intel_dvo.c |6 +++--- drivers/gpu/drm

Re: [PATCH 02/11 v3] drm/i915/intel_i2c: assign HDMI port D to pin pair 6

2012-03-27 Thread Daniel Kurtz
On Mon, Mar 26, 2012 at 11:08 PM, Daniel Vetter dan...@ffwll.ch wrote: On Mon, Mar 26, 2012 at 04:47:11PM +0200, Daniel Vetter wrote: On Mon, Mar 26, 2012 at 10:26:41PM +0800, Daniel Kurtz wrote: According to i915 documentation [1], Port D (DP/HDMI Port D) is actually gmbus pin pair 6

Re: [PATCH 03/11 v3] drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio xfers

2012-03-27 Thread Daniel Kurtz
On Mon, Mar 26, 2012 at 10:49 PM, Daniel Vetter dan...@ffwll.ch wrote: On Mon, Mar 26, 2012 at 10:26:42PM +0800, Daniel Kurtz wrote: Instead of rolling our own custom quirk_xfer function, use the bit_algo pre_xfer and post_xfer functions to setup and teardown bit-banged i2c transactions

[PATCH 05/13 v4] drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter

2012-03-27 Thread Daniel Kurtz
. In these cases, the driver must fall back to using a safer default port. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h|7 +++ drivers/gpu/drm/i915/intel_bios.c |4 ++-- drivers/gpu/drm/i915/intel_crt.c | 14 -- drivers/gpu

[PATCH 00/13 v4] fix gmbus writes and related issues

2012-03-27 Thread Daniel Kurtz
instead of BUG_ON when an invalid port is requested Daniel Kurtz (13): drm/i915/intel_i2c: refactor gmbus_xfer drm/i915/intel_i2c: cleanup error messages and comments drm/i915/intel_i2c: assign HDMI port D to pin pair 6 drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio

[PATCH 02/13 v4] drm/i915/intel_i2c: cleanup error messages and comments

2012-03-27 Thread Daniel Kurtz
Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index 30675ce..e6c090b 100644 --- a/drivers/gpu/drm/i915

[PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-27 Thread Daniel Kurtz
there is device present on the bus with a given address. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index c12db72..5a94e9b

[PATCH 03/13 v4] drm/i915/intel_i2c: assign HDMI port D to pin pair 6

2012-03-27 Thread Daniel Kurtz
. However, the driver immediately falls back again to the bit-bang method, which correctly uses GPIOF, so again, transfers succeed. However, if gmbus mode is re-enabled and the GPIO fall-back mode is disabled, then reading an attached monitor's EDID fail. Signed-off-by: Daniel Kurtz djku

[PATCH 01/13 v4] drm/i915/intel_i2c: refactor gmbus_xfer

2012-03-27 Thread Daniel Kurtz
Split out gmbus_xfer_read/write() helper functions. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 151 +++--- 1 files changed, 92 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu

[PATCH 07/13 v4] drm/i915/intel_i2c: allocate gmbus array as part of drm_i915_private

2012-03-27 Thread Daniel Kurtz
This memory is always allocated, and it is always a fixed size, so just allocate it along with the rest of the driver state. Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Daniel Vetter daniel.vet...@ffwll.ch --- drivers/gpu/drm/i915/i915_drv.h |2 +- drivers/gpu/drm/i915

[PATCH 12/13 v4] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions

2012-03-27 Thread Daniel Kurtz
such a small write followed by a read. The INDEX can be either one or two bytes long. The advantage of using such a cycle is that the CPU has slightly less work to do once the read with INDEX cycle is started. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c

[PATCH 06/13 v4] drm/i915/intel_i2c: gmbus disabled and reserved ports are invalid

2012-03-27 Thread Daniel Kurtz
== CougarPoint) hardware. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h |3 +- drivers/gpu/drm/i915/i915_reg.h |2 +- drivers/gpu/drm/i915/intel_i2c.c | 70 ++--- 3 files changed, 29 insertions(+), 46 deletions(-) diff --git

[PATCH 09/13 v4] drm/i915/intel_i2c: use double-buffered writes

2012-03-27 Thread Daniel Kurtz
The GMBUS controller GMBUS3 register is double-buffered. Take advantage of this by writing two 4-byte words before the first wait for HW_RDY. This helps keep the GMBUS controller from becoming idle during long writes. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915

[PATCH 04/13 v4] drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio xfers

2012-03-27 Thread Daniel Kurtz
Instead of rolling our own custom quirk_xfer function, use the bit_algo pre_xfer and post_xfer functions to setup and teardown bit-banged i2c transactions. Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Daniel Vetter daniel.vet...@ffwll.ch --- drivers/gpu/drm/i915/intel_i2c.c

[PATCH 13/13 v4] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop

2012-03-27 Thread Daniel Kurtz
a ret variable to store the wait_for macro return value. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 32 1 files changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm

[PATCH 11/13 v4] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-03-27 Thread Daniel Kurtz
for another patch. We return -ETIMEDOUT if the hardware doesn't deactivate after the STOP cycle. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 30 +++--- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu

Re: [PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-28 Thread Daniel Kurtz
On Wed, Mar 28, 2012 at 3:14 AM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed, 28 Mar 2012 02:36:17 +0800, Daniel Kurtz djku...@chromium.org wrote: A common method of probing an i2c bus is trying to do a zero-length write. Handle this case by checking the length first before decrementing

Re: [PATCH 13/13 v4] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop

2012-03-28 Thread Daniel Kurtz
On Wed, Mar 28, 2012 at 3:02 AM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed, 28 Mar 2012 02:36:22 +0800, Daniel Kurtz djku...@chromium.org wrote: Save the GMBUS2 value read while polling for state changes, and then reuse this value when determining for which reason the loops were

[PATCH 03/14 v5] drm/i915/intel_i2c: assign HDMI port D to pin pair 6

2012-03-28 Thread Daniel Kurtz
. However, the driver immediately falls back again to the bit-bang method, which correctly uses GPIOF, so again, transfers succeed. However, if gmbus mode is re-enabled and the GPIO fall-back mode is disabled, then reading an attached monitor's EDID fail. Signed-off-by: Daniel Kurtz djku

[PATCH 01/14 v5] drm/i915/intel_i2c: refactor gmbus_xfer

2012-03-28 Thread Daniel Kurtz
Split out gmbus_xfer_read/write() helper functions. Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk --- drivers/gpu/drm/i915/intel_i2c.c | 151 +++--- 1 files changed, 92 insertions(+), 59 deletions(-) diff

[PATCH 02/14 v5] drm/i915/intel_i2c: cleanup error messages and comments

2012-03-28 Thread Daniel Kurtz
Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk --- drivers/gpu/drm/i915/intel_i2c.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index

[PATCH 04/14 v5] drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio xfers

2012-03-28 Thread Daniel Kurtz
Instead of rolling our own custom quirk_xfer function, use the bit_algo pre_xfer and post_xfer functions to setup and teardown bit-banged i2c transactions. Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Daniel Vetter daniel.vet...@ffwll.ch Reviewed-by: Chris Wilson ch...@chris

[PATCH 07/14 v5] drm/i915/intel_i2c: allocate gmbus array as part of drm_i915_private

2012-03-28 Thread Daniel Kurtz
This memory is always allocated, and it is always a fixed size, so just allocate it along with the rest of the driver state. Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Daniel Vetter daniel.vet...@ffwll.ch --- drivers/gpu/drm/i915/i915_drv.h |2 +- drivers/gpu/drm/i915

[PATCH 10/14 v5] drm/i915/intel_i2c: always wait for IDLE before clearing NAK

2012-03-28 Thread Daniel Kurtz
in a bad state such that the next transaction may fail. Also, return -ENXIO if a device NAKs a transaction. Note: this patch also refactors gmbus_xfer to remove the done label. Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk --- drivers/gpu/drm/i915

[PATCH 09/14 v5] drm/i915/intel_i2c: use double-buffered writes

2012-03-28 Thread Daniel Kurtz
The GMBUS controller GMBUS3 register is double-buffered. Take advantage of this by writing two 4-byte words before the first wait for HW_RDY. This helps keep the GMBUS controller from becoming idle during long writes. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915

[PATCH 06/14 v5] drm/i915/intel_i2c: gmbus disabled and reserved ports are invalid

2012-03-28 Thread Daniel Kurtz
== CougarPoint) hardware. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h |3 +- drivers/gpu/drm/i915/i915_reg.h |2 +- drivers/gpu/drm/i915/intel_i2c.c | 70 ++--- 3 files changed, 29 insertions(+), 46 deletions(-) diff --git

[PATCH 12/14 v5] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions

2012-03-28 Thread Daniel Kurtz
such a small write followed by a read. The INDEX can be either one or two bytes long. The advantage of using such a cycle is that the CPU has slightly less work to do once the read with INDEX cycle is started. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c

[PATCH 05/14 v5] drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter

2012-03-28 Thread Daniel Kurtz
. In these cases, the driver must fall back to using a safer default port. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/i915_drv.h|7 +++ drivers/gpu/drm/i915/intel_bios.c |4 ++-- drivers/gpu/drm/i915/intel_crt.c | 14 -- drivers/gpu

[PATCH 14/14 v5] drm/i915/intel_i2c: remove POSTING_READ() from gmbus transfers

2012-03-28 Thread Daniel Kurtz
remove them. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index 2865313..be2852e 100644 --- a/drivers/gpu/drm

[PATCH 11/14 v5] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-03-28 Thread Daniel Kurtz
for another patch. We return -ETIMEDOUT if the hardware doesn't deactivate after the STOP cycle. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 30 +++--- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu

[PATCH 08/14 v5] drm/i915/intel_i2c: handle zero-length writes

2012-03-28 Thread Daniel Kurtz
there is device present on the bus with a given address. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index c12db72

[PATCH 00/14 v5] fix gmbus writes and related issues

2012-03-28 Thread Daniel Kurtz
instead of BUG_ON when an invalid port is requested v5: * fix bug in handle zero-length writes patch * remove POSTING_READ() from gmbus transfers Daniel Kurtz (14): drm/i915/intel_i2c: refactor gmbus_xfer drm/i915/intel_i2c: cleanup error messages and comments drm/i915/intel_i2c: assign

[PATCH 13/14 v5] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop

2012-03-28 Thread Daniel Kurtz
a ret variable to store the wait_for macro return value. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 33 + 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu

Re: [PATCH 14/14 v5] drm/i915/intel_i2c: remove POSTING_READ() from gmbus transfers

2012-03-28 Thread Daniel Kurtz
On Wed, Mar 28, 2012 at 9:05 PM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Wed, 28 Mar 2012 20:51:57 +0800, Daniel Kurtz djku...@chromium.org wrote: The POSTING_READ() calls were originally added to make sure the writes were flushed before any timing delays and across loops. However

[PATCH 3/7 v6] drm/i915/intel_i2c: always wait for IDLE before clearing NAK

2012-03-28 Thread Daniel Kurtz
in a bad state such that the next transaction may fail. Also, return -ENXIO if a device NAKs a transaction. Note: this patch also refactors gmbus_xfer to remove the done label. Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk --- drivers/gpu/drm/i915

[PATCH 1/7 v6] drm/i915/intel_i2c: handle zero-length writes

2012-03-28 Thread Daniel Kurtz
there is device present on the bus with a given address. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index c12db72

[PATCH 5/7 v6] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions

2012-03-28 Thread Daniel Kurtz
such a small write followed by a read. The INDEX can be either one or two bytes long. The advantage of using such a cycle is that the CPU has slightly less work to do once the read with INDEX cycle is started. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c

[PATCH 0/7 v6] fix gmbus writes and related issues

2012-03-28 Thread Daniel Kurtz
it immediately precedes another I915_READ(). Daniel Kurtz (7): drm/i915/intel_i2c: handle zero-length writes drm/i915/intel_i2c: use double-buffered writes drm/i915/intel_i2c: always wait for IDLE before clearing NAK drm/i915/intel_i2c: use WAIT cycle, not STOP drm/i915/intel_i2c: use INDEX cycles

[PATCH 6/7 v6] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop

2012-03-28 Thread Daniel Kurtz
a ret variable to store the wait_for macro return value. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 34 ++ 1 files changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu

[PATCH 2/7 v6] drm/i915/intel_i2c: use double-buffered writes

2012-03-28 Thread Daniel Kurtz
The GMBUS controller GMBUS3 register is double-buffered. Take advantage of this by writing two 4-byte words before the first wait for HW_RDY. This helps keep the GMBUS controller from becoming idle during long writes. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915

[PATCH 7/7 v6] drm/i915/intel_i2c: remove POSTING_READ() from gmbus transfers

2012-03-28 Thread Daniel Kurtz
The POSTING_READ() calls were originally added to make sure the writes were flushed before any timing delays and across loops. Now that the code has settled a bit, let's remove them. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |3 --- 1 files changed

[PATCH 4/7 v6] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-03-28 Thread Daniel Kurtz
for another patch. We return -ETIMEDOUT if the hardware doesn't deactivate after the STOP cycle. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 30 +++--- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu

Re: [PATCH 5/7 v6] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions

2012-03-29 Thread Daniel Kurtz
On Thu, Mar 29, 2012 at 2:52 AM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Thu, 29 Mar 2012 02:26:37 +0800, Daniel Kurtz djku...@chromium.org wrote: It is very common for an i2c device to require a small 1 or 2 byte write followed by a read.  For example, when reading from an i2c EEPROM

Re: [PATCH 4/7 v6] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-03-29 Thread Daniel Kurtz
On Thu, Mar 29, 2012 at 2:48 AM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Thu, 29 Mar 2012 02:26:36 +0800, Daniel Kurtz djku...@chromium.org wrote: The i915 is only able to generate a STOP cycle (i.e. finalize an i2c transaction) during a DATA or WAIT phase.  In other words

Re: [PATCH 2/7 v6] drm/i915/intel_i2c: use double-buffered writes

2012-03-29 Thread Daniel Kurtz
On Thu, Mar 29, 2012 at 2:41 AM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Thu, 29 Mar 2012 02:26:34 +0800, Daniel Kurtz djku...@chromium.org wrote: The GMBUS controller GMBUS3 register is double-buffered.  Take advantage of this  by writing two 4-byte words before the first wait

[PATCH 0/8 v7] fix gmbus writes and related issues

2012-03-30 Thread Daniel Kurtz
This patchset addresses a couple of issues with the i915 gmbus implementation. v7 adds a final patch to switch to using DRM_ERROR for reporting timeouts. Daniel Kurtz (8): drm/i915/intel_i2c: handle zero-length writes drm/i915/intel_i2c: use double-buffered writes drm/i915/intel_i2c

[PATCH 1/8 v7] drm/i915/intel_i2c: handle zero-length writes

2012-03-30 Thread Daniel Kurtz
there is device present on the bus with a given address. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index c12db72

[PATCH 3/8 v7] drm/i915/intel_i2c: always wait for IDLE before clearing NAK

2012-03-30 Thread Daniel Kurtz
in a bad state such that the next transaction may fail. Also, return -ENXIO if a device NAKs a transaction. Note: this patch also refactors gmbus_xfer to remove the done label. Signed-off-by: Daniel Kurtz djku...@chromium.org Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk --- drivers/gpu/drm/i915

[PATCH 4/8 v7] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-03-30 Thread Daniel Kurtz
for another patch. We return -ETIMEDOUT if the hardware doesn't deactivate after the STOP cycle. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 30 +++--- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu

[PATCH 5/8 v7] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions

2012-03-30 Thread Daniel Kurtz
such a small write followed by a read. The INDEX can be either one or two bytes long. The advantage of using such a cycle is that the CPU has slightly less work to do once the read with INDEX cycle is started. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c

[PATCH 6/8 v7] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop

2012-03-30 Thread Daniel Kurtz
a ret variable to store the wait_for macro return value. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 34 ++ 1 files changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu

[PATCH 7/8 v7] drm/i915/intel_i2c: remove POSTING_READ() from gmbus transfers

2012-03-30 Thread Daniel Kurtz
The POSTING_READ() calls were originally added to make sure the writes were flushed before any timing delays and across loops. Now that the code has settled a bit, let's remove them. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |3 --- 1 files changed

[PATCH 8/8 v7] drm/i915/intel_i2c: use DRM_ERROR on timeouts

2012-03-30 Thread Daniel Kurtz
/IHD_OS_Vol3_Part3.pdf, section 2.2.2) Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index 73431ed..154fedd

[PATCH 2/8 v7] drm/i915/intel_i2c: use double-buffered writes

2012-03-30 Thread Daniel Kurtz
would only trigger for transactions 4 bytes after 2 writes to GMBUS3. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915

Re: [PATCH 4/8 v7] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-04-10 Thread Daniel Kurtz
On Tue, Apr 10, 2012 at 6:41 PM, Daniel Vetter dan...@ffwll.ch wrote: On Tue, Apr 10, 2012 at 12:37:46PM +0200, Daniel Vetter wrote: On Fri, Mar 30, 2012 at 07:46:39PM +0800, Daniel Kurtz wrote: The i915 is only able to generate a STOP cycle (i.e. finalize an i2c transaction) during a DATA

Re: [PATCH 4/8 v7] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-04-11 Thread Daniel Kurtz
On Tue, Apr 10, 2012 at 11:03 PM, Daniel Vetter dan...@ffwll.ch wrote: On Tue, Apr 10, 2012 at 06:56:15PM +0800, Daniel Kurtz wrote: On Tue, Apr 10, 2012 at 6:41 PM, Daniel Vetter dan...@ffwll.ch wrote: On Tue, Apr 10, 2012 at 12:37:46PM +0200, Daniel Vetter wrote: On Fri, Mar 30, 2012 at 07

Re: [PATCH 4/8 v7] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-04-11 Thread Daniel Kurtz
On Wed, Apr 11, 2012 at 5:34 AM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Tue, 10 Apr 2012 17:03:04 +0200, Daniel Vetter dan...@ffwll.ch wrote: On Tue, Apr 10, 2012 at 06:56:15PM +0800, Daniel Kurtz wrote: On Tue, Apr 10, 2012 at 6:41 PM, Daniel Vetter dan...@ffwll.ch wrote: On Tue

[PATCH 2/2] drm/i915/intel_i2c: reduce verbosity of some messages

2012-04-13 Thread Daniel Kurtz
Some of these messages can be hit when userspace tries to probe the i2c with nothing connected or if the driver code tries to do the same. See: https://bugs.freedesktop.org/show_bug.cgi?id=48248 Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |7

[PATCH 1/2] drm/i915/intel_i2c: handle zero-length reads

2012-04-13 Thread Daniel Kurtz
there is device present on the bus with a given address. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/i915/intel_i2c.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index cab879f

Re: [PATCH 4/8 v7] drm/i915/intel_i2c: use WAIT cycle, not STOP

2012-04-13 Thread Daniel Kurtz
On Thu, Apr 12, 2012 at 4:26 AM, Chris Wilson ch...@chris-wilson.co.uk wrote: On Thu, 12 Apr 2012 02:17:46 +0800, Daniel Kurtz djku...@chromium.org wrote: On Wed, Apr 11, 2012 at 5:34 AM, Chris Wilson ch...@chris-wilson.co.uk wrote: The last major item on the wishlist is solving how to drive

[PATCH] drm: make frame duration time calculation more precise

2012-12-26 Thread Daniel Kurtz
It is a bit more precise to compute the total number of pixels first and then divide, rather than multiplying the line pixel count by the already-rounded line duration. Signed-off-by: Daniel Kurtz djku...@chromium.org --- drivers/gpu/drm/drm_irq.c |6 +- 1 files changed, 5 insertions

Re: [PATCH] drm: make frame duration time calculation more precise

2013-02-15 Thread Daniel Kurtz
On Wed, Dec 26, 2012 at 5:01 PM, Daniel Kurtz djku...@chromium.org wrote: It is a bit more precise to compute the total number of pixels first and then divide, rather than multiplying the line pixel count by the already-rounded line duration. Signed-off-by: Daniel Kurtz djku...@chromium.org

Re: [PATCH] drm: make frame duration time calculation more precise

2013-02-15 Thread Daniel Kurtz
On Wed, Dec 26, 2012 at 5:01 PM, Daniel Kurtz djku...@chromium.org wrote: It is a bit more precise to compute the total number of pixels first and then divide, rather than multiplying the line pixel count by the already-rounded line duration. Signed-off-by: Daniel Kurtz djku...@chromium.org

[PATCH] drm: Fix error message in drmWaitVBlank

2013-03-28 Thread Daniel Kurtz
If clock_gettime did fail, it would return -1 and set errno. What we really want to strerror() is the errno. Signed-off-by: Daniel Kurtz djku...@chromium.org --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xf86drm.c b/xf86drm.c index 2a74c80..4791a05 100644

[PATCH] libdrm: Make some drm headers compatible with gcc -std=c89 -pedantic

2013-08-26 Thread Daniel Kurtz
The following minor changes were needed to these headers: * Convert // comments to /* */ * No , after final member of enum With these changes, these header files can be included by a program that is built with gcc options: -std=c89 -Werror -pedantic Signed-off-by: Daniel Kurtz djku

  1   2   3   4   >