[PATCH] drm/amd/display: clean up some inconsistent indenting

2024-05-23 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:5200 dc_power_down_on_boot() 
warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9166
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c 
b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 3a2101b052ea..4612c60edebd 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -5194,9 +5194,7 @@ void dc_power_down_on_boot(struct dc *dc)
}
 }
 
-void dc_set_power_state(
-   struct dc *dc,
-   enum dc_acpi_cm_power_state power_state)
+void dc_set_power_state(struct dc *dc, enum dc_acpi_cm_power_state power_state)
 {
if (!dc->current_state)
return;
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: Remove duplicate amdgpu_umsch_mm.h header

2024-05-16 Thread Jiapeng Chong
./drivers/gpu/drm/amd/amdgpu/amdgpu.h: amdgpu_umsch_mm.h is included more than 
once.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9063
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 1a14e0101dac..bfae3c17e9bd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -112,7 +112,6 @@
 #include "amdgpu_xcp.h"
 #include "amdgpu_seq64.h"
 #include "amdgpu_reg_state.h"
-#include "amdgpu_umsch_mm.h"
 
 #define MAX_GPU_INSTANCE   64
 
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2024-05-10 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn401/dcn401_resource.c:792 
dcn401_i2c_hw_create() warn: inconsistent indenting.
drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn401/dcn401_resource.c:894 
dcn401_hubp_create() warn: inconsistent indenting.
drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn401/dcn401_resource.c:1738 
dcn401_resource_construct() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9002
Signed-off-by: Jiapeng Chong 
---
 .../dc/resource/dcn401/dcn401_resource.c  | 29 +--
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c 
b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
index 75e2c62ae792..3e1bfddc6e43 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
@@ -784,14 +784,13 @@ static struct dce_i2c_hw *dcn401_i2c_hw_create(
 
 #undef REG_STRUCT
 #define REG_STRUCT i2c_hw_regs
-   i2c_inst_regs_init(1),
-   i2c_inst_regs_init(2),
-   i2c_inst_regs_init(3),
-   i2c_inst_regs_init(4);
+   i2c_inst_regs_init(1),
+   i2c_inst_regs_init(2),
+   i2c_inst_regs_init(3),
+   i2c_inst_regs_init(4);
 
dcn2_i2c_hw_construct(dce_i2c_hw, ctx, inst,
-   _hw_regs[inst], _shifts, 
_masks);
-
+ _hw_regs[inst], _shifts, _masks);
return dce_i2c_hw;
 }
 
@@ -886,13 +885,13 @@ static struct hubp *dcn401_hubp_create(
 
 #undef REG_STRUCT
 #define REG_STRUCT hubp_regs
-   hubp_regs_init(0),
-   hubp_regs_init(1),
-   hubp_regs_init(2),
-   hubp_regs_init(3);
+   hubp_regs_init(0),
+   hubp_regs_init(1),
+   hubp_regs_init(2),
+   hubp_regs_init(3);
 
if (hubp401_construct(hubp2, ctx, inst,
-   _regs[inst], _shift, _mask))
+ _regs[inst], _shift, _mask))
return >base;
 
BREAK_TO_DEBUGGER();
@@ -1735,10 +1734,10 @@ static bool dcn401_resource_construct(
 
 #undef REG_STRUCT
 #define REG_STRUCT abm_regs
-   abm_regs_init(0),
-   abm_regs_init(1),
-   abm_regs_init(2),
-   abm_regs_init(3);
+   abm_regs_init(0),
+   abm_regs_init(1),
+   abm_regs_init(2),
+   abm_regs_init(3);
 
 #undef REG_STRUCT
 #define REG_STRUCT dccg_regs
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Remove duplicate dcn401/dcn401_clk_mgr.h header

2024-04-24 Thread Jiapeng Chong
./drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c: 
dcn401/dcn401_clk_mgr.h is included more than once.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8885
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c
index d146c35f6d60..005092b0a0cb 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c
@@ -21,7 +21,6 @@
 #include "dcn/dcn_4_1_0_offset.h"
 #include "dcn/dcn_4_1_0_sh_mask.h"
 
-#include "dcn401/dcn401_clk_mgr.h"
 #include "dml/dcn401/dcn401_fpu.h"
 
 #define mmCLK01_CLK0_CLK_PLL_REQ0x16E37
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Remove duplicate spl/dc_spl_types.h header

2024-04-24 Thread Jiapeng Chong
./drivers/gpu/drm/amd/display/dc/inc/hw/transform.h: spl/dc_spl_types.h is 
included more than once.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8884
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h 
b/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h
index 5aa2f1a1fb83..28da1dddf0a0 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h
@@ -31,8 +31,6 @@
 #include "fixed31_32.h"
 #include "spl/dc_spl_types.h"
 
-#include "spl/dc_spl_types.h"
-
 #define CSC_TEMPERATURE_MATRIX_SIZE 12
 
 struct bit_depth_reduction_params;
-- 
2.19.1.6.gb485710b



[PATCH] drm/amd/display: Remove duplicate dcn32/dcn32_clk_mgr.h header

2024-04-18 Thread Jiapeng Chong
./drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c: 
dcn32/dcn32_clk_mgr.h is included more than once.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8789
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
index 7eecb3403f74..d7bbb0891398 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
@@ -41,7 +41,6 @@
 #include "dcn/dcn_3_2_0_offset.h"
 #include "dcn/dcn_3_2_0_sh_mask.h"
 
-#include "dcn32/dcn32_clk_mgr.h"
 #include "dml/dcn32/dcn32_fpu.h"
 
 #define DCN_BASE__INST0_SEG1   0x00C0
-- 
2.20.1.7.g153144c



[PATCH] drm/vmwgfx: Remove duplicate vmwgfx_vkms.h header

2024-04-16 Thread Jiapeng Chong
./drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c: vmwgfx_vkms.h is included more than 
once.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8772
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
index 7e93a45948f7..3bfcf671fcd5 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
@@ -31,7 +31,6 @@
 #include "vmwgfx_bo.h"
 #include "vmwgfx_drv.h"
 #include "vmwgfx_kms.h"
-#include "vmwgfx_vkms.h"
 
 #include "vmw_surface_cache.h"
 
-- 
2.20.1.7.g153144c



[PATCH v2] drm/xe/irq: Remove unnecessary semicolon in pick_engine_gt()

2024-04-15 Thread Jiapeng Chong
No functional modification involved.

./drivers/gpu/drm/xe/xe_irq.c:279:3-4: Unneeded semicolon.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8757
Signed-off-by: Jiapeng Chong 
---
Changes in v2:
  -Make the commit message more clearer.

 drivers/gpu/drm/xe/xe_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
index 996806353171..5b1a2f46a1b2 100644
--- a/drivers/gpu/drm/xe/xe_irq.c
+++ b/drivers/gpu/drm/xe/xe_irq.c
@@ -276,7 +276,7 @@ static struct xe_gt *pick_engine_gt(struct xe_tile *tile,
return tile->media_gt;
default:
break;
-   };
+   }
fallthrough;
default:
return tile->primary_gt;
-- 
2.20.1.7.g153144c



[PATCH] drm/xe/irq: remove unneeded semicolon

2024-04-14 Thread Jiapeng Chong
No functional modification involved.

./drivers/gpu/drm/xe/xe_irq.c:279:3-4: Unneeded semicolon.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8757
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/xe/xe_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
index 996806353171..5b1a2f46a1b2 100644
--- a/drivers/gpu/drm/xe/xe_irq.c
+++ b/drivers/gpu/drm/xe/xe_irq.c
@@ -276,7 +276,7 @@ static struct xe_gt *pick_engine_gt(struct xe_tile *tile,
return tile->media_gt;
default:
break;
-   };
+   }
fallthrough;
default:
return tile->primary_gt;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2024-03-22 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn351/dcn351_fpu.c:569 
dcn351_decide_zstate_support() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8608
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c
index dc9e1b758ed6..1c16c5f2ce78 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c
@@ -564,9 +564,8 @@ void dcn351_decide_zstate_support(struct dc *dc, struct 
dc_state *context)
dc->debug.minimum_z8_residency_time > 0 ? 
dc->debug.minimum_z8_residency_time : 1000;
bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > 
(double)minmum_z8_residency;
 
-
/*for psr1/psr-su, we allow z8 and z10 based on latency, for 
replay with IPS enabled, it will enter ips2*/
-if (is_pwrseq0 && (is_psr || is_replay))
+   if (is_pwrseq0 && (is_psr || is_replay))
support = allow_z8 ? allow_z8 : 
DCN_ZSTATE_SUPPORT_DISALLOW;
 
}
-- 
2.20.1.7.g153144c



[PATCH] drm/qxl: remove redundant code

2024-02-25 Thread Jiapeng Chong
Variable num_relocs is not effectively used, so delete it. Having two
labels seems somewhat redundant; the 'out_free_release' can be removed,
leaving 'out_free_bos'.

