dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Simplify the calculation of variables
@ 2023-05-12  7:04 Jiapeng Chong
  2023-05-12 14:04 ` Hamza Mahfooz
  0 siblings, 1 reply; 6+ messages in thread
From: Jiapeng Chong @ 2023-05-12  7:04 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Abaci Robot, Xinhui.Pan,
	Rodrigo.Siqueira, linux-kernel, amd-gfx, dri-devel,
	alexander.deucher, christian.koenig

./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:586:37-39: WARNING !A || A && B is equivalent to !A || B.
./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:595:37-39: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4941
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
index 4950eaa4406b..2de910e0ce75 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
@@ -583,8 +583,8 @@ void dcn32_update_force_pstate(struct dc *dc, struct dc_state *context)
 		struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
 		struct hubp *hubp = pipe->plane_res.hubp;
 
-		if (!pipe->stream || (pipe->stream && !(pipe->stream->mall_stream_config.type == SUBVP_MAIN ||
-						pipe->stream->fpo_in_use))) {
+		if (!pipe->stream || !(pipe->stream->mall_stream_config.type == SUBVP_MAIN ||
+		    pipe->stream->fpo_in_use)) {
 			if (hubp && hubp->funcs->hubp_update_force_pstate_disallow)
 				hubp->funcs->hubp_update_force_pstate_disallow(hubp, false);
 		}
@@ -592,7 +592,7 @@ void dcn32_update_force_pstate(struct dc *dc, struct dc_state *context)
 		/* Today only FPO uses cursor P-State force. Only clear cursor P-State force
 		 * if it's not FPO.
 		 */
-		if (!pipe->stream || (pipe->stream && !pipe->stream->fpo_in_use)) {
+		if (!pipe->stream || !pipe->stream->fpo_in_use) {
 			if (hubp && hubp->funcs->hubp_update_force_cursor_pstate_disallow)
 				hubp->funcs->hubp_update_force_cursor_pstate_disallow(hubp, false);
 		}
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amd/display: Simplify the calculation of variables
  2023-05-12  7:04 [PATCH] drm/amd/display: Simplify the calculation of variables Jiapeng Chong
@ 2023-05-12 14:04 ` Hamza Mahfooz
  0 siblings, 0 replies; 6+ messages in thread
From: Hamza Mahfooz @ 2023-05-12 14:04 UTC (permalink / raw)
  To: Jiapeng Chong, harry.wentland
  Cc: sunpeng.li, Abaci Robot, Xinhui.Pan, Rodrigo.Siqueira,
	linux-kernel, amd-gfx, dri-devel, alexander.deucher,
	christian.koenig

On 5/12/23 03:04, Jiapeng Chong wrote:
> ./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:586:37-39: WARNING !A || A && B is equivalent to !A || B.
> ./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:595:37-39: WARNING !A || A && B is equivalent to !A || B.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4941
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Applied, thanks!

