Skip to contentSkip to conversation

drm/amd/display: remove output_tf_change flag

PATCH In review Melissa Wen 2 participants 2 messages Sep 1, 2025 – Sep 22, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: remove output_tf_change flag

Remove this flag as the driver stopped managing it individually since commit a4056c2a6344 ("drm/amd/display: use HW hdr mult for brightness boost"). After some back and forth it was reintroduced as a condition to set_output_transfer_func() in [1]. Without direct management, this flag only changes value when all surface update flags are set true on UPDATE_TYPE_FULL with no output TF status meaning.

Fixes bb622e0c0044 ("drm/amd/display: program output tf when required") [1]
---
 drivers/gpu/drm/amd/display/dc/dc.h                       | 1 -
 drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c   | 6 ++----
 drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 6 ++----
 3 files changed, 4 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
index b41e66c31e6a..95d803b40dd0 100644
@@ -1390,7 +1390,6 @@ union surface_update_flags {
 		uint32_t in_transfer_func_change:1;
 		uint32_t input_csc_change:1;
 		uint32_t coeff_reduction_change:1;
-		uint32_t output_tf_change:1;
 		uint32_t pixel_format_change:1;
 		uint32_t plane_size_change:1;
 		uint32_t gamut_remap_change:1;
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +2 -4
index 7d24fa1517bf..bd3d614aa71c 100644
@@ -1982,10 +1982,8 @@ static void dcn20_program_pipe(
 	 * updating on slave planes
 	 */
 	if (pipe_ctx->update_flags.bits.enable ||
-		pipe_ctx->update_flags.bits.plane_changed ||
-		pipe_ctx->stream->update_flags.bits.out_tf ||
-		(pipe_ctx->plane_state &&
-			pipe_ctx->plane_state->update_flags.bits.output_tf_change))
+	    pipe_ctx->update_flags.bits.plane_changed ||
+	    pipe_ctx->stream->update_flags.bits.out_tf)
 		hws->funcs.set_output_transfer_func(dc, pipe_ctx, pipe_ctx->stream);
 
 	/* If the pipe has been enabled or has a different opp, we
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +2 -4
index d5b5e2ce6ff6..65e45c624530 100644
@@ -2029,10 +2029,8 @@ void dcn401_program_pipe(
 	 * updating on slave planes
 	 */
 	if (pipe_ctx->update_flags.bits.enable ||
-		pipe_ctx->update_flags.bits.plane_changed ||
-		pipe_ctx->stream->update_flags.bits.out_tf ||
-		(pipe_ctx->plane_state &&
-			pipe_ctx->plane_state->update_flags.bits.output_tf_change))
+	    pipe_ctx->update_flags.bits.plane_changed ||
+	    pipe_ctx->stream->update_flags.bits.out_tf)
 		hws->funcs.set_output_transfer_func(dc, pipe_ctx, pipe_ctx->stream);
 
 	/* If the pipe has been enabled or has a different opp, we
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 61 lines · Melissa Wen

Remove this flag as the driver stopped managing it individually since commit a4056c2a6344 ("drm/amd/display: use HW hdr mult for brightness boost"). After some back and forth it was reintroduced as a condition to set_output_transfer_func() in [1]. Without direct management, this flag only changes value when all surface update flags are set true on UPDATE_TYPE_FULL with no output TF status meaning.

Fixes bb622e0c0044 ("drm/amd/display: program output tf when required") [1]
---
  drivers/gpu/drm/amd/display/dc/dc.h                       | 1 -
  drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c   | 6 ++----
  drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 6 ++----
  3 files changed, 4 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
index b41e66c31e6a..95d803b40dd0 100644
@@ -1390,7 +1390,6 @@ union surface_update_flags {
  		uint32_t in_transfer_func_change:1;
  		uint32_t input_csc_change:1;
  		uint32_t coeff_reduction_change:1;
-		uint32_t output_tf_change:1;
  		uint32_t pixel_format_change:1;
  		uint32_t plane_size_change:1;
  		uint32_t gamut_remap_change:1;
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +2 -4
index 7d24fa1517bf..bd3d614aa71c 100644
@@ -1982,10 +1982,8 @@ static void dcn20_program_pipe(
  	 * updating on slave planes
  	 */
  	if (pipe_ctx->update_flags.bits.enable ||
-		pipe_ctx->update_flags.bits.plane_changed ||
-		pipe_ctx->stream->update_flags.bits.out_tf ||
-		(pipe_ctx->plane_state &&
-			pipe_ctx->plane_state->update_flags.bits.output_tf_change))
+	    pipe_ctx->update_flags.bits.plane_changed ||
+	    pipe_ctx->stream->update_flags.bits.out_tf)
  		hws->funcs.set_output_transfer_func(dc, pipe_ctx, pipe_ctx->stream);
 
  	/* If the pipe has been enabled or has a different opp, we
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +2 -4
index d5b5e2ce6ff6..65e45c624530 100644
@@ -2029,10 +2029,8 @@ void dcn401_program_pipe(
  	 * updating on slave planes
  	 */
  	if (pipe_ctx->update_flags.bits.enable ||
-		pipe_ctx->update_flags.bits.plane_changed ||
-		pipe_ctx->stream->update_flags.bits.out_tf ||
-		(pipe_ctx->plane_state &&
-			pipe_ctx->plane_state->update_flags.bits.output_tf_change))
+	    pipe_ctx->update_flags.bits.plane_changed ||
+	    pipe_ctx->stream->update_flags.bits.out_tf)
  		hws->funcs.set_output_transfer_func(dc, pipe_ctx, pipe_ctx->stream);
 
  	/* If the pipe has been enabled or has a different opp, we