- Jul 27, 2022
-
-
Tales Aparecida authored
Use dml_ccflags Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
Tales L. Aparecida authored
Add kernel-doc to init and exit methods Signed-off-by:
Tales L. Aparecida <tales.aparecida@neuralmind.ai>
-
- Jul 26, 2022
-
-
This commit adds unit tests to the functions dcn20_cap_soc_clocks and dcn21_update_bw_bounding_box from dcn20/dcn20_fpu. Co-developed-by:
Tales Aparecida <tales.aparecida@gmail.com> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com> Signed-off-by:
Magali Lemes <magalilemes00@gmail.com>
-
Maíra Canal authored
The display_mode_vba library deals with hundreds of display parameters and sometimes does it in odd ways. The addition of unit tests intends to assure the quality of the code delivered by HW engineers and, also make it possible to refactor the code decreasing concerns about adding bugs to the codebase. Signed-off-by:
Maíra Canal <mairacanal@riseup.net> Co-developed-by:
Tales Aparecida <tales.aparecida@gmail.com> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
Maíra Canal authored
KUnit unifies the test structure and provides helper tools that simplify the development of tests. Basic use case allows running tests as regular processes, which makes easier to run unit tests on a development machine and to integrate the tests in a CI system. This commit introduces a unit test to the bw_fixed library, which performs a lot of the mathematical operations involving fixed-point arithmetic and the conversion of integers to fixed-point representation inside the Display Mode Library. As fixed-point representation is the base foundation of the DML calcs operations, this unit tests intend to assure the proper functioning of the basic mathematical operations of fixed-point arithmetic, such as multiplication, conversion from fractional to fixed-point number, and more. You can run it with: ./tools/testing/kunit/kunit.py run \ --arch=x86_64 \ --kunitconfig=drivers/gpu/drm/amd/display/tests/ Co-developed-by:
Magali Lemes <magalilemes00@gmail.com> Signed-off-by:
Magali Lemes <magalilemes00@gmail.com> Signed-off-by:
Maíra Canal <maira.canal@usp.br> Co-developed-by:
Tales Aparecida <tales.aparecida@gmail.com> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
Maíra Canal authored
The macros defined at bw_fixed are important mathematical definitions, specifying masks to get the fractional part and the maximum and minimum values of I64. In order to enable unit tests for bw_fixed, it is relevant to have access to those macros. This commit moves the macros to the header file, making it accessible to future unit tests. Co-developed-by:
Magali Lemes <magalilemes00@gmail.com> Signed-off-by:
Magali Lemes <magalilemes00@gmail.com> Signed-off-by:
Maíra Canal <maira.canal@usp.br> Co-developed-by:
Tales Aparecida <tales.aparecida@gmail.com> Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
Tales Aparecida authored
The fixed31_32 library performs a lot of the mathematical operations involving fixed-point arithmetic and the conversion of integers to fixed-point representation. This unit tests intend to assure the proper functioning of the basic mathematical operations of fixed-point arithmetic, such as multiplication, conversion from fractional to fixed-point number, and more. Use kunit_tool to run: $ ./tools/testing/kunit/kunit.py run --arch=x86_64 \ --kunitconfig=drivers/gpu/drm/amd/display/tests/ Signed-off-by:
Tales Aparecida <tales.aparecida@gmail.com>
-
Daniel Latypov authored
E.g. run tests but with KASAN $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kconfig_add=CONFIG_KASAN=y This also works with --kunitconfig $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kunitconfig=fs/ext4 --kconfig_add=CONFIG_KASAN=y This flag is inspired by TuxMake's --kconfig-add, see https://gitlab.com/Linaro/tuxmake#examples . Our version just uses "_" as the delimiter for consistency with pre-existing flags like --build_dir, --make_options, --kernel_args, etc. Note: this does make it easier to run into a pre-existing edge case: $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kconfig_add=CONFIG_KASAN=y $ ./tools/testing/kunit/kunit.py run --arch=x86_64 This second invocation ^ still has KASAN enabled! kunit.py won't call olddefconfig if our current .config is already a superset of the provided kunitconfig. Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Daniel Latypov authored
read_from_file() clears its `self` Kconfig object and parses a config file. It is a way to construct Kconfig objects more so than an operation on Kconfig objects. This is reflected in the fact its only ever used as: kconfig = kunit_config.Kconfig() kconfig.read_from_file(path) So clean this up and simplify callers by replacing it with kconfig = kunit_config.parse_file(path) Do the same thing for the related parse_from_string() function as well. Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Michał Winiarski authored
Python 3.10.0 contains: 9e09849d20 ("bpo-41006: importlib.util no longer imports typing (GH-20938)") It causes importlib.util to no longer import importlib.abs, which leads to the following error when trying to use kunit with qemu: AttributeError: module 'importlib' has no attribute 'abc'. Did you mean: '_abc'? Add the missing import. Signed-off-by:
Michał Winiarski <michal.winiarski@intel.com> Reviewed-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Daniel Latypov authored
Background: Currently, a reader looking at kunit/test.h will find the file is quite long, and the first meaty comment is a doc comment about struct kunit_resource. Most users will not ever use the KUnit resource API directly. They'll use kunit_kmalloc() and friends, or decide it's simpler to do cleanups via labels (it often can be) instead of figuring out how to use the API. It's also logically separate from everything else in test.h. Removing it from the file doesn't cause any compilation errors (since struct kunit has `struct list_head resources` to store them). This commit: Let's move it into a kunit/resource.h file and give it a separate page in the docs, kunit/api/resource.rst. We include resource.h at the bottom of test.h since * don't want to force existing users to add a new include if they use the API * it accesses `lock` inside `struct kunit` in a inline func * so we can't just forward declare, and the alternatives require uninlining the func, adding hepers to lock/unlock, or other more invasive changes. Now the first big comment in test.h is about kunit_case, which is a lot more relevant to what a new user wants to know. A side effect of this is git blame won't properly track history by default, users need to run $ git blame -L ,1 -C17 include/kunit/resource.h Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Daniel Latypov authored
KUnit does not have any first party support for "mocking". The original RFC had some, but the code got dropped. However, the documentation patches never got updated. This fixes that. https://kunit.dev/mocking.html has a current writeup on the status quo and will hopefully be eventually folded into the in-kernel Documentation. Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Daniel Latypov authored
We currently store kunit suites in the .kunit_test_suites ELF section as a `struct kunit_suite***` (modulo some `const`s). For every test file, we store a struct kunit_suite** NULL-terminated array. This adds quite a bit of complexity to the test filtering code in the executor. Instead, let's just make the .kunit_test_suites section contain a single giant array of struct kunit_suite pointers, which can then be directly manipulated. Signed-off-by:
Daniel Latypov <dlatypov@google.com> Co-developed-by:
David Gow <davidgow@google.com> Signed-off-by:
David Gow <davidgow@google.com>
-
Daniel Latypov authored
kmemdup() is easier than kmalloc() + memcpy(), per lkp bot. Also make the input `suite` as const since we're now always making copies after commit a127b154 ("kunit: tool: allow filtering test cases via glob"). Reported-by:
kernel test robot <lkp@intel.com> Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Daniel Latypov authored
The existing logic happens to work fine on UML, but is not correct when running on other arches. 1. We didn't initialize `int err`, and kunit_filter_suites() doesn't explicitly set it to 0 on success. So we had false "failures". Note: it doesn't happen on UML, causing this to get overlooked. 2. If we error out, we do not call kunit_handle_shutdown(). This makes kunit.py timeout when using a non-UML arch, since the QEMU process doesn't ever exit. Fixes: a02353f4 ("kunit: bail out of test filtering logic quicker if OOM") Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Daniel Latypov authored
When filtering what tests to run (suites and/or cases) via kunit.filter_glob (e.g. kunit.py run <glob>), we allocate copies of suites. These allocations can fail, and we largely don't handle that. Note: realistically, this probably doesn't matter much. We're not allocating much memory and this happens early in boot, so if we can't do that, then there's likely far bigger problems. This patch makes us immediately bail out from the top-level function (kunit_filter_suites) with -ENOMEM if any of the underlying kmalloc() calls return NULL. Implementation note: we used to return NULL pointers from some functions to indicate either that all suites/tests were filtered out or there was an error allocating the new array. We'll log a short error in this case and not run any tests or print a TAP header. From a kunit.py user's perspective, they'll get a message about missing/invalid TAP output and have to dig into the test.log to see it. Since hitting this error seems so unlikely, it's probably fine to not invent a way to plumb this error message more visibly. See also: https://lore.kernel.org/linux-kselftest/20220329103919.2376818-1-lv.ruyi@zte.com.cn/ Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reported-by:
Zeal Robot <zealci@zte.com.cn> Reported-by:
Lv Ruyi <lv.ruyi@zte.com.cn> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Jeremy Kerr authored
Currently, KUnit runs built-in tests and tests loaded from modules differently. For built-in tests, the kunit_test_suite{,s}() macro adds a list of suites in the .kunit_test_suites linker section. However, for kernel modules, a module_init() function is used to run the test suites. This causes problems if tests are included in a module which already defines module_init/exit_module functions, as they'll conflict with the kunit-provided ones. This change removes the kunit-defined module inits, and instead parses the kunit tests from their own section in the module. After module init, we call __kunit_test_suites_init() on the contents of that section, which prepares and runs the suite. This essentially unifies the module- and non-module kunit init formats. Signed-off-by:
Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by:
Daniel Latypov <dlatypov@google.com> Signed-off-by:
David Gow <davidgow@google.com>
-
Daniel Latypov authored
We've split out the declarations from include/kunit/test.h into resource.h. This patch splits out the definitions as well for consistency. A side effect of this is git blame won't properly track history by default, users need to run $ git blame -L ,1 -C13 lib/kunit/resource.c Signed-off-by:
Daniel Latypov <dlatypov@google.com> Reviewed-by:
David Gow <davidgow@google.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
Aaron Tomlin authored
No functional changes. This patch moves all module related code into a separate directory, modifies each file name and creates a new Makefile. Note: this effort is in preparation to refactor core module code. Reviewed-by:
Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by:
Aaron Tomlin <atomlin@redhat.com> Signed-off-by:
Luis Chamberlain <mcgrof@kernel.org>
-
Dmitry Torokhov authored
Current scheme of having userspace decompress kernel modules before loading them into the kernel runs afoul of LoadPin security policy, as it loses link between the source of kernel module on the disk and binary blob that is being loaded into the kernel. To solve this issue let's implement decompression in kernel, so that we can pass a file descriptor of compressed module file into finit_module() which will keep LoadPin happy. To let userspace know what compression/decompression scheme kernel supports it will create /sys/module/compression attribute. kmod can read this attribute and decide if it can pass compressed file to finit_module(). New MODULE_INIT_COMPRESSED_DATA flag indicates that the kernel should attempt to decompress the data read from file descriptor prior to trying load the module. To simplify things kernel will only implement single decompression method matching compression method selected when generating modules. This patch implements gzip and xz; more can be added later, Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by:
Luis Chamberlain <mcgrof@kernel.org>
-
- Jul 25, 2022
-
-
This version brings along following fixes: - Copy crc_skip_count when duplicating CRTC state - Add debug option for idle optimizations on cursor updates - Disable MPC split for DCN32/321 - Add missing ODM 2:1 policy logic - Update DCN32 and DCN321 SR latencies - Add reinstate dram in the FPO logic - Add dc_ctx to link_enc_create() parameters - Cache cursor when cursor exceeds 64x64 - Add support for manual DMUB FAMS trigger - Fix dpstreamclk programming - Add missing AUDIO_DTO_SEL reg field - Add OTG/ODM functions - Use correct clock source constructor for DCN314 - Use correct DTO_SRC_SEL for 128b/132b encoding - Add pixel rate div calcs and programming - Remove FPU flags from DCN30 Makefile - Create patch bounding box function for isolate FPU - Move mclk calculation function to DML - Remove FPU operations from dcn201 resources - Fallback to SW cursor if SubVP + cursor too big - Drop unnecessary FPU flags on dcn302 files - Reboot while unplug hdcp enabled dp from mst hub - Reset pipe count when iterating for DET override - Calculate MALL cache lines based on Mblks required - Fix two MPO videos in single display ODM combine mode - Guard against zero memory channels - Updates SubVP + SubVP DRR cases updates - Fix OPTC function pointers for DCN314 - Add enable/disable FIFO callbacks to stream setup - Avoid MPC infinite loop Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Anthony Koo <anthony.koo@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[Why] crc_skip_count is used to track how many frames to skip to allow the OTG CRC engine to "warm up" before it outputs correct CRC values. Experimentally, this seems to be 2 frames. When duplicating CRTC states, this value was not copied to the duplicated state. Therefore, when this state is committed, we will needlessly wait 2 frames before outputing CRC values. Even if the CRC engine is already warmed up. [How] Copy the crc_skip_count as part of dm_crtc_duplicate_state. Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Leo Li <sunpeng.li@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
For optimizations and debug purposes we added an option to exit idle operations on cursor updates. Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Alvin Lee <Alvin.Lee2@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
Due to CRB, no need to rely on MPC splitting to maximize use of DET anymore. Reviewed-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Alvin Lee <Alvin.Lee2@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
Phantom pipes must use the same configuration used in main pipes. This commit add this check. Reviewed-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Samson Tam <Samson.Tam@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
Update worst case SR latencies according to values measured by hardware team. Reviewed-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Alvin Lee <Alvin.Lee2@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
In order to handle FPO correctly, we need to reinstate the dram values. This function adds the required code to handle the vblank stretch and the dram calculation. Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[Why&How] Preparation to enable run time initialization of register offsets to add dc_context to the link_enc_create callback. This is needed to get the dc_ctx handle where register offset initialization routine is called. Reviewed-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Acked-by:
Alan Liu <HaoPing.Liu@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Aurabindo Pillai <aurabindo.pillai@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[Why] When Static screen from MALL, the cursor needs to be cached if cursor exceeds 64x64 size. [How] Program the bit that cache cursor in MALL when size of the cursor exceeds 64x64. Reviewed-by:
Jun Lei <Jun.Lei@amd.com> Acked-by:
Alan Liu <HaoPing.Liu@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Chris Park <chris.park@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
- Add is_drr parameter to indicate DRR is enabled on the panel to determine whether SubVP MCLK switch logic should be enabled - Add DRR manual trigger in FW (instead of driver) because manual trigger programming triggers DRR update pending and can block SubVP MCLK switches from taking place Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Anthony Koo <Anthony.Koo@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[WHY] Currently programming incorrect hpo inst as well as selecting incorrect source [HOW] Use hpo inst instead of otg inst to select dpstreamclk inst Reviewed-by:
Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Michael Strauss <michael.strauss@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[WHY] Needed to program audio dto Reviewed-by:
Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Michael Strauss <michael.strauss@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[WHY] Required for correct OTG_H_TIMING_CNTL programming Reviewed-by:
Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Michael Strauss <michael.strauss@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[WHY] Previously was pointing to DCN3 clock constructor rather than DCN31's Reviewed-by:
Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Michael Strauss <michael.strauss@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[WHY] DP DTO isn't used for 128b/132b encoding [HOW] Check current link rate to determine whether using 8b/10b or 128/132b encoding Reviewed-by:
Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Michael Strauss <michael.strauss@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
[WHY/HOW] Need to calculate and set some pixel rate divisors on correct otg_inst Reviewed-by:
Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Michael Strauss <michael.strauss@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
At this stage, we must have all the FPU code for DCN30 isolated in the DML folder. Drop FPU flags from Makefile. Reviewed-by:
Harry Wentland <Harry.Wentland@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
In the DCN30 resource, we have a small patch to the bounding box struct; this patch uses FPU operations. This commit moves that specific part to its function under the DML folder. Reviewed-by:
Harry Wentland <Harry.Wentland@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
The function responsible for calculating the MCLK switching has FPU operations. This commit moves it to the dcn30_fpu file. Reviewed-by:
Harry Wentland <Harry.Wentland@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-
We have some FPU operations on the resource part of the DCN201. This commit drops FPU flags and moves any required FPU code to the DML folder. Reviewed-by:
Harry Wentland <Harry.Wentland@amd.com> Acked-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com>
-