diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-12-10 02:48:42 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-12-10 02:48:42 +0000 |
commit | 3e5e60411cd9946ca01cbdfeaabcb8c862fa1560 (patch) | |
tree | 6cc8426319d094cc06d4465ddc285c1064ce823c | |
parent | 4b4d0905810e6c8901025207896739bd230148fe (diff) |
drm/amd/display: Check null pointer before try to access it
From Rodrigo Siqueira
ebef6616219ff04abdeb39450625f85419787ee3 in linux-6.6.y/6.6.64
1b686053c06ffb9f4524b288110cf2a831ff7a25 in mainline linux
-rw-r--r-- | sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c index cd1d1b7283a..941e670bfd3 100644 --- a/sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ b/sys/dev/pci/drm/amd/display/dc/dcn20/dcn20_hwseq.c @@ -1741,13 +1741,17 @@ static void dcn20_program_pipe( (pipe_ctx->plane_state && pipe_ctx->plane_state->update_flags.bits.hdr_mult)) hws->funcs.set_hdr_multiplier(pipe_ctx); - if (pipe_ctx->update_flags.bits.enable || - (pipe_ctx->plane_state && + if ((pipe_ctx->plane_state && pipe_ctx->plane_state->update_flags.bits.hdr_mult) || + pipe_ctx->update_flags.bits.enable) + hws->funcs.set_hdr_multiplier(pipe_ctx); + + if ((pipe_ctx->plane_state && pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change) || (pipe_ctx->plane_state && pipe_ctx->plane_state->update_flags.bits.gamma_change) || (pipe_ctx->plane_state && - pipe_ctx->plane_state->update_flags.bits.lut_3d)) + pipe_ctx->plane_state->update_flags.bits.lut_3d) || + pipe_ctx->update_flags.bits.enable) hws->funcs.set_input_transfer_func(dc, pipe_ctx, pipe_ctx->plane_state); /* dcn10_translate_regamma_to_hw_format takes 750us to finish |