[PATCH 4/4] Documentation/gpu: Update AMD Display Core Unit Test documentation

2024-04-20 Thread Joao Paulo Pereira da Silva
Display Core unit tests documentation is a bit outdated, therefore
update it to follow current configuration.

Signed-off-by: Joao Paulo Pereira da Silva 
---
 .../gpu/amdgpu/display/display-test.rst   | 20 +--
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/Documentation/gpu/amdgpu/display/display-test.rst 
b/Documentation/gpu/amdgpu/display/display-test.rst
index a8c136ce87b7..a9fddf0adae7 100644
--- a/Documentation/gpu/amdgpu/display/display-test.rst
+++ b/Documentation/gpu/amdgpu/display/display-test.rst
@@ -15,14 +15,14 @@ How to run the tests?
 =
 
 In order to facilitate running the test suite, a configuration file is present
-in ``drivers/gpu/drm/amd/display/tests/dc/.kunitconfig``. This configuration 
file
+in ``drivers/gpu/drm/amd/display/test/kunit/.kunitconfig``. This configuration 
file
 can be used to run the kunit_tool, a Python script 
(``tools/testing/kunit/kunit.py``)
 used to configure, build, exec, parse and run tests.
 
 .. code-block:: bash
 
-   $ ./tools/testing/kunit/kunit.py run --arch=x86_64 \
-   --kunitconfig=drivers/gpu/drm/amd/display/tests
+$ ./tools/testing/kunit/kunit.py run --arch=x86_64 \
+--kunitconfig=drivers/gpu/drm/amd/display/test/kunit
 
 Currently, the Display Core Unit Tests are only supported on x86_64.
 
@@ -34,10 +34,9 @@ you might add the following config options to your 
``.config``:
 
CONFIG_KUNIT=y
CONFIG_AMDGPU=m
-   CONFIG_AMD_DC_BASICS_KUNIT_TEST=y
-   CONFIG_AMD_DC_KUNIT_TEST=y
-   CONFIG_DCE_KUNIT_TEST=y
-   CONFIG_DML_KUNIT_TEST=y
+   CONFIG_DRM_AMD_DC_BASICS_KUNIT_TEST=y
+   CONFIG_DRM_AMD_DC_KUNIT_TEST=y
+   CONFIG_DRM_AMD_DC_DML_KUNIT_TEST=y
 
 Once the kernel is built and installed, you can load the ``amdgpu`` module
 to run all tests available.
@@ -49,10 +48,9 @@ following config options to your ``.config``:
 
CONFIG_KUNIT=y
CONFIG_AMDGPU=y
-   CONFIG_AMD_DC_BASICS_KUNIT_TEST=y
-   CONFIG_AMD_DC_KUNIT_TEST=y
-   CONFIG_DCE_KUNIT_TEST=y
-   CONFIG_DML_KUNIT_TEST=y
+   CONFIG_DRM_AMD_DC_BASICS_KUNIT_TEST=y
+   CONFIG_DRM_AMD_DC_KUNIT_TEST=y
+   CONFIG_DRM_AMD_DC_DML_KUNIT_TEST=y
 
 In order to run specific tests, you can check the filter options from KUnit on
 Documentation/dev-tools/kunit/kunit-tool.rst.
-- 
2.44.0



[PATCH 3/4] drm/amd/display/test: Optimize kunit test suite dml_dcn20_fpu_dcn21_update_bw_bounding_box_test

2024-04-20 Thread Joao Paulo Pereira da Silva
The KUnit init function of the suite
dml_dcn20_fpu_dcn21_update_bw_bounding_box_test does not need to be executed
before every test, but only once before the test suite, since it's just
used to store backup copies of DCN global structures.
So, turn it into a suite_init.

Signed-off-by: Joao Paulo Pereira da Silva 
---
 .../amd/display/test/kunit/dc/dml/dcn20/dcn20_fpu_test.c| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/drivers/gpu/drm/amd/display/test/kunit/dc/dml/dcn20/dcn20_fpu_test.c 
