RE: [PATCH] drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of
> Wayne Lin
> Sent: 2019/December/01, Sunday 10:59 PM
> To: dri-devel@xxxxxxxxxxxxxxxxxxxxx; amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Zuo, Jerry <Jerry.Zuo@xxxxxxx>; Wentland, Harry
> <Harry.Wentland@xxxxxxx>; Kazlauskas, Nicholas
> <Nicholas.Kazlauskas@xxxxxxx>; Lin, Wayne <Wayne.Lin@xxxxxxx>
> 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@xxxxxxx>


Reviewed-by: Zhan Liu <zhan.liu@xxxxxxx>


> ---
>  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@xxxxxxxxxxxxxxxxxxxxx
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&amp;data=02%7C01%7Czhan.liu%40amd.com%7Cacbf6c9272c44e5642
> ca08d776dbf688%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6
> 37108559483579263&amp;sdata=JNUpYWZRxNe%2B0%2FCe04fjWRvWh%2
> FPp3CASy4FRrg0iHuI%3D&amp;reserved=0
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux