[PATCH 22/22] drm/amd/display: Promote DAL to 3.2.246

2023-08-01 Thread Tom Chung
From: Martin Leung This version brings along following fixes: - Fix a regression in blank pixel data caused by coding mistake - Fix a bug when searching for insert_above_mpcc - Fix backlight off cmd for OLED panel - Update add plane to context logic with a new algorithm - Adjust visual confirm dp

[PATCH 21/22] drm/amd/display: Change HDCP update sequence for DM

2023-08-01 Thread Tom Chung
From: Bhawanpreet Lakha Refactor the sequence in hdcp_update_display() to use mod_hdcp_update_display(). Previous sequence: - remove()->add() This Sequence was used to update the display, (mod_hdcp_update_display didn't exist at the time). This meant for any hdcp updates (type changes,

[PATCH 20/22] drm/amd/display: Fix backlight off cmd for OLED panel

2023-08-01 Thread Tom Chung
From: Swapnil Patel [Why] Currently driver fails to send backlight off command while powering down. This is because in dce110_edp_backlight_control, current backlight status isn't being acccessed correctly for OLED panel with AUX control. [How] Add support for accessing current backlight status

[PATCH 19/22] drm/amd/display: rename acquire_idle_pipe_for_layer to acquire_free_pipe_as_sec_dpp_pipe

2023-08-01 Thread Tom Chung
From: Wenjing Liu [why] Secondary DPP pipes are used for rendering secondary layers of planes. The name "for layer" doesn't make it obvious. The function is acquiring a free pipe as secondary dpp pipe only. We rename it so it is more obvious. In a future follow up change, we want to add functions

[PATCH 18/22] drm/amd/display: move idle pipe allocation logic into dcn specific layer

2023-08-01 Thread Tom Chung
From: Wenjing Liu [why] generic dc resource file should not know what an optimal idle pipe is because this is dcn hardware dependent. [how] We move the optimial pipe searching logic in dcn specific layer. Reviewed-by: Jun Lei Acked-by: Tom Chung Signed-off-by: Wenjing Liu --- .../gpu/drm/am

[PATCH 17/22] drm/amd/display: Use max memclk variable when setting max memclk

2023-08-01 Thread Tom Chung
From: Alvin Lee [Description] In overclocking scenarios the max memclk could be higher than the DC mode limit. However, for configs that don't support MCLK switching we need to set the max memclk to the overclocked max instead of the DC mode max or we could result in underflow. Reviewed-by: Sams

[PATCH 15/22] drm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN314

2023-08-01 Thread Tom Chung
From: Leo Chen [Why & How] HDMI TMDS does not have ODM support. Filtering 420 modes that exceed the 4096 FMT limitation on DCN314 will resolve intermittent corruptions issues. Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Leo Chen --- .../gpu/drm/amd/display/dc/dml/dcn3

[PATCH 16/22] drm/amd/display: Add vendor Id for reference

2023-08-01 Thread Tom Chung
From: Mike Hsieh Add a new vendor ID code for reference Reviewed-by: Wenjing Liu Acked-by: Tom Chung Signed-off-by: Mike Hsieh --- drivers/gpu/drm/amd/display/include/ddc_service_types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types

[PATCH 14/22] drm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN31

2023-08-01 Thread Tom Chung
From: Leo Chen [Why & How] HDMI TMDS does not have ODM support. Filtering 420 modes that exceed the 4096 FMT limitation on DCN31 will resolve intermittent corruptions issues. Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Leo Chen --- .../gpu/drm/amd/display/dc/dml/dcn31

[PATCH 13/22] drm/amd/display: Revert "dc: read down-spread percentage from lut to adjust dprefclk"

2023-08-01 Thread Tom Chung
From: Leo Chen [Why & How] Revert commit feb90174e9c6 ("drm/amd/display: Read down-spread percentage from lut to adjust dprefclk.") This change was causing 240hz display to not light up after s0i3. Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Leo Chen --- .../dc/clk_m

[PATCH 12/22] drm/amd/display: do not treat clip_rect size change as a scaling change

2023-08-01 Thread Tom Chung
From: Wenjing Liu [why] With previous ODM + MPO policy we will only allocate pipes when MPO plane has intersection with current ODM slice. With this policy we have to indicate scaling change when plane clip is updated in case plane clip change causes MPO plane to go in or out current ODM slice. W

[PATCH 10/22] drm/amd/display: update add plane to context logic with a new algorithm

2023-08-01 Thread Tom Chung
From: Wenjing Liu [why] Preivous algorithm for finding an optimal idle pipe for a new plane was implemented to handle dynamic pipe allocation when MPO plane moves from one ODM slice to the other. Now pipe allocation is more static so it no longer depends on the MPO plane's position. We are simpli

[PATCH 11/22] drm/amd/display: adjust visual confirm dpp height offset to be 1/240 of v addressable

2023-08-01 Thread Tom Chung
From: Wenjing Liu [why] For timing with large v addressable visual confirm is just too small. It is difficult to tell visually which DPP we are using. On the other hand with timing with small v addressable visual confirm is too large and covers the UI area. [how] We calculate visual confirm dp

[PATCH 09/22] drm/amd/display: always acquire MPO pipe for every blending tree

2023-08-01 Thread Tom Chung
From: Wenjing Liu [why] We only acquire MPO pipe for blending tree where the plane clip will be rendered. If an MPO plane is outside current ODM slice rect, we will skip pipe allocation. With new programming policy we want to allocate pipes for every ODM slice blending tree even for those whose O

[PATCH 07/22] drm/amd/display: Use DTBCLK as refclk instead of DPREFCLK

2023-08-01 Thread Tom Chung
From: Austin Zheng [Why] Flash of corruption observed when UCLK switching after transitioning from DTBCLK to DPREFCLK on subVP(DP) + subVP(HDMI) config Scenario where DPREFCLK is required instead of DTBCLK is not expected [How] Always set the DTBCLK source as DTBCLK0 Reviewed-by: Alvin Lee Ack

[PATCH 08/22] drm/amd/display: support plane clip with zero recout size

2023-08-01 Thread Tom Chung
From: Wenjing Liu [why] If plane clip is outside current pipe's ODM slice rect, our logic will fail validation because we assume that when a pipe is acquired to support a plane clip, it must blend some portion of the plane on the screen. This assumption needs to be changed. When a pipe is acquire

[PATCH 06/22] drm/amd/display: Set Stream Update Flags in commit_state_no_check

2023-08-01 Thread Tom Chung
From: Austin Zheng [Why] Front-end would be programmed using the stream update flags set from the previous update and the full update should be triggered whenever commit_state_no_check gets called. [How] Set all stream update flags before programming the front-end Clear all flags that got set to

[PATCH 05/22] drm/amd/display: Make mpc32 functions available to future DCNs

2023-08-01 Thread Tom Chung
From: Wesley Chalmers Make the mpc32 functions available for future DCNs to use Reviewed-by: Jun Lei Acked-by: Tom Chung Signed-off-by: Wesley Chalmers --- .../gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c | 28 - .../gpu/drm/amd/display/dc/dcn32/dcn32_mpc.h | 61 +++ 2

[PATCH 04/22] drm/amd/display: Fix a bug when searching for insert_above_mpcc

2023-08-01 Thread Tom Chung
From: Wesley Chalmers [WHY] Currently, when insert_plane is called with insert_above_mpcc parameter that is equal to tree->opp_list, the function returns NULL. [HOW] Instead, the function should insert the plane at the top of the tree. Cc: Mario Limonciello Cc: Alex Deucher Cc: sta...@vger.ke

[PATCH 03/22] drm/amd/display: Enable DPIA trace with DC debug mask

2023-08-01 Thread Tom Chung
From: Stylon Wang [Why] DPIA traces from DMUB is not enabled by default, which is less convenient to debug DPIA related issues because we have to resort to other means to enable DPIA trace. [How] Reuse existing DC debug mask to enable DPIA trace log from kernel command line. This makes debugging

[PATCH 02/22] drm/amd/display: Add interface to enable DPIA trace

2023-08-01 Thread Tom Chung
From: Stylon Wang [Why] DPIA traces from DMUB is not enabled by default, which is less convenient to debug DPIA related issues because we have to resort to other debug tools to enable DPIA trace. [How] Exposes interfaces to update trace mask from the DMUB GPING commands. Also provides DC impleme

[PATCH 01/22] drm/amd/display: fix a regression in blank pixel data caused by coding mistake

2023-08-01 Thread Tom Chung
From: Wenjing Liu [why] There was unfortunately a coding mistake. It gets caught with an ultrawide monitor that requires ODM 4:1 combine. We are blanking or unblanking pixel data we are supposed to enumerate through all ODM pipes and program DPG for each of those pipes. However the coding mistak

[PATCH 00/22] DC Patches Aug 04 2023

2023-08-01 Thread Tom Chung
This DC patchset brings improvements in multiple areas. In summary, we have: - Fix a regression in blank pixel data caused by coding mistake - Fix a bug when searching for insert_above_mpcc - Fix backlight off cmd for OLED panel - Update add plane to context logic with a new algorithm - Adjust vis

[PATCH] drm/amdgpu: Report vbios version instead of PN

2023-08-01 Thread Lijo Lazar
Report VBIOS version in vbios_version sysfs node instead of part number. Part number remains constant for a SKU type. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_a

[PATCH] drm/amd/pm: Fix SMU v13.0.6 energy reporting

2023-08-01 Thread Lijo Lazar
Energy counter should be reported in units of 15.259 uJ. Don't apply any conversion. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b

[PATCH] drm/amdgpu: Refactor 'amdgpu_connector_dvi_detect' in amdgpu_connectors.c

2023-08-01 Thread Srinivasan Shanmugam
Fixes the below: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: Missing a blank line after declarations WARNING: Too many leading tabs - consider code refactoring + if (list_connector->connector_type != DRM_MODE_CONNECTOR_VGA) { WAR

RE: [PATCH] drm/amdgpu: Fix unused variable ‘i’ in 'gfxhub_v1_2_xcc_gart_enable'

2023-08-01 Thread Chen, Guchun
[Public] Reviewed-by: Guchun Chen > -Original Message- > From: SHANMUGAM, SRINIVASAN > Sent: Wednesday, August 2, 2023 9:39 AM > To: Koenig, Christian ; Deucher, Alexander > ; Chen, Guchun ; > Pan, Xinhui > Cc: amd-gfx@lists.freedesktop.org; SHANMUGAM, SRINIVASAN > > Subject: [PATCH]

[PATCH] drm/amdgpu: Fix unused variable ‘i’ in 'gfxhub_v1_2_xcc_gart_enable'

2023-08-01 Thread Srinivasan Shanmugam
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c: In function ‘gfxhub_v1_2_xcc_gart_enable’: drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:405:6: warning: unused variable ‘i’ [-Wunused-variable] 405 | int i; | Cc: Guchun Chen Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by:

RE: [PATCH] gpu: drm: amd: amdgpu: Fix calls to dev_{info,err}

2023-08-01 Thread Chen, Guchun
[Public] Hi Bert, Thanks for your patch. However, I guess adding a dev member for printing purpose only does not introduce much benefit. So, instead, the culprit commits have been reverted. https://patchwork.freedesktop.org/patch/550297/ https://patchwork.freedesktop.org/patch/550396/ Regards,

RE: [PATCH -next] drm/amd/pm: Remove many unnecessary NULL values

2023-08-01 Thread Quan, Evan
[AMD Official Use Only - General] Reviewed-by: Evan Quan > -Original Message- > From: Ruan Jinjie > Sent: Tuesday, August 1, 2023 8:55 PM > To: Quan, Evan ; Deucher, Alexander > ; Koenig, Christian > ; Pan, Xinhui ; > airl...@gmail.com; dan...@ffwll.ch; mrip...@kernel.org; > tzimmerm...

[PATCH] drm/amd: fix debugfs access for discovery blob

2023-08-01 Thread Mario Limonciello
Accessing the blob for amdgpu discovery from debugfs triggers: [ 1924.487667] kernel BUG at mm/usercopy.c:102! usercopy_abort() explains that it needs to be solved by creating a cache to store the data. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2748#note_2023519 Signed-off-by: Mario

Re: [PATCH v2] drm/amdgpu: Prefer pr_err/_warn/_notice over printk in amdgpu_atpx_handler.c

2023-08-01 Thread Luben Tuikov
On 2023-08-01 01:01, Srinivasan Shanmugam wrote: > Fixes the following style issues: > > ERROR: open brace '{' following function definitions go on the next line > WARNING: printk() should include KERN_ facility level > > Cc: Guchun Chen > Cc: Christian König > Cc: Alex Deucher > Cc: Bert Karw

[PATCH v5 19/22] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN

2023-08-01 Thread Jim Cromie
Lots of burn-in testing needed before signing, upstreaming. NOTE: I set default Y to maximize testing by default. Is there a better way to do this ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/Kconfi

[PATCH v5 22/22] checkpatch: reword long-line warn about commit-msg

2023-08-01 Thread Jim Cromie
Reword the warning to complain about line length 1st, since thats whats actually tested. Cc: a...@canonical.com Cc: j...@perches.com Signed-off-by: Jim Cromie --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.

[PATCH v5 21/22] dyndbg-doc: add classmap info to howto

2023-08-01 Thread Jim Cromie
Add some basic info on classmap usage and api Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 64 ++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic

[PATCH v5 20/22] drm-drivers: DRM_CLASSMAP_USE in 2nd batch of drivers, helpers

2023-08-01 Thread Jim Cromie
Add a DRM_CLASSMAP_USE declaration to 2nd batch of helpers and *_drv.c files. For drivers, add the decl just above the module's PARAMs, since it identifies the "inherited" drm.debug param. Note: with CONFIG_DRM_USE_DYNAMIC_DEBUG=y, a module not also declaring DRM_CLASSMAP_USE will have its class'

[PATCH v5 17/22] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API

2023-08-01 Thread Jim Cromie
move macro from test-dynamic-debug.c into header, and refine it. Distinguish the 2 use cases of DYNDBG_CLASSMAP_PARAM* 1.DYNDBG_CLASSMAP_PARAM_REF for DRM, to pass in extern __drm_debug by name. dyndbg keeps bits in it, so drm can still use it as before 2.DYNDBG_CLASSMAP_PARAM new us

[PATCH v5 16/22] dyndbg: refactor ddebug_classparam_clamp_input

2023-08-01 Thread Jim Cromie
Extract input validation code, from param_set_dyndbg_module_classes() (the sys-node >handler) to new: ddebug_classparam_clamp_input(kp), call it from former. It takes kernel-param arg, so it can complain about "foo: bad input". Reuse ddparam_clamp_input(kp) in ddebug_sync_classbits(), to validate

[PATCH v5 18/22] dyndbg-test: build it with just CONFIG_DYNAMIC_DEBUG_CORE

2023-08-01 Thread Jim Cromie
Make the test-module buildable with CONFIG_DYNAMIC_DEBUG_CORE; add CFLAGS_$ofile defns to supply -DDYNAMIC_DEBUG_MODULE to cc. Change the Kconfig entry to allow building with just _CORE, and fix the help text. Signed-off-by: Jim Cromie --- lib/Kconfig.debug | 10 +- lib/Makefile |

[PATCH v5 15/22] dyndbg: add for_each_boxed_vector

2023-08-01 Thread Jim Cromie
Add a for_each iterator to walk a counted vector member in a struct (ie the box), and use it to replace 8 open-coded loops. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynami

[PATCH v5 14/22] dyndbg-API: fix CONFIG_DRM_USE_DYNAMIC_DEBUG regression

2023-08-01 Thread Jim Cromie
DECLARE_DYNDBG_CLASSMAP() has a design error; it fails a basic K&R rule: "define once, refer many times". When DRM_USE_DYNAMIC_DEBUG=y, DECLARE_DYNDBG_CLASSMAP() is used across DRM core & drivers; they all repeat the same classmap-defn args, which must match for the modules to respond together whe

[PATCH v5 11/22] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap

2023-08-01 Thread Jim Cromie
old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-

[PATCH v5 13/22] checkpatch: special case for file-scoped extern linker-symbol

2023-08-01 Thread Jim Cromie
"externs should be avoided in .c files" needs an exception for linker symbols, like those that mark the start, stop of many kernel sections. Since code already checks REALNAME to avoid linker-scripts entirely, add a new else-if block to look at them instead. As a simple heuristic, treat all words

[PATCH v5 09/22] dyndbg: silence debugs with no-change updates

2023-08-01 Thread Jim Cromie
check for actual changes before announcing them, declutter logs. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 2a5cbb68d88d..a8973d1a6896 100644 --- a/lib/dynamic_

[PATCH v5 13/22] checkpatch: file-scoped extern special case for linker-symbol

2023-08-01 Thread Jim Cromie
"externs should be avoided in .c files" needs an exception for linker symbols, like those that mark the start, stop of many kernel sections. Since code already checks REALNAME to avoid linker-scripts entirely, add a new else-if block to look at them instead. As a simple heuristic, treat all words

[PATCH v5 10/22] dyndbg: tighten ddebug_class_name() 1st arg type

2023-08-01 Thread Jim Cromie
Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_d

[PATCH v5 12/22] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code

2023-08-01 Thread Jim Cromie
Remove the NAMED class types; these 2 classmap types accept class names at the PARAM interface, for example: echo +DRM_UT_CORE,-DRM_UT_KMS > /sys/module/drm/parameters/debug_names The code works, but its only used by test-dynamic-debug, and wasn't asked for by anyone else, so simplify things fo

[PATCH v5 08/22] dyndbg: reduce verbose/debug clutter

2023-08-01 Thread Jim Cromie
currently, for verbose=3, these are logged (blank lines for clarity): dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op='+' dyndbg: flags=0x1 dyndbg: *flagsp=0x1 *maskp=0x dyndbg: parsed: func="" file="" module="" format="

[PATCH v5 07/22] dyndbg: drop NUM_TYPE_ARRAY

2023-08-01 Thread Jim Cromie
ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 596d0664c29f..719c5b6a

[PATCH v5 06/22] dyndbg: split param_set_dyndbg_classes to module/wrapper fns

2023-08-01 Thread Jim Cromie
rename param_set_dyndbg_classes: add _module_ name & arg, old name is wrapper to new. New arg allows caller to specify that only one module is affected by a prdbgs update. Outer fn preserves kernel_param interface, passing NULL to inner fn. This selectivity will be used later to narrow the scope

[PATCH v5 05/22] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it

2023-08-01 Thread Jim Cromie
Add query_module param to ddebug_apply_class_bitmap(). This allows its caller to update just one module, or all (as currently). We'll use this later to propagate drm.debug to each USEr as they're modprobed. No functional change. Signed-off-by: Jim Cromie --- after `modprobe i915`, heres the m

[PATCH v5 04/22] dyndbg: replace classmap list with a vector

2023-08-01 Thread Jim Cromie
Classmaps are stored/linked in a section/array, but are each added to the module's ddebug_table.maps list-head. This is unnecessary; even when ddebug_attach_classmap() is handling the builtin section (with classmaps for multiple builtin modules), its contents are ordered, so a module's possibly mu

[PATCH v5 02/22] test-dyndbg: fixup CLASSMAP usage error

2023-08-01 Thread Jim Cromie
more careful reading of test output reveals: lib/test_dynamic_debug.c:103 [test_dynamic_debug]do_cats =pmf "doing categories\n" lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =p "LOW msg\n" class:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =p "MID msg\n" class:HI lib/t

[PATCH v5 03/22] dyndbg: make ddebug_class_param union members same size

2023-08-01 Thread Jim Cromie
struct ddebug_class_param keeps a ref to the state-storage of the param, make both flavors use the same unsigned long under-type. ISTM this is simpler and safer. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- lib/dynamic_debug.c | 2 +- 2 files changed, 2 insertion

[PATCH v5 00/22] fix DRM_USE_DYNAMIC_DEBUG regression

2023-08-01 Thread Jim Cromie
Hi Jason, Daniel, etal This is V5, Im hoping to land this one. patchwork will probably call this set v3 113361 fix DRM_USE_DYNAMIC_DEBUG regression - revs 1,2 111652 DRM_USE_DYNAMIC_DEBUG regression - older, also 2 revs It (patch 14 mainly): Fixes: aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CL

[PATCH v5 01/22] drm: use correct ccflags-y syntax

2023-08-01 Thread Jim Cromie
Incorrect CFLAGS- usage failed to add -DDYNAMIC_DEBUG_MODULE, which broke builds with: CONFIG_DRM_USE_DYNAMIC_DEBUG=y CONFIG_DYNAMIC_DEBUG_CORE=y but without DYNAMIC_DEBUG Nobody noticed because a larger regression emerged. Also add subdir-ccflags so that all drivers pick up the addition. Fixes

Re: [PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-01 Thread Christian König
Am 31.07.23 um 18:14 schrieb Limonciello, Mario: On 7/31/2023 8:26 AM, Ruan Jinjie wrote: Ther are many ternary operators, the true or false judgement of which is unnecessary in C language semantics. s/Ther/There/ Unnecessary; sure.  But don't they improve the readability quite a bit? No,

RE: [PATCH] drm/amd/pm: fix variable dereferenced issue in amdgpu_device_attr_create()

2023-08-01 Thread Feng, Kenneth
[AMD Official Use Only - General] Reviewed-by: Kenneth Feng -Original Message- From: amd-gfx On Behalf Of Yang Wang Sent: Tuesday, August 1, 2023 5:16 PM To: amd-gfx@lists.freedesktop.org Cc: Dan Carpenter ; Wang, Yang(Kevin) Subject: [PATCH] drm/amd/pm: fix variable dereferenced iss

Re: [PATCH] drm/amd/pm: Clean up errors in smu73_discrete.h

2023-08-01 Thread Jani Nikula
On Tue, 01 Aug 2023, Bagas Sanjaya wrote: > And it is unfortunate that you and @208suo.com people doesn't reply to > review comments (try searching lore.kernel.org) Essentially a one-way firehose of patches pointed at our general direction is not benefitial to the community. It's not participatio

Re: [PATCH] drm/amd: Clean up errors in processpptables.c

2023-08-01 Thread Jani Nikula
On Tue, 01 Aug 2023, Ran Sun wrote: > Fix the following errors reported by checkpatch: > > ERROR: open brace '{' following function definitions go on the next line > ERROR: code indent should use tabs where possible > ERROR: space required before the open parenthesis '(' The commit message does n

RE: [PATCH] drm/amdgpu: Clean up errors in vega20_baco.c

2023-08-01 Thread Quan, Evan
[AMD Official Use Only - General] Reviewed-by: Evan Quan > -Original Message- > From: amd-gfx On Behalf Of Ran > Sun > Sent: Tuesday, August 1, 2023 4:03 PM > To: Deucher, Alexander ; airl...@gmail.com; > dan...@ffwll.ch > Cc: Ran Sun ; dri-de...@lists.freedesktop.org; > amd-gfx@lists.f

RE: [PATCH] drm/amd/pm: Clean up errors in vega20_hwmgr.h

2023-08-01 Thread Quan, Evan
[AMD Official Use Only - General] Reviewed-by: Evan Quan > -Original Message- > From: amd-gfx On Behalf Of Ran > Sun > Sent: Tuesday, August 1, 2023 10:39 AM > To: Deucher, Alexander ; airl...@gmail.com; > dan...@ffwll.ch > Cc: Ran Sun ; dri-de...@lists.freedesktop.org; > amd-gfx@lists.

[PATCH] drm/amd/pm: fix variable dereferenced issue in amdgpu_device_attr_create()

2023-08-01 Thread Yang Wang
- fix variable ('attr') dereferenced issue. - using condition check instead of BUG_ON(). Fixes: 4e01847c38f7 ("drm/amdgpu: optimize amdgpu device attribute code") Cc: Dan Carpenter Signed-off-by: Yang Wang --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 10 +++--- 1 file changed, 7 insertions(+),

Re: [PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-01 Thread Ruan Jinjie
On 2023/8/1 0:14, Limonciello, Mario wrote: > > > On 7/31/2023 8:26 AM, Ruan Jinjie wrote: >> Ther are many ternary operators, the true or false judgement >> of which is unnecessary in C language semantics. > s/Ther/There/ > > Unnecessary; sure.  But don't they improve the readability quite a

Re: [PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-01 Thread Ruan Jinjie
On 2023/8/1 0:22, Tom Rix wrote: > > On 7/31/23 6:26 AM, Ruan Jinjie wrote: >> Ther are many ternary operators, the true or false judgement >> of which is unnecessary in C language semantics. >> >> Signed-off-by: Ruan Jinjie >> --- > > snip >> data->registry_data.avfs_support = >> -

[PATCH] drm/amd/pm/powerplay/hwmgr/ppevvmath: Clean up errors in ppevvmath.h

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: return is not a function, parentheses are not required ERROR: space required after that ',' (ctx:VxV) ERROR: space required before the open parenthesis '(' ERROR: need consistent spacing around '-' (ctx:WxV) Signed-off-by: Ran Sun --- driv

[PATCH] drm/amd/pm: Clean up errors in amd_powerplay.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: spaces required around that '||' (ctx:WxO) Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 16 1 file changed, 8 insertions(+), 8 deleti

[PATCH] drm/amd/pm: Clean up errors in vega10_powertune.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: space prohibited after that open parenthesis '(' Signed-off-by: Ran Sun --- .../amd/pm/powerplay/hwmgr/vega10_powertune.c | 89 +++ 1 file changed, 31 insertions(+), 5

[PATCH] drm/amdgpu: Clean up errors in vega20_baco.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: space required before the open parenthesis '(' Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_baco.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletion

[PATCH] drm/amd/pm: Clean up errors in amdgpu_smu.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: spaces required around that '=' (ctx:WxV) ERROR: spaces required around that '&&' (ctx:VxW) ERROR: that open brace { should be on the previous line ERROR: space required before the open parenthesis '(' ERROR: space required before the open br

[PATCH] drm/amdgpu: Clean up errors in common_baco.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: code indent should use tabs where possible Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/common_baco.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/common_ba

[PATCH] drm/amd/pm: Clean up errors in smu_v13_0_5_ppt.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_p

[PATCH] drm/amd/pm: Clean up errors in smu_v13_0_7_ppt.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: open brace '{' following struct go on the same line ERROR: spaces required around that '=' (ctx:VxW) ERROR: that open brace { should be on the previous line Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c |

[PATCH] drm/amd/pm: Clean up errors in smu_v11_0.h

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: code indent should use tabs where possible Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v11_0.h | 7 +++--- scripts/checkpatch.pl| 23 -

[PATCH] drm/amd/pm: Clean up errors in smu10_hwmgr.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: spaces required around that '=' (ctx:VxW) ERROR: space required after that ',' (ctx:VxV) Signed-off-by: Ran Sun --- .../gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) di

[PATCH] drm/amd/pm: Clean up errors in amdgpu_smu.h

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: open brace '{' following enum go on the same line ERROR: open brace '{' following struct go on the same line Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 36 +++ 1 file changed, 12 insertions(+

[PATCH] drm/amd/pm: Clean up errors in vega10_hwmgr.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: trailing statements should be on next line ERROR: space required before the open brace '{' ERROR: space required before the open parenthesis '(' ERROR: space required after that ',' (ctx:VxV) Signed-off-by: Ran Sun --- .../drm/amd/pm/power

[PATCH] drm/amd/pm: Clean up errors in smu_v13_0.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: space required before the open parenthesis '(' ERROR: that open brace { should be on the previous line Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-)

[PATCH] drm/amd/pm: Clean up errors in vega12_hwmgr.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: need consistent spacing around '/' (ctx:WxV) ERROR: code indent should use tabs where possible Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-

[PATCH] drm/amd/pm: Clean up errors in vega10_baco.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: space required after that ',' (ctx:VxV) ERROR: space prohibited before that ',' (ctx:WxV) Signed-off-by: Ran Sun --- .../drm/amd/pm/powerplay/hwmgr/vega10_baco.c | 26 ---

[PATCH] drm/amd/pm: Clean up errors in vega12_baco.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_baco.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerp

[PATCH] drm/amdgpu: Clean up errors in smu_helper.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: spaces required around that '=' (ctx:VxV) ERROR: spaces required around that '<' (ctx:VxV) Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH] drm/amd/pm: Clean up errors in vega20_hwmgr.h

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: open brace '{' following enum go on the same line Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/h

[PATCH] drm/amd/pm: Clean up errors in fiji_baco.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line Signed-off-by: Ran Sun --- .../drm/amd/pm/powerplay/hwmgr/fiji_baco.c| 24 +++ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/power

[bug report] drm/amdgpu: optimize amdgpu device attribute code

2023-08-01 Thread Dan Carpenter
Hello Kevin Wang, This is a semi-automatic email about new static checker warnings. The patch 4e01847c38f7: "drm/amdgpu: optimize amdgpu device attribute code" from Apr 27, 2020, leads to the following Smatch complaint: ./drivers/gpu/drm/amd/pm/amdgpu_pm.c:2182 amdgpu_device_attr_create()

[PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-01 Thread Ruan Jinjie
Ther are many ternary operators, the true or false judgement of which is unnecessary in C language semantics. Signed-off-by: Ruan Jinjie --- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 2 +- drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c

[PATCH] drm/amd/pm: Clean up errors in smu_v13_0_6_ppt.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: code indent should use tabs where possible ERROR: that open brace { should be on the previous line Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(

[PATCH] drm/amdgpu: Clean up errors in ci_baco.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line Signed-off-by: Ran Sun --- .../gpu/drm/amd/pm/powerplay/hwmgr/ci_baco.c | 21 +++ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/power

Re: [PATCH v3 0/4] mm: convert to vma_is_initial_heap/stack()

2023-08-01 Thread Peter Zijlstra
On Fri, Jul 28, 2023 at 01:00:39PM +0800, Kefeng Wang wrote: > Kefeng Wang (4): > mm: factor out VMA stack and heap checks > drm/amdkfd: use vma_is_initial_stack() and vma_is_initial_heap() > selinux: use vma_is_initial_stack() and vma_is_initial_heap() > perf/core: use vma_is_initial_stac

Re: [PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-08-01 Thread Tom Rix
On 7/31/23 6:26 AM, Ruan Jinjie wrote: Ther are many ternary operators, the true or false judgement of which is unnecessary in C language semantics. Signed-off-by: Ruan Jinjie --- snip data->registry_data.avfs_support = - hwmgr->feature_mask & PP_AVFS_MASK ? true : fals

[PATCH] drm/amd: Clean up errors in smu_v13_0_5_ppt.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h b/driver

[PATCH] drm/amd/pm: Clean up errors in smu_v11_0_pptable.h

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: trailing whitespace ERROR: open brace '{' following struct go on the same line ERROR: code indent should use tabs where possible Signed-off-by: Ran Sun --- .../gpu/drm/amd/pm/swsmu/inc/smu_v11_0_pptable.h | 15 ++- 1 file chan

[PATCH] drm/amd/pm: Clean up errors in vega12_pptable.h

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: open brace '{' following struct go on the same line ERROR: space prohibited before open square bracket '[' Signed-off-by: Ran Sun --- .../gpu/drm/amd/pm/powerplay/hwmgr/vega12_pptable.h | 11 +-- 1 file changed, 5 insertions(+),

[PATCH] drm/amdgpu: Clean up errors in smu7_powertune.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: space required after that ',' (ctx:VxV) Signed-off-by: Ran Sun --- .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c | 13 + 1 file changed, 5 insertions(+), 8 deletions

[PATCH] gpu: drm: amd: amdgpu: Fix calls to dev_{info,err}

2023-08-01 Thread Bert Karwatzki
Commit b0bd0a92b8158ea9c809d885e0f0c21518bdbd14 introduced dev_{info,err} calls which failed (leading to a hang on boot) because of an incorrect usage of the container_of macro. This fixes the error by introducing a pointer to the device as an additional element in struct amdgpu_atpx and struct rad

[PATCH] drm/amd/pm: Clean up errors in aldebaran_ppt.c

2023-08-01 Thread Ran Sun
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: space required after that ',' (ctx:VxV) ERROR: spaces required around that '=' (ctx:VxW) ERROR: else should follow close brace '}' Signed-off-by: Ran Sun --- drivers/gpu/drm/amd/pm/sw

[PATCH] drm/amdgpu: add support to create large TMR BO for APU

2023-08-01 Thread Lang Yu
TMR requires physical contiguous memory, amdgpu_bo_create_kernel() can't satisfy large(>128MB) physical contiguous memory allocation request with default 512MB VRAM on APU. When requested TMR size > 128MB, use amdgpu_bo_create_kernel_at() to create the BO at offset 32MB with a step 1MB in the VRAM

[PATCH v3] drm/amdgpu: refine amdgpu_bo_create_kernel_at()

2023-08-01 Thread Lang Yu
Use amdgpu_bo_create_reserved() to create a BO in VRAM domain would fail if requested VRAM size is large(>128MB) on APU which usually has a default 512MB VRAM. That's because VRAM is framgented after several allocations. The approach is using amdgpu_bo_create_reserved() to create a BO in CPU doma