* [PATCH v2] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-03 4:24 ` Wayne Lin
0 siblings, 0 replies; 5+ messages in thread
From: Wayne Lin @ 2019-12-03 4:24 UTC (permalink / raw)
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: jerry.zuo-5C7GfCeVMHo, harry.wentland-5C7GfCeVMHo,
Nicholas.Kazlauskas-5C7GfCeVMHo, Wayne Lin
[Why]
If the payload_state is DP_PAYLOAD_DELETE_LOCAL in series, current
code doesn't delete the payload at current index and just move the
index to next one after shuffling payloads.
[How]
Drop the i++ increasing part in for loop head and decide whether
to increase the index or not according to payload_state of current
payload.
Changes since v1:
* Refine the code to have it easy reading
* Amend the commit message to meet the way code is modified now.
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 81e92b260d7a..4ef6decc0551 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3176,9 +3176,11 @@ int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr)
drm_dp_mst_topology_put_port(port);
}
- for (i = 0; i < mgr->max_payloads; i++) {
- if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
+ for (i = 0; i < mgr->max_payloads; /* do nothing */) {
+ if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) {
+ i++;
continue;
+ }
DRM_DEBUG_KMS("removing payload %d\n", i);
for (j = i; j < mgr->max_payloads - 1; j++) {
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-03 4:24 ` Wayne Lin
0 siblings, 0 replies; 5+ messages in thread
From: Wayne Lin @ 2019-12-03 4:24 UTC (permalink / raw)
To: dri-devel, amd-gfx; +Cc: jerry.zuo, Nicholas.Kazlauskas, Wayne Lin
[Why]
If the payload_state is DP_PAYLOAD_DELETE_LOCAL in series, current
code doesn't delete the payload at current index and just move the
index to next one after shuffling payloads.
[How]
Drop the i++ increasing part in for loop head and decide whether
to increase the index or not according to payload_state of current
payload.
Changes since v1:
* Refine the code to have it easy reading
* Amend the commit message to meet the way code is modified now.
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 81e92b260d7a..4ef6decc0551 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3176,9 +3176,11 @@ int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr)
drm_dp_mst_topology_put_port(port);
}
- for (i = 0; i < mgr->max_payloads; i++) {
- if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
+ for (i = 0; i < mgr->max_payloads; /* do nothing */) {
+ if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) {
+ i++;
continue;
+ }
DRM_DEBUG_KMS("removing payload %d\n", i);
for (j = i; j < mgr->max_payloads - 1; j++) {
--
2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-03 4:24 ` Wayne Lin
0 siblings, 0 replies; 5+ messages in thread
From: Wayne Lin @ 2019-12-03 4:24 UTC (permalink / raw)
To: dri-devel, amd-gfx
Cc: jerry.zuo, harry.wentland, Nicholas.Kazlauskas, Wayne Lin
[Why]
If the payload_state is DP_PAYLOAD_DELETE_LOCAL in series, current
code doesn't delete the payload at current index and just move the
index to next one after shuffling payloads.
[How]
Drop the i++ increasing part in for loop head and decide whether
to increase the index or not according to payload_state of current
payload.
Changes since v1:
* Refine the code to have it easy reading
* Amend the commit message to meet the way code is modified now.
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 81e92b260d7a..4ef6decc0551 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3176,9 +3176,11 @@ int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr)
drm_dp_mst_topology_put_port(port);
}
- for (i = 0; i < mgr->max_payloads; i++) {
- if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
+ for (i = 0; i < mgr->max_payloads; /* do nothing */) {
+ if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) {
+ i++;
continue;
+ }
DRM_DEBUG_KMS("removing payload %d\n", i);
for (j = i; j < mgr->max_payloads - 1; j++) {
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
2019-12-03 4:24 ` Wayne Lin
@ 2019-12-04 20:35 ` Lyude Paul
-1 siblings, 0 replies; 5+ messages in thread
From: Lyude Paul @ 2019-12-04 20:35 UTC (permalink / raw)
To: Wayne Lin, dri-devel, amd-gfx; +Cc: jerry.zuo, Nicholas.Kazlauskas
Just pushed to drm-misc-next-fixes as
e5a6ca27eb72c67533ddfc11c06df84beaa167fa, thanks!
On Tue, 2019-12-03 at 12:24 +0800, Wayne Lin wrote:
> [Why]
> If the payload_state is DP_PAYLOAD_DELETE_LOCAL in series, current
> code doesn't delete the payload at current index and just move the
> index to next one after shuffling payloads.
>
> [How]
> Drop the i++ increasing part in for loop head and decide whether
> to increase the index or not according to payload_state of current
> payload.
>
> Changes since v1:
> * Refine the code to have it easy reading
> * Amend the commit message to meet the way code is modified now.
>
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 81e92b260d7a..4ef6decc0551 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3176,9 +3176,11 @@ int drm_dp_update_payload_part1(struct
> drm_dp_mst_topology_mgr *mgr)
> drm_dp_mst_topology_put_port(port);
> }
>
> - for (i = 0; i < mgr->max_payloads; i++) {
> - if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> + for (i = 0; i < mgr->max_payloads; /* do nothing */) {
> + if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> {
> + i++;
> continue;
> + }
>
> DRM_DEBUG_KMS("removing payload %d\n", i);
> for (j = i; j < mgr->max_payloads - 1; j++) {
--
Cheers,
Lyude Paul
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-04 20:35 ` Lyude Paul
0 siblings, 0 replies; 5+ messages in thread
From: Lyude Paul @ 2019-12-04 20:35 UTC (permalink / raw)
To: Wayne Lin, dri-devel, amd-gfx
Cc: jerry.zuo, harry.wentland, Nicholas.Kazlauskas
Just pushed to drm-misc-next-fixes as
e5a6ca27eb72c67533ddfc11c06df84beaa167fa, thanks!
On Tue, 2019-12-03 at 12:24 +0800, Wayne Lin wrote:
> [Why]
> If the payload_state is DP_PAYLOAD_DELETE_LOCAL in series, current
> code doesn't delete the payload at current index and just move the
> index to next one after shuffling payloads.
>
> [How]
> Drop the i++ increasing part in for loop head and decide whether
> to increase the index or not according to payload_state of current
> payload.
>
> Changes since v1:
> * Refine the code to have it easy reading
> * Amend the commit message to meet the way code is modified now.
>
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 81e92b260d7a..4ef6decc0551 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3176,9 +3176,11 @@ int drm_dp_update_payload_part1(struct
> drm_dp_mst_topology_mgr *mgr)
> drm_dp_mst_topology_put_port(port);
> }
>
> - for (i = 0; i < mgr->max_payloads; i++) {
> - if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> + for (i = 0; i < mgr->max_payloads; /* do nothing */) {
> + if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> {
> + i++;
> continue;
> + }
>
> DRM_DEBUG_KMS("removing payload %d\n", i);
> for (j = i; j < mgr->max_payloads - 1; j++) {
--
Cheers,
Lyude Paul
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-12-04 20:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 4:24 [PATCH v2] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1() Wayne Lin
2019-12-03 4:24 ` Wayne Lin
2019-12-03 4:24 ` Wayne Lin
2019-12-04 20:35 ` Lyude Paul
2019-12-04 20:35 ` Lyude Paul
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.