b/drivers/gpu/drm/amd/display/test/kunit/dc/dml/dcn20/dcn20_fpu_test.c
index c51a0afbe518..b13a952e0227 100644
--- a/drivers/gpu/drm/amd/display/test/kunit/dc/dml/dcn20/dcn20_fpu_test.c
+++ b/drivers/gpu/drm/amd/display/test/kunit/dc/dml/dcn20/dcn20_fpu_test.c
@@ -449,10 +449,10 @@ static struct _vcs_dpi_soc_bounding_box_st 
original_dcn2_1_soc;
 static struct _vcs_dpi_ip_params_st original_dcn2_1_ip;
 
 /**
- * dcn20_fpu_dcn21_update_bw_bounding_box_test_init - Store backup copies of 
DCN global structures
+ * dcn20_fpu_dcn21_update_bw_bounding_box_test_suite_init - Store backup 
copies of DCN global structures
  * @test: represents a running instance of a test.
  */
-static int dcn20_fpu_dcn21_update_bw_bounding_box_test_init(struct kunit *test)
+static int dcn20_fpu_dcn21_update_bw_bounding_box_test_suite_init(struct 
kunit_suite *suite)
 {
memcpy(_dcn2_1_soc, _1_soc, sizeof(struct 
_vcs_dpi_soc_bounding_box_st));
memcpy(_dcn2_1_ip, _1_ip, sizeof(struct 
_vcs_dpi_ip_params_st));
@@ -553,7 +553,7 @@ static struct kunit_case 
dcn20_fpu_dcn21_update_bw_bounding_box_test_cases[] = {
 
 static struct kunit_suite dcn21_update_bw_bounding_box_test_suite = {
.name = "dml_dcn20_fpu_dcn21_update_bw_bounding_box_test",
-   .init = dcn20_fpu_dcn21_update_bw_bounding_box_test_init,
+   .suite_init = dcn20_fpu_dcn21_update_bw_bounding_box_test_suite_init,
.exit = dcn20_fpu_dcn21_update_bw_bounding_box_test_exit,
.test_cases = dcn20_fpu_dcn21_update_bw_bounding_box_test_cases,
 };
-- 
2.44.0



[PATCH 2/4] drm/amd/display/test: Fix kunit test that is not running

2024-04-20 Thread Joao Paulo Pereira da Silva
The KUnit test file test/kunit/dc/dml/calcs/bw_fixed_test.c does not have the
correct path relative to the file being tested, dc/basics/bw_fixed.c.
Also, it is neither compiling nor running.
Therefore, change the test file path and import it conditionally in the file
dc/basics/bw_fixed.c to make it runnable.

Signed-off-by: Joao Paulo Pereira da Silva 
---
 drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c   | 3 +++
 .../test/kunit/dc/{dml/calcs => basics}/bw_fixed_test.c| 0
 2 files changed, 3 insertions(+)
 rename drivers/gpu/drm/amd/display/test/kunit/dc/{dml/calcs => 
basics}/bw_fixed_test.c (100%)

diff --git a/drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c 
b/drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c
index c8cb89e0d4d0..f18945fc84b9 100644
--- a/drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c
+++ b/drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c
@@ -186,3 +186,6 @@ struct bw_fixed bw_mul(const struct bw_fixed arg1, const 
struct bw_fixed arg2)
return res;
 }
 
+#if IS_ENABLED(CONFIG_DRM_AMD_DC_BASICS_KUNIT_TEST)
+#include "../../test/kunit/dc/basics/bw_fixed_test.c"
+#endif
diff --git 
a/drivers/gpu/drm/amd/display/test/kunit/dc/dml/calcs/bw_fixed_test.c 
b/drivers/gpu/drm/amd/display/test/kunit/dc/basics/bw_fixed_test.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/test/kunit/dc/dml/calcs/bw_fixed_test.c
rename to drivers/gpu/drm/amd/display/test/kunit/dc/basics/bw_fixed_test.c
-- 
2.44.0



[PATCH 1/4] drm/amd/display: Refactor AMD display KUnit tests configs

2024-04-20 Thread Joao Paulo Pereira da Silva
Configs in AMD display KUnit tests can be clarified. Remove unnecessary
configs, rename configs to follow a pattern, and update config Help
blocks.

Signed-off-by: Joao Paulo Pereira da Silva 
---
 drivers/gpu/drm/amd/display/Kconfig   | 31 ++-
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |  2 +-
 .../dc/dml/dcn20/display_mode_vba_20.c|  2 +-
 .../dc/dml/dcn20/display_rq_dlg_calc_20.c |  2 +-
 .../drm/amd/display/test/kunit/.kunitconfig   |  7 ++---
 .../gpu/drm/amd/display/test/kunit/Makefile   |  4 +--
 6 files changed, 17 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/Kconfig 
b/drivers/gpu/drm/amd/display/Kconfig
index 11b0e54262f3..b2760adb3da9 100644
--- a/drivers/gpu/drm/amd/display/Kconfig
+++ b/drivers/gpu/drm/amd/display/Kconfig
@@ -51,25 +51,25 @@ config DRM_AMD_SECURE_DISPLAY
  This option enables the calculation of crc of specific region via
  debugfs. Cooperate with specific DMCU FW.
 
-config DCE_KUNIT_TEST
-   bool "Run all KUnit tests for DCE" if !KUNIT_ALL_TESTS
+config DRM_AMD_DC_KUNIT_TEST
+   bool "Enable KUnit tests for the root of DC" if !KUNIT_ALL_TESTS
depends on DRM_AMD_DC && KUNIT
default KUNIT_ALL_TESTS
help
-   Enables unit tests for the Display Controller Engine. Only 
useful for kernel
-   devs running KUnit.
+   Enables unit tests for files in the root of the Display Core 
directory.
+   Only useful for kernel devs running KUnit.
 
For more information on KUnit and unit tests in general please 
refer to
the KUnit documentation in Documentation/dev-tools/kunit/.
 
If unsure, say N.
 
-config DML_KUNIT_TEST
+config DRM_AMD_DC_DML_KUNIT_TEST
bool "Run all KUnit tests for DML" if !KUNIT_ALL_TESTS
depends on DRM_AMD_DC_FP && KUNIT
default KUNIT_ALL_TESTS
help
-   Enables unit tests for the Display Controller Engine. Only 
useful for kernel
+   Enables unit tests for the Display Controller Next. Only useful 
for kernel
devs running KUnit.
 
For more information on KUnit and unit tests in general please 
refer to
@@ -77,26 +77,13 @@ config DML_KUNIT_TEST
 
If unsure, say N.
 
-config AMD_DC_BASICS_KUNIT_TEST
+config DRM_AMD_DC_BASICS_KUNIT_TEST
bool "Enable KUnit tests for the 'basics' sub-component of DAL" if 
!KUNIT_ALL_TESTS
depends on DRM_AMD_DC && KUNIT
default KUNIT_ALL_TESTS
help
-   Enables unit tests for the Display Core. Only useful for kernel
-   devs running KUnit.
-
-   For more information on KUnit and unit tests in general please 
refer to
-   the KUnit documentation in Documentation/dev-tools/kunit/.
-
-   If unsure, say N.
-
-config AMD_DC_KUNIT_TEST
-   bool "Enable KUnit tests for the 'utils' sub-component of DAL" if 
!KUNIT_ALL_TESTS
-   depends on DRM_AMD_DC && KUNIT
-   default KUNIT_ALL_TESTS
-   help
-   Enables unit tests for the basics folder of Display Core. Only 
useful for
-   kernel devs running KUnit.
+   Enables unit tests for the basics folder of the Display Core. 
Only useful
+   for kernel devs running KUnit.
 
For more information on KUnit and unit tests in general please 
refer to
the KUnit documentation in Documentation/dev-tools/kunit/.
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 7aafdfeac60e..7efd4768b0d7 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1439,6 +1439,6 @@ bool dc_wake_and_execute_gpint(const struct dc_context 
*ctx, enum dmub_gpint_com
return result;
 }
 
-#if IS_ENABLED(CONFIG_AMD_DC_KUNIT_TEST)
+#if IS_ENABLED(CONFIG_DRM_AMD_DC_KUNIT_TEST)
 #include "../test/kunit/dc/dc_dmub_srv_test.c"
 #endif
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
index aea6e29fd6e5..5c5be75c08e0 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
@@ -5117,6 +5117,6 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct 
display_mode_lib *mode_l
}
 }
 
