Skip to contentSkip to conversation

drm/amd/display: Add otg_master NULL check within init_pipe_slice_table_from_context

PATCH In review Ma Ke 2 participants 2 messages Jul 9, 2024

Subsystems (5)
lore
Share & tools
lore

Ma Ke

author
#0 lore raw

PATCH v2 1/1 drm/amd/display: Add otg_master NULL check within init_pipe_slice_table_from_context

To avoid reports of NULL_RETURN warning, we should add otg_master NULL check.

Fixes c51d87202d1f ("drm/amd/display: do not attempt ODM power optimization if minimal transition doesn't exist")

---
Changes in v2:
- added the recipient's email address, due to the prolonged absence of a response from the recipient.
- added Cc stable.

---
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +3 -0
index f6fe0a64beac..8972598ca77f 100644
@@ -1177,6 +1177,9 @@ static void init_pipe_slice_table_from_context(
 		stream = context->streams[i];
 		otg_master = resource_get_otg_master_for_stream(
 				&context->res_ctx, stream);
+		if (!otg_master)
+			continue;
+
 		count = resource_get_odm_slice_count(otg_master);
 		update_slice_table_for_stream(table, stream, count);
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 20 lines · Ma Ke

To avoid reports of NULL_RETURN warning, we should add otg_master NULL check.

Fixes c51d87202d1f ("drm/amd/display: do not attempt ODM power optimization if minimal transition doesn't exist")

---
Changes in v2:
- added the recipient's email address, due to the prolonged absence of a response from the recipient.
- added Cc stable.

---
  drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +0 -0
index f6fe0a64beac..8972598ca77f 100644

drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c static void init_pipe_slice_table_from_context( · line 1185

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +3 -0
@@ -1177,6 +1177,9 @@ static void init_pipe_slice_table_from_context(
  		stream = context->streams[i];
  		otg_master = resource_get_otg_master_for_stream(
  				&context->res_ctx, stream);
+		if (!otg_master)
+			continue;
+
  		count = resource_get_odm_slice_count(otg_master);
  		update_slice_table_for_stream(table, stream, count);
 

Hi,

Which repository and branch are you using? It looks like this issue is already fixed on amd-staging-drm-next.

Thanks
Siqueira