* [PATCH] drm/dp_mst: Support remote i2c writes
@ 2020-07-27 6:03 ` Sam McNally
0 siblings, 0 replies; 7+ messages in thread
From: Sam McNally @ 2020-07-27 6:03 UTC (permalink / raw)
To: LKML
Cc: Sam McNally, Daniel Vetter, David Airlie, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, dri-devel
For DP MST outputs, the i2c device currently only supports transfers
that can be implemented using remote i2c reads. Such transfers must
consist of zero or more write transactions followed by one read
transaction. DDC/CI commands require standalone write transactions and
hence aren't supported.
Since each remote i2c write is handled as a separate transfer, remote
i2c writes can support transfers consisting of write transactions, where
all but the last have I2C_M_STOP set. According to the DDC/CI 1.1
standard, DDC/CI commands only require a single write or read
transaction in a transfer, so this is sufficient.
For i2c transfers meeting the above criteria, generate and send a remote
i2c write message for each transaction. Add the trivial remote i2c write
reply parsing support so remote i2c write acks bubble up correctly.
Signed-off-by: Sam McNally <sammc@chromium.org>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 106 ++++++++++++++++++++++----
1 file changed, 90 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 09b32289497e..1ac874e4e7a1 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -961,6 +961,8 @@ static bool drm_dp_sideband_parse_reply(struct drm_dp_sideband_msg_rx *raw,
return drm_dp_sideband_parse_remote_dpcd_write(raw, msg);
case DP_REMOTE_I2C_READ:
return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg);
+ case DP_REMOTE_I2C_WRITE:
+ return true; /* since there's nothing to parse */
case DP_ENUM_PATH_RESOURCES:
return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg);
case DP_ALLOCATE_PAYLOAD:
@@ -5326,29 +5328,29 @@ static bool remote_i2c_read_ok(const struct i2c_msg msgs[], int num)
msgs[num - 1].len <= 0xff;
}
-/* I2C device */
-static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
- int num)
+static bool remote_i2c_write_ok(const struct i2c_msg msgs[], int num)
+{
+ int i;
+
+ for (i = 0; i < num - 1; i++) {
+ if (msgs[i].flags & I2C_M_RD || !(msgs[i].flags & I2C_M_STOP) ||
+ msgs[i].len > 0xff)
+ return false;
+ }
+
+ return !(msgs[num - 1].flags & I2C_M_RD) && msgs[num - 1].len <= 0xff;
+}
+
+static int drm_dp_mst_i2c_read(struct drm_dp_mst_branch *mstb,
+ struct drm_dp_mst_port *port,
+ struct i2c_msg *msgs, int num)
{
- struct drm_dp_aux *aux = adapter->algo_data;
- struct drm_dp_mst_port *port = container_of(aux, struct drm_dp_mst_port, aux);
- struct drm_dp_mst_branch *mstb;
struct drm_dp_mst_topology_mgr *mgr = port->mgr;
unsigned int i;
struct drm_dp_sideband_msg_req_body msg;
struct drm_dp_sideband_msg_tx *txmsg = NULL;
int ret;
- mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent);
- if (!mstb)
- return -EREMOTEIO;
-
- if (!remote_i2c_read_ok(msgs, num)) {
- DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
- ret = -EIO;
- goto out;
- }
-
memset(&msg, 0, sizeof(msg));
msg.req_type = DP_REMOTE_I2C_READ;
msg.u.i2c_read.num_transactions = num - 1;
@@ -5389,6 +5391,78 @@ static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs
}
out:
kfree(txmsg);
+ return ret;
+}
+
+static int drm_dp_mst_i2c_write(struct drm_dp_mst_branch *mstb,
+ struct drm_dp_mst_port *port,
+ struct i2c_msg *msgs, int num)
+{
+ struct drm_dp_mst_topology_mgr *mgr = port->mgr;
+ unsigned int i;
+ struct drm_dp_sideband_msg_req_body msg;
+ struct drm_dp_sideband_msg_tx *txmsg = NULL;
+ int ret;
+
+ txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
+ if (!txmsg) {
+ ret = -ENOMEM;
+ goto out;
+ }
+ for (i = 0; i < num; i++) {
+ memset(&msg, 0, sizeof(msg));
+ msg.req_type = DP_REMOTE_I2C_WRITE;
+ msg.u.i2c_write.port_number = port->port_num;
+ msg.u.i2c_write.write_i2c_device_id = msgs[i].addr;
+ msg.u.i2c_write.num_bytes = msgs[i].len;
+ msg.u.i2c_write.bytes = msgs[i].buf;
+
+ memset(txmsg, 0, sizeof(*txmsg));
+ txmsg->dst = mstb;
+
+ drm_dp_encode_sideband_req(&msg, txmsg);
+ drm_dp_queue_down_tx(mgr, txmsg);
+
+ ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
+ if (ret > 0) {
+ if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) {
+ ret = -EREMOTEIO;
+ goto out;
+ }
+ } else {
+ goto out;
+ }
+ }
+ ret = num;
+out:
+ kfree(txmsg);
+ return ret;
+}
+
+/* I2C device */
+static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter,
+ struct i2c_msg *msgs, int num)
+{
+ struct drm_dp_aux *aux = adapter->algo_data;
+ struct drm_dp_mst_port *port =
+ container_of(aux, struct drm_dp_mst_port, aux);
+ struct drm_dp_mst_branch *mstb;
+ struct drm_dp_mst_topology_mgr *mgr = port->mgr;
+ int ret;
+
+ mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent);
+ if (!mstb)
+ return -EREMOTEIO;
+
+ if (remote_i2c_read_ok(msgs, num)) {
+ ret = drm_dp_mst_i2c_read(mstb, port, msgs, num);
+ } else if (remote_i2c_write_ok(msgs, num)) {
+ ret = drm_dp_mst_i2c_write(mstb, port, msgs, num);
+ } else {
+ DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
+ ret = -EIO;
+ }
+
drm_dp_mst_topology_put_mstb(mstb);
return ret;
}
--
2.28.0.rc0.142.g3c755180ce-goog
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH] drm/dp_mst: Support remote i2c writes
@ 2020-07-27 6:03 ` Sam McNally
0 siblings, 0 replies; 7+ messages in thread
From: Sam McNally @ 2020-07-27 6:03 UTC (permalink / raw)
To: LKML; +Cc: Thomas Zimmermann, David Airlie, Sam McNally, dri-devel
For DP MST outputs, the i2c device currently only supports transfers
that can be implemented using remote i2c reads. Such transfers must
consist of zero or more write transactions followed by one read
transaction. DDC/CI commands require standalone write transactions and
hence aren't supported.
Since each remote i2c write is handled as a separate transfer, remote
i2c writes can support transfers consisting of write transactions, where
all but the last have I2C_M_STOP set. According to the DDC/CI 1.1
standard, DDC/CI commands only require a single write or read
transaction in a transfer, so this is sufficient.
For i2c transfers meeting the above criteria, generate and send a remote
i2c write message for each transaction. Add the trivial remote i2c write
reply parsing support so remote i2c write acks bubble up correctly.
Signed-off-by: Sam McNally <sammc@chromium.org>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 106 ++++++++++++++++++++++----
1 file changed, 90 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 09b32289497e..1ac874e4e7a1 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -961,6 +961,8 @@ static bool drm_dp_sideband_parse_reply(struct drm_dp_sideband_msg_rx *raw,
return drm_dp_sideband_parse_remote_dpcd_write(raw, msg);
case DP_REMOTE_I2C_READ:
return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg);
+ case DP_REMOTE_I2C_WRITE:
+ return true; /* since there's nothing to parse */
case DP_ENUM_PATH_RESOURCES:
return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg);
case DP_ALLOCATE_PAYLOAD:
@@ -5326,29 +5328,29 @@ static bool remote_i2c_read_ok(const struct i2c_msg msgs[], int num)
msgs[num - 1].len <= 0xff;
}
-/* I2C device */
-static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
- int num)
+static bool remote_i2c_write_ok(const struct i2c_msg msgs[], int num)
+{
+ int i;
+
+ for (i = 0; i < num - 1; i++) {
+ if (msgs[i].flags & I2C_M_RD || !(msgs[i].flags & I2C_M_STOP) ||
+ msgs[i].len > 0xff)
+ return false;
+ }
+
+ return !(msgs[num - 1].flags & I2C_M_RD) && msgs[num - 1].len <= 0xff;
+}
+
+static int drm_dp_mst_i2c_read(struct drm_dp_mst_branch *mstb,
+ struct drm_dp_mst_port *port,
+ struct i2c_msg *msgs, int num)
{
- struct drm_dp_aux *aux = adapter->algo_data;
- struct drm_dp_mst_port *port = container_of(aux, struct drm_dp_mst_port, aux);
- struct drm_dp_mst_branch *mstb;
struct drm_dp_mst_topology_mgr *mgr = port->mgr;
unsigned int i;
struct drm_dp_sideband_msg_req_body msg;
struct drm_dp_sideband_msg_tx *txmsg = NULL;
int ret;
- mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent);
- if (!mstb)
- return -EREMOTEIO;
-
- if (!remote_i2c_read_ok(msgs, num)) {
- DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
- ret = -EIO;
- goto out;
- }
-
memset(&msg, 0, sizeof(msg));
msg.req_type = DP_REMOTE_I2C_READ;
msg.u.i2c_read.num_transactions = num - 1;
@@ -5389,6 +5391,78 @@ static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs
}
out:
kfree(txmsg);
+ return ret;
+}
+
+static int drm_dp_mst_i2c_write(struct drm_dp_mst_branch *mstb,
+ struct drm_dp_mst_port *port,
+ struct i2c_msg *msgs, int num)
+{
+ struct drm_dp_mst_topology_mgr *mgr = port->mgr;
+ unsigned int i;
+ struct drm_dp_sideband_msg_req_body msg;
+ struct drm_dp_sideband_msg_tx *txmsg = NULL;
+ int ret;
+
+ txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
+ if (!txmsg) {
+ ret = -ENOMEM;
+ goto out;
+ }
+ for (i = 0; i < num; i++) {
+ memset(&msg, 0, sizeof(msg));
+ msg.req_type = DP_REMOTE_I2C_WRITE;
+ msg.u.i2c_write.port_number = port->port_num;
+ msg.u.i2c_write.write_i2c_device_id = msgs[i].addr;
+ msg.u.i2c_write.num_bytes = msgs[i].len;
+ msg.u.i2c_write.bytes = msgs[i].buf;
+
+ memset(txmsg, 0, sizeof(*txmsg));
+ txmsg->dst = mstb;
+
+ drm_dp_encode_sideband_req(&msg, txmsg);
+ drm_dp_queue_down_tx(mgr, txmsg);
+
+ ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
+ if (ret > 0) {
+ if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) {
+ ret = -EREMOTEIO;
+ goto out;
+ }
+ } else {
+ goto out;
+ }
+ }
+ ret = num;
+out:
+ kfree(txmsg);
+ return ret;
+}
+
+/* I2C device */
+static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter,
+ struct i2c_msg *msgs, int num)
+{
+ struct drm_dp_aux *aux = adapter->algo_data;
+ struct drm_dp_mst_port *port =
+ container_of(aux, struct drm_dp_mst_port, aux);
+ struct drm_dp_mst_branch *mstb;
+ struct drm_dp_mst_topology_mgr *mgr = port->mgr;
+ int ret;
+
+ mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent);
+ if (!mstb)
+ return -EREMOTEIO;
+
+ if (remote_i2c_read_ok(msgs, num)) {
+ ret = drm_dp_mst_i2c_read(mstb, port, msgs, num);
+ } else if (remote_i2c_write_ok(msgs, num)) {
+ ret = drm_dp_mst_i2c_write(mstb, port, msgs, num);
+ } else {
+ DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
+ ret = -EIO;
+ }
+
drm_dp_mst_topology_put_mstb(mstb);
return ret;
}
--
2.28.0.rc0.142.g3c755180ce-goog
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/dp_mst: Support remote i2c writes
2020-07-27 6:03 ` Sam McNally
(?)
(?)
@ 2020-08-31 16:21 ` Patchwork
-1 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2020-08-31 16:21 UTC (permalink / raw)
To: Sam McNally; +Cc: intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 4388 bytes --]
== Series Details ==
Series: drm/dp_mst: Support remote i2c writes
URL : https://patchwork.freedesktop.org/series/81191/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8946 -> Patchwork_18424
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/index.html
Known issues
------------
Here are the changes found in Patchwork_18424 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@module-reload:
- fi-byt-j1900: [PASS][1] -> [DMESG-WARN][2] ([i915#1982])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/fi-byt-j1900/igt@i915_pm_rpm@module-reload.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/fi-byt-j1900/igt@i915_pm_rpm@module-reload.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-kbl-r: [PASS][3] -> [DMESG-WARN][4] ([i915#1982])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/fi-kbl-r/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/fi-kbl-r/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
* igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
- fi-icl-u2: [PASS][5] -> [DMESG-WARN][6] ([i915#1982]) +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/fi-icl-u2/igt@kms_cursor_legacy@basic-flip-after-cursor-atomic.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/fi-icl-u2/igt@kms_cursor_legacy@basic-flip-after-cursor-atomic.html
* igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2:
- fi-skl-guc: [PASS][7] -> [DMESG-WARN][8] ([i915#2203])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/fi-skl-guc/igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/fi-skl-guc/igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2.html
#### Possible fixes ####
* igt@gem_exec_parallel@engines@basic:
- fi-bxt-dsi: [INCOMPLETE][9] ([i915#1635] / [i915#2398]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/fi-bxt-dsi/igt@gem_exec_parallel@engines@basic.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/fi-bxt-dsi/igt@gem_exec_parallel@engines@basic.html
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-bsw-kefka: [DMESG-WARN][11] ([i915#1982]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- {fi-kbl-7560u}: [DMESG-WARN][13] ([i915#1982]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/fi-kbl-7560u/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/fi-kbl-7560u/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
[i915#2398]: https://gitlab.freedesktop.org/drm/intel/issues/2398
Participating hosts (38 -> 33)
------------------------------
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper
Build changes
-------------
* Linux: CI_DRM_8946 -> Patchwork_18424
CI-20190529: 20190529
CI_DRM_8946: e2a5eec44f19c7732c7114c62410914fda06e106 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5774: 2a5db9f60241383272aeec176e1b97b3f487209f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18424: efe6eb406477be941a39de90fd2181786079bf40 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
efe6eb406477 drm/dp_mst: Support remote i2c writes
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/index.html
[-- Attachment #1.2: Type: text/html, Size: 5438 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread* [Intel-gfx] ✓ Fi.CI.IGT: success for drm/dp_mst: Support remote i2c writes
2020-07-27 6:03 ` Sam McNally
` (2 preceding siblings ...)
(?)
@ 2020-08-31 23:58 ` Patchwork
-1 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2020-08-31 23:58 UTC (permalink / raw)
To: Sam McNally; +Cc: intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 18037 bytes --]
== Series Details ==
Series: drm/dp_mst: Support remote i2c writes
URL : https://patchwork.freedesktop.org/series/81191/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8946_full -> Patchwork_18424_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_18424_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_persistence@engines-mixed-process@vcs0:
- shard-apl: [PASS][1] -> [FAIL][2] ([i915#1635] / [i915#2374])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-apl1/igt@gem_ctx_persistence@engines-mixed-process@vcs0.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-apl3/igt@gem_ctx_persistence@engines-mixed-process@vcs0.html
* igt@gem_eio@in-flight-10ms:
- shard-skl: [PASS][3] -> [DMESG-WARN][4] ([i915#1982]) +9 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl7/igt@gem_eio@in-flight-10ms.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl1/igt@gem_eio@in-flight-10ms.html
* igt@gem_exec_reloc@basic-concurrent0:
- shard-apl: [PASS][5] -> [TIMEOUT][6] ([i915#1635] / [i915#1958])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-apl6/igt@gem_exec_reloc@basic-concurrent0.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-apl4/igt@gem_exec_reloc@basic-concurrent0.html
* igt@gem_exec_whisper@basic-contexts-forked:
- shard-glk: [PASS][7] -> [TIMEOUT][8] ([i915#1958]) +1 similar issue
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-glk5/igt@gem_exec_whisper@basic-contexts-forked.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-glk5/igt@gem_exec_whisper@basic-contexts-forked.html
* igt@gem_exec_whisper@basic-fds:
- shard-iclb: [PASS][9] -> [TIMEOUT][10] ([i915#1958])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-iclb4/igt@gem_exec_whisper@basic-fds.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-iclb6/igt@gem_exec_whisper@basic-fds.html
* igt@gem_exec_whisper@basic-fds-priority:
- shard-tglb: [PASS][11] -> [TIMEOUT][12] ([i915#1958])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-tglb7/igt@gem_exec_whisper@basic-fds-priority.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-tglb3/igt@gem_exec_whisper@basic-fds-priority.html
* igt@gem_exec_whisper@basic-forked:
- shard-kbl: [PASS][13] -> [TIMEOUT][14] ([i915#1958])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-kbl1/igt@gem_exec_whisper@basic-forked.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-kbl7/igt@gem_exec_whisper@basic-forked.html
* igt@gem_sync@basic-store-all:
- shard-apl: [PASS][15] -> [FAIL][16] ([i915#1635] / [i915#2356])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-apl8/igt@gem_sync@basic-store-all.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-apl2/igt@gem_sync@basic-store-all.html
- shard-glk: [PASS][17] -> [FAIL][18] ([i915#2356])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-glk4/igt@gem_sync@basic-store-all.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-glk9/igt@gem_sync@basic-store-all.html
* igt@kms_big_fb@x-tiled-64bpp-rotate-0:
- shard-glk: [PASS][19] -> [DMESG-FAIL][20] ([i915#118] / [i915#95])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-glk9/igt@kms_big_fb@x-tiled-64bpp-rotate-0.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-glk8/igt@kms_big_fb@x-tiled-64bpp-rotate-0.html
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][21] -> [FAIL][22] ([i915#79])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-glk1/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-glk4/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2.html
* igt@kms_flip@2x-plain-flip-ts-check@ac-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][23] -> [FAIL][24] ([i915#2122])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-glk9/igt@kms_flip@2x-plain-flip-ts-check@ac-hdmi-a1-hdmi-a2.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-glk8/igt@kms_flip@2x-plain-flip-ts-check@ac-hdmi-a1-hdmi-a2.html
* igt@kms_flip@flip-vs-expired-vblank@b-edp1:
- shard-skl: [PASS][25] -> [FAIL][26] ([i915#79])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl3/igt@kms_flip@flip-vs-expired-vblank@b-edp1.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl10/igt@kms_flip@flip-vs-expired-vblank@b-edp1.html
* igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
- shard-kbl: [PASS][27] -> [DMESG-WARN][28] ([i915#180]) +5 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-kbl7/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-kbl2/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
* igt@kms_frontbuffer_tracking@fbcpsr-tiling-linear:
- shard-tglb: [PASS][29] -> [DMESG-WARN][30] ([i915#1982])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-tglb3/igt@kms_frontbuffer_tracking@fbcpsr-tiling-linear.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-tglb7/igt@kms_frontbuffer_tracking@fbcpsr-tiling-linear.html
* igt@kms_frontbuffer_tracking@psr-suspend:
- shard-skl: [PASS][31] -> [INCOMPLETE][32] ([i915#123])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl4/igt@kms_frontbuffer_tracking@psr-suspend.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl4/igt@kms_frontbuffer_tracking@psr-suspend.html
* igt@kms_hdr@bpc-switch-dpms:
- shard-skl: [PASS][33] -> [FAIL][34] ([i915#1188]) +2 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl2/igt@kms_hdr@bpc-switch-dpms.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl4/igt@kms_hdr@bpc-switch-dpms.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-skl: [PASS][35] -> [INCOMPLETE][36] ([i915#648])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl7/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl4/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
- shard-iclb: [PASS][37] -> [INCOMPLETE][38] ([i915#1185] / [i915#250])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-iclb3/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-iclb3/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes.html
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][39] -> [FAIL][40] ([fdo#108145] / [i915#265])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl1/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl7/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
* igt@kms_psr@psr2_cursor_plane_onoff:
- shard-iclb: [PASS][41] -> [SKIP][42] ([fdo#109441])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-iclb7/igt@kms_psr@psr2_cursor_plane_onoff.html
* igt@kms_setmode@basic:
- shard-kbl: [PASS][43] -> [FAIL][44] ([i915#31])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-kbl4/igt@kms_setmode@basic.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-kbl2/igt@kms_setmode@basic.html
#### Possible fixes ####
* igt@gem_exec_whisper@basic-contexts:
- shard-skl: [TIMEOUT][45] ([i915#1958]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl9/igt@gem_exec_whisper@basic-contexts.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl2/igt@gem_exec_whisper@basic-contexts.html
* igt@gem_exec_whisper@basic-fds-forked:
- shard-glk: [TIMEOUT][47] ([i915#1958]) -> [PASS][48] +1 similar issue
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-glk3/igt@gem_exec_whisper@basic-fds-forked.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-glk8/igt@gem_exec_whisper@basic-fds-forked.html
* igt@gem_exec_whisper@basic-queues-forked:
- shard-skl: [DMESG-WARN][49] ([i915#1982]) -> [PASS][50] +3 similar issues
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl2/igt@gem_exec_whisper@basic-queues-forked.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl9/igt@gem_exec_whisper@basic-queues-forked.html
* igt@gem_sync@basic-store-all:
- shard-kbl: [FAIL][51] ([i915#2356]) -> [PASS][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-kbl7/igt@gem_sync@basic-store-all.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-kbl1/igt@gem_sync@basic-store-all.html
* igt@i915_pm_dc@dc6-psr:
- shard-skl: [FAIL][53] ([i915#454]) -> [PASS][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl10/igt@i915_pm_dc@dc6-psr.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl6/igt@i915_pm_dc@dc6-psr.html
* igt@i915_selftest@mock@contexts:
- shard-apl: [INCOMPLETE][55] ([i915#1635] / [i915#2278]) -> [PASS][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-apl3/igt@i915_selftest@mock@contexts.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-apl2/igt@i915_selftest@mock@contexts.html
* igt@kms_big_fb@y-tiled-64bpp-rotate-180:
- shard-glk: [FAIL][57] ([i915#1119]) -> [PASS][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-glk3/igt@kms_big_fb@y-tiled-64bpp-rotate-180.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-glk6/igt@kms_big_fb@y-tiled-64bpp-rotate-180.html
* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl: [DMESG-WARN][59] ([i915#180]) -> [PASS][60] +7 similar issues
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-kbl4/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
- shard-skl: [INCOMPLETE][61] ([i915#300]) -> [PASS][62]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl9/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl2/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-pgflip-blt:
- shard-kbl: [DMESG-WARN][63] ([i915#1982]) -> [PASS][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-kbl7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-pgflip-blt.html
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-kbl7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-pgflip-blt.html
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt:
- shard-iclb: [DMESG-WARN][65] ([i915#1982]) -> [PASS][66] +1 similar issue
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt.html
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt.html
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-onoff:
- shard-tglb: [DMESG-WARN][67] ([i915#1982]) -> [PASS][68]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-tglb8/igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-onoff.html
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-tglb8/igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-onoff.html
* igt@kms_plane@plane-panning-bottom-right-pipe-a-planes:
- shard-glk: [FAIL][69] ([i915#1036]) -> [PASS][70]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-glk3/igt@kms_plane@plane-panning-bottom-right-pipe-a-planes.html
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-glk6/igt@kms_plane@plane-panning-bottom-right-pipe-a-planes.html
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: [FAIL][71] ([fdo#108145] / [i915#265]) -> [PASS][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl10/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl6/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [SKIP][73] ([fdo#109441]) -> [PASS][74] +2 similar issues
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-iclb7/igt@kms_psr@psr2_cursor_render.html
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
* igt@kms_psr@suspend:
- shard-skl: [INCOMPLETE][75] ([i915#198]) -> [PASS][76]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl1/igt@kms_psr@suspend.html
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl7/igt@kms_psr@suspend.html
#### Warnings ####
* igt@kms_content_protection@atomic:
- shard-kbl: [TIMEOUT][77] ([i915#1319] / [i915#1958]) -> [TIMEOUT][78] ([i915#1319])
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-kbl1/igt@kms_content_protection@atomic.html
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-kbl4/igt@kms_content_protection@atomic.html
* igt@kms_flip@plain-flip-fb-recreate@a-edp1:
- shard-skl: [DMESG-WARN][79] ([i915#1982]) -> [DMESG-FAIL][80] ([i915#1982])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-skl5/igt@kms_flip@plain-flip-fb-recreate@a-edp1.html
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-skl3/igt@kms_flip@plain-flip-fb-recreate@a-edp1.html
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- shard-kbl: [DMESG-WARN][81] ([i915#180]) -> [INCOMPLETE][82] ([i915#155])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8946/shard-kbl1/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/shard-kbl4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[i915#1036]: https://gitlab.freedesktop.org/drm/intel/issues/1036
[i915#1119]: https://gitlab.freedesktop.org/drm/intel/issues/1119
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1185]: https://gitlab.freedesktop.org/drm/intel/issues/1185
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#123]: https://gitlab.freedesktop.org/drm/intel/issues/123
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1958]: https://gitlab.freedesktop.org/drm/intel/issues/1958
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2278]: https://gitlab.freedesktop.org/drm/intel/issues/2278
[i915#2356]: https://gitlab.freedesktop.org/drm/intel/issues/2356
[i915#2374]: https://gitlab.freedesktop.org/drm/intel/issues/2374
[i915#250]: https://gitlab.freedesktop.org/drm/intel/issues/250
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#300]: https://gitlab.freedesktop.org/drm/intel/issues/300
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#648]: https://gitlab.freedesktop.org/drm/intel/issues/648
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_8946 -> Patchwork_18424
CI-20190529: 20190529
CI_DRM_8946: e2a5eec44f19c7732c7114c62410914fda06e106 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5774: 2a5db9f60241383272aeec176e1b97b3f487209f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18424: efe6eb406477be941a39de90fd2181786079bf40 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18424/index.html
[-- Attachment #1.2: Type: text/html, Size: 21378 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] drm/dp_mst: Support remote i2c writes
2020-07-27 6:03 ` Sam McNally
@ 2020-09-01 9:31 ` Ville Syrjälä
-1 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2020-09-01 9:31 UTC (permalink / raw)
To: Sam McNally; +Cc: David Airlie, dri-devel, LKML, Thomas Zimmermann
On Mon, Jul 27, 2020 at 04:03:37PM +1000, Sam McNally wrote:
> For DP MST outputs, the i2c device currently only supports transfers
> that can be implemented using remote i2c reads. Such transfers must
> consist of zero or more write transactions followed by one read
> transaction. DDC/CI commands require standalone write transactions and
> hence aren't supported.
>
> Since each remote i2c write is handled as a separate transfer, remote
> i2c writes can support transfers consisting of write transactions, where
> all but the last have I2C_M_STOP set. According to the DDC/CI 1.1
> standard, DDC/CI commands only require a single write or read
> transaction in a transfer, so this is sufficient.
>
> For i2c transfers meeting the above criteria, generate and send a remote
> i2c write message for each transaction. Add the trivial remote i2c write
> reply parsing support so remote i2c write acks bubble up correctly.
Looks great.
For good measure I bounced this to intel-gfx so we got
the CI to check it. Seems to have passed.
Amended with
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/37
and pushed to drm-misc-next. Thanks!
>
> Signed-off-by: Sam McNally <sammc@chromium.org>
> ---
>
> drivers/gpu/drm/drm_dp_mst_topology.c | 106 ++++++++++++++++++++++----
> 1 file changed, 90 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 09b32289497e..1ac874e4e7a1 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -961,6 +961,8 @@ static bool drm_dp_sideband_parse_reply(struct drm_dp_sideband_msg_rx *raw,
> return drm_dp_sideband_parse_remote_dpcd_write(raw, msg);
> case DP_REMOTE_I2C_READ:
> return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg);
> + case DP_REMOTE_I2C_WRITE:
> + return true; /* since there's nothing to parse */
> case DP_ENUM_PATH_RESOURCES:
> return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg);
> case DP_ALLOCATE_PAYLOAD:
> @@ -5326,29 +5328,29 @@ static bool remote_i2c_read_ok(const struct i2c_msg msgs[], int num)
> msgs[num - 1].len <= 0xff;
> }
>
> -/* I2C device */
> -static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
> - int num)
> +static bool remote_i2c_write_ok(const struct i2c_msg msgs[], int num)
> +{
> + int i;
> +
> + for (i = 0; i < num - 1; i++) {
> + if (msgs[i].flags & I2C_M_RD || !(msgs[i].flags & I2C_M_STOP) ||
> + msgs[i].len > 0xff)
> + return false;
> + }
> +
> + return !(msgs[num - 1].flags & I2C_M_RD) && msgs[num - 1].len <= 0xff;
> +}
> +
> +static int drm_dp_mst_i2c_read(struct drm_dp_mst_branch *mstb,
> + struct drm_dp_mst_port *port,
> + struct i2c_msg *msgs, int num)
> {
> - struct drm_dp_aux *aux = adapter->algo_data;
> - struct drm_dp_mst_port *port = container_of(aux, struct drm_dp_mst_port, aux);
> - struct drm_dp_mst_branch *mstb;
> struct drm_dp_mst_topology_mgr *mgr = port->mgr;
> unsigned int i;
> struct drm_dp_sideband_msg_req_body msg;
> struct drm_dp_sideband_msg_tx *txmsg = NULL;
> int ret;
>
> - mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent);
> - if (!mstb)
> - return -EREMOTEIO;
> -
> - if (!remote_i2c_read_ok(msgs, num)) {
> - DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
> - ret = -EIO;
> - goto out;
> - }
> -
> memset(&msg, 0, sizeof(msg));
> msg.req_type = DP_REMOTE_I2C_READ;
> msg.u.i2c_read.num_transactions = num - 1;
> @@ -5389,6 +5391,78 @@ static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs
> }
> out:
> kfree(txmsg);
> + return ret;
> +}
> +
> +static int drm_dp_mst_i2c_write(struct drm_dp_mst_branch *mstb,
> + struct drm_dp_mst_port *port,
> + struct i2c_msg *msgs, int num)
> +{
> + struct drm_dp_mst_topology_mgr *mgr = port->mgr;
> + unsigned int i;
> + struct drm_dp_sideband_msg_req_body msg;
> + struct drm_dp_sideband_msg_tx *txmsg = NULL;
> + int ret;
> +
> + txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
> + if (!txmsg) {
> + ret = -ENOMEM;
> + goto out;
> + }
> + for (i = 0; i < num; i++) {
> + memset(&msg, 0, sizeof(msg));
> + msg.req_type = DP_REMOTE_I2C_WRITE;
> + msg.u.i2c_write.port_number = port->port_num;
> + msg.u.i2c_write.write_i2c_device_id = msgs[i].addr;
> + msg.u.i2c_write.num_bytes = msgs[i].len;
> + msg.u.i2c_write.bytes = msgs[i].buf;
> +
> + memset(txmsg, 0, sizeof(*txmsg));
> + txmsg->dst = mstb;
> +
> + drm_dp_encode_sideband_req(&msg, txmsg);
> + drm_dp_queue_down_tx(mgr, txmsg);
> +
> + ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
> + if (ret > 0) {
> + if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) {
> + ret = -EREMOTEIO;
> + goto out;
> + }
> + } else {
> + goto out;
> + }
> + }
> + ret = num;
> +out:
> + kfree(txmsg);
> + return ret;
> +}
> +
> +/* I2C device */
> +static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter,
> + struct i2c_msg *msgs, int num)
> +{
> + struct drm_dp_aux *aux = adapter->algo_data;
> + struct drm_dp_mst_port *port =
> + container_of(aux, struct drm_dp_mst_port, aux);
> + struct drm_dp_mst_branch *mstb;
> + struct drm_dp_mst_topology_mgr *mgr = port->mgr;
> + int ret;
> +
> + mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent);
> + if (!mstb)
> + return -EREMOTEIO;
> +
> + if (remote_i2c_read_ok(msgs, num)) {
> + ret = drm_dp_mst_i2c_read(mstb, port, msgs, num);
> + } else if (remote_i2c_write_ok(msgs, num)) {
> + ret = drm_dp_mst_i2c_write(mstb, port, msgs, num);
> + } else {
> + DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
> + ret = -EIO;
> + }
> +
> drm_dp_mst_topology_put_mstb(mstb);
> return ret;
> }
> --
> 2.28.0.rc0.142.g3c755180ce-goog
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] drm/dp_mst: Support remote i2c writes
@ 2020-09-01 9:31 ` Ville Syrjälä
0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2020-09-01 9:31 UTC (permalink / raw)
To: Sam McNally; +Cc: LKML, Thomas Zimmermann, David Airlie, dri-devel
On Mon, Jul 27, 2020 at 04:03:37PM +1000, Sam McNally wrote:
> For DP MST outputs, the i2c device currently only supports transfers
> that can be implemented using remote i2c reads. Such transfers must
> consist of zero or more write transactions followed by one read
> transaction. DDC/CI commands require standalone write transactions and
> hence aren't supported.
>
> Since each remote i2c write is handled as a separate transfer, remote
> i2c writes can support transfers consisting of write transactions, where
> all but the last have I2C_M_STOP set. According to the DDC/CI 1.1
> standard, DDC/CI commands only require a single write or read
> transaction in a transfer, so this is sufficient.
>
> For i2c transfers meeting the above criteria, generate and send a remote
> i2c write message for each transaction. Add the trivial remote i2c write
> reply parsing support so remote i2c write acks bubble up correctly.
Looks great.
For good measure I bounced this to intel-gfx so we got
the CI to check it. Seems to have passed.
Amended with
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/37
and pushed to drm-misc-next. Thanks!
>
> Signed-off-by: Sam McNally <sammc@chromium.org>
> ---
>
> drivers/gpu/drm/drm_dp_mst_topology.c | 106 ++++++++++++++++++++++----
> 1 file changed, 90 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 09b32289497e..1ac874e4e7a1 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -961,6 +961,8 @@ static bool drm_dp_sideband_parse_reply(struct drm_dp_sideband_msg_rx *raw,
> return drm_dp_sideband_parse_remote_dpcd_write(raw, msg);
> case DP_REMOTE_I2C_READ:
> return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg);
> + case DP_REMOTE_I2C_WRITE:
> + return true; /* since there's nothing to parse */
> case DP_ENUM_PATH_RESOURCES:
> return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg);
> case DP_ALLOCATE_PAYLOAD:
> @@ -5326,29 +5328,29 @@ static bool remote_i2c_read_ok(const struct i2c_msg msgs[], int num)
> msgs[num - 1].len <= 0xff;
> }
>
> -/* I2C device */
> -static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
> - int num)
> +static bool remote_i2c_write_ok(const struct i2c_msg msgs[], int num)
> +{
> + int i;
> +
> + for (i = 0; i < num - 1; i++) {
> + if (msgs[i].flags & I2C_M_RD || !(msgs[i].flags & I2C_M_STOP) ||
> + msgs[i].len > 0xff)
> + return false;
> + }
> +
> + return !(msgs[num - 1].flags & I2C_M_RD) && msgs[num - 1].len <= 0xff;
> +}
> +
> +static int drm_dp_mst_i2c_read(struct drm_dp_mst_branch *mstb,
> + struct drm_dp_mst_port *port,
> + struct i2c_msg *msgs, int num)
> {
> - struct drm_dp_aux *aux = adapter->algo_data;
> - struct drm_dp_mst_port *port = container_of(aux, struct drm_dp_mst_port, aux);
> - struct drm_dp_mst_branch *mstb;
> struct drm_dp_mst_topology_mgr *mgr = port->mgr;
> unsigned int i;
> struct drm_dp_sideband_msg_req_body msg;
> struct drm_dp_sideband_msg_tx *txmsg = NULL;
> int ret;
>
> - mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent);
> - if (!mstb)
> - return -EREMOTEIO;
> -
> - if (!remote_i2c_read_ok(msgs, num)) {
> - DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
> - ret = -EIO;
> - goto out;
> - }
> -
> memset(&msg, 0, sizeof(msg));
> msg.req_type = DP_REMOTE_I2C_READ;
> msg.u.i2c_read.num_transactions = num - 1;
> @@ -5389,6 +5391,78 @@ static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs
> }
> out:
> kfree(txmsg);
> + return ret;
> +}
> +
> +static int drm_dp_mst_i2c_write(struct drm_dp_mst_branch *mstb,
> + struct drm_dp_mst_port *port,
> + struct i2c_msg *msgs, int num)
> +{
> + struct drm_dp_mst_topology_mgr *mgr = port->mgr;
> + unsigned int i;
> + struct drm_dp_sideband_msg_req_body msg;
> + struct drm_dp_sideband_msg_tx *txmsg = NULL;
> + int ret;
> +
> + txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
> + if (!txmsg) {
> + ret = -ENOMEM;
> + goto out;
> + }
> + for (i = 0; i < num; i++) {
> + memset(&msg, 0, sizeof(msg));
> + msg.req_type = DP_REMOTE_I2C_WRITE;
> + msg.u.i2c_write.port_number = port->port_num;
> + msg.u.i2c_write.write_i2c_device_id = msgs[i].addr;
> + msg.u.i2c_write.num_bytes = msgs[i].len;
> + msg.u.i2c_write.bytes = msgs[i].buf;
> +
> + memset(txmsg, 0, sizeof(*txmsg));
> + txmsg->dst = mstb;
> +
> + drm_dp_encode_sideband_req(&msg, txmsg);
> + drm_dp_queue_down_tx(mgr, txmsg);
> +
> + ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
> + if (ret > 0) {
> + if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) {
> + ret = -EREMOTEIO;
> + goto out;
> + }
> + } else {
> + goto out;
> + }
> + }
> + ret = num;
> +out:
> + kfree(txmsg);
> + return ret;
> +}
> +
> +/* I2C device */
> +static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter,
> + struct i2c_msg *msgs, int num)
> +{
> + struct drm_dp_aux *aux = adapter->algo_data;
> + struct drm_dp_mst_port *port =
> + container_of(aux, struct drm_dp_mst_port, aux);
> + struct drm_dp_mst_branch *mstb;
> + struct drm_dp_mst_topology_mgr *mgr = port->mgr;
> + int ret;
> +
> + mstb = drm_dp_mst_topology_get_mstb_validated(mgr, port->parent);
> + if (!mstb)
> + return -EREMOTEIO;
> +
> + if (remote_i2c_read_ok(msgs, num)) {
> + ret = drm_dp_mst_i2c_read(mstb, port, msgs, num);
> + } else if (remote_i2c_write_ok(msgs, num)) {
> + ret = drm_dp_mst_i2c_write(mstb, port, msgs, num);
> + } else {
> + DRM_DEBUG_KMS("Unsupported I2C transaction for MST device\n");
> + ret = -EIO;
> + }
> +
> drm_dp_mst_topology_put_mstb(mstb);
> return ret;
> }
> --
> 2.28.0.rc0.142.g3c755180ce-goog
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
^ permalink raw reply [flat|nested] 7+ messages in thread