-#if IS_ENABLED(CONFIG_DML_KUNIT_TEST)
+#if IS_ENABLED(CONFIG_DRM_AMD_DC_DML_KUNIT_TEST)
 #include "../../test/kunit/dc/dml/dcn20/display_mode_vba_20_test.c"
 #endif
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c 
b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
index 45f75a7f84c7..aab34156e9ae 100644
--- a/drivers/gp

[PATCH 0/4] drm/amd/display: Update Display Core unit tests

2024-04-20 Thread Joao Paulo Pereira da Silva
Hey, I'm interested in contributing for display tests from this patch-set.
I've noticed potential updates related to both refactoring and optimization.
This patch-set applies these suggestions.


[WHY]

1.  The single test suite in the file
test/kunit/dc/dml/calcs/bw_fixed_test.c, which tests some static
functions defined in the dc/basics/bpw_fixed.c, is not being run.
According to kunit documentation

(https://www.kernel.org/doc/html/latest/dev-tools/kunit/usage.html#testing-static-functions),
there are two strategies for testing
static functions, but none of them seem to be configured. Additionally,
it appears that the Config DCE_KUNIT_TEST should be associated with this
test, since it was introduced in the same patch of the test

(https://lore.kernel.org/amd-gfx/20240222155811.44096-3-rodrigo.sique...@amd.com/),
but it is not being used anywhere in the display driver.

2.  Also, according to the documentation, "The display/tests folder 
replicates
the folder hierarchy of the display folder". However, note that this 
test file
(test/kunit/dc/dml/calcs/bw_fixed_test.c) has a conflicting path with 
the file
that is being tested (dc/basics/bw_fixed.c).

3.  Config Names and Helps are a bit misleading and don't follow a strict
pattern. For example, the config DML_KUNIT_TEST indicates that it is 
used
to activate tests for the Display Core Engine, but instead activates 
tests
for the Display Core Next. Also, note the different name patterns in
DML_KUNIT_TEST and AMD_DC_BASICS_KUNIT_TEST.

4.  The test suite dcn21_update_bw_bounding_box_test_suite configures an 
init
function that doesn't need to be executed before every test, but only 
once
before the suite runs.

5.  There are some not updated info in the Documentation, such as the
recommended command to run the tests:
$ ./tools/testing/kunit/kunit.py run --arch=x86_64 \
--kunitconfig=drivers/gpu/drm/amd/display/tests
(it doesn't work since there is no .kunitconfig in
drivers/gpu/drm/amd/display/tests)


[HOW]

1. Revise Config names and Help blocks.

2.  Change the path of the test file bw_fixed_test from
test/kunit/dc/dml/calcs/bw_fixed_test.c to 
test/kunit/dc/basics/bw_fixed_test.c
to make it consistent with the Documentation and the other display 
driver
tests. Make this same test file run by importing it conditionally in 
the file
dc/basics/bw_fixed_test.c.

3.  Turn the test init function of the suite
dcn21_update_bw_bounding_box_test_suite into a suite init.

4.  Update Documentation

Joao Paulo Pereira da Silva (4):
  drm/amd/display: Refactor AMD display KUnit tests configs
  drm/amd/display/test: Fix kunit test that is not running
  drm/amd/display/test: Optimize kunit test suite
dml_dcn20_fpu_dcn21_update_bw_bounding_box_test
  Documentation/gpu: Update AMD Display Core Unit Test documentation

 .../gpu/amdgpu/display/display-test.rst   | 20 ++--
 drivers/gpu/drm/amd/display/Kconfig   | 31 ++-
 .../gpu/drm/amd/display/dc/basics/bw_fixed.c  |  3 ++
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |  2 +-
 .../dc/dml/dcn20/display_mode_vba_20.c|  2 +-
 .../dc/dml/dcn20/display_rq_dlg_calc_20.c |  2 +-
 .../drm/amd/display/test/kunit/.kunitconfig   |  7 ++---
 .../gpu/drm/amd/display/test/kunit/Makefile   |  4 +--
 .../dc/{dml/calcs => basics}/bw_fixed_test.c  |  0
 .../test/kunit/dc/dml/dcn20/dcn20_fpu_test.c  |  6 ++--
 10 files changed, 32 insertions(+), 45 deletions(-)
 rename drivers/gpu/drm/amd/display/test/kunit/dc/{dml/calcs => 
basics}/bw_fixed_test.c (100%)

-- 
2.44.0



[PATCH] drm/amd/display: Add prefix to functions inside dnc10_cm_common.h

2024-02-21 Thread Joao Paulo Pereira da Silva
While debugging with ftrace, it's useful to create filters to search
within the codebase. However, since some function names lack prefixes,
creating a good filter may become more difficult.

Because of this, add prefix to functions declared inside the header
dcn10/dcn10_cm_common.h to facilitate creating good filters for the
functions declared inside the file.

Signed-off-by: Joao Paulo Pereira da Silva 
---
 .../drm/amd/display/dc/dcn10/dcn10_cm_common.c | 12 ++--
 .../drm/amd/display/dc/dcn10/dcn10_cm_common.h |  8 
 .../drm/amd/display/dc/dcn10/dcn10_dpp_cm.c| 18 +-
 .../drm/amd/display/dc/dcn20/dcn20_dpp_cm.c|  8 
 .../gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c   |  8 
 .../gpu/drm/amd/display/dc/dcn30/dcn30_dpp.c   |  2 +-
 .../drm/amd/display/dc/dcn30/dcn30_dpp_cm.c|  4 ++--
 .../drm/amd/display/dc/dcn30/dcn30_dwb_cm.c|  6 +++---
 .../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c   |  8 
 .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c|  2 +-
 .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c|  6 +++---
 .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c|  2 +-
 .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c|  2 +-
 13 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c
index 3538973bd0c6..3878b78faf89 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c
@@ -38,7 +38,7 @@
 #define FN(reg_name, field_name) \
reg->shifts.field_name, reg->masks.field_name
 
-void cm_helper_program_color_matrices(
+void dcn10_cm_common_helper_program_color_matrices(
struct dc_context *ctx,
const uint16_t *regval,
const struct color_matrices_reg *reg)
@@ -62,7 +62,7 @@ void cm_helper_program_color_matrices(
 
 }
 
-void cm_helper_program_xfer_func(
+void dcn10_cm_common_helper_program_xfer_func(
struct dc_context *ctx,
const struct pwl_params *params,
const struct xfer_func_reg *reg)
@@ -125,7 +125,7 @@ void cm_helper_program_xfer_func(
 
 
 
-bool cm_helper_convert_to_custom_float(
+bool dcn10_cm_common_helper_convert_to_custom_float(
struct pwl_result_data *rgb_resulted,
struct curve_points3 *corner_points,
uint32_t hw_points_num,
@@ -311,7 +311,7 @@ bool cm_helper_convert_to_custom_float(
 #define DC_LOGGER \
ctx->logger
 
-bool cm_helper_translate_curve_to_hw_format(struct dc_context *ctx,
+bool dcn10_cm_common_helper_translate_curve_to_hw_format(struct dc_context 
*ctx,
const struct dc_transfer_func *output_tf,
struct pwl_params *lut_params, bool fixpoint)
 {
@@ -507,7 +507,7 @@ bool cm_helper_translate_curve_to_hw_format(struct 
dc_context *ctx,
++rgb;
++i;
}
-   cm_helper_convert_to_custom_float(rgb_resulted,
+   dcn10_cm_common_helper_convert_to_custom_float(rgb_resulted,
lut_params->corner_points,
hw_points, fixpoint);
 
@@ -653,7 +653,7 @@ bool cm_helper_translate_curve_to_degamma_hw_format(
++rgb;
++i;
}
-   cm_helper_convert_to_custom_float(rgb_resulted,
+   dcn10_cm_common_helper_convert_to_custom_float(rgb_resulted,
lut_params->corner_points,
hw_points, false);
 
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h
index 0a68b63d6126..0622dbdbe84b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h
@@ -89,23 +89,23 @@ struct color_matrices_reg{
uint32_t csc_c33_c34;
 };
 
-void cm_helper_program_color_matrices(
+void dcn10_cm_common_helper_program_color_matrices(
struct dc_context *ctx,
const uint16_t *regval,
const struct color_matrices_reg *reg);
 
-void cm_helper_program_xfer_func(
+void dcn10_cm_common_helper_program_xfer_func(
struct dc_context *ctx,
const struct pwl_params *params,
const struct xfer_func_reg *reg);
 
-bool cm_helper_convert_to_custom_float(
+bool dcn10_cm_common_helper_convert_to_custom_float(
struct pwl_result_data *rgb_resulted,
struct curve_points3 *corner_points,
uint32_t hw_points_num,
bool fixpoint);
 
-bool cm_helper_translate_curve_to_hw_format(
+bool dcn10_cm_common_helper_translate_curve_to_hw_format(
struct dc_context *ctx,
const struct dc_transfer_

[PATCH 2/2] drm/amd/display: clean else not following close brace

2024-02-13 Thread Joao Paulo Pereira da Silva
From: jppaulo 

Put else statement in the same line and after the close brace.

Signed-off-by: Joao Paulo Pereira da Silva 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
index be5a6d008b29..e750c853890e 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
@@ -396,8 +396,7 @@ void link_enc_cfg_link_encs_assign(
eng_id_req = 
stream->link->dpia_preferred_eng_id;
 
eng_id = find_first_avail_link_enc(stream->ctx, state, 
eng_id_req);
-   }
-   else
+   } else
eng_id =  link_enc->preferred_engine;
 
add_link_enc_assignment(state, stream, eng_id);
-- 
2.43.0



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

2024-02-13 Thread Joao Paulo Pereira da Silva
From: jppaulo 

Clean some wrong indenting that throw errors in checkpatch.

Signed-off-by: Joao Paulo Pereira da Silva 
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +++---
 1 file changed, 3 insertions(+), 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 aa7c02ba948e..7832832b973d 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -962,7 +962,7 @@ static bool dc_construct(struct dc *dc,
goto fail;
}
 
-dc_ctx = dc->ctx;
+   dc_ctx = dc->ctx;
 
/* Resource should construct all asic specific resources.
 * This should be the only place where we need to parse the asic id
@@ -3155,10 +3155,10 @@ static void commit_planes_do_stream_update(struct dc 
*dc,
if (stream_update->mst_bw_update->is_increase)

dc->link_srv->increase_mst_payload(pipe_ctx,

stream_update->mst_bw_update->mst_stream_bw);
-   else
+   else

dc->link_srv->reduce_mst_payload(pipe_ctx,

stream_update->mst_bw_update->mst_stream_bw);
-   }
+   }
 
if (stream_update->pending_test_pattern) {
dc_link_dp_set_test_pattern(stream->link,
-- 
2.43.0



[PATCH 0/2] drm/amd/display: clean codestyle errors

2024-02-13 Thread Joao Paulo Pereira da Silva
jppaulo (2):
  drm/amd/display: clean inconsistent indenting
  drm/amd/display: clean else not following close brace

 drivers/gpu/drm/amd/display/dc/core/dc.c  | 6 +++---
 drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

-- 
2.43.0