diff options
author | Aurabindo Pillai <[email protected]> | 2024-05-14 00:17:00 +0000 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2024-05-29 14:40:39 -0400 |
commit | 00ee2e58c144f425345be65ce71f3b37119a673b (patch) | |
tree | 1b3d37ffb45f436f8a1535b250e1cb236fa1c288 | |
parent | 7da55c27e76749b98401fe307d3e243fe6ceb53d (diff) |
drm/amd/display: Fix null pointer dereference for dcn401
When ODM slice happens on DCN401, there is a null pointer exception
caused by that. This commit address this issue by checking if the
required data structures are initialized.
Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index ce1991e06049..beca40f8694f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2083,8 +2083,10 @@ int resource_get_odm_slice_dst_width(struct pipe_ctx *otg_master, timing->h_border_left + timing->h_border_right; int width = h_active / count; - bool two_pixel_alignment_required = - otg_master->stream_res.tg->funcs->is_two_pixels_per_container(timing); + bool two_pixel_alignment_required = false; + + if (otg_master && otg_master->stream_res.tg && otg_master->stream) + two_pixel_alignment_required = otg_master->stream_res.tg->funcs->is_two_pixels_per_container(timing); if ((width % 2) && two_pixel_alignment_required) width++; @@ -2124,7 +2126,7 @@ struct rect resource_get_odm_slice_src_rect(struct pipe_ctx *pipe_ctx) odm_slice_dst = resource_get_odm_slice_dst_rect(opp_head); odm_slice_src = odm_slice_dst; - if (opp->funcs->opp_get_left_edge_extra_pixel_count) + if (opp && opp->funcs->opp_get_left_edge_extra_pixel_count) left_edge_extra_pixel_count = opp->funcs->opp_get_left_edge_extra_pixel_count( opp, pipe_ctx->stream->timing.pixel_encoding, |