drivers/gpu/drm/qxl/qxl_ioctl.c:148:14: warning: variable 'num_relocs' set but 
not used.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8316
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/qxl/qxl_ioctl.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
index dd0f834d881c..c1dd5709d37a 100644
--- a/drivers/gpu/drm/qxl/qxl_ioctl.c
+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
@@ -145,7 +145,7 @@ static int qxl_process_single_command(struct qxl_device 
*qdev,
struct qxl_release *release;
struct qxl_bo *cmd_bo;
void *fb_cmd;
-   int i, ret, num_relocs;
+   int i, ret;
int unwritten;
 
switch (cmd->type) {
@@ -196,11 +196,10 @@ static int qxl_process_single_command(struct qxl_device 
*qdev,
if (unwritten) {
DRM_ERROR("got unwritten %d\n", unwritten);
ret = -EFAULT;
-   goto out_free_release;
+   goto out_free_bos;
}
 
/* fill out reloc info structs */
-   num_relocs = 0;
for (i = 0; i < cmd->relocs_num; ++i) {
struct drm_qxl_reloc reloc;
struct drm_qxl_reloc __user *u = u64_to_user_ptr(cmd->relocs);
@@ -230,7 +229,6 @@ static int qxl_process_single_command(struct qxl_device 
*qdev,
reloc_info[i].dst_bo = cmd_bo;
reloc_info[i].dst_offset = reloc.dst_offset + 
release->release_offset;
}
-   num_relocs++;
 
/* reserve and validate the reloc dst bo */
if (reloc.reloc_type == QXL_RELOC_TYPE_BO || reloc.src_handle) {
@@ -261,7 +259,6 @@ static int qxl_process_single_command(struct qxl_device 
*qdev,
ret = qxl_push_command_ring_release(qdev, release, cmd->type, true);
 
 out_free_bos:
-out_free_release:
if (ret)
qxl_release_free(qdev, release);
 out_free_reloc:
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Simplify the calculation of variables

2024-02-02 Thread Jiapeng Chong
./drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c:236:49-51: WARNING !A || A 
&& B is equivalent to !A || B.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8169
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c 
b/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
index 1068b962d1c1..f15d1dbad6a9 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
@@ -234,7 +234,7 @@ static bool get_plane_id(struct dml2_context *dml2, const 
struct dc_state *state
if (state->streams[i]->stream_id == stream_id) {
for (j = 0; j < state->stream_status[i].plane_count; 
j++) {
if (state->stream_status[i].plane_states[j] == 
plane &&
-   (!is_plane_duplicate || 
(is_plane_duplicate && (j == plane_index {
+   (!is_plane_duplicate || (j == 
plane_index))) {
*plane_id = (i << 16) | j;
return true;
}
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Simplify the calculation of variables

2024-01-17 Thread Jiapeng Chong
./drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c:703:47-49: 
WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7931
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c 
b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
index a0ce681b26c6..118aaf4389bc 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
@@ -700,9 +700,9 @@ static void free_unused_pipes_for_plane(struct dml2_context 
*ctx, struct dc_stat
for (i = 0; i < ctx->config.dcn_pipe_count; i++) {
if (state->res_ctx.pipe_ctx[i].plane_state == plane &&
state->res_ctx.pipe_ctx[i].stream->stream_id == 
stream_id &&
-   (!is_plane_duplicate || (is_plane_duplicate &&
+   (!is_plane_duplicate ||

ctx->v20.scratch.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_index[state->res_ctx.pipe_ctx[i].pipe_idx]
 == plane_index)) &&
-   !is_pipe_used(pool, 
state->res_ctx.pipe_ctx[i].pipe_idx)) {
+   !is_pipe_used(pool, 
state->res_ctx.pipe_ctx[i].pipe_idx) {
free_pipe(>res_ctx.pipe_ctx[i]);
}
}
-- 
2.20.1.7.g153144c



[PATCH] fbdev/vt8500lcdfb: Remove unnecessary print function dev_err()

2024-01-04 Thread Jiapeng Chong
The print function dev_err() is redundant because platform_get_irq()
already prints an error.

./drivers/video/fbdev/vt8500lcdfb.c:377:2-9: line 377 is redundant because 
platform_get_irq() already prints an error.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7824
Signed-off-by: Jiapeng Chong 
---
 drivers/video/fbdev/vt8500lcdfb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/vt8500lcdfb.c 
b/drivers/video/fbdev/vt8500lcdfb.c
index 42c25dc85197..ac73937073a7 100644
--- a/drivers/video/fbdev/vt8500lcdfb.c
+++ b/drivers/video/fbdev/vt8500lcdfb.c
@@ -374,7 +374,6 @@ static int vt8500lcd_probe(struct platform_device *pdev)
 
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
-   dev_err(>dev, "no IRQ defined\n");
ret = -ENODEV;
goto failed_free_palette;
}
-- 
2.20.1.7.g153144c



[PATCH] drm/xe/vm: Simplify the calculation of variables

2024-01-02 Thread Jiapeng Chong
./drivers/gpu/drm/xe/xe_vm.c:187:25-27: WARNING !A || A && B is equivalent to 
!A || B.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7818
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/xe/xe_vm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 9180f2d2d71d..dd304a92d0bb 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -184,8 +184,8 @@ static bool preempt_fences_waiting(struct xe_vm *vm)
 
list_for_each_entry(q, >preempt.exec_queues, compute.link) {
if (!q->compute.pfence ||
-   (q->compute.pfence && 
test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
-  >compute.pfence->flags))) 
{
+   test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
+>compute.pfence->flags)) {
return true;
}
}
-- 
2.20.1.7.g153144c



[PATCH] drm/rockchip: vop2: clean up some inconsistent indenting

2023-12-18 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:1708 rk3588_calc_cru_cfg() warn: 
inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7778
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index 44508c2dd614..d3fad523bd6e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -1705,8 +1705,8 @@ static unsigned long rk3588_calc_cru_cfg(struct 
vop2_video_port *vp, int id,
 * *if_pixclk_div = dclk_rate / if_pixclk_rate;
 * *if_dclk_div = dclk_rate / if_dclk_rate;
 */
-*if_pixclk_div = 2;
-*if_dclk_div = 4;
+   *if_pixclk_div = 2;
+   *if_dclk_div = 4;
} else if (vop2_output_if_is_edp(id)) {
/*
 * edp_pixclk = edp_dclk > dclk_core
-- 
2.20.1.7.g153144c



[PATCH] drm/rockchip: vop2: Remove the unused variable if_dclk_rate

2023-12-14 Thread Jiapeng Chong
Variable if_dclk_rate is not effectively used, so delete it.

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:1688:16: warning: variable 
‘if_dclk_rate’ set but not used.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7750
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index 44508c2dd614..b4e7cddaf25a 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -1685,13 +1685,11 @@ static unsigned long rk3588_calc_cru_cfg(struct 
vop2_video_port *vp, int id,
unsigned long dclk_core_rate = v_pixclk >> 2;
unsigned long dclk_rate = v_pixclk;
unsigned long dclk_out_rate;
-   unsigned long if_dclk_rate;
unsigned long if_pixclk_rate;
int K = 1;
 
if (vop2_output_if_is_hdmi(id)) {
/*
-* K = 2: dclk_core = if_pixclk_rate > if_dclk_rate
 * K = 1: dclk_core = hdmie_edp_dclk > if_pixclk_rate
 */
if (output_mode == ROCKCHIP_OUT_MODE_YUV420) {
@@ -1700,10 +1698,8 @@ static unsigned long rk3588_calc_cru_cfg(struct 
vop2_video_port *vp, int id,
}
 
if_pixclk_rate = (dclk_core_rate << 1) / K;
-   if_dclk_rate = dclk_core_rate / K;
/*
 * *if_pixclk_div = dclk_rate / if_pixclk_rate;
-* *if_dclk_div = dclk_rate / if_dclk_rate;
 */
 *if_pixclk_div = 2;
 *if_dclk_div = 4;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/amdgpu: clean up some inconsistent indenting

2023-12-01 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1106 
amdgpu_connector_dvi_detect() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7673
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 96f63fd39b9e..9caba10315a8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1103,7 +1103,7 @@ amdgpu_connector_dvi_detect(struct drm_connector 
*connector, bool force)
 * DDC line.  The latter is more complex because with 
DVI<->HDMI adapters
 * you don't really know what's connected to which port 
as both are digital.
 */
-amdgpu_connector_shared_ddc(, connector, 
amdgpu_connector);
+   amdgpu_connector_shared_ddc(, connector, 
amdgpu_connector);
}
}
 
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Fix warning comparing pointer to 0

2023-12-01 Thread Jiapeng Chong
Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c:532:62-63: WARNING comparing 
pointer to 0.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7672
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c 
b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
index 38360adc53d9..7d13d2e1bda8 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
@@ -529,7 +529,7 @@ enum dmub_status dmub_srv_calc_mem_info(struct dmub_srv 
*dmub,
out->fb[i].cpu_addr = cpu_base + reg->base;
out->fb[i].gpu_addr = gpu_base + reg->base;
 
-   if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr != 0) {
+   if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr) {
out->fb[i].cpu_addr = (uint8_t *)params->cpu_inbox_addr 
+ reg->base;
out->fb[i].gpu_addr = params->gpu_inbox_addr + 
reg->base;
}
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Simplify the calculation of variables

2023-12-01 Thread Jiapeng Chong
./drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c:964:49-51: 
WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7671
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c 
b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
index fa8fe5bf7e57..519db4931b8d 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
@@ -961,7 +961,7 @@ static bool get_plane_id(struct dml2_context *dml2, const 
struct dc_state *conte
if (context->streams[i]->stream_id == stream_id) {
for (j = 0; j < context->stream_status[i].plane_count; 
j++) {
if (context->stream_status[i].plane_states[j] 
== plane &&
-   (!is_plane_duplicate || 
(is_plane_duplicate && (j == plane_index {
+   (!is_plane_duplicate || (j == 
plane_index))) {
*plane_id = (i << 16) | j;
return true;
}
-- 
2.20.1.7.g153144c



[PATCH] drm/i915/psr: Fix unsigned expression compared with zero

2023-11-22 Thread Jiapeng Chong
The entry_setup_frames is defined as u8 type, else(entry_setup_frames < 0)
is invalid. At the same time, the return value of function
intel_psr_entry_setup_frames is also of type int. so modified
its type to int.

./drivers/gpu/drm/i915/display/intel_psr.c:1336:5-23: WARNING: Unsigned 
expression compared with zero: entry_setup_frames >= 0.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7610
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/i915/display/intel_psr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c 
b/drivers/gpu/drm/i915/display/intel_psr.c
index 8d180132a74b..204da50e3f28 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1319,7 +1319,7 @@ static bool _psr_compute_config(struct intel_dp *intel_dp,
 {
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
const struct drm_display_mode *adjusted_mode = 
_state->hw.adjusted_mode;
-   u8 entry_setup_frames;
+   int entry_setup_frames;
 
/*
 * Current PSR panels don't work reliably with VRR enabled
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-11-16 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2461 
link_set_dpms_on() warn: if statement not indented.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7579
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index 34a4a8c0e18c..3586d7c519a3 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2454,9 +2454,9 @@ void link_set_dpms_on(
 
/* eDP lit up by bios already, no need to enable again. */
if (pipe_ctx->stream->signal == SIGNAL_TYPE_EDP &&
-   apply_edp_fast_boot_optimization &&
-   !pipe_ctx->stream->timing.flags.DSC &&
-   !pipe_ctx->next_odm_pipe) {
+   apply_edp_fast_boot_optimization &&
+   !pipe_ctx->stream->timing.flags.DSC &&
+   !pipe_ctx->next_odm_pipe) {
pipe_ctx->stream->dpms_off = false;
update_psp_stream_config(pipe_ctx, false);
return;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-11-09 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_util.c:118 
dml_floor() warn: if statement not indented.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7224
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c 
b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c
index c247aee89caf..16f4c506a334 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c
@@ -116,7 +116,7 @@ dml_float_t dml_ceil(dml_float_t x, dml_float_t granularity)
 dml_float_t dml_floor(dml_float_t x, dml_float_t granularity)
 {
if (granularity == 0)
-   return 0;
+   return 0;
//return (dml_float_t) (floor(x / granularity) * granularity);
return (dml_float_t)dcn_bw_floor2(x, granularity);
 }
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-10-18 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2902 dm_resume() 
warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6940
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 801f87a12ccf..0e1f8c5d7f9b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2899,7 +2899,7 @@ static int dm_resume(void *handle)
}
 
/* power on hardware */
-dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
+   dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
 
/* program HPD filter */
dc_resume(dm->dc);
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Use swap() instead of open coding it

2023-10-18 Thread Jiapeng Chong
Swap is a function interface that provides exchange function. To avoid
code duplication, we can use swap function.

./drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c:445:127-128: 
WARNING opportunity for swap().

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6903
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c 
b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
index 36baf35bb170..5cbb2db9dfd1 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
@@ -425,7 +425,6 @@ static void sort_pipes_for_splitting(struct 
dc_plane_pipe_pool *pipes)
 {
bool sorted, swapped;
unsigned int cur_index;
-   unsigned int temp;
int odm_slice_index;
 
for (odm_slice_index = 0; odm_slice_index < 
pipes->num_pipes_assigned_to_plane_for_odm_combine; odm_slice_index++) {
@@ -441,10 +440,7 @@ static void sort_pipes_for_splitting(struct 
dc_plane_pipe_pool *pipes)
swapped = false;
while (!sorted) {
if 
(pipes->pipes_assigned_to_plane[odm_slice_index][cur_index] > 
pipes->pipes_assigned_to_plane[odm_slice_index][cur_index + 1]) {
-   temp = 
pipes->pipes_assigned_to_plane[odm_slice_index][cur_index];
-   
pipes->pipes_assigned_to_plane[odm_slice_index][cur_index] = 
pipes->pipes_assigned_to_plane[odm_slice_index][cur_index + 1];
-   
pipes->pipes_assigned_to_plane[odm_slice_index][cur_index + 1] = temp;
-
+   
swap(pipes->pipes_assigned_to_plane[odm_slice_index][cur_index], 
pipes->pipes_assigned_to_plane[odm_slice_index][cur_index + 1]);
swapped = true;
}
 
-- 
2.20.1.7.g153144c



[PATCH] drm/amdkfd: clean up some inconsistent indenting

2023-10-12 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:305 svm_range_free() warn: 
inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6804
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index f4038b33c404..eef76190800c 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -302,7 +302,7 @@ static void svm_range_free(struct svm_range *prange, bool 
do_unmap)
for (gpuidx = 0; gpuidx < MAX_GPU_INSTANCE; gpuidx++) {
if (prange->dma_addr[gpuidx]) {
kvfree(prange->dma_addr[gpuidx]);
-   prange->dma_addr[gpuidx] = NULL;
+   prange->dma_addr[gpuidx] = NULL;
}
}
 
-- 
2.20.1.7.g153144c



[PATCH] drm/msm/a6xx: Remove some unused functions

2023-10-11 Thread Jiapeng Chong
These functions are defined in the a6xx_gpu_state.h file, but not called
elsewhere, so delete these unused functions.

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h:356:36: warning: ‘a7xx_ahb_reglist’ 
defined but not used.
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h:360:36: warning: 
‘a7xx_gbif_reglist’ defined but not used.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6785
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h 
b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h
index 8d7e6f26480a..76e021063732 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h
@@ -353,13 +353,6 @@ static const u32 a7xx_gbif_registers[] = {
0x3cc0, 0x3cd1,
 };
 
-static const struct a6xx_registers a7xx_ahb_reglist[] = {
-   REGS(a7xx_ahb_registers, 0, 0),
-};
-
-static const struct a6xx_registers a7xx_gbif_reglist =
-   REGS(a7xx_gbif_registers, 0, 0);
-
 static const u32 a6xx_gmu_gx_registers[] = {
/* GMU GX */
0x, 0x, 0x0010, 0x0013, 0x0016, 0x0016, 0x0018, 0x001b,
-- 
2.20.1.7.g153144c



[PATCH] drm/radeon/kms/atom: Remove redundant code

2023-09-28 Thread Jiapeng Chong
drivers/gpu/drm/radeon/atom.c:396 atom_skip_src_int() warn: ignoring 
unreachable code.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6713
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/radeon/atom.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index ceb6d772ef94..3082d08a06c2 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -393,7 +393,6 @@ static void atom_skip_src_int(atom_exec_context *ctx, 
uint8_t attr, int *ptr)
(*ptr)++;
return;
}
-   return;
}
 }
 
-- 
2.20.1.7.g153144c



[PATCH] alpha: clean up some inconsistent indenting

2023-09-14 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c:491 
dcn32_auto_dpm_test_log() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6574
Signed-off-by: Jiapeng Chong 
---
 .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c  | 72 +--
 1 file changed, 34 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
index 37ffa0050e60..e34b1d6dd964 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
@@ -460,25 +460,25 @@ static int dcn32_get_dispclk_from_dentist(struct clk_mgr 
*clk_mgr_base)
 
 static void dcn32_auto_dpm_test_log(struct dc_clocks *new_clocks, struct 
clk_mgr_internal *clk_mgr)
 {
-unsigned int dispclk_khz_reg= REG_READ(CLK1_CLK0_CURRENT_CNT); // 
DISPCLK
-unsigned int dppclk_khz_reg = REG_READ(CLK1_CLK1_CURRENT_CNT); // 
DPPCLK
-unsigned int dprefclk_khz_reg   = REG_READ(CLK1_CLK2_CURRENT_CNT); // 
DPREFCLK
-unsigned int dcfclk_khz_reg = REG_READ(CLK1_CLK3_CURRENT_CNT); // 
DCFCLK
-unsigned int dtbclk_khz_reg = REG_READ(CLK1_CLK4_CURRENT_CNT); // 
DTBCLK
-unsigned int fclk_khz_reg   = REG_READ(CLK4_CLK0_CURRENT_CNT); // FCLK
-
-// Overrides for these clocks in case there is no p_state change support
-int dramclk_khz_override = new_clocks->dramclk_khz;
-int fclk_khz_override = new_clocks->fclk_khz;
-
-int num_fclk_levels = 
clk_mgr->base.bw_params->clk_table.num_entries_per_clk.num_fclk_levels - 1;
-
-if (!new_clocks->p_state_change_support) {
-   dramclk_khz_override = clk_mgr->base.bw_params->max_memclk_mhz * 
1000;
-}
-if (!new_clocks->fclk_p_state_change_support) {
-   fclk_khz_override = 
clk_mgr->base.bw_params->clk_table.entries[num_fclk_levels].fclk_mhz * 1000;
-}
+   unsigned int dispclk_khz_reg= REG_READ(CLK1_CLK0_CURRENT_CNT); // 
DISPCLK
+   unsigned int dppclk_khz_reg = REG_READ(CLK1_CLK1_CURRENT_CNT); // 
DPPCLK
+   unsigned int dprefclk_khz_reg   = REG_READ(CLK1_CLK2_CURRENT_CNT); // 
DPREFCLK
+   unsigned int dcfclk_khz_reg = REG_READ(CLK1_CLK3_CURRENT_CNT); // 
DCFCLK
+   unsigned int dtbclk_khz_reg = REG_READ(CLK1_CLK4_CURRENT_CNT); // 
DTBCLK
+   unsigned int fclk_khz_reg   = REG_READ(CLK4_CLK0_CURRENT_CNT); // 
FCLK
+
+   // Overrides for these clocks in case there is no p_state change support
+   int dramclk_khz_override = new_clocks->dramclk_khz;
+   int fclk_khz_override = new_clocks->fclk_khz;
+
+   int num_fclk_levels = 
clk_mgr->base.bw_params->clk_table.num_entries_per_clk.num_fclk_levels - 1;
+
+   if (!new_clocks->p_state_change_support) {
+   dramclk_khz_override = clk_mgr->base.bw_params->max_memclk_mhz 
* 1000;
+   }
+   if (!new_clocks->fclk_p_state_change_support) {
+   fclk_khz_override = 
clk_mgr->base.bw_params->clk_table.entries[num_fclk_levels].fclk_mhz * 1000;
+   }
 


//  IMPORTANT:  When adding more clocks to these logs, do NOT 
put a newline
@@ -488,26 +488,22 @@ static void dcn32_auto_dpm_test_log(struct dc_clocks 
*new_clocks, struct clk_mgr
//
//  AutoDPMTest: clk1:%d - clk2:%d - 
clk3:%d - clk4:%d\n"


-   if (new_clocks &&
-   new_clocks->dramclk_khz > 0 &&
-   new_clocks->fclk_khz > 0 &&
-   new_clocks->dcfclk_khz > 0 &&
-   new_clocks->dppclk_khz > 0) {
-
+   if (new_clocks && new_clocks->dramclk_khz > 0 && new_clocks->fclk_khz > 
0 &&
+   new_clocks->dcfclk_khz > 0 && new_clocks->dppclk_khz > 0) {
DC_LOG_AUTO_DPM_TEST("AutoDPMTest: dramclk:%d - fclk:%d - "
-   "dcfclk:%d - dppclk:%d - dispclk_hw:%d - "
-   "dppclk_hw:%d - dprefclk_hw:%d - dcfclk_hw:%d - "
-   "dtbclk_hw:%d - fclk_hw:%d\n",
-   dramclk_khz_override,
-   fclk_khz_override,
-   new_clocks->dcfclk_khz,
-   new_clocks->dppclk_khz,
-   dispclk_khz_reg,
-   dppclk_khz_reg,
-   dprefclk_khz_reg,
-   dcfclk_khz_reg,
-   dtbclk_khz_reg,
-   fclk_khz_reg);
+ 

[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-09-08 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2476 
link_set_dpms_on() warn: if statement not indented.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6502
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index cd9dd270b05f..e7e528c68cb6 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2474,9 +2474,8 @@ void link_set_dpms_on(
 */
if (pipe_ctx->stream->timing.flags.DSC) {
if (dc_is_dp_signal(pipe_ctx->stream->signal) ||
-   dc_is_virtual_signal(pipe_ctx->stream->signal))
-   link_set_dsc_enable(pipe_ctx, true);
-
+   dc_is_virtual_signal(pipe_ctx->stream->signal))
+   link_set_dsc_enable(pipe_ctx, true);
}
 
status = enable_link(state, pipe_ctx);
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: clean up some inconsistent indenting

2023-09-01 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c:34 nbio_v7_11_get_rev_id() warn: 
inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6316
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c 
b/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c
index 7c08e5f95e97..76e21357dd4d 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c
@@ -31,10 +31,9 @@
 static u32 nbio_v7_11_get_rev_id(struct amdgpu_device *adev)
 {
u32 tmp;
- printk("%s, getid\n",__func__);
-
-   tmp = RREG32_SOC15(NBIO, 0, regRCC_STRAP1_RCC_DEV0_EPF0_STRAP0);
 
+   printk("%s, getid\n", __func__);
+   tmp = RREG32_SOC15(NBIO, 0, regRCC_STRAP1_RCC_DEV0_EPF0_STRAP0);
tmp &= RCC_STRAP0_RCC_DEV0_EPF0_STRAP0__STRAP_ATI_REV_ID_DEV0_F0_MASK;
tmp >>= 
RCC_STRAP0_RCC_DEV0_EPF0_STRAP0__STRAP_ATI_REV_ID_DEV0_F0__SHIFT;
 
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/pm: Fix unsigned expression compared with zero

2023-08-17 Thread Jiapeng Chong
The val is defined as unsigned int type, if(val<0) is invalid, modify
to int type.

drivers/gpu/drm/amd/amdgpu/../pm/amdgpu_pm.c:2813 
amdgpu_hwmon_show_power_input() warn: unsigned 'val' is never less than zero.
drivers/gpu/drm/amd/amdgpu/../pm/amdgpu_pm.c:2800 amdgpu_hwmon_show_power_avg() 
warn: unsigned 'val' is never less than zero.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6181
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c 
b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 5b1d73b00ef7..fe490e5860d2 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2794,7 +2794,7 @@ static ssize_t amdgpu_hwmon_show_power_avg(struct device 
*dev,
   struct device_attribute *attr,
   char *buf)
 {
-   unsigned int val;
+   int val;
 
val = amdgpu_hwmon_get_power(dev, AMDGPU_PP_SENSOR_GPU_AVG_POWER);
if (val < 0)
@@ -2807,7 +2807,7 @@ static ssize_t amdgpu_hwmon_show_power_input(struct 
device *dev,
 struct device_attribute *attr,
 char *buf)
 {
-   unsigned int val;
+   int val;
 
val = amdgpu_hwmon_get_power(dev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER);
if (val < 0)
-- 
2.20.1.7.g153144c



[PATCH] drm: manager: Remove the unused variable prev

2023-08-09 Thread Jiapeng Chong
Variable prev is not effectively used, so delete it.

drivers/gpu/drm/drm_gpuva_mgr.c:1079:32: warning: variable ‘prev’ set but not 
used.

Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/drm_gpuva_mgr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_gpuva_mgr.c b/drivers/gpu/drm/drm_gpuva_mgr.c
index f86bfad74ff8..afa5330445b3 100644
--- a/drivers/gpu/drm/drm_gpuva_mgr.c
+++ b/drivers/gpu/drm/drm_gpuva_mgr.c
@@ -1076,7 +1076,7 @@ __drm_gpuva_sm_map(struct drm_gpuva_manager *mgr,
   u64 req_addr, u64 req_range,
   struct drm_gem_object *req_obj, u64 req_offset)
 {
-   struct drm_gpuva *va, *next, *prev = NULL;
+   struct drm_gpuva *va, *next = NULL;
u64 req_end = req_addr + req_range;
int ret;
 
@@ -1206,7 +1206,6 @@ __drm_gpuva_sm_map(struct drm_gpuva_manager *mgr,
}
}
 next:
-   prev = va;
}
 
return op_map_cb(ops, priv,
-- 
2.20.1.7.g153144c



[PATCH] drm/msm/dpu: clean up some inconsistent indenting

2023-08-04 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:183 dpu_core_perf_crtc_check() 
warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6096
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index 0b54a659a940..1c0e7e5480e4 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -177,10 +177,10 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,
to_dpu_crtc_state(tmp_crtc->state);
 
DRM_DEBUG_ATOMIC("crtc:%d bw:%llu ctrl:%d\n",
-   tmp_crtc->base.id, tmp_cstate->new_perf.bw_ctl,
-   tmp_cstate->bw_control);
+tmp_crtc->base.id, 
tmp_cstate->new_perf.bw_ctl,
+tmp_cstate->bw_control);
 
-   bw_sum_of_intfs += tmp_cstate->new_perf.bw_ctl;
+   bw_sum_of_intfs += tmp_cstate->new_perf.bw_ctl;
}
 
/* convert bandwidth to kb */
-- 
2.20.1.7.g153144c



[PATCH] drm/ssd130x: clean up some inconsistent indenting

2023-07-31 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/solomon/ssd130x.c:715 ssd130x_primary_plane_duplicate_state() 
warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6034
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/solomon/ssd130x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/solomon/ssd130x.c 
b/drivers/gpu/drm/solomon/ssd130x.c
index 971c425340c1..5a80b228d18c 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -712,7 +712,7 @@ static struct drm_plane_state 
*ssd130x_primary_plane_duplicate_state(struct drm_
 
new_shadow_plane_state = _state->base;
 
-__drm_gem_duplicate_shadow_plane_state(plane, new_shadow_plane_state);
+   __drm_gem_duplicate_shadow_plane_state(plane, new_shadow_plane_state);
 
return _shadow_plane_state->base;
 }
-- 
2.20.1.7.g153144c



[PATCH] drm/nouveau: Remove the unused variable entry

2023-06-25 Thread Jiapeng Chong
Variable entry is not effectively used, so delete it.

drivers/gpu/drm/nouveau/nouveau_connector.c:1298:7: warning: variable 'entry' 
set but not used.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5596
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c 
b/drivers/gpu/drm/nouveau/nouveau_connector.c
index f75c6f09dd2a..3a267b793afa 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -1295,11 +1295,8 @@ nouveau_connector_create(struct drm_device *dev,
/* attempt to parse vbios connector type and hotplug gpio */
nv_connector->dcb = olddcb_conn(dev, index);
if (nv_connector->dcb) {
-   u32 entry = ROM16(nv_connector->dcb[0]);
-   if (olddcb_conntab(dev)[3] >= 4)
-   entry |= (u32)ROM16(nv_connector->dcb[2]) << 16;
-
nv_connector->type = nv_connector->dcb[0];
+
if (drm_conntype_from_dcb(nv_connector->type) ==
  DRM_MODE_CONNECTOR_Unknown) {
NV_WARN(drm, "unknown connector type %02x\n",
-- 
2.20.1.7.g153144c



[PATCH] drm/amdkfd: Switch over to memdup_user()

2023-06-13 Thread Jiapeng Chong
Use memdup_user() rather than duplicating its implementation. This is a
little bit restricted to reduce false positives.

./drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c:2813:13-20: WARNING 
opportunity for memdup_user.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5523
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index d6b15493fffd..637962d4083c 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -2810,12 +2810,9 @@ static uint32_t *get_queue_ids(uint32_t num_queues, 
uint32_t *usr_queue_id_array
if (!usr_queue_id_array)
return NULL;
 
-   queue_ids = kzalloc(array_size, GFP_KERNEL);
-   if (!queue_ids)
-   return ERR_PTR(-ENOMEM);
-
-   if (copy_from_user(queue_ids, usr_queue_id_array, array_size))
-   return ERR_PTR(-EFAULT);
+   queue_ids = memdup_user(usr_queue_id_array, array_size);
+   if (IS_ERR(queue_ids))
+   return PTR_ERR(queue_ids);
 
return queue_ids;
 }
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: clean up some inconsistent indenting

2023-06-02 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2377 
link_set_dpms_on() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5376
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c 
b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
index 2963267fe74a..f7f1a1586f3b 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2374,8 +2374,8 @@ void link_set_dpms_on(
}
}
 
-   if (dc_is_virtual_signal(pipe_ctx->stream->signal))
-   return;
+   if (dc_is_virtual_signal(pipe_ctx->stream->signal))
+   return;
 
link_enc = link_enc_cfg_get_link_enc(link);
ASSERT(link_enc);
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: clean up some inconsistent indenting

2023-06-02 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:614 amdgpu_gfx_enable_kcq() warn: 
inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5377
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index a33d4bc34cee..37a8f43cf281 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -611,8 +611,7 @@ int amdgpu_gfx_enable_kcq(struct amdgpu_device *adev, int 
xcc_id)
kiq->pmf->kiq_set_resources(kiq_ring, queue_mask);
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
j = i + xcc_id * adev->gfx.num_compute_rings;
-   kiq->pmf->kiq_map_queues(kiq_ring,
->gfx.compute_ring[j]);
+   kiq->pmf->kiq_map_queues(kiq_ring, >gfx.compute_ring[j]);
}
 
r = amdgpu_ring_test_helper(kiq_ring);
-- 
2.20.1.7.g153144c



[PATCH 2/2] drm/amd/display: clean up some inconsistent indenting

2023-05-24 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn321/dcn321_fpu.c:556 
dcn321_update_bw_bounding_box_fpu() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5304
Signed-off-by: Jiapeng Chong 
---
 .../amd/display/dc/dml/dcn321/dcn321_fpu.c| 242 +-
 1 file changed, 121 insertions(+), 121 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c
index ffd7c3c1b142..1aaff6f2d453 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c
@@ -553,148 +553,148 @@ void dcn321_update_bw_bounding_box_fpu(struct dc *dc, 
struct clk_bw_params *bw_p
dc->dml.soc.dispclk_dppclk_vco_speed_mhz = 
dc->clk_mgr->dentist_vco_freq_khz / 1000.0;
 
/* Overrides Clock levelsfrom CLK Mgr table entries as reported by PM 
FW */
-   if (dc->debug.use_legacy_soc_bb_mechanism) {
-   unsigned int i = 0, j = 0, num_states = 0;
-
-   unsigned int dcfclk_mhz[DC__VOLTAGE_STATES] = {0};
-   unsigned int dram_speed_mts[DC__VOLTAGE_STATES] = {0};
-   unsigned int 
optimal_uclk_for_dcfclk_sta_targets[DC__VOLTAGE_STATES] = {0};
-   unsigned int 
optimal_dcfclk_for_uclk[DC__VOLTAGE_STATES] = {0};
-
-   unsigned int dcfclk_sta_targets[DC__VOLTAGE_STATES] = 
{615, 906, 1324, 1564};
-   unsigned int num_dcfclk_sta_targets = 4, 
num_uclk_states = 0;
-   unsigned int max_dcfclk_mhz = 0, max_dispclk_mhz = 0, 
max_dppclk_mhz = 0, max_phyclk_mhz = 0;
-
-   for (i = 0; i < MAX_NUM_DPM_LVL; i++) {
-   if (bw_params->clk_table.entries[i].dcfclk_mhz 
> max_dcfclk_mhz)
-   max_dcfclk_mhz = 
bw_params->clk_table.entries[i].dcfclk_mhz;
-   if (bw_params->clk_table.entries[i].dispclk_mhz 
> max_dispclk_mhz)
-   max_dispclk_mhz = 
bw_params->clk_table.entries[i].dispclk_mhz;
-   if (bw_params->clk_table.entries[i].dppclk_mhz 
> max_dppclk_mhz)
-   max_dppclk_mhz = 
bw_params->clk_table.entries[i].dppclk_mhz;
-   if (bw_params->clk_table.entries[i].phyclk_mhz 
> max_phyclk_mhz)
-   max_phyclk_mhz = 
bw_params->clk_table.entries[i].phyclk_mhz;
-   }
-   if (!max_dcfclk_mhz)
-   max_dcfclk_mhz = 
dcn3_21_soc.clock_limits[0].dcfclk_mhz;
-   if (!max_dispclk_mhz)
-   max_dispclk_mhz = 
dcn3_21_soc.clock_limits[0].dispclk_mhz;
-   if (!max_dppclk_mhz)
-   max_dppclk_mhz = 
dcn3_21_soc.clock_limits[0].dppclk_mhz;
-   if (!max_phyclk_mhz)
-   max_phyclk_mhz = 
dcn3_21_soc.clock_limits[0].phyclk_mhz;
-
-   if (max_dcfclk_mhz > 
dcfclk_sta_targets[num_dcfclk_sta_targets-1]) {
-   // If max DCFCLK is greater than the max DCFCLK 
STA target, insert into the DCFCLK STA target array
-   dcfclk_sta_targets[num_dcfclk_sta_targets] = 
max_dcfclk_mhz;
-   num_dcfclk_sta_targets++;
-   } else if (max_dcfclk_mhz < 
dcfclk_sta_targets[num_dcfclk_sta_targets-1]) {
-   // If max DCFCLK is less than the max DCFCLK 
STA target, cap values and remove duplicates
-   for (i = 0; i < num_dcfclk_sta_targets; i++) {
-   if (dcfclk_sta_targets[i] > 
max_dcfclk_mhz) {
-   dcfclk_sta_targets[i] = 
max_dcfclk_mhz;
-   break;
-   }
+   if (dc->debug.use_legacy_soc_bb_mechanism) {
+   unsigned int i = 0, j = 0, num_states = 0;
+
+   unsigned int dcfclk_mhz[DC__VOLTAGE_STATES] = {0};
+   unsigned int dram_speed_mts[DC__VOLTAGE_STATES] = {0};
+   unsigned int 
optimal_uclk_for_dcfclk_sta_targets[DC__VOLTAGE_STATES] = {0};
+   unsigned int optimal_dcfclk_for_uclk[DC__VOLTAGE_STATES] = {0};
+
+   unsigned int dcfclk_sta_targets[DC__VOLTAGE_STATES] = {615, 
906, 1324, 1564};
+   unsigned int num_dcfclk_sta_targets = 4, num_uclk_states = 0;
+   unsigned int max_dcfclk_mhz = 0, max_dispclk_mhz = 0, 
max_dppclk_mhz = 0, max_phyclk_mhz = 0;
+
+   for (i = 0;

[PATCH 1/2] drm/amd/display: clean up some inconsistent indenting

2023-05-24 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/dcn314_fpu.c:269 
dcn314_update_bw_bounding_box_fpu() warn: inconsistent indenting.

Reported-by: Abaci Robot 
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5305
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
index 318b9c2bc9be..c9afddd11589 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
@@ -265,8 +265,7 @@ void dcn314_update_bw_bounding_box_fpu(struct dc *dc, 
struct clk_bw_params *bw_p
}
 
dcn20_patch_bounding_box(dc, _14_soc);
-
-   dml_init_instance(>dml, _14_soc, _14_ip, 
DML_PROJECT_DCN314);
+   dml_init_instance(>dml, _14_soc, _14_ip, 
DML_PROJECT_DCN314);
 }
 
 static bool is_dual_plane(enum surface_pixel_format format)
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu/vcn: Modify mismatched function name

2023-05-22 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c:374: warning: expecting prototype for 
vcn_v4_0_mc_resume_dpg_mode(). Prototype was for 
vcn_v4_0_3_mc_resume_dpg_mode() instead.
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c:631: warning: expecting prototype for 
vcn_v4_0_enable_clock_gating(). Prototype was for 
vcn_v4_0_3_enable_clock_gating() instead.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=5284
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
index 339842382a1e..5d67b8b8a3d6 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
@@ -362,7 +362,7 @@ static void vcn_v4_0_3_mc_resume(struct amdgpu_device 
*adev, int inst_idx)
 }
 
 /**
- * vcn_v4_0_mc_resume_dpg_mode - memory controller programming for dpg mode
+ * vcn_v4_0_3_mc_resume_dpg_mode - memory controller programming for dpg mode
  *
  * @adev: amdgpu_device pointer
  * @inst_idx: instance number index
@@ -620,7 +620,7 @@ static void vcn_v4_0_3_disable_clock_gating_dpg_mode(struct 
amdgpu_device *adev,
 }
 
 /**
- * vcn_v4_0_enable_clock_gating - enable VCN clock gating
+ * vcn_v4_0_3_enable_clock_gating - enable VCN clock gating
  *
  * @adev: amdgpu_device pointer
  * @inst_idx: instance number
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: Modify mismatched function name

2023-05-22 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:426: warning: expecting prototype for 
sdma_v4_4_2_gfx_stop(). Prototype was for sdma_v4_4_2_inst_gfx_stop() instead.
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:457: warning: expecting prototype for 
sdma_v4_4_2_rlc_stop(). Prototype was for sdma_v4_4_2_inst_rlc_stop() instead.
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:470: warning: expecting prototype for 
sdma_v4_4_2_page_stop(). Prototype was for sdma_v4_4_2_inst_page_stop() instead.
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:506: warning: expecting prototype for 
sdma_v4_4_2_ctx_switch_enable(). Prototype was for 
sdma_v4_4_2_inst_ctx_switch_enable() instead.
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:561: warning: expecting prototype for 
sdma_v4_4_2_enable(). Prototype was for sdma_v4_4_2_inst_enable() instead.
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:798: warning: expecting prototype for 
sdma_v4_4_2_rlc_resume(). Prototype was for sdma_v4_4_2_inst_rlc_resume() 
instead.
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c:814: warning: expecting prototype for 
sdma_v4_4_2_load_microcode(). Prototype was for 
sdma_v4_4_2_inst_load_microcode() instead.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=5283
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
index bf47eb33c12e..590b08585901 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
@@ -415,7 +415,7 @@ static void sdma_v4_4_2_ring_emit_fence(struct amdgpu_ring 
*ring, u64 addr, u64
 
 
 /**
- * sdma_v4_4_2_gfx_stop - stop the gfx async dma engines
+ * sdma_v4_4_2_inst_gfx_stop - stop the gfx async dma engines
  *
  * @adev: amdgpu_device pointer
  *
@@ -446,7 +446,7 @@ static void sdma_v4_4_2_inst_gfx_stop(struct amdgpu_device 
*adev,
 }
 
 /**
- * sdma_v4_4_2_rlc_stop - stop the compute async dma engines
+ * sdma_v4_4_2_inst_rlc_stop - stop the compute async dma engines
  *
  * @adev: amdgpu_device pointer
  *
@@ -459,7 +459,7 @@ static void sdma_v4_4_2_inst_rlc_stop(struct amdgpu_device 
*adev,
 }
 
 /**
- * sdma_v4_4_2_page_stop - stop the page async dma engines
+ * sdma_v4_4_2_inst_page_stop - stop the page async dma engines
  *
  * @adev: amdgpu_device pointer
  *
@@ -494,7 +494,7 @@ static void sdma_v4_4_2_inst_page_stop(struct amdgpu_device 
*adev,
 }
 
 /**
- * sdma_v4_4_2_ctx_switch_enable - stop the async dma engines context switch
+ * sdma_v4_4_2_inst_ctx_switch_enable - stop the async dma engines context 
switch
  *
  * @adev: amdgpu_device pointer
  * @enable: enable/disable the DMA MEs context switch.
@@ -548,7 +548,7 @@ static void sdma_v4_4_2_inst_ctx_switch_enable(struct 
amdgpu_device *adev,
 }
 
 /**
- * sdma_v4_4_2_enable - stop the async dma engines
+ * sdma_v4_4_2_inst_enable - stop the async dma engines
  *
  * @adev: amdgpu_device pointer
  * @enable: enable/disable the DMA MEs.
@@ -786,7 +786,7 @@ static void sdma_v4_4_2_init_pg(struct amdgpu_device *adev)
 }
 
 /**
- * sdma_v4_4_2_rlc_resume - setup and start the async dma engines
+ * sdma_v4_4_2_inst_rlc_resume - setup and start the async dma engines
  *
  * @adev: amdgpu_device pointer
  *
@@ -802,7 +802,7 @@ static int sdma_v4_4_2_inst_rlc_resume(struct amdgpu_device 
*adev,
 }
 
 /**
- * sdma_v4_4_2_load_microcode - load the sDMA ME ucode
+ * sdma_v4_4_2_inst_load_microcode - load the sDMA ME ucode
  *
  * @adev: amdgpu_device pointer
  *
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: Remove duplicate include

2023-05-22 Thread Jiapeng Chong
./drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c: amdgpu_xcp.h is included more than 
once.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=5281
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index e5cfb3adb3b3..7fb2d38b010a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -23,7 +23,6 @@
 #include 
 
 #include "amdgpu.h"
-#include "amdgpu_xcp.h"
 #include "amdgpu_gfx.h"
 #include "soc15.h"
 #include "soc15d.h"
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Simplify the calculation of variables

2023-05-12 Thread Jiapeng Chong
./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:586:37-39: WARNING !A || A 
&& B is equivalent to !A || B.
./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:595:37-39: WARNING !A || A 
&& B is equivalent to !A || B.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4941
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
index 4950eaa4406b..2de910e0ce75 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
@@ -583,8 +583,8 @@ void dcn32_update_force_pstate(struct dc *dc, struct 
dc_state *context)
struct pipe_ctx *pipe = >res_ctx.pipe_ctx[i];
struct hubp *hubp = pipe->plane_res.hubp;
 
-   if (!pipe->stream || (pipe->stream && 
!(pipe->stream->mall_stream_config.type == SUBVP_MAIN ||
-   pipe->stream->fpo_in_use))) {
+   if (!pipe->stream || !(pipe->stream->mall_stream_config.type == 
SUBVP_MAIN ||
+   pipe->stream->fpo_in_use)) {
if (hubp && 
hubp->funcs->hubp_update_force_pstate_disallow)

hubp->funcs->hubp_update_force_pstate_disallow(hubp, false);
}
@@ -592,7 +592,7 @@ void dcn32_update_force_pstate(struct dc *dc, struct 
dc_state *context)
/* Today only FPO uses cursor P-State force. Only clear cursor 
P-State force
 * if it's not FPO.
 */
-   if (!pipe->stream || (pipe->stream && 
!pipe->stream->fpo_in_use)) {
+   if (!pipe->stream || !pipe->stream->fpo_in_use) {
if (hubp && 
hubp->funcs->hubp_update_force_cursor_pstate_disallow)

hubp->funcs->hubp_update_force_cursor_pstate_disallow(hubp, false);
}
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: Remove the unused variable golden_settings_gc_9_4_3

2023-05-06 Thread Jiapeng Chong
Variable golden_settings_gc_9_4_3 is not effectively used, so delete it.

drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:48:38: warning: 
‘golden_settings_gc_9_4_3’ defined but not used.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4877
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index 312491455382..74be46d382f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -45,10 +45,6 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
 #define GFX9_MEC_HPD_SIZE 4096
 #define RLCG_UCODE_LOADING_START_ADDRESS 0x2000L
 
-static const struct soc15_reg_golden golden_settings_gc_9_4_3[] = {
-
-};
-
 static void gfx_v9_4_3_set_ring_funcs(struct amdgpu_device *adev);
 static void gfx_v9_4_3_set_irq_funcs(struct amdgpu_device *adev);
 static void gfx_v9_4_3_set_gds_init(struct amdgpu_device *adev);
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: remove unneeded semicolon

2023-05-05 Thread Jiapeng Chong
No functional modification involved.

./drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c:146:2-3: Unneeded semicolon.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4871
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c 
b/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c
index 24d12075ca3a..a331a59c49e3 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c
@@ -143,7 +143,7 @@ static void nbio_v7_9_sdma_doorbell_range(struct 
amdgpu_device *adev, int instan
break;
default:
break;
-   };
+   }
 
return;
 }
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Clean up some inconsistent indenting

2023-03-21 Thread Jiapeng Chong
No functional modification involved.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4585
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c 
b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
index fa469de3e935..0d3a983cb9ec 100644
--- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
+++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
@@ -758,8 +758,8 @@ bool dmcu_load_iram(struct dmcu *dmcu,
 
if (dmcu->dmcu_version.abm_version == 0x24) {
fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params, 
true);
-   result = dmcu->funcs->load_iram(
-   dmcu, 0, (char *)(_table), 
IRAM_RESERVE_AREA_START_V2_2);
+   result = dmcu->funcs->load_iram(dmcu, 0, (char *)(_table),
+   IRAM_RESERVE_AREA_START_V2_2);
} else if (dmcu->dmcu_version.abm_version == 0x23) {
fill_iram_v_2_3((struct iram_table_v_2_2 *)ram_table, params, 
true);
 
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Remove the unused variable dppclk_delay_subtotal

2023-03-21 Thread Jiapeng Chong
Variable dppclk_delay_subtotal is not effectively used, so delete it.

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/display_rq_dlg_calc_314.c:1004:15:
 warning: variable 'dppclk_delay_subtotal' set but not used.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4584
Signed-off-by: Jiapeng Chong 
---
 .../display/dc/dml/dcn314/display_rq_dlg_calc_314.c| 10 --
 1 file changed, 10 deletions(-)

diff --git 
a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c
index 6576b897a512..d1c2693a2e28 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c
@@ -1001,7 +1001,6 @@ static void dml_rq_dlg_get_dlg_params(
unsigned int vupdate_width;
unsigned int vready_offset;
 
-   unsigned int dppclk_delay_subtotal;
unsigned int dispclk_delay_subtotal;
 
unsigned int vstartup_start;
@@ -1130,17 +1129,8 @@ static void dml_rq_dlg_get_dlg_params(
vupdate_offset = dst->vupdate_offset;
vupdate_width = dst->vupdate_width;
vready_offset = dst->vready_offset;
-
-   dppclk_delay_subtotal = mode_lib->ip.dppclk_delay_subtotal;
dispclk_delay_subtotal = mode_lib->ip.dispclk_delay_subtotal;
 
-   if (scl_enable)
-   dppclk_delay_subtotal += mode_lib->ip.dppclk_delay_scl;
-   else
-   dppclk_delay_subtotal += mode_lib->ip.dppclk_delay_scl_lb_only;
-
-   dppclk_delay_subtotal += mode_lib->ip.dppclk_delay_cnvc_formatter + 
src->num_cursors * mode_lib->ip.dppclk_delay_cnvc_cursor;
-
if (dout->dsc_enable) {
double dsc_delay = get_dsc_delay(mode_lib, e2e_pipe_param, 
num_pipes, pipe_idx); // FROM VBA
 
-- 
2.20.1.7.g153144c



[PATCH] drm/shmem-helper: Remove duplicate include

2023-03-19 Thread Jiapeng Chong
./drivers/gpu/drm/drm_gem_shmem_helper.c: linux/module.h is included more than 
once.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4567
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/drm_gem_shmem_helper.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c 
b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 4ea6507a77e5..f401df26facf 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #ifdef CONFIG_X86
 #include 
-- 
2.20.1.7.g153144c



[PATCH 2/2] drm/amd/display: Remove the unused function link_timing_bandwidth_kbps()

2023-03-16 Thread Jiapeng Chong
The function link_timing_bandwidth_kbps is defined in the
link_validation.c file, but not called elsewhere, so remove this unused
function.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_validation.c:258:10: 
warning: no previous prototype for ‘link_timing_bandwidth_kbps’.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4547
Signed-off-by: Jiapeng Chong 
---
 .../drm/amd/display/dc/link/link_validation.c | 51 ---
 1 file changed, 51 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_validation.c 
b/drivers/gpu/drm/amd/display/dc/link/link_validation.c
index 9a5010f86003..afbd22631721 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_validation.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_validation.c
@@ -255,57 +255,6 @@ uint32_t dp_link_bandwidth_kbps(
return link_rate_per_lane_kbps * link_settings->lane_count / 1 * 
total_data_bw_efficiency_x1;
 }
 
-uint32_t link_timing_bandwidth_kbps(const struct dc_crtc_timing *timing)
-{
-   uint32_t bits_per_channel = 0;
-   uint32_t kbps;
-
-   if (timing->flags.DSC)
-   return dc_dsc_stream_bandwidth_in_kbps(timing,
-   timing->dsc_cfg.bits_per_pixel,
-   timing->dsc_cfg.num_slices_h,
-   timing->dsc_cfg.is_dp);
-
-   switch (timing->display_color_depth) {
-   case COLOR_DEPTH_666:
-   bits_per_channel = 6;
-   break;
-   case COLOR_DEPTH_888:
-   bits_per_channel = 8;
-   break;
-   case COLOR_DEPTH_101010:
-   bits_per_channel = 10;
-   break;
-   case COLOR_DEPTH_121212:
-   bits_per_channel = 12;
-   break;
-   case COLOR_DEPTH_141414:
-   bits_per_channel = 14;
-   break;
-   case COLOR_DEPTH_161616:
-   bits_per_channel = 16;
-   break;
-   default:
-   ASSERT(bits_per_channel != 0);
-   bits_per_channel = 8;
-   break;
-   }
-
-   kbps = timing->pix_clk_100hz / 10;
-   kbps *= bits_per_channel;
-
-   if (timing->flags.Y_ONLY != 1) {
-   /*Only YOnly make reduce bandwidth by 1/3 compares to RGB*/
-   kbps *= 3;
-   if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
-   kbps /= 2;
-   else if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR422)
-   kbps = kbps * 2 / 3;
-   }
-
-   return kbps;
-}
-
 static bool dp_validate_mode_timing(
struct dc_link *link,
const struct dc_crtc_timing *timing)
-- 
2.20.1.7.g153144c



[PATCH 1/2] drm/amd/display: make is_synaptics_cascaded_panamera static

2023-03-16 Thread Jiapeng Chong
This symbol is not used outside of amdgpu_dm_mst_types.c, so marks it
static.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:211:6: 
warning: no previous prototype for ‘is_synaptics_cascaded_panamera’.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4548
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 6378352346c8..994ba426ca66 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -208,7 +208,7 @@ bool needs_dsc_aux_workaround(struct dc_link *link)
return false;
 }
 
-bool is_synaptics_cascaded_panamera(struct dc_link *link, struct 
drm_dp_mst_port *port)
+static bool is_synaptics_cascaded_panamera(struct dc_link *link, struct 
drm_dp_mst_port *port)
 {
u8 branch_vendor_data[4] = { 0 }; // Vendor data 0x50C ~ 0x50F
 
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: Remove useless else if

2023-03-08 Thread Jiapeng Chong
The assignment of the else and if branches is the same, so the if else
here is redundant, so we remove it.

./drivers/gpu/drm/amd/amdgpu/nv.c:1048:2-4: WARNING: possible condition with no 
effect (if == else).

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4454
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 855d390c41de..84803929f7d9 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -1045,19 +1045,11 @@ static int nv_common_late_init(void *handle)
 
if (amdgpu_sriov_vf(adev)) {
xgpu_nv_mailbox_get_irq(adev);
-   if (adev->vcn.harvest_config & AMDGPU_VCN_HARVEST_VCN0) {
-   amdgpu_virt_update_sriov_video_codec(adev,
-
sriov_sc_video_codecs_encode_array,
-
ARRAY_SIZE(sriov_sc_video_codecs_encode_array),
-
sriov_sc_video_codecs_decode_array_vcn1,
-
ARRAY_SIZE(sriov_sc_video_codecs_decode_array_vcn1));
-   } else {
-   amdgpu_virt_update_sriov_video_codec(adev,
-
sriov_sc_video_codecs_encode_array,
-
ARRAY_SIZE(sriov_sc_video_codecs_encode_array),
-
sriov_sc_video_codecs_decode_array_vcn1,
-
ARRAY_SIZE(sriov_sc_video_codecs_decode_array_vcn1));
-   }
+   amdgpu_virt_update_sriov_video_codec(adev,
+
sriov_sc_video_codecs_encode_array,
+
ARRAY_SIZE(sriov_sc_video_codecs_encode_array),
+
sriov_sc_video_codecs_decode_array_vcn1,
+
ARRAY_SIZE(sriov_sc_video_codecs_decode_array_vcn1));
}
 
return 0;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Use swap() instead of open coding it

2023-03-08 Thread Jiapeng Chong
Swap is a function interface that provides exchange function. To avoid
code duplication, we can use swap function.

./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:359:57-58: WARNING 
opportunity for swap().

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4448
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++--
 1 file changed, 2 insertions(+), 6 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 ae994c6c65ac..f6d9bbce15b2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -352,13 +352,9 @@ static inline void reverse_planes_order(struct 
dc_surface_update *array_of_surfa
int planes_count)
 {
int i, j;
-   struct dc_surface_update surface_updates_temp;
 
-   for (i = 0, j = planes_count - 1; i < j; i++, j--) {
-   surface_updates_temp = array_of_surface_update[i];
-   array_of_surface_update[i] = array_of_surface_update[j];
-   array_of_surface_update[j] = surface_updates_temp;
-   }
+   for (i = 0, j = planes_count - 1; i < j; i++, j--)
+   swap(array_of_surface_update[i], array_of_surface_update[j]);
 }
 
 /**
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: make umc_v8_10_convert_error_address static

2023-02-26 Thread Jiapeng Chong
This symbol is not used outside of umc_v8_10.c, so marks it static.

drivers/gpu/drm/amd/amdgpu/umc_v8_10.c:212:6: warning: no previous prototype 
for function 'umc_v8_10_convert_error_address'.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4230
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/umc_v8_10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v8_10.c 
b/drivers/gpu/drm/amd/amdgpu/umc_v8_10.c
index 66158219f791..048ab4202e9f 100644
--- a/drivers/gpu/drm/amd/amdgpu/umc_v8_10.c
+++ b/drivers/gpu/drm/amd/amdgpu/umc_v8_10.c
@@ -209,7 +209,7 @@ static int umc_v8_10_swizzle_mode_na_to_pa(struct 
amdgpu_device *adev,
return 0;
 }
 
-void umc_v8_10_convert_error_address(struct amdgpu_device *adev,
+static void umc_v8_10_convert_error_address(struct amdgpu_device *adev,
struct ras_err_data *err_data, uint64_t 
err_addr,
uint32_t ch_inst, uint32_t umc_inst,
uint32_t node_inst, uint64_t mc_umc_status)
-- 
2.20.1.7.g153144c



[PATCH v2] drm/gma500: Clean up some inconsistent indenting

2023-02-23 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/gma500/cdv_device.c:218 cdv_errata() warn: inconsistent 
indenting.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4126
Signed-off-by: Jiapeng Chong 
---
Changes in v2:
  -Change the subject.

 drivers/gpu/drm/gma500/cdv_device.c | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_device.c 
b/drivers/gpu/drm/gma500/cdv_device.c
index 3e83299113e3..1349ea787ae7 100644
--- a/drivers/gpu/drm/gma500/cdv_device.c
+++ b/drivers/gpu/drm/gma500/cdv_device.c
@@ -78,7 +78,8 @@ static u32 cdv_get_max_backlight(struct drm_device *dev)
if (max == 0) {
DRM_DEBUG_KMS("LVDS Panel PWM value is 0!\n");
/* i915 does this, I believe which means that we should not
-* smash PWM control as firmware will take control of it. */
+* smash PWM control as firmware will take control of it.
+*/
return 1;
}
 
@@ -149,6 +150,7 @@ static inline u32 CDV_MSG_READ32(int domain, uint port, 
uint offset)
int mcr = (0x10<<24) | (port << 16) | (offset << 8);
uint32_t ret_val = 0;
struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
+
pci_write_config_dword(pci_root, 0xD0, mcr);
pci_read_config_dword(pci_root, 0xD4, _val);
pci_dev_put(pci_root);
@@ -160,6 +162,7 @@ static inline void CDV_MSG_WRITE32(int domain, uint port, 
uint offset,
 {
int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
+
pci_write_config_dword(pci_root, 0xD4, value);
pci_write_config_dword(pci_root, 0xD0, mcr);
pci_dev_put(pci_root);
@@ -180,10 +183,8 @@ static void cdv_init_pm(struct drm_device *dev)
int domain = pci_domain_nr(pdev->bus);
int i;
 
-   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
-   PSB_APMBA) & 0x;
-   dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
-   PSB_OSPMBA) & 0x;
+   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT, PSB_APMBA) 
& 0x;
+   dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT, 
PSB_OSPMBA) & 0x;
 
/* Power status */
pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
@@ -196,6 +197,7 @@ static void cdv_init_pm(struct drm_device *dev)
/* Wait for the GPU power */
for (i = 0; i < 5; i++) {
u32 pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
+
if ((pwr_sts & PSB_PWRGT_GFX_MASK) == 0)
return;
udelay(10);
@@ -215,7 +217,7 @@ static void cdv_errata(struct drm_device *dev)
 *  Bonus Launch to work around the issue, by degrading
 *  performance.
 */
-CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
+   CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
 }
 
 /**
@@ -401,20 +403,22 @@ static int cdv_power_up(struct drm_device *dev)
 
 static void cdv_hotplug_work_func(struct work_struct *work)
 {
-struct drm_psb_private *dev_priv = container_of(work, struct 
drm_psb_private,
+   struct drm_psb_private *dev_priv = container_of(work, struct 
drm_psb_private,
hotplug_work);
struct drm_device *dev = _priv->dev;
 
-/* Just fire off a uevent and let userspace tell us what to do */
-drm_helper_hpd_irq_event(dev);
+   /* Just fire off a uevent and let userspace tell us what to do */
+   drm_helper_hpd_irq_event(dev);
 }
 
 /* The core driver has received a hotplug IRQ. We are in IRQ context
-   so extract the needed information and kick off queued processing */
+ * so extract the needed information and kick off queued processing
+ */
 
 static int cdv_hotplug_event(struct drm_device *dev)
 {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
+
schedule_work(_priv->hotplug_work);
REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT));
return 1;
@@ -424,6 +428,7 @@ static void cdv_hotplug_enable(struct drm_device *dev, bool 
on)
 {
if (on) {
u32 hotplug = REG_READ(PORT_HOTPLUG_EN);
+
hotplug |= HDMIB_HOTPLUG_INT_EN | HDMIC_HOTPLUG_INT_EN |
   HDMID_HOTPLUG_INT_EN | CRT_HOTPLUG_INT_EN;
REG_WRITE(PORT_HOTPLUG_EN, hotplug);
@@ -549,6 +554,7 @@ static const struct psb_offset cdv_regmap[2] = {
 static int cdv_chip_setup(struct drm_device *dev)
 {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
+
I

[PATCH] drm/amd/display: Clean up some inconsistent indenting

2023-02-20 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/gma500/cdv_device.c:218 cdv_errata() warn: inconsistent 
indenting.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4126
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/gma500/cdv_device.c | 27 ---
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_device.c 
b/drivers/gpu/drm/gma500/cdv_device.c
index 3e83299113e3..765f359365b9 100644
--- a/drivers/gpu/drm/gma500/cdv_device.c
+++ b/drivers/gpu/drm/gma500/cdv_device.c
@@ -78,7 +78,8 @@ static u32 cdv_get_max_backlight(struct drm_device *dev)
if (max == 0) {
DRM_DEBUG_KMS("LVDS Panel PWM value is 0!\n");
/* i915 does this, I believe which means that we should not
-* smash PWM control as firmware will take control of it. */
+* smash PWM control as firmware will take control of it.
+*/
return 1;
}
 
@@ -149,6 +150,7 @@ static inline u32 CDV_MSG_READ32(int domain, uint port, 
uint offset)
int mcr = (0x10<<24) | (port << 16) | (offset << 8);
uint32_t ret_val = 0;
struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
+
pci_write_config_dword(pci_root, 0xD0, mcr);
pci_read_config_dword(pci_root, 0xD4, _val);
pci_dev_put(pci_root);
@@ -160,6 +162,7 @@ static inline void CDV_MSG_WRITE32(int domain, uint port, 
uint offset,
 {
int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
+
pci_write_config_dword(pci_root, 0xD4, value);
pci_write_config_dword(pci_root, 0xD0, mcr);
pci_dev_put(pci_root);
@@ -180,10 +183,8 @@ static void cdv_init_pm(struct drm_device *dev)
int domain = pci_domain_nr(pdev->bus);
int i;
 
-   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
-   PSB_APMBA) & 0x;
-   dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
-   PSB_OSPMBA) & 0x;
+   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT, PSB_APMBA) 
& 0x;
+   dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT, 
PSB_OSPMBA) & 0x;
 
/* Power status */
pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
@@ -196,6 +197,7 @@ static void cdv_init_pm(struct drm_device *dev)
/* Wait for the GPU power */
for (i = 0; i < 5; i++) {
u32 pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
+
if ((pwr_sts & PSB_PWRGT_GFX_MASK) == 0)
return;
udelay(10);
@@ -215,7 +217,7 @@ static void cdv_errata(struct drm_device *dev)
 *  Bonus Launch to work around the issue, by degrading
 *  performance.
 */
-CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
+   CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
 }
 
 /**
@@ -401,20 +403,21 @@ static int cdv_power_up(struct drm_device *dev)
 
 static void cdv_hotplug_work_func(struct work_struct *work)
 {
-struct drm_psb_private *dev_priv = container_of(work, struct 
drm_psb_private,
+   struct drm_psb_private *dev_priv = container_of(work, struct 
drm_psb_private,
hotplug_work);
struct drm_device *dev = _priv->dev;
 
-/* Just fire off a uevent and let userspace tell us what to do */
-drm_helper_hpd_irq_event(dev);
+   /* Just fire off a uevent and let userspace tell us what to do */
+   drm_helper_hpd_irq_event(dev);
 }
 
 /* The core driver has received a hotplug IRQ. We are in IRQ context
-   so extract the needed information and kick off queued processing */
-
+ * so extract the needed information and kick off queued processing
+ */
 static int cdv_hotplug_event(struct drm_device *dev)
 {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
+
schedule_work(_priv->hotplug_work);
REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT));
return 1;
@@ -424,6 +427,7 @@ static void cdv_hotplug_enable(struct drm_device *dev, bool 
on)
 {
if (on) {
u32 hotplug = REG_READ(PORT_HOTPLUG_EN);
+
hotplug |= HDMIB_HOTPLUG_INT_EN | HDMIC_HOTPLUG_INT_EN |
   HDMID_HOTPLUG_INT_EN | CRT_HOTPLUG_INT_EN;
REG_WRITE(PORT_HOTPLUG_EN, hotplug);
@@ -549,6 +553,7 @@ static const struct psb_offset cdv_regmap[2] = {
 static int cdv_chip_setup(struct drm_device *dev)
 {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
+
INIT_WORK(_priv->hotplug_work, cdv_hotplug_work_func);
 
dev_priv->use_msi = true;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Modify mismatched function name

2023-02-16 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_detection.c:1199: warning: 
expecting prototype for dc_link_detect_connection_type(). Prototype was for 
link_detect_connection_type() instead.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4103
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_detection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c 
b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
index 38216c789d77..5394d8a6087a 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
@@ -1189,7 +1189,7 @@ static bool detect_link_and_local_sink(struct dc_link 
*link,
 }
 
 /**
- * dc_link_detect_connection_type() - Determine if there is a sink connected
+ * link_detect_connection_type() - Determine if there is a sink connected
  *
  * @type: Returned connection type
  * Does not detect downstream devices, such as MST sinks
-- 
2.20.1.7.g153144c



[PATCH] habanalabs: make some functions static

2023-02-16 Thread Jiapeng Chong
These functions are not used outside the file device.c, so the
modification is defined as static.

drivers/accel/habanalabs/common/device.c:2641:6: warning: no previous prototype 
for ‘hl_capture_fw_err’.
drivers/accel/habanalabs/common/device.c:2619:6: warning: no previous prototype 
for ‘hl_capture_hw_err’.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4098
Signed-off-by: Jiapeng Chong 
---
 drivers/accel/habanalabs/common/device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/accel/habanalabs/common/device.c 
b/drivers/accel/habanalabs/common/device.c
index fefe70bbbede..a5f5ee102823 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -2616,7 +2616,7 @@ void hl_handle_page_fault(struct hl_device *hdev, u64 
addr, u16 eng_id, bool is_
*event_mask |=  HL_NOTIFIER_EVENT_PAGE_FAULT;
 }
 
-void hl_capture_hw_err(struct hl_device *hdev, u16 event_id)
+static void hl_capture_hw_err(struct hl_device *hdev, u16 event_id)
 {
struct hw_err_info *info = >captured_err_info.hw_err;
 
@@ -2638,7 +2638,7 @@ void hl_handle_critical_hw_err(struct hl_device *hdev, 
u16 event_id, u64 *event_
*event_mask |= HL_NOTIFIER_EVENT_CRITICL_HW_ERR;
 }
 
-void hl_capture_fw_err(struct hl_device *hdev, struct hl_info_fw_err_info 
*fw_info)
+static void hl_capture_fw_err(struct hl_device *hdev, struct 
hl_info_fw_err_info *fw_info)
 {
struct fw_err_info *info = >captured_err_info.fw_err;
 
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Remove the unused variable pre_connection_type

2023-02-09 Thread Jiapeng Chong
Variable pre_connection_type is not effectively used, so delete it.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4031
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_detection.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c 
b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
index 63e75c392031..d224a44c4cc8 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
@@ -886,7 +886,6 @@ static bool detect_link_and_local_sink(struct dc_link *link,
struct dc_sink *prev_sink = NULL;
struct dpcd_caps prev_dpcd_caps;
enum dc_connection_type new_connection_type = dc_connection_none;
-   enum dc_connection_type pre_connection_type = dc_connection_none;
const uint32_t post_oui_delay = 30; // 30ms
 
DC_LOGGER_INIT(link->ctx->logger);
@@ -923,7 +922,6 @@ static bool detect_link_and_local_sink(struct dc_link *link,
 
link_disconnect_sink(link);
if (new_connection_type != dc_connection_none) {
-   pre_connection_type = link->type;
link->type = new_connection_type;
link->link_state_valid = false;
 
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Remove the unused variable ds_port

2023-02-09 Thread Jiapeng Chong
Variable ds_port is not effectively used, so delete it.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c:280:35:
 warning: variable ‘ds_port’ set but not used.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4030
Signed-off-by: Jiapeng Chong 
---
 .../drm/amd/display/dc/link/protocols/link_dp_capability.c| 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c 
b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
index 24d356ebd7a9..816bf4ff8017 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
@@ -277,7 +277,6 @@ static void dp_wa_power_up_0010FA(struct dc_link *link, 
uint8_t *dpcd_data,
int length)
 {
int retry = 0;
-   union dp_downstream_port_present ds_port = { 0 };
 
if (!link->dpcd_caps.dpcd_rev.raw) {
do {
@@ -290,9 +289,6 @@ static void dp_wa_power_up_0010FA(struct dc_link *link, 
uint8_t *dpcd_data,
} while (retry++ < 4 && !link->dpcd_caps.dpcd_rev.raw);
}
 
-   ds_port.byte = dpcd_data[DP_DOWNSTREAMPORT_PRESENT -
-DP_DPCD_REV];
-
if (link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_VGA_CONVERTER) {
switch (link->dpcd_caps.branch_dev_id) {
/* 0010FA active dongles (DP-VGA, DP-DLDVI converters) power 
down
-- 
2.20.1.7.g153144c



[PATCH] drm/rockchip: dsi: Remove the unused function dsi_read()

2023-02-07 Thread Jiapeng Chong
The function dsi_read is defined in the dw-mipi-dsi-rockchip.c file, but
not called elsewhere, so remove this unused function.

drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:362:19: warning: unused 
function 'dsi_read'.

Reported-by: Abaci Robot 
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3984
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 7901c3babc8c..917e79951aac 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -359,11 +359,6 @@ static inline void dsi_write(struct dw_mipi_dsi_rockchip 
*dsi, u32 reg, u32 val)
writel(val, dsi->base + reg);
 }
 
-static inline u32 dsi_read(struct dw_mipi_dsi_rockchip *dsi, u32 reg)
-{
-   return readl(dsi->base + reg);
-}
-
 static void dw_mipi_dsi_phy_write(struct dw_mipi_dsi_rockchip *dsi,
  u8 test_code,
  u8 test_data)
-- 
2.20.1.7.g153144c



[PATCH v3] drm/msm/dpu: add the regdma entries to .dma_cfg of these chipsets

2023-01-18 Thread Jiapeng Chong
Variables 'sc8280xp_regdma' and 'sm8350_regdma' are defined in the
dpu_hw_catalog.c file, but not used elsewhere, so adding the regdma
entries to .dma_cfg of these chipsets.

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:2029:37: warning: unused
variable 'sc8280xp_regdma'.
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:2053:37: warning: unused
variable 'sm8350_regdma'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3722
Fixes: 4a352c2fc15a ("drm/msm/dpu: Introduce SC8280XP")
Fixes: 0e91bcbb0016 ("drm/msm/dpu: Add SM8350 to hw catalog")
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
Changes in v3:
  -Add Fixes tag and change the title.

 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
index 0f3da480b066..3318e1d18a0e 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
@@ -2677,6 +2677,8 @@ static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = {
.intf = sc8280xp_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif,
+   .reg_dma_count = 1,
+   .dma_cfg = _regdma,
.perf = _perf_data,
.mdss_irqs = IRQ_SC8280XP_MASK,
 };
@@ -2732,7 +2734,7 @@ static const struct dpu_mdss_cfg sm8350_dpu_cfg = {
.vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif,
.reg_dma_count = 1,
-   .dma_cfg = _regdma,
+   .dma_cfg = _regdma,
.perf = _perf_data,
.mdss_irqs = IRQ_SM8350_MASK,
 };
-- 
2.20.1.7.g153144c



[PATCH v2] drm/msm/dpu: Remove some unused variables

2023-01-18 Thread Jiapeng Chong
Variables 'sc8280xp_regdma' and 'sm8350_regdma' are defined in the
dpu_hw_catalog.c file, but not used elsewhere, so remove these unused
variables.

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:2029:37: warning: unused
variable 'sc8280xp_regdma'.
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:2053:37: warning: unused
variable 'sm8350_regdma'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3722
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
Changes in v2:
  -Adding the regdma entries to .dma_cfg of these chipsets.

 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
index 0f3da480b066..3318e1d18a0e 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
@@ -2677,6 +2677,8 @@ static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = {
.intf = sc8280xp_intf,
.vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif,
+   .reg_dma_count = 1,
+   .dma_cfg = _regdma,
.perf = _perf_data,
.mdss_irqs = IRQ_SC8280XP_MASK,
 };
@@ -2732,7 +2734,7 @@ static const struct dpu_mdss_cfg sm8350_dpu_cfg = {
.vbif_count = ARRAY_SIZE(sdm845_vbif),
.vbif = sdm845_vbif,
.reg_dma_count = 1,
-   .dma_cfg = _regdma,
+   .dma_cfg = _regdma,
.perf = _perf_data,
.mdss_irqs = IRQ_SM8350_MASK,
 };
-- 
2.20.1.7.g153144c



[PATCH 3/3] drm/amd/display: Clean up some inconsistent indenting

2023-01-16 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_hpd.c:140 get_hpd_line() 
warn: inconsistent indenting.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3787
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/link/link_hpd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_hpd.c 
b/drivers/gpu/drm/amd/display/dc/link/link_hpd.c
index 5f39dfe06e9a..4746ea623354 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_hpd.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_hpd.c
@@ -137,10 +137,9 @@ enum hpd_source_id get_hpd_line(struct dc_link *link)
struct gpio *hpd;
enum hpd_source_id hpd_id;
 
-   hpd_id = HPD_SOURCEID_UNKNOWN;
-
+   hpd_id = HPD_SOURCEID_UNKNOWN;
hpd = link_get_hpd_gpio(link->ctx->dc_bios, link->link_id,
-  link->ctx->gpio_service);
+   link->ctx->gpio_service);
 
if (hpd) {
switch (dal_irq_get_source(hpd)) {
-- 
2.20.1.7.g153144c



[PATCH 2/3] drm/amd/display: Remove the unused variable value0

2023-01-16 Thread Jiapeng Chong
Variable value0 is not effectively used, so delete it.

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_link_encoder.c:1222:11: 
warning: variable ‘value0’ set but not used.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3783
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
index c4287147b853..4c067f8a19b4 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
@@ -1219,7 +1219,6 @@ void 
dcn10_link_encoder_update_mst_stream_allocation_table(
const struct link_mst_stream_allocation_table *table)
 {
struct dcn10_link_encoder *enc10 = TO_DCN10_LINK_ENC(enc);
-   uint32_t value0 = 0;
uint32_t value1 = 0;
uint32_t value2 = 0;
uint32_t slots = 0;
@@ -1321,13 +1320,9 @@ void 
dcn10_link_encoder_update_mst_stream_allocation_table(
do {
udelay(10);
 
-   value0 = REG_READ(DP_MSE_SAT_UPDATE);
-
-   REG_GET(DP_MSE_SAT_UPDATE,
-   DP_MSE_SAT_UPDATE, );
-
-   REG_GET(DP_MSE_SAT_UPDATE,
-   DP_MSE_16_MTP_KEEPOUT, );
+   REG_READ(DP_MSE_SAT_UPDATE);
+   REG_GET(DP_MSE_SAT_UPDATE, DP_MSE_SAT_UPDATE, );
+   REG_GET(DP_MSE_SAT_UPDATE, DP_MSE_16_MTP_KEEPOUT, );
 
/* bit field DP_MSE_SAT_UPDATE is set to 1 already */
if (!value1 && !value2)
-- 
2.20.1.7.g153144c



[PATCH 1/3] drm/amd/display: Remove the unused variable optc

2023-01-16 Thread Jiapeng Chong
Variable optc is not effectively used, so delete it.

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_hwseq.c:325:27: warning: 
variable ‘optc’ set but not used.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3782
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
index 7360b3ce4283..bae6e3b52546 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
@@ -322,13 +322,11 @@ void dcn30_enable_writeback(
 {
struct dwbc *dwb;
struct mcif_wb *mcif_wb;
-   struct timing_generator *optc;
 
dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
mcif_wb = dc->res_pool->mcif_wb[wb_info->dwb_pipe_inst];
 
/* set the OPTC source mux */
-   optc = dc->res_pool->timing_generators[dwb->otg_inst];
DC_LOG_DWB("%s dwb_pipe_inst = %d, mpcc_inst = %d",\
__func__, wb_info->dwb_pipe_inst,\
wb_info->mpcc_inst);
-- 
2.20.1.7.g153144c



[PATCH] drm/msm/dpu: Remove some unused variables

2023-01-11 Thread Jiapeng Chong
Variables 'sc8280xp_regdma' and 'sm8350_regdma' are defined in the
dpu_hw_catalog.c file, but not used elsewhere, so remove these unused
variables.

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:2029:37: warning: unused 
variable 'sc8280xp_regdma'.
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:2053:37: warning: unused 
variable 'sm8350_regdma'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3722
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 16 
 1 file changed, 16 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
index 0f3da480b066..79bbef93948f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
@@ -2026,14 +2026,6 @@ static const struct dpu_vbif_cfg sdm845_vbif[] = {
},
 };
 
-static const struct dpu_reg_dma_cfg sc8280xp_regdma = {
-   .base = 0x0,
-   .version = 0x0002,
-   .trigger_sel_off = 0x119c,
-   .xin_id = 7,
-   .clk_ctrl = DPU_CLK_CTRL_REG_DMA,
-};
-
 static const struct dpu_reg_dma_cfg sdm845_regdma = {
.base = 0x0, .version = 0x1, .trigger_sel_off = 0x119c
 };
@@ -2050,14 +2042,6 @@ static const struct dpu_reg_dma_cfg sm8250_regdma = {
.clk_ctrl = DPU_CLK_CTRL_REG_DMA,
 };
 
-static const struct dpu_reg_dma_cfg sm8350_regdma = {
-   .base = 0x400,
-   .version = 0x0002,
-   .trigger_sel_off = 0x119c,
-   .xin_id = 7,
-   .clk_ctrl = DPU_CLK_CTRL_REG_DMA,
-};
-
 static const struct dpu_reg_dma_cfg sm8450_regdma = {
.base = 0x0,
.version = 0x0002,
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Remove useless else if

2023-01-11 Thread Jiapeng Chong
The assignment of the else and if branches is the same, so the if else
here is redundant, so we remove it.

./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951:2-4: WARNING: possible 
condition with no effect (if == else).

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3719
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +
 1 file changed, 1 insertion(+), 4 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 4300ce98ce8d..aa3024e58d12 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1948,10 +1948,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
dmub_asic = DMUB_ASIC_DCN21;
break;
case IP_VERSION(3, 0, 0):
-   if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
-   dmub_asic = DMUB_ASIC_DCN30;
-   else
-   dmub_asic = DMUB_ASIC_DCN30;
+   dmub_asic = DMUB_ASIC_DCN30;
break;
case IP_VERSION(3, 0, 1):
dmub_asic = DMUB_ASIC_DCN301;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: Remove the unused function dmub_outbox_irq_info_funcs

2022-12-19 Thread Jiapeng Chong
The function dmub_outbox_irq_info_funcs is defined in the
irq_service_dcn201.c file, but not called elsewhere, so remove this
unused function.

drivers/gpu/drm/amd/amdgpu/../display/dc/irq/dcn201/irq_service_dcn201.c:139:43:
 warning: unused variable 'dmub_outbox_irq_info_funcs'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3520
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 .../gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c   | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c 
b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
index 5f4f6dd79511..27dc8c9955f4 100644
--- a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
+++ b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
@@ -136,11 +136,6 @@ static const struct irq_source_info_funcs 
vupdate_no_lock_irq_info_funcs = {
.ack = NULL
 };
 
-static const struct irq_source_info_funcs dmub_outbox_irq_info_funcs = {
-   .set = NULL,
-   .ack = NULL
-};
-
 #undef BASE_INNER
 #define BASE_INNER(seg) DMU_BASE__INST0_SEG ## seg
 
-- 
2.20.1.7.g153144c



[PATCH v3] drm/i915: Remove unnecessary doc from static engine_init_common()

2022-12-13 Thread Jiapeng Chong
The function engine_init_common() has changed to static and we don't need
doc comment in the static function. No functional modification involved.

drivers/gpu/drm/i915/gt/intel_engine_cs.c:1306: warning: expecting prototype 
for intel_engines_init_common(). Prototype was for engine_init_common() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3442
Fixes: 019bf277634a ("drm/i915: Pull out some more common engine init code")
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
Changes in v3:
  -Modify the commit message and add a "Fixes:" tag.

 drivers/gpu/drm/i915/gt/intel_engine_cs.c | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c 
b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index c33e0d72d670..7c29b1504ae7 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -1291,17 +1291,6 @@ create_kernel_context(struct intel_engine_cs *engine)
  , "kernel_context");
 }
 
-/**
- * intel_engines_init_common - initialize cengine state which might require hw 
access
- * @engine: Engine to initialize.
- *
- * Initializes @engine@ structure members shared between legacy and execlists
- * submission modes which do require hardware access.
- *
- * Typcally done at later stages of submission mode specific engine setup.
- *
- * Returns zero on success or an error code on failure.
- */
 static int engine_init_common(struct intel_engine_cs *engine)
 {
struct intel_context *ce;
-- 
2.20.1.7.g153144c



[PATCH] drm/i915/gt: Modify mismatched function name

2022-12-13 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/i915/gt/intel_engine_cs.c:1306: warning: expecting prototype 
for intel_engines_init_common(). Prototype was for engine_init_common() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3442
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c 
b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index c33e0d72d670..dfcd3a91fbe7 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -1292,7 +1292,7 @@ create_kernel_context(struct intel_engine_cs *engine)
 }
 
 /**
- * intel_engines_init_common - initialize cengine state which might require hw 
access
+ * engine_init_common - initialize cengine state which might require hw access
  * @engine: Engine to initialize.
  *
  * Initializes @engine@ structure members shared between legacy and execlists
-- 
2.20.1.7.g153144c



[PATCH v2] drm/i915/hwconfig: Remove comment block

2022-12-12 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c:112: warning: expecting 
prototype for intel_guc_hwconfig_init(). Prototype was for guc_hwconfig_init() 
instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3414
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
Changes in v2:
  -Remove the comment block.

 drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c 
b/drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c
index 4781fccc2687..5559d39881ee 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c
@@ -102,12 +102,6 @@ static bool has_table(struct drm_i915_private *i915)
return false;
 }
 
-/**
- * intel_guc_hwconfig_init - Initialize the HWConfig
- *
- * Retrieve the HWConfig table from the GuC and save it locally.
- * It can then be queried on demand by other users later on.
- */
 static int guc_hwconfig_init(struct intel_gt *gt)
 {
struct intel_hwconfig *hwconfig = >info.hwconfig;
-- 
2.20.1.7.g153144c



[PATCH v2] net: ksz884x: Remove some unused functions

2022-12-12 Thread Jiapeng Chong
These functions are defined in the ksz884x.c file, but not called
elsewhere, so delete these unused functions.

drivers/net/ethernet/micrel/ksz884x.c:2212:20: warning: unused function 
'port_cfg_force_flow_ctrl'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3418
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
Changes in v2:
  -Delete more unused functions.

 drivers/net/ethernet/micrel/ksz884x.c | 89 ---
 1 file changed, 89 deletions(-)

diff --git a/drivers/net/ethernet/micrel/ksz884x.c 
b/drivers/net/ethernet/micrel/ksz884x.c
index e6acd1e7b263..5d6ed7a63e59 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -2209,102 +2209,13 @@ static inline void port_cfg_back_pressure(struct 
ksz_hw *hw, int p, int set)
KS8842_PORT_CTRL_2_OFFSET, PORT_BACK_PRESSURE, set);
 }
 
-static inline void port_cfg_force_flow_ctrl(struct ksz_hw *hw, int p, int set)
-{
-   port_cfg(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_FORCE_FLOW_CTRL, set);
-}
-
-static inline int port_chk_back_pressure(struct ksz_hw *hw, int p)
-{
-   return port_chk(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_BACK_PRESSURE);
-}
-
-static inline int port_chk_force_flow_ctrl(struct ksz_hw *hw, int p)
-{
-   return port_chk(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_FORCE_FLOW_CTRL);
-}
-
 /* Spanning Tree */
 
-static inline void port_cfg_rx(struct ksz_hw *hw, int p, int set)
-{
-   port_cfg(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_RX_ENABLE, set);
-}
-
-static inline void port_cfg_tx(struct ksz_hw *hw, int p, int set)
-{
-   port_cfg(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_TX_ENABLE, set);
-}
-
 static inline void sw_cfg_fast_aging(struct ksz_hw *hw, int set)
 {
sw_cfg(hw, KS8842_SWITCH_CTRL_1_OFFSET, SWITCH_FAST_AGING, set);
 }
 
-static inline void sw_flush_dyn_mac_table(struct ksz_hw *hw)
-{
-   if (!(hw->overrides & FAST_AGING)) {
-   sw_cfg_fast_aging(hw, 1);
-   mdelay(1);
-   sw_cfg_fast_aging(hw, 0);
-   }
-}
-
-/* VLAN */
-
-static inline void port_cfg_ins_tag(struct ksz_hw *hw, int p, int insert)
-{
-   port_cfg(hw, p,
-   KS8842_PORT_CTRL_1_OFFSET, PORT_INSERT_TAG, insert);
-}
-
-static inline void port_cfg_rmv_tag(struct ksz_hw *hw, int p, int remove)
-{
-   port_cfg(hw, p,
-   KS8842_PORT_CTRL_1_OFFSET, PORT_REMOVE_TAG, remove);
-}
-
-static inline int port_chk_ins_tag(struct ksz_hw *hw, int p)
-{
-   return port_chk(hw, p,
-   KS8842_PORT_CTRL_1_OFFSET, PORT_INSERT_TAG);
-}
-
-static inline int port_chk_rmv_tag(struct ksz_hw *hw, int p)
-{
-   return port_chk(hw, p,
-   KS8842_PORT_CTRL_1_OFFSET, PORT_REMOVE_TAG);
-}
-
-static inline void port_cfg_dis_non_vid(struct ksz_hw *hw, int p, int set)
-{
-   port_cfg(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_DISCARD_NON_VID, set);
-}
-
-static inline void port_cfg_in_filter(struct ksz_hw *hw, int p, int set)
-{
-   port_cfg(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_INGRESS_VLAN_FILTER, set);
-}
-
-static inline int port_chk_dis_non_vid(struct ksz_hw *hw, int p)
-{
-   return port_chk(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_DISCARD_NON_VID);
-}
-
-static inline int port_chk_in_filter(struct ksz_hw *hw, int p)
-{
-   return port_chk(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_INGRESS_VLAN_FILTER);
-}
-
 /* Mirroring */
 
 static inline void port_cfg_mirror_sniffer(struct ksz_hw *hw, int p, int set)
-- 
2.20.1.7.g153144c



[PATCH] net: ksz884x: Remove the unused function port_cfg_force_flow_ctrl()

2022-12-11 Thread Jiapeng Chong
The function port_cfg_force_flow_ctrl() is defined in the ksz884x.c file,
but not called elsewhere, so remove this unused function.

drivers/net/ethernet/micrel/ksz884x.c:2212:20: warning: unused function 
'port_cfg_force_flow_ctrl'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3418
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/net/ethernet/micrel/ksz884x.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/micrel/ksz884x.c 
b/drivers/net/ethernet/micrel/ksz884x.c
index e6acd1e7b263..46f1fbf58b5a 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -2209,12 +2209,6 @@ static inline void port_cfg_back_pressure(struct ksz_hw 
*hw, int p, int set)
KS8842_PORT_CTRL_2_OFFSET, PORT_BACK_PRESSURE, set);
 }
 
-static inline void port_cfg_force_flow_ctrl(struct ksz_hw *hw, int p, int set)
-{
-   port_cfg(hw, p,
-   KS8842_PORT_CTRL_2_OFFSET, PORT_FORCE_FLOW_CTRL, set);
-}
-
 static inline int port_chk_back_pressure(struct ksz_hw *hw, int p)
 {
return port_chk(hw, p,
-- 
2.20.1.7.g153144c



[PATCH] drm/i915/hwconfig: Modify mismatched function name

2022-12-11 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c:112: warning: expecting 
prototype for intel_guc_hwconfig_init(). Prototype was for guc_hwconfig_init() 
instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3414
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c 
b/drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c
index 4781fccc2687..bdb20beb3e70 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_hwconfig.c
@@ -103,7 +103,7 @@ static bool has_table(struct drm_i915_private *i915)
 }
 
 /**
- * intel_guc_hwconfig_init - Initialize the HWConfig
+ * guc_hwconfig_init - Initialize the HWConfig
  *
  * Retrieve the HWConfig table from the GuC and save it locally.
  * It can then be queried on demand by other users later on.
-- 
2.20.1.7.g153144c



[PATCH 2/2] drm/amd/display: Remove set but unused variable cursor_bpp

2022-11-16 Thread Jiapeng Chong
Variable cursor_bpp is not effectively used in the function, so delete it.

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_hwseq.c:217:10: warning: 
variable ‘cursor_bpp’ set but not used.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3120
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
index 763311ffb967..311be35de315 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
@@ -214,7 +214,6 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc 
*dc, struct dc_state *c
uint32_t lines_per_way = 0;
uint8_t num_ways = 0;
uint8_t bytes_per_pixel = 0;
-   uint8_t cursor_bpp = 0;
uint16_t mblk_width = 0;
uint16_t mblk_height = 0;
uint16_t mall_alloc_width_blk_aligned = 0;
@@ -288,19 +287,16 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc 
*dc, struct dc_state *c
switch 
(pipe->stream->cursor_attributes.color_format) {
case CURSOR_MODE_MONO:
cursor_size /= 2;
-   cursor_bpp = 4;
break;
case CURSOR_MODE_COLOR_1BIT_AND:
case CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA:
case CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA:
cursor_size *= 4;
-   cursor_bpp = 4;
break;
 
case CURSOR_MODE_COLOR_64BIT_FP_PRE_MULTIPLIED:
case 
CURSOR_MODE_COLOR_64BIT_FP_UN_PRE_MULTIPLIED:
cursor_size *= 8;
-   cursor_bpp = 8;
break;
}
 
-- 
2.20.1.7.g153144c



[PATCH 1/2] drm/amd/display: Remove set but unused variable 'TPreMargin'

2022-11-16 Thread Jiapeng Chong
Variable TPreMargin is not effectively used in the function, so delete it.

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_util_32.c:3478:10:
 warning: variable ‘TPreMargin’ set but not used.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3144
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 2 --
 1 file changed, 2 deletions(-)

diff --git 
a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
index d967264e25cf..7f840c20d213 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
@@ -3475,7 +3475,6 @@ bool dml32_CalculatePrefetchSchedule(
double  min_Lsw;
double  Tsw_est1 = 0;
double  Tsw_est3 = 0;
-   double  TPreMargin = 0;
 
if (v->GPUVMEnable == true && v->HostVMEnable == true)
HostVMDynamicLevelsTrips = v->HostVMMaxNonCachedPageTableLevels;
@@ -3703,7 +3702,6 @@ bool dml32_CalculatePrefetchSchedule(
dst_y_prefetch_equ = dml_floor(4.0 * (dst_y_prefetch_equ + 0.125), 1) / 
4.0;
Tpre_rounded = dst_y_prefetch_equ * LineTime;
 
-   TPreMargin = Tpre_rounded - TPreReq;
 #ifdef __DML_VBA_DEBUG__
dml_print("DML::%s: dst_y_prefetch_equ: %f (after round)\n", __func__, 
dst_y_prefetch_equ);
dml_print("DML::%s: LineTime: %f\n", __func__, LineTime);
-- 
2.20.1.7.g153144c



[PATCH] drm/nouveau/svm: Remove set but unused variable 'priority'

2022-11-11 Thread Jiapeng Chong
Variable priority is not effectively used in the function, so delete it.

drivers/gpu/drm/nouveau/nouveau_svm.c:115:24: warning: variable 'priority' set 
but not used.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3028
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/nouveau/nouveau_svm.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c 
b/drivers/gpu/drm/nouveau/nouveau_svm.c
index a74ba8d84ba7..2b1f600ed723 100644
--- a/drivers/gpu/drm/nouveau/nouveau_svm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_svm.c
@@ -112,7 +112,7 @@ nouveau_svmm_bind(struct drm_device *dev, void *data,
 {
struct nouveau_cli *cli = nouveau_cli(file_priv);
struct drm_nouveau_svm_bind *args = data;
-   unsigned target, cmd, priority;
+   unsigned int target, cmd;
unsigned long addr, end;
struct mm_struct *mm;
 
@@ -136,9 +136,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data,
return -EINVAL;
}
 
-   priority = args->header >> NOUVEAU_SVM_BIND_PRIORITY_SHIFT;
-   priority &= NOUVEAU_SVM_BIND_PRIORITY_MASK;
-
/* FIXME support CPU target ie all target value < GPU_VRAM */
target = args->header >> NOUVEAU_SVM_BIND_TARGET_SHIFT;
target &= NOUVEAU_SVM_BIND_TARGET_MASK;
-- 
2.20.1.7.g153144c



[PATCH] drm/amd/display: remove set but unused variable 'state'

2022-11-11 Thread Jiapeng Chong
The variable state is not effectively used in the function, so delete it.

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c:1613:24: 
warning: variable ‘state’ set but not used.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3027#c0
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c 
b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
index f7fea3544c31..df477a53b64a 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
@@ -1610,7 +1610,6 @@ bool dcn32_acquire_post_bldn_3dlut(
struct dc_transfer_func **shaper)
 {
bool ret = false;
-   union dc_3dlut_state *state;
 
ASSERT(*lut == NULL && *shaper == NULL);
*lut = NULL;
@@ -1619,7 +1618,6 @@ bool dcn32_acquire_post_bldn_3dlut(
if (!res_ctx->is_mpc_3dlut_acquired[mpcc_id]) {
*lut = pool->mpc_lut[mpcc_id];
*shaper = pool->mpc_shaper[mpcc_id];
-   state = >mpc_lut[mpcc_id]->state;
res_ctx->is_mpc_3dlut_acquired[mpcc_id] = true;
ret = true;
}
-- 
2.20.1.7.g153144c



[PATCH 5/5] drm/nouveau/gr/tu102: Remove the unused function tu102_gr_load()

2022-11-11 Thread Jiapeng Chong
The function tu102_gr_load() is defined in the tu102.c file, but
not called elsewhere, so remove this unused function.

drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c:210:1: warning: no
previous prototype for ‘tu102_gr_load’.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3020
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c
index 3b6c8100a242..a7775aa18541 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c
@@ -206,19 +206,6 @@ tu102_gr_av_to_init_veid(struct nvkm_blob *blob, struct 
gf100_gr_pack **ppack)
return gk20a_gr_av_to_init_(blob, 64, 0x0010, ppack);
 }
 
-int
-tu102_gr_load(struct gf100_gr *gr, int ver, const struct gf100_gr_fwif *fwif)
-{
-   int ret;
-
-   ret = gm200_gr_load(gr, ver, fwif);
-   if (ret)
-   return ret;
-
-   return gk20a_gr_load_net(gr, "gr/", "sw_veid_bundle_init", ver, 
tu102_gr_av_to_init_veid,
->bundle_veid);
-}
-
 static const struct gf100_gr_fwif
 tu102_gr_fwif[] = {
{  0, gm200_gr_load, _gr, _gr_fecs_acr, _gr_gpccs_acr 
},
-- 
2.20.1.7.g153144c



[PATCH 4/5] drm/nouveau/fifo/gf100-: make gf100_fifo_nonstall_block() static

2022-11-11 Thread Jiapeng Chong
This symbol is not used outside of gf100.c, so marks it static.

drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c:451:1: warning: no previous 
prototype for ‘gf100_fifo_nonstall_block’.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3021
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
index 5bb65258c36d..6c94451d0faa 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
@@ -447,7 +447,7 @@ gf100_fifo_nonstall_allow(struct nvkm_event *event, int 
type, int index)
spin_unlock_irqrestore(>lock, flags);
 }
 
-void
+static void
 gf100_fifo_nonstall_block(struct nvkm_event *event, int type, int index)
 {
struct nvkm_fifo *fifo = container_of(event, typeof(*fifo), 
nonstall.event);
-- 
2.20.1.7.g153144c



[PATCH 3/5] drm/nouveau/fifo: make nvkm_engn_cgrp_get static

2022-11-11 Thread Jiapeng Chong
This symbol is not used outside of runl.c, so marks it static.

drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c:34:1: warning: no previous 
prototype for ‘nvkm_engn_cgrp_get’.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3022
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c
index b5836cbc29aa..93d628d7d508 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c
@@ -30,7 +30,7 @@
 #include 
 #include 
 
-struct nvkm_cgrp *
+static struct nvkm_cgrp *
 nvkm_engn_cgrp_get(struct nvkm_engn *engn, unsigned long *pirqflags)
 {
struct nvkm_cgrp *cgrp = NULL;
-- 
2.20.1.7.g153144c



[PATCH 2/5] drm/nouveau/acr: remove the unused variable loc

2022-11-11 Thread Jiapeng Chong
The variable loc is not effectively used in the function, so delete it.

drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:221:7: warning: variable ‘loc’ 
set but not used.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3024
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
index f36a359d4531..bd104a030243 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
@@ -218,7 +218,7 @@ nvkm_acr_lsfw_load_sig_image_desc_v2(struct nvkm_subdev 
*subdev,
const struct firmware *hsbl;
const struct nvfw_ls_hsbl_bin_hdr *hdr;
const struct nvfw_ls_hsbl_hdr *hshdr;
-   u32 loc, sig, cnt, *meta;
+   u32 sig, cnt, *meta;
 
ret = nvkm_firmware_load_name(subdev, path, "hs_bl_sig", ver, 
);
if (ret)
@@ -227,7 +227,6 @@ nvkm_acr_lsfw_load_sig_image_desc_v2(struct nvkm_subdev 
*subdev,
hdr = nvfw_ls_hsbl_bin_hdr(subdev, hsbl->data);
hshdr = nvfw_ls_hsbl_hdr(subdev, hsbl->data + 
hdr->header_offset);
meta = (u32 *)(hsbl->data + hshdr->meta_data_offset);
-   loc = *(u32 *)(hsbl->data + hshdr->patch_loc);
sig = *(u32 *)(hsbl->data + hshdr->patch_sig);
cnt = *(u32 *)(hsbl->data + hshdr->num_sig);
 
-- 
2.20.1.7.g153144c



[PATCH 1/5] drm/nouveau/nvfw/acr: make wpr_generic_header_dump() static

2022-11-11 Thread Jiapeng Chong
This symbol is not used outside of acr.c, so marks it static.

drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c:49:1: warning: no previous prototype 
for ‘wpr_generic_header_dump’.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3023
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c 
b/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c
index 83a9c48bc58c..7ac90c495737 100644
--- a/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c
+++ b/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c
@@ -45,7 +45,7 @@ wpr_header_v1_dump(struct nvkm_subdev *subdev, const struct 
wpr_header_v1 *hdr)
nvkm_debug(subdev, "\tstatus: %d\n", hdr->status);
 }
 
-void
+static void
 wpr_generic_header_dump(struct nvkm_subdev *subdev, const struct 
wpr_generic_header *hdr)
 {
nvkm_debug(subdev, "wprGenericHeader\n");
-- 
2.20.1.7.g153144c



[PATCH] drm/bridge: sii9234: Remove the unused function sii9234_mode_valid()

2022-11-04 Thread Jiapeng Chong
The function sii9234_mode_valid() is defined in the sii9234.c file, but
not called elsewhere, so remove this unused function.

drivers/gpu/drm/bridge/sii9234.c:870:31: warning: unused function 
'bridge_to_sii9234'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2735
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/bridge/sii9234.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/bridge/sii9234.c b/drivers/gpu/drm/bridge/sii9234.c
index 5b3061d4b5c3..62b6bc8ca7af 100644
--- a/drivers/gpu/drm/bridge/sii9234.c
+++ b/drivers/gpu/drm/bridge/sii9234.c
@@ -867,11 +867,6 @@ static int sii9234_init_resources(struct sii9234 *ctx,
return 0;
 }
 
-static inline struct sii9234 *bridge_to_sii9234(struct drm_bridge *bridge)
-{
-   return container_of(bridge, struct sii9234, bridge);
-}
-
 static enum drm_mode_status sii9234_mode_valid(struct drm_bridge *bridge,
 const struct drm_display_info *info,
 const struct drm_display_mode *mode)
-- 
2.20.1.7.g153144c



[PATCH] $drm/nouveau: Fix kernel-doc

2022-11-03 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: expecting prototype for 
Called whenever a 32-bit process running under a 64(). Prototype was for 
nouveau_compat_ioctl() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2730
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/nouveau/nouveau_ioc32.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c 
b/drivers/gpu/drm/nouveau/nouveau_ioc32.c
index adf01ca9e035..d13a64c0b529 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ioc32.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c
@@ -39,13 +39,13 @@
 #include "nouveau_ioctl.h"
 
 /**
- * Called whenever a 32-bit process running under a 64-bit kernel
+ * nouveau_compat_ioctl - Called whenever a 32-bit process running under a 
64-bit kernel
  * performs an ioctl on /dev/dri/card.
  *
- * \param filp file pointer.
- * \param cmd command.
- * \param arg user argument.
- * \return zero on success or negative number on failure.
+ * @filp: file pointer.
+ * @cmd: command.
+ * @arg: user argument.
+ * Return zero on success or negative number on failure.
  */
 long nouveau_compat_ioctl(struct file *filp, unsigned int cmd,
 unsigned long arg)
-- 
2.20.1.7.g153144c



[PATCH] drm: xlnx: zynqmp_dpsub: Modify mismatched function name

2022-10-30 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/xlnx/zynqmp_dp.c:793: warning: expecting prototype for 
zynqmp_dp_link_train(). Prototype was for zynqmp_dp_train() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2666
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
index 7c9ae167eac7..176d752782df 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
@@ -784,7 +784,7 @@ static int zynqmp_dp_link_train_ce(struct zynqmp_dp *dp)
 }
 
 /**
- * zynqmp_dp_link_train - Train the link
+ * zynqmp_dp_train - Train the link
  * @dp: DisplayPort IP core structure
  *
  * Return: 0 if all trains are done successfully, or corresponding error code.
-- 
2.20.1.7.g153144c



[PATCH 2/2] drm/amd/display: Modify mismatched function name

2022-10-26 Thread Jiapeng Chong
No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:615: warning: expecting 
prototype for setup_subvp_dmub_command(). Prototype was for 
populate_subvp_cmd_pipe_info() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2587
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c 
b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index 774e06936661..67eef5beab95 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -595,7 +595,7 @@ static void update_subvp_prefetch_end_to_mall_start(struct 
dc *dc,
 }
 
 /**
- * setup_subvp_dmub_command - Helper to populate the SubVP pipe info for the 
DMUB subvp command
+ * populate_subvp_cmd_pipe_info - Helper to populate the SubVP pipe info for 
the DMUB subvp command
  *
  * @dc: [in] current dc state
  * @context: [in] new dc state
-- 
2.20.1.7.g153144c



[PATCH 1/2] drm/amd/display: make wake_up_aux_channel static

2022-10-26 Thread Jiapeng Chong
This symbol is not used outside of dc_link_dp.c, so marks it static.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:5230:16: warning: no 
previous prototype for function 'wake_up_aux_channel'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2581
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 420119efcf5f..e5ab751a5ca1 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
@@ -5227,7 +5227,7 @@ static void retrieve_cable_id(struct dc_link *link)
>dpcd_caps.cable_id, _cable_id);
 }
 
-enum dc_status wake_up_aux_channel(struct dc_link *link)
+static enum dc_status wake_up_aux_channel(struct dc_link *link)
 {
enum dc_status status = DC_ERROR_UNEXPECTED;
uint32_t aux_channel_retry_cnt = 0;
-- 
2.20.1.7.g153144c



[PATCH] gma500: Remove the unused function gma_pipe_event()

2022-10-18 Thread Jiapeng Chong
The function gma_pipe_event() is defined in the psb_irq.c file, but not
called elsewhere, so remove this unused function.

drivers/gpu/drm/gma500/psb_irq.c:35:19: warning: unused function 
'gma_pipe_event'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2428
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/gma500/psb_irq.c | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/gma500/psb_irq.c b/drivers/gpu/drm/gma500/psb_irq.c
index d421031462df..343c51250207 100644
--- a/drivers/gpu/drm/gma500/psb_irq.c
+++ b/drivers/gpu/drm/gma500/psb_irq.c
@@ -32,17 +32,6 @@ static inline u32 gma_pipestat(int pipe)
BUG();
 }
 
-static inline u32 gma_pipe_event(int pipe)
-{
-   if (pipe == 0)
-   return _PSB_PIPEA_EVENT_FLAG;
-   if (pipe == 1)
-   return _MDFLD_PIPEB_EVENT_FLAG;
-   if (pipe == 2)
-   return _MDFLD_PIPEC_EVENT_FLAG;
-   BUG();
-}
-
 static inline u32 gma_pipeconf(int pipe)
 {
if (pipe == 0)
-- 
2.20.1.7.g153144c



[PATCH] drm/kmb: Remove some unused functions

2022-10-18 Thread Jiapeng Chong
Functions set_test_mode_src_osc_freq_target_low_bits() and
set_test_mode_src_osc_freq_target_hi_bits() are defined in the kmb_dsi.c
file, but not called elsewhere, so remove these unused functions.

drivers/gpu/drm/kmb/kmb_dsi.c:822:2: warning: unused function 
'set_test_mode_src_osc_freq_target_low_bits'.
drivers/gpu/drm/kmb/kmb_dsi.c:834:2: warning: unused function 
'set_test_mode_src_osc_freq_target_hi_bits'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2426
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/kmb/kmb_dsi.c | 28 
 1 file changed, 28 deletions(-)

diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c
index cf7cf0b07541..ed99b14375aa 100644
--- a/drivers/gpu/drm/kmb/kmb_dsi.c
+++ b/drivers/gpu/drm/kmb/kmb_dsi.c
@@ -818,34 +818,6 @@ static void test_mode_send(struct kmb_dsi *kmb_dsi, u32 
dphy_no,
}
 }
 
-static inline void
-   set_test_mode_src_osc_freq_target_low_bits(struct kmb_dsi *kmb_dsi,
-  u32 dphy_no,
-  u32 freq)
-{
-   /* Typical rise/fall time=166, refer Table 1207 databook,
-* sr_osc_freq_target[7:0]
-*/
-   test_mode_send(kmb_dsi, dphy_no, TEST_CODE_SLEW_RATE_DDL_CYCLES,
-  (freq & 0x7f));
-}
-
-static inline void
-   set_test_mode_src_osc_freq_target_hi_bits(struct kmb_dsi *kmb_dsi,
- u32 dphy_no,
- u32 freq)
-{
-   u32 data;
-
-   /* Flag this as high nibble */
-   data = ((freq >> 6) & 0x1f) | (1 << 7);
-
-   /* Typical rise/fall time=166, refer Table 1207 databook,
-* sr_osc_freq_target[11:7]
-*/
-   test_mode_send(kmb_dsi, dphy_no, TEST_CODE_SLEW_RATE_DDL_CYCLES, data);
-}
-
 static void mipi_tx_get_vco_params(struct vco_params *vco)
 {
int i;
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: Remove the unused function amdgpu_ucode_print_imu_hdr()

2022-10-17 Thread Jiapeng Chong
The function amdgpu_ucode_print_imu_hdr() is defined in the amdgpu_ucode.c
file, but not called elsewhere, so delete this unused function.

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:129:6: warning: no previous prototype 
for function 'amdgpu_ucode_print_imu_hdr'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2416
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index dd0bc649a57d..148cc2d475c5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -126,19 +126,6 @@ void amdgpu_ucode_print_gfx_hdr(const struct 
common_firmware_header *hdr)
}
 }
 
-void amdgpu_ucode_print_imu_hdr(const struct common_firmware_header *hdr)
-{
-   uint16_t version_major = le16_to_cpu(hdr->header_version_major);
-   uint16_t version_minor = le16_to_cpu(hdr->header_version_minor);
-
-   DRM_DEBUG("IMU\n");
-   amdgpu_ucode_print_common_hdr(hdr);
-
-   if (version_major != 1) {
-   DRM_ERROR("Unknown GFX ucode version: %u.%u\n", version_major, 
version_minor);
-   }
-}
-
 void amdgpu_ucode_print_rlc_hdr(const struct common_firmware_header *hdr)
 {
uint16_t version_major = le16_to_cpu(hdr->header_version_major);
-- 
2.20.1.7.g153144c



[PATCH] drm/rockchip: dsi: Remove the unused function dsi_update_bits()

2022-10-17 Thread Jiapeng Chong
The function dsi_update_bits() is defined in the dw-mipi-dsi-rockchip.c
file, but not called elsewhere, so delete this unused function.

drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:367:20: warning: unused 
function 'dsi_update_bits'.

https://bugzilla.openanolis.cn/show_bug.cgi?id=2414
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index bf6948125b84..313231d886d2 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -364,12 +364,6 @@ static inline u32 dsi_read(struct dw_mipi_dsi_rockchip 
*dsi, u32 reg)
return readl(dsi->base + reg);
 }
 
-static inline void dsi_update_bits(struct dw_mipi_dsi_rockchip *dsi, u32 reg,
-  u32 mask, u32 val)
-{
-   dsi_write(dsi, reg, (dsi_read(dsi, reg) & ~mask) | val);
-}
-
 static void dw_mipi_dsi_phy_write(struct dw_mipi_dsi_rockchip *dsi,
  u8 test_code,
  u8 test_data)
-- 
2.20.1.7.g153144c



[PATCH] drm/amdgpu: Remove the unused function get_umc_v6_7_channel_index()

2022-10-17 Thread Jiapeng Chong
The function get_umc_v6_7_channel_index() is defined in the umc_v6_7.c
file, but not called elsewhere, so delete this unused function.

drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:60:24: warning: unused function 
'get_umc_v6_7_channel_index'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2413
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/amd/amdgpu/umc_v6_7.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c 
b/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c
index 5d5d031c9e7d..6837fc89ba8f 100644
--- a/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c
+++ b/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c
@@ -57,13 +57,6 @@ static inline uint32_t get_umc_v6_7_reg_offset(struct 
amdgpu_device *adev,
return adev->umc.channel_offs * ch_inst + UMC_V6_7_INST_DIST * umc_inst;
 }
 
-static inline uint32_t get_umc_v6_7_channel_index(struct amdgpu_device *adev,
- uint32_t umc_inst,
- uint32_t ch_inst)
-{
-   return adev->umc.channel_idx_tbl[umc_inst * adev->umc.channel_inst_num 
+ ch_inst];
-}
-
 static void umc_v6_7_query_error_status_helper(struct amdgpu_device *adev,
  uint64_t mc_umc_status, 
uint32_t umc_reg_offset)
 {
-- 
2.20.1.7.g153144c



[PATCH 1/2] drm/i915/gvt: Fix kernel-doc

2022-09-26 Thread Jiapeng Chong
drivers/gpu/drm/i915/gvt/vgpu.c:356: warning: expecting prototype for 
intel_gvt_destroy_vgpu(). Prototype was for intel_gvt_destroy_idle_vgpu() 
instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2276
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/i915/gvt/vgpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c
index 5c533fbc2c8d..e081027761d5 100644
--- a/drivers/gpu/drm/i915/gvt/vgpu.c
+++ b/drivers/gpu/drm/i915/gvt/vgpu.c
@@ -346,7 +346,7 @@ struct intel_vgpu *intel_gvt_create_idle_vgpu(struct 
intel_gvt *gvt)
 }
 
 /**
- * intel_gvt_destroy_vgpu - destroy an idle virtual GPU
+ * intel_gvt_destroy_idle_vgpu() - destroy an idle virtual GPU
  * @vgpu: virtual GPU
  *
  * This function is called when user wants to destroy an idle virtual GPU.
-- 
2.20.1.7.g153144c



[PATCH 2/2] drm/i915/gvt: Remove the unused function get_pt_type()

2022-09-26 Thread Jiapeng Chong
The function get_pt_type is defined in the gtt.c file, but not
called elsewhere, so delete this unused function.

drivers/gpu/drm/i915/gvt/gtt.c:285:19: warning: unused function 'get_pt_type'.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2277
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/i915/gvt/gtt.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
index ce0eb03709c3..6cd4c1d386a5 100644
--- a/drivers/gpu/drm/i915/gvt/gtt.c
+++ b/drivers/gpu/drm/i915/gvt/gtt.c
@@ -282,11 +282,6 @@ static inline int get_next_pt_type(int type)
return gtt_type_table[type].next_pt_type;
 }
 
-static inline int get_pt_type(int type)
-{
-   return gtt_type_table[type].pt_type;
-}
-
 static inline int get_entry_type(int type)
 {
return gtt_type_table[type].entry_type;
-- 
2.20.1.7.g153144c



[PATCH] drm/atomic-helper: Fix kernel-doc

2022-09-19 Thread Jiapeng Chong
drivers/gpu/drm/drm_atomic_helper.c:802: warning: expecting prototype for 
drm_atomic_helper_check_wb_connector_state(). Prototype was for 
drm_atomic_helper_check_wb_encoder_state() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2216
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/drm_atomic_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
b/drivers/gpu/drm/drm_atomic_helper.c
index ee5fea48b5cb..98cc3137c062 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -786,7 +786,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
 EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
 
 /**
- * drm_atomic_helper_check_wb_connector_state() - Check writeback encoder state
+ * drm_atomic_helper_check_wb_encoder_state() - Check writeback encoder state
  * @encoder: encoder state to check
  * @conn_state: connector state to check
  *
-- 
2.20.1.7.g153144c



[PATCH] drm/i915/gvt: Fix kernel-doc

2022-09-19 Thread Jiapeng Chong
drivers/gpu/drm/i915/gvt/cfg_space.c:258: warning: expecting prototype for 
intel_vgpu_emulate_cfg_read(). Prototype was for intel_vgpu_emulate_cfg_write() 
instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2217
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/i915/gvt/cfg_space.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/cfg_space.c 
b/drivers/gpu/drm/i915/gvt/cfg_space.c
index eef3bba8a41b..5e8bc2d8a638 100644
--- a/drivers/gpu/drm/i915/gvt/cfg_space.c
+++ b/drivers/gpu/drm/i915/gvt/cfg_space.c
@@ -244,7 +244,7 @@ static void emulate_pci_bar_write(struct intel_vgpu *vgpu, 
unsigned int offset,
 }
 
 /**
- * intel_vgpu_emulate_cfg_read - emulate vGPU configuration space write
+ * intel_vgpu_emulate_cfg_write() - emulate vGPU configuration space write
  * @vgpu: target vgpu
  * @offset: offset
  * @p_data: write data ptr
-- 
2.20.1.7.g153144c



[PATCH] drm/i915/gt: Fix kernel-doc

2022-09-19 Thread Jiapeng Chong
drivers/gpu/drm/i915/gt/intel_engine_cs.c:1288: warning: expecting prototype 
for intel_engines_cleanup_common(). Prototype was for 
intel_engine_cleanup_common() instead.
drivers/gpu/drm/i915/gt/intel_engine_cs.c:1211: warning: expecting prototype 
for intel_engines_init_common(). Prototype was for engine_init_common() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2218
Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c 
b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 275ad72940c1..6e8d45e5e574 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -1197,7 +1197,7 @@ create_kernel_context(struct intel_engine_cs *engine)
 }
 
 /**
- * intel_engines_init_common - initialize cengine state which might require hw 
access
+ * engine_init_common() - initialize cengine state which might require hw 
access
  * @engine: Engine to initialize.
  *
  * Initializes @engine@ structure members shared between legacy and execlists
@@ -1278,7 +1278,7 @@ int intel_engines_init(struct intel_gt *gt)
 }
 
 /**
- * intel_engines_cleanup_common - cleans up the engine state created by
+ * intel_engine_cleanup_common() - cleans up the engine state created by
  *the common initiailizers.
  * @engine: Engine to cleanup.
  *
-- 
2.20.1.7.g153144c



  1   2   3   >