Skip to contentSkip to conversation

drm/amd/display: Create and Destroy PSR resources for DCN302

PATCH In review Bhawanpreet Lakha 2 participants 2 messages Dec 18, 2020 – Dec 22, 2020

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

PATCH 1/1 drm/amd/display: Create and Destroy PSR resources for DCN302

From: Joshua Aberback <[email protected]>

We need these to support PSR on DCN302

---
 .../gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +13 -0
index 808c4dcdb3ac..8d24cd5e484e 100644
@@ -53,6 +53,7 @@
 #include "dce/dce_i2c_hw.h"
 #include "dce/dce_panel_cntl.h"
 #include "dce/dmub_abm.h"
+#include "dce/dmub_psr.h"
 
 #include "hw_sequencer_private.h"
 #include "reg_helper.h"
@@ -238,6 +239,7 @@ static const struct dc_debug_options debug_defaults_diags = {
 		.dwb_fi_phase = -1, // -1 = disable
 		.dmub_command_table = true,
 		.enable_tri_buf = true,
+		.disable_psr = true,
 };
 
 enum dcn302_clk_src_array_id {
@@ -1213,6 +1215,9 @@ static void dcn302_resource_destruct(struct resource_pool *pool)
 			dce_abm_destroy(&pool->multiple_abms[i]);
 	}
 
+	if (pool->psr != NULL)
+		dmub_psr_destroy(&pool->psr);
+
 	if (pool->dccg != NULL)
 		dcn_dccg_destroy(&pool->dccg);
 }
@@ -1469,6 +1474,14 @@ static bool dcn302_resource_construct(
 	}
 	pool->timing_generator_count = i;
 
+	/* PSR */
+	pool->psr = dmub_psr_create(ctx);
+	if (pool->psr == NULL) {
+		dm_error("DC: failed to create psr!\n");
+		BREAK_TO_DEBUGGER();
+		goto create_fail;
+	}
+
 	/* ABMs */
 	for (i = 0; i < pool->res_cap->num_timing_generator; i++) {
 		pool->multiple_abms[i] = dmub_abm_create(ctx, &abm_regs[i], &abm_shift, &abm_mask);
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Bhawanpreet Lakha

From: Joshua Aberback <[email protected]>

We need these to support PSR on DCN302

Quoted 52 lines
---
 .../gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +13 -1
index 808c4dcdb3ac..8d24cd5e484e 100644
@@ -53,6 +53,7 @@
 #include "dce/dce_i2c_hw.h"
 #include "dce/dce_panel_cntl.h"
 #include "dce/dmub_abm.h"
+#include "dce/dmub_psr.h"
 
 #include "hw_sequencer_private.h"
 #include "reg_helper.h"
@@ -238,6 +239,7 @@ static const struct dc_debug_options debug_defaults_diags = {
                .dwb_fi_phase = -1, // -1 = disable
                .dmub_command_table = true,
                .enable_tri_buf = true,
+               .disable_psr = true,
 };
 
 enum dcn302_clk_src_array_id {
@@ -1213,6 +1215,9 @@ static void dcn302_resource_destruct(struct resource_pool *pool)
                        dce_abm_destroy(&pool->multiple_abms[i]);
        }
 
+       if (pool->psr != NULL)
+               dmub_psr_destroy(&pool->psr);
+
        if (pool->dccg != NULL)
                dcn_dccg_destroy(&pool->dccg);
 }
@@ -1469,6 +1474,14 @@ static bool dcn302_resource_construct(
        }
        pool->timing_generator_count = i;
 
+       /* PSR */
+       pool->psr = dmub_psr_create(ctx);
+       if (pool->psr == NULL) {
+               dm_error("DC: failed to create psr!\n");
+               BREAK_TO_DEBUGGER();
+               goto create_fail;
+       }
+
        /* ABMs */
        for (i = 0; i < pool->res_cap->num_timing_generator; i++) {
                pool->multiple_abms[i] = dmub_abm_create(ctx, &abm_regs[i], &abm_shift, &abm_mask);
--

2.25.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx