[PATCH] drm/amdgpu: Fix style issues in amdgpu_psp.c

2023-07-26 Thread Praful Swarnakar
Fixes the following to align to linux coding style:

WARNING: Block comments use a trailing */ on a separate line
WARNING: Block comments should align the * on each line

Cc: Christian König 
Cc: Alex Deucher 
Cc: Guchun Chen 
Signed-off-by: Praful Swarnakar 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 28 ++---
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 4e428060a1fa..1d0516e904b1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -438,14 +438,15 @@ static int psp_sw_init(void *handle)
/* If psp runtime database exists, then
 * only enable two stage memory training
 * when TWO_STAGE_DRAM_TRAINING bit is set
-* in runtime database */
+* in runtime database
+*/
mem_training_ctx->enable_mem_training = true;
}
 
} else {
-   /* If psp runtime database doesn't exist or
-* is invalid, force enable two stage memory
-* training */
+   /* If psp runtime database doesn't exist or is
+* invalid, force enable two stage memory training
+*/
mem_training_ctx->enable_mem_training = true;
}
 
@@ -797,7 +798,8 @@ static int psp_tmr_init(struct psp_context *psp)
tmr_size = PSP_TMR_SIZE(psp->adev);
 
/* For ASICs support RLC autoload, psp will parse the toc
-* and calculate the total size of TMR needed */
+* and calculate the total size of TMR needed
+*/
if (!amdgpu_sriov_vf(psp->adev) &&
psp->toc.start_addr &&
psp->toc.size_bytes &&
@@ -1137,9 +1139,9 @@ int psp_ta_init_shared_buf(struct psp_context *psp,
  struct ta_mem_context *mem_ctx)
 {
/*
-   * Allocate 16k memory aligned to 4k from Frame Buffer (local
-   * physical) for ta to host memory
-   */
+* Allocate 16k memory aligned to 4k from Frame Buffer (local
+* physical) for ta to host memory
+*/
return amdgpu_bo_create_kernel(psp->adev, mem_ctx->shared_mem_size,
  PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM |
  AMDGPU_GEM_DOMAIN_GTT,
@@ -1728,7 +1730,8 @@ int psp_ras_trigger_error(struct psp_context *psp,
return -EINVAL;
 
/* If err_event_athub occurs error inject was successful, however
-  return status from TA is no long reliable */
+*  return status from TA is no long reliable
+*/
if (amdgpu_ras_intr_triggered())
return 0;
 
@@ -2577,7 +2580,8 @@ static int psp_load_non_psp_fw(struct psp_context *psp)
 ucode->ucode_id == AMDGPU_UCODE_ID_SDMA2 ||
 ucode->ucode_id == AMDGPU_UCODE_ID_SDMA3))
/* PSP only receive one SDMA fw for sienna_cichlid,
-* as all four sdma fw are same */
+* as all four sdma fw are same
+*/
continue;
 
psp_print_fw_hdr(psp, ucode);
@@ -2642,8 +2646,8 @@ static int psp_load_fw(struct amdgpu_device *adev)
if (adev->gmc.xgmi.num_physical_nodes > 1) {
ret = psp_xgmi_initialize(psp, false, true);
/* Warning the XGMI seesion initialize failure
-   * Instead of stop driver initialization
-   */
+* Instead of stop driver initialization
+*/
if (ret)
dev_err(psp->adev->dev,
"XGMI: Failed to initialize XGMI 
session\n");
-- 
2.25.1



[PATCH] drm/amdgpu: Fix style issues in amdgpu_debugfs.c

2023-07-26 Thread Praful Swarnakar
Fixes the following to align to linux coding style:

WARNING: Missing a blank line after declarations
WARNING: sizeof *rd should be sizeof(*rd)

Cc: Christian König 
Cc: Alex Deucher 
Cc: Guchun Chen 
Signed-off-by: Praful Swarnakar 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 00ab0b3c8277..a4faea4fa0b5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -375,7 +375,7 @@ static int amdgpu_debugfs_gprwave_open(struct inode *inode, 
struct file *file)
 {
struct amdgpu_debugfs_gprwave_data *rd;
 
-   rd = kzalloc(sizeof *rd, GFP_KERNEL);
+   rd = kzalloc(sizeof(*rd), GFP_KERNEL);
if (!rd)
return -ENOMEM;
rd->adev = file_inode(file)->i_private;
@@ -388,6 +388,7 @@ static int amdgpu_debugfs_gprwave_open(struct inode *inode, 
struct file *file)
 static int amdgpu_debugfs_gprwave_release(struct inode *inode, struct file 
*file)
 {
struct amdgpu_debugfs_gprwave_data *rd = file->private_data;
+
mutex_destroy(&rd->lock);
kfree(file->private_data);
return 0;
-- 
2.25.1



[PATCH] drm/amd/display: Remove redundant logs from DSC code

2022-12-16 Thread Praful Swarnakar
[Why & How]
Remove redundant log in DSC that just add additional blank prints

Signed-off-by: Praful Swarnakar 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 1 -
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index af9411ee3c74..f2b6d40e4f5c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -7510,7 +7510,6 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool 
enable, bool immediate_u
dsc_cfg.is_odm = pipe_ctx->next_odm_pipe ? true : false;
dsc_cfg.dc_dsc_cfg = stream->timing.dsc_cfg;
 
-   DC_LOG_DSC(" ");
dsc->funcs->dsc_get_packed_pps(dsc, &dsc_cfg, 
&dsc_packed_pps[0]);
memcpy(&stream->dsc_packed_pps[0], &dsc_packed_pps[0], 
sizeof(stream->dsc_packed_pps));
if (dc_is_dp_signal(stream->signal)) {
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c 
b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
index 784a8b6f360d..c08c01e05dcf 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
@@ -200,7 +200,6 @@ static void dsc2_set_config(struct 
display_stream_compressor *dsc, const struct
bool is_config_ok;
struct dcn20_dsc *dsc20 = TO_DCN20_DSC(dsc);
 
-   DC_LOG_DSC(" ");
DC_LOG_DSC("Setting DSC Config at DSC inst %d", dsc->inst);
dsc_config_log(dsc, dsc_cfg);
is_config_ok = dsc_prepare_config(dsc_cfg, &dsc20->reg_vals, 
dsc_optc_cfg);
-- 
2.25.1



[PATCH] drm/amd/display: Increase frame-larger-than to 4096 in dml Makefile

2022-07-29 Thread Praful Swarnakar
When enabling kcov and debug kernel configuration, stack frame size
exceeds set limit, resulting into build error.

Fixes the following build warnings:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.c:3955:6:
error: stack frame size (2344) exceeds limit (2048) in
'dml31_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than]

Fixes: 5679b6e2c887 ("drm/amd/display: Enable building new display engine with 
KCOV enabled")
Signed-off-by: Praful Swarnakar 
Signed-off-by: Tim Van Patten 
Suggested-by: Raul Rangel 
---
 drivers/gpu/drm/amd/display/dc/dml/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile 
b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index 359f6e9a1da0..42b1df843a6c 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -51,7 +51,7 @@ endif
 endif
 
 ifneq ($(CONFIG_FRAME_WARN),0)
-frame_warn_flag := -Wframe-larger-than=2048
+frame_warn_flag := -Wframe-larger-than=4096
 endif
 
 CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_ccflags)
-- 
2.25.1