* [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-02 3:58 ` Wayne Lin
0 siblings, 0 replies; 11+ messages in thread
From: Wayne Lin @ 2019-12-02 3:58 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]
After shuffling payloads, decide whether to move on index or not
according to payload_state of current payload.
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 81e92b260d7a..8da5d461ea01 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3176,7 +3176,8 @@ 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++) {
+ for (i = 0; i < mgr->max_payloads;
+ (mgr->payloads[i].payload_state == DP_PAYLOAD_DELETE_LOCAL) ? i : i++) {
if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
continue;
--
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] 11+ messages in thread* [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-02 3:58 ` Wayne Lin
0 siblings, 0 replies; 11+ messages in thread
From: Wayne Lin @ 2019-12-02 3:58 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]
After shuffling payloads, decide whether to move on index or not
according to payload_state of current payload.
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 81e92b260d7a..8da5d461ea01 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3176,7 +3176,8 @@ 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++) {
+ for (i = 0; i < mgr->max_payloads;
+ (mgr->payloads[i].payload_state == DP_PAYLOAD_DELETE_LOCAL) ? i : i++) {
if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
continue;
--
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] 11+ messages in thread* RE: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
2019-12-02 3:58 ` Wayne Lin
(?)
@ 2019-12-02 16:03 ` Liu, Zhan
-1 siblings, 0 replies; 11+ messages in thread
From: Liu, Zhan @ 2019-12-02 16:03 UTC (permalink / raw)
To: Lin, Wayne, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org
Cc: Zuo, Jerry, Wentland, Harry, Kazlauskas, Nicholas, Lin, Wayne
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Wayne Lin
> Sent: 2019/December/01, Sunday 10:59 PM
> To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
> Cc: Zuo, Jerry <Jerry.Zuo@amd.com>; Wentland, Harry
> <Harry.Wentland@amd.com>; Kazlauskas, Nicholas
> <Nicholas.Kazlauskas@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>
> Subject: [PATCH] drm/dp_mst: Correct the bug in
> drm_dp_update_payload_part1()
>
> [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]
> After shuffling payloads, decide whether to move on index or not according
> to payload_state of current payload.
>
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Zhan Liu <zhan.liu@amd.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 81e92b260d7a..8da5d461ea01 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3176,7 +3176,8 @@ 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++) {
> + for (i = 0; i < mgr->max_payloads;
> + (mgr->payloads[i].payload_state ==
> DP_PAYLOAD_DELETE_LOCAL) ? i :
> +i++) {
> if (mgr->payloads[i].payload_state !=
> DP_PAYLOAD_DELETE_LOCAL)
> continue;
>
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&data=02%7C01%7Czhan.liu%40amd.com%7Cacbf6c9272c44e5642
> ca08d776dbf688%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6
> 37108559483579263&sdata=JNUpYWZRxNe%2B0%2FCe04fjWRvWh%2
> FPp3CASy4FRrg0iHuI%3D&reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread* RE: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-02 16:03 ` Liu, Zhan
0 siblings, 0 replies; 11+ messages in thread
From: Liu, Zhan @ 2019-12-02 16:03 UTC (permalink / raw)
To: Lin, Wayne, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org
Cc: Zuo, Jerry, Kazlauskas, Nicholas, Lin, Wayne
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Wayne Lin
> Sent: 2019/December/01, Sunday 10:59 PM
> To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
> Cc: Zuo, Jerry <Jerry.Zuo@amd.com>; Wentland, Harry
> <Harry.Wentland@amd.com>; Kazlauskas, Nicholas
> <Nicholas.Kazlauskas@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>
> Subject: [PATCH] drm/dp_mst: Correct the bug in
> drm_dp_update_payload_part1()
>
> [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]
> After shuffling payloads, decide whether to move on index or not according
> to payload_state of current payload.
>
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Zhan Liu <zhan.liu@amd.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 81e92b260d7a..8da5d461ea01 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3176,7 +3176,8 @@ 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++) {
> + for (i = 0; i < mgr->max_payloads;
> + (mgr->payloads[i].payload_state ==
> DP_PAYLOAD_DELETE_LOCAL) ? i :
> +i++) {
> if (mgr->payloads[i].payload_state !=
> DP_PAYLOAD_DELETE_LOCAL)
> continue;
>
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&data=02%7C01%7Czhan.liu%40amd.com%7Cacbf6c9272c44e5642
> ca08d776dbf688%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6
> 37108559483579263&sdata=JNUpYWZRxNe%2B0%2FCe04fjWRvWh%2
> FPp3CASy4FRrg0iHuI%3D&reserved=0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* RE: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-02 16:03 ` Liu, Zhan
0 siblings, 0 replies; 11+ messages in thread
From: Liu, Zhan @ 2019-12-02 16:03 UTC (permalink / raw)
To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: Zuo, Jerry, Kazlauskas, Nicholas, Lin, Wayne
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Wayne Lin
> Sent: 2019/December/01, Sunday 10:59 PM
> To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
> Cc: Zuo, Jerry <Jerry.Zuo@amd.com>; Wentland, Harry
> <Harry.Wentland@amd.com>; Kazlauskas, Nicholas
> <Nicholas.Kazlauskas@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>
> Subject: [PATCH] drm/dp_mst: Correct the bug in
> drm_dp_update_payload_part1()
>
> [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]
> After shuffling payloads, decide whether to move on index or not according
> to payload_state of current payload.
>
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Zhan Liu <zhan.liu@amd.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 81e92b260d7a..8da5d461ea01 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3176,7 +3176,8 @@ 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++) {
> + for (i = 0; i < mgr->max_payloads;
> + (mgr->payloads[i].payload_state ==
> DP_PAYLOAD_DELETE_LOCAL) ? i :
> +i++) {
> if (mgr->payloads[i].payload_state !=
> DP_PAYLOAD_DELETE_LOCAL)
> continue;
>
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&data=02%7C01%7Czhan.liu%40amd.com%7Cacbf6c9272c44e5642
> ca08d776dbf688%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6
> 37108559483579263&sdata=JNUpYWZRxNe%2B0%2FCe04fjWRvWh%2
> FPp3CASy4FRrg0iHuI%3D&reserved=0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-03 0:23 ` Lyude Paul
0 siblings, 0 replies; 11+ messages in thread
From: Lyude Paul @ 2019-12-03 0:23 UTC (permalink / raw)
To: Wayne Lin, dri-devel, amd-gfx
Cc: Jerry.Zuo, harry.wentland, Nicholas.Kazlauskas
On Mon, 2019-12-02 at 11:58 +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]
> After shuffling payloads, decide whether to move on index or not
> according to payload_state of current payload.
>
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 81e92b260d7a..8da5d461ea01 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3176,7 +3176,8 @@ 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++) {
> + for (i = 0; i < mgr->max_payloads;
> + (mgr->payloads[i].payload_state == DP_PAYLOAD_DELETE_LOCAL) ?
> i : i++) {
Took me a moment to figure out what this line was actually doing. Nice catch
by the way!
Anyway: let's just drop this line to avoid making things confusing to read,
drop i++ from the for loop instead, and just rewrite it so it looks like this:
for (i = 0; i < mgr->max_payloads; /* do nothing */) {
if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) {
i++;
continue;
}
With those changes, this patch is:
Reviewed-by: Lyude Paul <lyude@redhat.com>
I can go ahead and push these patches to drm-misc for you once you've sent me
the v2
> if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> continue;
>
--
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] 11+ messages in thread* Re: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-03 0:23 ` Lyude Paul
0 siblings, 0 replies; 11+ messages in thread
From: Lyude Paul @ 2019-12-03 0:23 UTC (permalink / raw)
To: Wayne Lin, dri-devel, amd-gfx; +Cc: Jerry.Zuo, Nicholas.Kazlauskas
On Mon, 2019-12-02 at 11:58 +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]
> After shuffling payloads, decide whether to move on index or not
> according to payload_state of current payload.
>
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 81e92b260d7a..8da5d461ea01 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3176,7 +3176,8 @@ 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++) {
> + for (i = 0; i < mgr->max_payloads;
> + (mgr->payloads[i].payload_state == DP_PAYLOAD_DELETE_LOCAL) ?
> i : i++) {
Took me a moment to figure out what this line was actually doing. Nice catch
by the way!
Anyway: let's just drop this line to avoid making things confusing to read,
drop i++ from the for loop instead, and just rewrite it so it looks like this:
for (i = 0; i < mgr->max_payloads; /* do nothing */) {
if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) {
i++;
continue;
}
With those changes, this patch is:
Reviewed-by: Lyude Paul <lyude@redhat.com>
I can go ahead and push these patches to drm-misc for you once you've sent me
the v2
> if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> continue;
>
--
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] 11+ messages in thread* Re: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-03 0:23 ` Lyude Paul
0 siblings, 0 replies; 11+ messages in thread
From: Lyude Paul @ 2019-12-03 0:23 UTC (permalink / raw)
To: Wayne Lin, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Jerry.Zuo-5C7GfCeVMHo, harry.wentland-5C7GfCeVMHo,
Nicholas.Kazlauskas-5C7GfCeVMHo
On Mon, 2019-12-02 at 11:58 +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]
> After shuffling payloads, decide whether to move on index or not
> according to payload_state of current payload.
>
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 81e92b260d7a..8da5d461ea01 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3176,7 +3176,8 @@ 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++) {
> + for (i = 0; i < mgr->max_payloads;
> + (mgr->payloads[i].payload_state == DP_PAYLOAD_DELETE_LOCAL) ?
> i : i++) {
Took me a moment to figure out what this line was actually doing. Nice catch
by the way!
Anyway: let's just drop this line to avoid making things confusing to read,
drop i++ from the for loop instead, and just rewrite it so it looks like this:
for (i = 0; i < mgr->max_payloads; /* do nothing */) {
if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) {
i++;
continue;
}
With those changes, this patch is:
Reviewed-by: Lyude Paul <lyude@redhat.com>
I can go ahead and push these patches to drm-misc for you once you've sent me
the v2
> if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> continue;
>
--
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] 11+ messages in thread* RE: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
2019-12-03 0:23 ` Lyude Paul
@ 2019-12-03 4:18 ` Lin, Wayne
-1 siblings, 0 replies; 11+ messages in thread
From: Lin, Wayne @ 2019-12-03 4:18 UTC (permalink / raw)
To: Lyude Paul, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org
Cc: Zuo, Jerry, Wentland, Harry, Kazlauskas, Nicholas
> -----Original Message-----
> From: Lyude Paul <lyude@redhat.com>
> Sent: Tuesday, December 3, 2019 8:23 AM
> To: Lin, Wayne <Wayne.Lin@amd.com>; dri-devel@lists.freedesktop.org;
> amd-gfx@lists.freedesktop.org
> Cc: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Wentland, Harry
> <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>
> Subject: Re: [PATCH] drm/dp_mst: Correct the bug in
> drm_dp_update_payload_part1()
>
> On Mon, 2019-12-02 at 11:58 +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]
> > After shuffling payloads, decide whether to move on index or not
> > according to payload_state of current payload.
> >
> > Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> > ---
> > drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 81e92b260d7a..8da5d461ea01 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -3176,7 +3176,8 @@ 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++) {
> > + for (i = 0; i < mgr->max_payloads;
> > + (mgr->payloads[i].payload_state == DP_PAYLOAD_DELETE_LOCAL) ?
> > i : i++) {
>
> Took me a moment to figure out what this line was actually doing. Nice catch
> by the way!
>
> Anyway: let's just drop this line to avoid making things confusing to read, drop
> i++ from the for loop instead, and just rewrite it so it looks like this:
>
> for (i = 0; i < mgr->max_payloads; /* do nothing */) {
> if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) {
> i++;
> continue;
> }
>
> With those changes, this patch is:
>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
>
Thanks for your time and sorry for not well organized code.
I will send you the v2 right away. Thanks!
> I can go ahead and push these patches to drm-misc for you once you've sent
> me the v2
> > if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> > continue;
> >
> --
> Cheers,
> Lyude Paul
--
BR,
Wayne Lin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread* RE: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
@ 2019-12-03 4:18 ` Lin, Wayne
0 siblings, 0 replies; 11+ messages in thread
From: Lin, Wayne @ 2019-12-03 4:18 UTC (permalink / raw)
To: Lyude Paul, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org
Cc: Zuo, Jerry, Kazlauskas, Nicholas
> -----Original Message-----
> From: Lyude Paul <lyude@redhat.com>
> Sent: Tuesday, December 3, 2019 8:23 AM
> To: Lin, Wayne <Wayne.Lin@amd.com>; dri-devel@lists.freedesktop.org;
> amd-gfx@lists.freedesktop.org
> Cc: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Wentland, Harry
> <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>
> Subject: Re: [PATCH] drm/dp_mst: Correct the bug in
> drm_dp_update_payload_part1()
>
> On Mon, 2019-12-02 at 11:58 +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]
> > After shuffling payloads, decide whether to move on index or not
> > according to payload_state of current payload.
> >
> > Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> > ---
> > drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 81e92b260d7a..8da5d461ea01 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -3176,7 +3176,8 @@ 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++) {
> > + for (i = 0; i < mgr->max_payloads;
> > + (mgr->payloads[i].payload_state == DP_PAYLOAD_DELETE_LOCAL) ?
> > i : i++) {
>
> Took me a moment to figure out what this line was actually doing. Nice catch
> by the way!
>
> Anyway: let's just drop this line to avoid making things confusing to read, drop
> i++ from the for loop instead, and just rewrite it so it looks like this:
>
> for (i = 0; i < mgr->max_payloads; /* do nothing */) {
> if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) {
> i++;
> continue;
> }
>
> With those changes, this patch is:
>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
>
Thanks for your time and sorry for not well organized code.
I will send you the v2 right away. Thanks!
> I can go ahead and push these patches to drm-misc for you once you've sent
> me the v2
> > if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL)
> > continue;
> >
> --
> Cheers,
> Lyude Paul
--
BR,
Wayne Lin
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread