[PATCH] drm/amd/display: Remove duplicated function signature from dcn3.01 DCCG

2024-02-22 Thread David Tadokoro
In the header file dc/dcn301/dcn301_dccg.h, the function dccg301_create
is declared twice, so remove duplication.

Signed-off-by: David Tadokoro 
---
 drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dccg.h | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dccg.h 
b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dccg.h
index 73db962dbc03..067e49cb238e 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dccg.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dccg.h
@@ -56,10 +56,4 @@ struct dccg *dccg301_create(
const struct dccg_shift *dccg_shift,
const struct dccg_mask *dccg_mask);
 
-struct dccg *dccg301_create(
-   struct dc_context *ctx,
-   const struct dccg_registers *regs,
-   const struct dccg_shift *dccg_shift,
-   const struct dccg_mask *dccg_mask);
-
 #endif //__DCN301_DCCG_H__
-- 
2.39.2



[PATCH 3/3] drm/amd/display: add prefix to rv1_clk_mgr_vbios_smu.c functions

2024-02-21 Thread David Tadokoro
The functions defined in dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c don't
have names that indicate where they were declared.

To better filter results in debug tools like ftrace, prefix these
functions with 'rv1_clk_mgr_vbios_smu_'.

Signed-off-by: David Tadokoro 
---
 .../drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c |  2 +-
 .../dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c   | 14 +++---
 .../dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.h   |  4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c
index 093084a48daa..3109c6651f1c 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c
@@ -312,7 +312,7 @@ static struct clk_mgr_funcs rv1_clk_funcs = {
 };
 
 static struct clk_mgr_internal_funcs rv1_clk_internal_funcs = {
-   .set_dispclk = rv1_vbios_smu_set_dispclk,
+   .set_dispclk = rv1_clk_mgr_vbios_smu_set_dispclk,
.set_dprefclk = dce112_set_dprefclk
 };
 