> ---
>   drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> index 4950eaa4406b..2de910e0ce75 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> @@ -583,8 +583,8 @@ void dcn32_update_force_pstate(struct dc *dc, struct dc_state *context)
>   		struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
>   		struct hubp *hubp = pipe->plane_res.hubp;
>   
> -		if (!pipe->stream || (pipe->stream && !(pipe->stream->mall_stream_config.type == SUBVP_MAIN ||
> -						pipe->stream->fpo_in_use))) {
> +		if (!pipe->stream || !(pipe->stream->mall_stream_config.type == SUBVP_MAIN ||
> +		    pipe->stream->fpo_in_use)) {
>   			if (hubp && hubp->funcs->hubp_update_force_pstate_disallow)
>   				hubp->funcs->hubp_update_force_pstate_disallow(hubp, false);
>   		}
> @@ -592,7 +592,7 @@ void dcn32_update_force_pstate(struct dc *dc, struct dc_state *context)
>   		/* Today only FPO uses cursor P-State force. Only clear cursor P-State force
>   		 * if it's not FPO.
>   		 */
> -		if (!pipe->stream || (pipe->stream && !pipe->stream->fpo_in_use)) {
> +		if (!pipe->stream || !pipe->stream->fpo_in_use) {
>   			if (hubp && hubp->funcs->hubp_update_force_cursor_pstate_disallow)
>   				hubp->funcs->hubp_update_force_cursor_pstate_disallow(hubp, false);
>   		}
-- 
Hamza


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amd/display: Simplify the calculation of variables
  2024-02-02  8:47 Jiapeng Chong
@ 2024-02-02 16:23 ` Alex Deucher
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2024-02-02 16:23 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel, amd-gfx,
	dri-devel, linux-kernel, Abaci Robot

On Fri, Feb 2, 2024 at 10:13 AM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> ./drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c:236:49-51: WARNING !A || A && B is equivalent to !A || B.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8169
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
> index 1068b962d1c1..f15d1dbad6a9 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
> @@ -234,7 +234,7 @@ static bool get_plane_id(struct dml2_context *dml2, const struct dc_state *state
>                 if (state->streams[i]->stream_id == stream_id) {
>                         for (j = 0; j < state->stream_status[i].plane_count; j++) {
>                                 if (state->stream_status[i].plane_states[j] == plane &&
> -                                       (!is_plane_duplicate || (is_plane_duplicate && (j == plane_index)))) {
> +                                       (!is_plane_duplicate || (j == plane_index))) {
>                                         *plane_id = (i << 16) | j;
>                                         return true;
>                                 }
> --
> 2.20.1.7.g153144c
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] drm/amd/display: Simplify the calculation of variables
@ 2024-02-02  8:47 Jiapeng Chong
  2024-02-02 16:23 ` Alex Deucher
  0 siblings, 1 reply; 6+ messages in thread
From: Jiapeng Chong @ 2024-02-02  8:47 UTC (permalink / raw)
  To: harry.wentland
  Cc: sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel, amd-gfx,
	dri-devel, linux-kernel, Jiapeng Chong, Abaci Robot

./drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c:236:49-51: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8169
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
index 1068b962d1c1..f15d1dbad6a9 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
@@ -234,7 +234,7 @@ static bool get_plane_id(struct dml2_context *dml2, const struct dc_state *state
 		if (state->streams[i]->stream_id == stream_id) {
 			for (j = 0; j < state->stream_status[i].plane_count; j++) {
 				if (state->stream_status[i].plane_states[j] == plane &&
-					(!is_plane_duplicate || (is_plane_duplicate && (j == plane_index)))) {
+					(!is_plane_duplicate || (j == plane_index))) {
 					*plane_id = (i << 16) | j;
 					return true;
 				}
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/amd/display: Simplify the calculation of variables
@ 2024-01-18  2:23 Jiapeng Chong
  0 siblings, 0 replies; 6+ messages in thread
From: Jiapeng Chong @ 2024-01-18  2:23 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Abaci Robot, Xinhui.Pan,
	Rodrigo.Siqueira, linux-kernel, amd-gfx, dri-devel, daniel,
	alexander.deucher, airlied, christian.koenig

./drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c:703:47-49: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7931
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
index a0ce681b26c6..118aaf4389bc 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
@@ -700,9 +700,9 @@ static void free_unused_pipes_for_plane(struct dml2_context *ctx, struct dc_stat
 	for (i = 0; i < ctx->config.dcn_pipe_count; i++) {
 		if (state->res_ctx.pipe_ctx[i].plane_state == plane &&
 			state->res_ctx.pipe_ctx[i].stream->stream_id == stream_id &&
-			(!is_plane_duplicate || (is_plane_duplicate &&
+			(!is_plane_duplicate ||
 			ctx->v20.scratch.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_index[state->res_ctx.pipe_ctx[i].pipe_idx] == plane_index)) &&
-			!is_pipe_used(pool, state->res_ctx.pipe_ctx[i].pipe_idx)) {
+			!is_pipe_used(pool, state->res_ctx.pipe_ctx[i].pipe_idx) {
 			free_pipe(&state->res_ctx.pipe_ctx[i]);
 		}
 	}
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/amd/display: Simplify the calculation of variables
@ 2023-12-01  9:00 Jiapeng Chong
  0 siblings, 0 replies; 6+ messages in thread
From: Jiapeng Chong @ 2023-12-01  9:00 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Abaci Robot, Xinhui.Pan,
	Rodrigo.Siqueira, linux-kernel, amd-gfx, dri-devel,
	alexander.deucher, christian.koenig

./drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c:964:49-51: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7671
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
index fa8fe5bf7e57..519db4931b8d 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
@@ -961,7 +961,7 @@ static bool get_plane_id(struct dml2_context *dml2, const struct dc_state *conte
 		if (context->streams[i]->stream_id == stream_id) {
 			for (j = 0; j < context->stream_status[i].plane_count; j++) {
 				if (context->stream_status[i].plane_states[j] == plane &&
-					(!is_plane_duplicate || (is_plane_duplicate && (j == plane_index)))) {
+				    (!is_plane_duplicate || (j == plane_index))) {
 					*plane_id = (i << 16) | j;
 					return true;
 				}
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-02 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12  7:04 [PATCH] drm/amd/display: Simplify the calculation of variables Jiapeng Chong
2023-05-12 14:04 ` Hamza Mahfooz
2023-12-01  9:00 Jiapeng Chong
2024-01-18  2:23 Jiapeng Chong
2024-02-02  8:47 Jiapeng Chong
2024-02-02 16:23 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).