diff --git 
a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c
index 89b79dd39628..7823186250d3 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c
@@ -83,7 +83,7 @@ static const struct IP_BASE MP1_BASE  = { { { { 0x00016000, 
0, 0, 0, 0 } },
  * the register is NOT EQUAL to zero, and because the translation in msg_if.h
  * won't work with REG_WAIT.
  */
-static uint32_t rv1_smu_wait_for_response(struct clk_mgr_internal *clk_mgr, 
unsigned int delay_us, unsigned int max_retries)
+static uint32_t rv1_clk_mgr_vbios_smu_wait_for_response(struct 
clk_mgr_internal *clk_mgr, unsigned int delay_us, unsigned int max_retries)
 {
uint32_t res_val = VBIOSSMC_Status_BUSY;
 
@@ -101,7 +101,7 @@ static uint32_t rv1_smu_wait_for_response(struct 
clk_mgr_internal *clk_mgr, unsi
return res_val;
 }
 
-static int rv1_vbios_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr,
+static int rv1_clk_mgr_vbios_smu_send_msg_with_param(struct clk_mgr_internal 
*clk_mgr,
unsigned int msg_id, unsigned int param)
 {
uint32_t result;
@@ -115,7 +115,7 @@ static int rv1_vbios_smu_send_msg_with_param(struct 
clk_mgr_internal *clk_mgr,
/* Trigger the message transaction by writing the message ID */
REG_WRITE(MP1_SMN_C2PMSG_67, msg_id);
 
-   result = rv1_smu_wait_for_response(clk_mgr, 10, 1000);
+   result = rv1_clk_mgr_vbios_smu_wait_for_response(clk_mgr, 10, 1000);
 
ASSERT(result == VBIOSSMC_Result_OK);
 
@@ -123,14 +123,14 @@ static int rv1_vbios_smu_send_msg_with_param(struct 
clk_mgr_internal *clk_mgr,
return REG_READ(MP1_SMN_C2PMSG_83);
 }
 
-int rv1_vbios_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int 
requested_dispclk_khz)
+int rv1_clk_mgr_vbios_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int 
requested_dispclk_khz)
 {
int actual_dispclk_set_mhz = -1;
struct dc *dc = clk_mgr->base.ctx->dc;
struct dmcu *dmcu = dc->res_pool->dmcu;
 
/*  Unit of SMU msg parameter is Mhz */
-   actual_dispclk_set_mhz = rv1_vbios_smu_send_msg_with_param(
+   actual_dispclk_set_mhz = rv1_clk_mgr_vbios_smu_send_msg_with_param(
clk_mgr,
VBIOSSMC_MSG_SetDispclkFreq,
khz_to_mhz_ceil(requested_dispclk_khz));
@@ -144,11 +144,11 @@ int rv1_vbios_smu_set_dispclk(struct clk_mgr_internal 
*clk_mgr, int requested_di
return actual_dispclk_set_mhz * 1000;
 }
 
-int rv1_vbios_smu_set_dprefclk(struct clk_mgr_internal *clk_mgr)
+int rv1_clk_mgr_vbios_smu_set_dprefclk(struct clk_mgr_internal *clk_mgr)
 {
int actual_dprefclk_set_mhz = -1;
 
-   actual_dprefclk_set_mhz = rv1_vbios_smu_send_msg_with_param(
+   actual_dprefclk_set_mhz = rv1_clk_mgr_vbios_smu_send_msg_with_param(
clk_mgr,
VBIOSSMC_MSG_SetDprefclkFreq,
khz_to_mhz_ceil(clk_mgr->base.dprefclk_khz));
diff --git 
a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.h 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.h
index 083cb3158859..d6d50cd3755d 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.h
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.h
@@ -26,7 +26,7 @@
 #ifndef DAL_DC_DCN10_RV1_CLK_MGR_VBIOS_SMU_H_
 #define DAL_DC_DCN10_RV1_CLK_MGR_VBIOS_SMU_H_
 
-int rv1_vbios_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int 
requested_dispclk_khz);
-int rv1_vbios_smu_set_dprefclk(struct clk_mgr_internal *clk_mgr);
+int rv1_clk_mgr_vbios_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int 
requested_dis

[PATCH 1/3] drm/amd/display: add prefix to rv1_clk_mgr_clk.c function

2024-02-21 Thread David Tadokoro
The function defined in dc/clk_mgr/dcn10/rv1_clk_mgr_clk.c doesn't
have a name that indicates where it was declared.

To better filter results in debug tools like ftrace, prefix this
function with 'rv1_clk_mgr_clk_'.

Signed-off-by: David Tadokoro 
---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_clk.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_clk.c
index 61dd12198a3c..b63e0e92d118 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_clk.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_clk.c
@@ -49,7 +49,7 @@
 
 
 /* Only used by testing framework*/
-void rv1_dump_clk_registers(struct clk_state_registers *regs, struct 
clk_bypass *bypass, struct clk_mgr *clk_mgr_base)
+void rv1_clk_mgr_clk_dump_clk_registers(struct clk_state_registers *regs, 
struct clk_bypass *bypass, struct clk_mgr *clk_mgr_base)
 {
struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
 
-- 
2.39.2



[PATCH 2/3] drm/amd/display: add prefix to rv1_clk_mgr.c functions

2024-02-21 Thread David Tadokoro
The functions defined in dc/clk_mgr/dcn10/rv1_clk_mgr.c don't have
names that indicates where they were declared.

To better filter results in debug tools like ftrace, prefix these
functions with 'rv1_clk_mgr_'.

Signed-off-by: David Tadokoro 
---
 .../display/dc/clk_mgr/dcn10/rv1_clk_mgr.c| 22 +--
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c
index 60761ff3cbf1..093084a48daa 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c
@@ -34,12 +34,12 @@
 #include "rv1_clk_mgr_vbios_smu.h"
 #include "rv1_clk_mgr_clk.h"
 
-static void rv1_init_clocks(struct clk_mgr *clk_mgr)
+static void rv1_clk_mgr_init_clocks(struct clk_mgr *clk_mgr)
 {
memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks));
 }
 
-static int rv1_determine_dppclk_threshold(struct clk_mgr_internal *clk_mgr, 
struct dc_clocks *new_clocks)
+static int rv1_clk_mgr_determine_dppclk_threshold(struct clk_mgr_internal 
*clk_mgr, struct dc_clocks *new_clocks)
 {
bool request_dpp_div = new_clocks->dispclk_khz > new_clocks->dppclk_khz;
bool dispclk_increase = new_clocks->dispclk_khz > 
clk_mgr->base.clks.dispclk_khz;
@@ -85,18 +85,18 @@ static int rv1_determine_dppclk_threshold(struct 
clk_mgr_internal *clk_mgr, stru
return disp_clk_threshold;
 }
 
-static void ramp_up_dispclk_with_dpp(
+static void rv1_clk_mgr_ramp_up_dispclk_with_dpp(
struct clk_mgr_internal *clk_mgr,
struct dc *dc,
struct dc_clocks *new_clocks,
bool safe_to_lower)
 {
int i;
-   int dispclk_to_dpp_threshold = rv1_determine_dppclk_threshold(clk_mgr, 
new_clocks);
+   int dispclk_to_dpp_threshold = 
rv1_clk_mgr_determine_dppclk_threshold(clk_mgr, new_clocks);
bool request_dpp_div = new_clocks->dispclk_khz > new_clocks->dppclk_khz;
 
/* this function is to change dispclk, dppclk and dprefclk according to
-* bandwidth requirement. Its call stack is rv1_update_clocks -->
+* bandwidth requirement. Its call stack is rv1_clk_mgr_update_clocks 
-->
 * update_clocks --> dcn10_prepare_bandwidth / dcn10_optimize_bandwidth
 * --> prepare_bandwidth / optimize_bandwidth. before change dcn hw,
 * prepare_bandwidth will be called first to allow enough clock,
@@ -187,7 +187,7 @@ static void ramp_up_dispclk_with_dpp(
clk_mgr->base.clks.max_supported_dppclk_khz = 
new_clocks->max_supported_dppclk_khz;
 }
 
-static void rv1_update_clocks(struct clk_mgr *clk_mgr_base,
+static void rv1_clk_mgr_update_clocks(struct clk_mgr *clk_mgr_base,
struct dc_state *context,
bool safe_to_lower)
 {
@@ -274,7 +274,7 @@ static void rv1_update_clocks(struct clk_mgr *clk_mgr_base,
/* program dispclk on = as a w/a for sleep resume clock ramping issues 
*/
if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, 
clk_mgr_base->clks.dispclk_khz)
|| new_clocks->dispclk_khz == 
clk_mgr_base->clks.dispclk_khz) {
-   ramp_up_dispclk_with_dpp(clk_mgr, dc, new_clocks, 
safe_to_lower);
+   rv1_clk_mgr_ramp_up_dispclk_with_dpp(clk_mgr, dc, new_clocks, 
safe_to_lower);
clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;
send_request_to_lower = true;
}
@@ -291,7 +291,7 @@ static void rv1_update_clocks(struct clk_mgr *clk_mgr_base,
}
 }
 
-static void rv1_enable_pme_wa(struct clk_mgr *clk_mgr_base)
+static void rv1_clk_mgr_enable_pme_wa(struct clk_mgr *clk_mgr_base)
 {
struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
struct pp_smu_funcs_rv *pp_smu = NULL;
@@ -305,10 +305,10 @@ static void rv1_enable_pme_wa(struct clk_mgr 
*clk_mgr_base)
 }
 
 static struct clk_mgr_funcs rv1_clk_funcs = {
-   .init_clocks = rv1_init_clocks,
+   .init_clocks = rv1_clk_mgr_init_clocks,
.get_dp_ref_clk_frequency = dce12_get_dp_ref_freq_khz,
-   .update_clocks = rv1_update_clocks,
-   .enable_pme_wa = rv1_enable_pme_wa,
+   .update_clocks = rv1_clk_mgr_update_clocks,
+   .enable_pme_wa = rv1_clk_mgr_enable_pme_wa,
 };
 
 static struct clk_mgr_internal_funcs rv1_clk_internal_funcs = {
-- 
2.39.2



[PATCH 0/3] drm/amd/display: add prefix to dc/clk_mgr/dcn10 functions

2024-02-21 Thread David Tadokoro
This patchset has three commits that add prefix to all the functions defined in
dc/clk_mgr/dcn10 that indicate the file that they were defined. Enforcing this
pattern makes filtering results in debug tools like ftrace better.

David Tadokoro (3):
  drm/amd/display: add prefix to rv1_clk_mgr_clk.c function
  drm/amd/display: add prefix to rv1_clk_mgr.c functions
  drm/amd/display: add prefix to rv1_clk_mgr_vbios_smu.c functions

 .../display/dc/clk_mgr/dcn10/rv1_clk_mgr.c| 24 +--
 .../dc/clk_mgr/dcn10/rv1_clk_mgr_clk.c|  2 +-
 .../dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c  | 14 +--
 .../dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.h  |  4 ++--
 4 files changed, 22 insertions(+), 22 deletions(-)

-- 
2.39.2



[PATCH] drm/amd/display: add prefix to amdgpu_dm_crtc.h functions

2023-03-08 Thread David Tadokoro
Some amdgpu_dm_crtc.h functions didn't have names that indicated where
they were declared.

To better filter results in debug tools like ftrace, prefix these
functions with 'amdgpu_dm_crtc_'.

Signed-off-by: David Tadokoro 
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 +--
 .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c| 26 +++
 .../amd/display/amdgpu_dm/amdgpu_dm_crtc.h| 14 
 3 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index b472931cb7ca..b3e874589617 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -342,7 +342,7 @@ static inline bool is_dc_timing_adjust_needed(struct 
dm_crtc_state *old_state,
 {
if (new_state->freesync_config.state ==  VRR_STATE_ACTIVE_FIXED)
return true;
-   else if (amdgpu_dm_vrr_active(old_state) != 
amdgpu_dm_vrr_active(new_state))
+   else if (amdgpu_dm_crtc_vrr_active(old_state) != 
amdgpu_dm_crtc_vrr_active(new_state))
return true;
else
return false;
@@ -436,7 +436,7 @@ static void dm_pflip_high_irq(void *interrupt_params)
 
WARN_ON(!e);
 
-   vrr_active = amdgpu_dm_vrr_active_irq(amdgpu_crtc);
+   vrr_active = amdgpu_dm_crtc_vrr_active_irq(amdgpu_crtc);
 
/* Fixed refresh rate, or VRR scanout position outside front-porch? */
if (!vrr_active ||
@@ -510,7 +510,7 @@ static void dm_vupdate_high_irq(void *interrupt_params)
acrtc = get_crtc_by_otg_inst(adev, irq_params->irq_src - 
IRQ_TYPE_VUPDATE);
 
if (acrtc) {
-   vrr_active = amdgpu_dm_vrr_active_irq(acrtc);
+   vrr_active = amdgpu_dm_crtc_vrr_active_irq(acrtc);
drm_dev = acrtc->base.dev;
vblank = _dev->vblank[acrtc->base.index];
previous_timestamp = 
atomic64_read(_params->previous_timestamp);
@@ -534,7 +534,7 @@ static void dm_vupdate_high_irq(void *interrupt_params)
 * if a pageflip happened inside front-porch.
 */
if (vrr_active) {
-   dm_crtc_handle_vblank(acrtc);
+   amdgpu_dm_crtc_handle_vblank(acrtc);
 
/* BTR processing for pre-DCE12 ASICs */
if (acrtc->dm_irq_params.stream &&
@@ -574,7 +574,7 @@ static void dm_crtc_high_irq(void *interrupt_params)
if (!acrtc)
return;
 
-   vrr_active = amdgpu_dm_vrr_active_irq(acrtc);
+   vrr_active = amdgpu_dm_crtc_vrr_active_irq(acrtc);
 
DC_LOG_VBLANK("crtc:%d, vupdate-vrr:%d, planes:%d\n", acrtc->crtc_id,
  vrr_active, acrtc->dm_irq_params.active_planes);
@@ -586,7 +586,7 @@ static void dm_crtc_high_irq(void *interrupt_params)
 * to dm_vupdate_high_irq after end of front-porch.
 */
if (!vrr_active)
-   dm_crtc_handle_vblank(acrtc);
+   amdgpu_dm_crtc_handle_vblank(acrtc);
 
/**
 * Following stuff must happen at start of vblank, for crc
@@ -2483,11 +2483,11 @@ static void dm_gpureset_toggle_interrupts(struct 
amdgpu_device *adev,
 enable ? "enable" : "disable");
 
if (enable) {
-   rc = dm_enable_vblank(>base);
+   rc = amdgpu_dm_crtc_enable_vblank(>base);
if (rc)
DRM_WARN("Failed to enable vblank 
interrupts\n");
} else {
-   dm_disable_vblank(>base);
+   amdgpu_dm_crtc_disable_vblank(>base);
}
 
}
@@ -7746,7 +7746,7 @@ static void update_freesync_state_on_stream(
_params);
 
if (adev->family < AMDGPU_FAMILY_AI &&
-   amdgpu_dm_vrr_active(new_crtc_state)) {
+   amdgpu_dm_crtc_vrr_active(new_crtc_state)) {
mod_freesync_handle_v_update(dm->freesync_module,
 new_stream, _params);
 
@@ -7864,8 +7864,8 @@ static void update_stream_irq_parameters(
 static void amdgpu_dm_handle_vrr_transition(struct dm_crtc_state *old_state,
struct dm_crtc_state *new_state)
 {
-   bool old_vrr_active = amdgpu_dm_vrr_active(old_state);
-   bool new_vrr_active = amdgpu_dm_vrr_active(new_state);
+   bool old_vrr_active = amdgpu_dm_crtc_vrr_active(old_state);
+   bool new_vrr_active = amdgpu_dm_crtc_vrr_active(new_state);
 
if (!old_vrr_active && new_vrr_active) {
/* Transition

[PATCH] drm/amd/display: remove legacy fields of dc_plane_cap struct

2023-03-08 Thread David Tadokoro
The fields blends_with_above and blends_with_below of struct
dc_plane_cap (defined in dc/dc.h) are boolean and set to true by
default. All instances of a dc_plane_cap maintain the default values of
both. Also, there is only one if statement that checks those fields and
there would be the same effect if it was deleted (assuming that those
fields are always going to be true).

For this reason, considering both fields as legacy ones, this commit
removes them and the aforementioned if statement.

Signed-off-by: David Tadokoro 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c   | 3 ---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 --
 drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 3 ---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c   | 2 --
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c   | 2 --
 drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 2 --
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c   | 2 --
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c   | 2 --
 drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 --
 drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 --
 drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 --
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c   | 2 --
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 2 --
 drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 2 --
 drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c | 2 --
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c   | 2 --
 drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 2 --
 17 files changed, 36 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index b472931cb7ca..fdcb375e908a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4354,9 +4354,6 @@ static int amdgpu_dm_initialize_drm_device(struct 
amdgpu_device *adev)
if (plane->type != DC_PLANE_TYPE_DCN_UNIVERSAL)
continue;
 
-   if (!plane->blends_with_above || !plane->blends_with_below)
-   continue;
-
if (!plane->pixel_format_support.argb)
continue;
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index f0a1934ebf8c..ccc27d482640 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -82,8 +82,6 @@ enum det_size {
 
 struct dc_plane_cap {
enum dc_plane_type type;
-   uint32_t blends_with_above : 1;
-   uint32_t blends_with_below : 1;
uint32_t per_pixel_alpha : 1;
struct {
uint32_t argb : 1;
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c 
b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
index f808315b2835..a4a45a6ce61e 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
@@ -401,8 +401,6 @@ static const struct resource_caps stoney_resource_cap = {
 
 static const struct dc_plane_cap plane_cap = {
.type = DC_PLANE_TYPE_DCE_RGB,
-   .blends_with_below = true,
-   .blends_with_above = true,
.per_pixel_alpha = 1,
 
.pixel_format_support = {
@@ -428,7 +426,6 @@ static const struct dc_plane_cap plane_cap = {
 
 static const struct dc_plane_cap underlay_plane_cap = {
.type = DC_PLANE_TYPE_DCE_UNDERLAY,
-   .blends_with_above = true,
.per_pixel_alpha = 1,
 
.pixel_format_support = {
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
index 6bfac8088ab0..2bb8e11f26e0 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
@@ -504,8 +504,6 @@ static const struct resource_caps rv2_res_cap = {
 
 static const struct dc_plane_cap plane_cap = {
.type = DC_PLANE_TYPE_DCN_UNIVERSAL,
-   .blends_with_above = true,
-   .blends_with_below = true,
.per_pixel_alpha = true,
 
.pixel_format_support = {
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c 
b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
index 3af24ef9cb2d..00668df0938e 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
@@ -670,8 +670,6 @@ static const struct resource_caps res_cap_nv10 = {
 
 static const struct dc_plane_cap plane_cap = {
.type = DC_PLANE_TYPE_DCN_UNIVERSAL,
-   .blends_with_above = true,
-   .blends_with_below = true,
.per_pixel_alpha = true,
 
.pixel_format_support = {
diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_r

[PATCH] drm/amd/display: add prefix to amdgpu_dm_plane.h functions

2023-03-06 Thread David Tadokoro
From: David Tadokoro 

The amdgpu_dm_plane.h functions didn't have names that indicated where
they were declared.

To better filter results in debug tools like ftrace, prefix these
functions with 'amdgpu_dm_plane_'.

Note that we may want to make this same change in other files like
amdgpu_dm_crtc.h.

Signed-off-by: David Tadokoro 
---
 .../gpu/amdgpu/display/display-manager.rst|  2 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++---
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 20 +--
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.h   | 12 +--
 4 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/Documentation/gpu/amdgpu/display/display-manager.rst 
b/Documentation/gpu/amdgpu/display/display-manager.rst
index b7abb18cfc82..be2651ecdd7f 100644
--- a/Documentation/gpu/amdgpu/display/display-manager.rst
+++ b/Documentation/gpu/amdgpu/display/display-manager.rst
@@ -173,7 +173,7 @@ The alpha blending equation is configured from DRM to DC 
interface by the
 following path:
 
 1. When updating a :c:type:`drm_plane_state `, DM calls
-   :c:type:`fill_blending_from_plane_state()` that maps
+   :c:type:`amdgpu_dm_plane_fill_blending_from_plane_state()` that maps
:c:type:`drm_plane_state ` attributes to
:c:type:`dc_plane_info ` struct to be handled in the
OS-agnostic component (DC).
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 4217ebe6391b..f7111acd45cc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2923,7 +2923,7 @@ const struct amdgpu_ip_block_version dm_ip_block =
 
 static const struct drm_mode_config_funcs amdgpu_dm_mode_funcs = {
.fb_create = amdgpu_display_user_framebuffer_create,
-   .get_format_info = amd_get_format_info,
+   .get_format_info = amdgpu_dm_plane_get_format_info,
.output_poll_changed = drm_fb_helper_output_poll_changed,
.atomic_check = amdgpu_dm_atomic_check,
.atomic_commit = drm_atomic_helper_commit,
@@ -4948,7 +4948,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
if (ret)
return ret;
 
-   ret = fill_plane_buffer_attributes(adev, afb, plane_info->format,
+   ret = amdgpu_dm_plane_fill_plane_buffer_attributes(adev, afb, 
plane_info->format,
   plane_info->rotation, tiling_flags,
   _info->tiling_info,
   _info->plane_size,
@@ -4957,7 +4957,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
if (ret)
return ret;
 
-   fill_blending_from_plane_state(
+   amdgpu_dm_plane_fill_blending_from_plane_state(
plane_state, _info->per_pixel_alpha, 
_info->pre_multiplied_alpha,
_info->global_alpha, _info->global_alpha_value);
 
@@ -4976,7 +4976,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device 
*adev,
int ret;
bool force_disable_dcc = false;
 
-   ret = fill_dc_scaling_info(adev, plane_state, _info);
+   ret = amdgpu_dm_plane_fill_dc_scaling_info(adev, plane_state, 
_info);
if (ret)
return ret;
 
@@ -7882,7 +7882,7 @@ static void amdgpu_dm_commit_cursors(struct 
drm_atomic_state *state)
 */
for_each_old_plane_in_state(state, plane, old_plane_state, i)
if (plane->type == DRM_PLANE_TYPE_CURSOR)
-   handle_cursor_update(plane, old_plane_state);
+   amdgpu_dm_plane_handle_cursor_update(plane, 
old_plane_state);
 }
 
 static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
@@ -7967,7 +7967,7 @@ static void amdgpu_dm_commit_planes(struct 
drm_atomic_state *state,

bundle->surface_updates[planes_count].gamut_remap_matrix = 
_plane->gamut_remap_matrix;
}
 
-   fill_dc_scaling_info(dm->adev, new_plane_state,
+   amdgpu_dm_plane_fill_dc_scaling_info(dm->adev, new_plane_state,
 >scaling_infos[planes_count]);
 
bundle->surface_updates[planes_count].scaling_info =
@@ -9634,7 +9634,7 @@ static int dm_update_plane_state(struct dc *dc,
if (!needs_reset)
return 0;
 
-   ret = dm_plane_helper_check_state(new_plane_state, 
new_crtc_state);
+   ret = amdgpu_dm_plane_helper_check_state(new_plane_state, 
new_crtc_state);
if (ret)
return ret;
 
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index 28fb1f02591a..dc23c788cdba 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_p