Re: [PATCH v2 18/21] drm/amd/display: Fallback to 2020_YCBCR if the pixel encoding is not RGB

2023-01-25 Thread Sebastian Wick
On Tue, Jan 24, 2023 at 7:57 PM Harry Wentland wrote: > > > > On 1/24/23 10:37, Harry Wentland wrote: > > > > > > On 1/23/23 15:30, Sebastian Wick wrote: > >> A new property to control YCC and subsampling would be the more > >> complete path here. If we actually want to fix this in the short-term

Re: [PATCH v2 18/21] drm/amd/display: Fallback to 2020_YCBCR if the pixel encoding is not RGB

2023-01-25 Thread Sebastian Wick
On Wed, Jan 25, 2023 at 2:00 PM Joshua Ashton wrote: > > > > On 1/23/23 20:30, Sebastian Wick wrote: > > A new property to control YCC and subsampling would be the more > > complete path here. If we actually want to fix this in the short-term > > though, we should handle the YCC and RGB

[PATCH 16/16] drm/amd/display: 3.2.221

2023-01-25 Thread Alex Hung
From: Aric Cyr This version brings along following fixes: - fix linux dp link lost handled only one time - Reset DMUB mailbox SW state after HW reset - Unassign does_plane_fit_in_mall function from dcn3.2 - Add Function delaration in dc_link - Fix crash when connecting 2 displays with video

[PATCH 15/16] drm/amd/display: fix linux dp link lost handled only one time

2023-01-25 Thread Alex Hung
From: Hersen Wu [Why] linux amdgpu defer handle link lost irq. dm add handle request to irq work queue for the first irq of link lost. if link training fails for link lost handle, link will not be enabled anymore. [How] allow adding handle request of link lost to work queue before running dp

[PATCH 14/16] drm/amd/display: Reset DMUB mailbox SW state after HW reset

2023-01-25 Thread Alex Hung
From: Nicholas Kazlauskas [Why] Otherwise we can be out of sync with what's in the hardware, leading to us rerunning every command that's presently in the ringbuffer. [How] Reset software state for the mailboxes in hw_reset callback. This is already done as part of the mailbox init in hw_init,

[PATCH 13/16] drm/amd/display: Unassign does_plane_fit_in_mall function from dcn3.2

2023-01-25 Thread Alex Hung
From: George Shen [Why] The hwss function does_plane_fit_in_mall not applicable to dcn3.2 asics. Using it with dcn3.2 can result in undefined behaviour. [How] Assign the function pointer to NULL. Reviewed-by: Alvin Lee Acked-by: Alex Hung Signed-off-by: George Shen ---

[PATCH 12/16] drm/amd/display: Add Function delaration in dc_link

2023-01-25 Thread Alex Hung
From: Mustapha Ghaddar [WHY] Housekeeping cleaning and adding declaration for function to be called from DM layer [HOW] Adding public functions to dc_link.h Reviewed-by: Jun Lei Acked-by: Alex Hung Signed-off-by: Mustapha Ghaddar --- drivers/gpu/drm/amd/display/dc/dc_link.h | 27

[PATCH 11/16] drm/amd/display: Revert "avoid disable otg when dig was disabled"

2023-01-25 Thread Alex Hung
From: Aric Cyr This reverts commit 82dca8576d14f3dcb775b3be5f1bbb5df9a682ac. Acked-by: Alex Hung Signed-off-by: Aric Cyr --- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c| 26 +-- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git

[PATCH 10/16] drm/amd/display: Adjust downscaling limits for dcn314

2023-01-25 Thread Alex Hung
From: Daniel Miess [Why] Lower max_downscale_ratio and ARGB888 downscale factor to prevent cases where underflow may occur on dcn314 [How] Set max_downscale_ratio to 400 and ARGB downscale factor to 250 for dcn314 Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung Signed-off-by: Daniel

[PATCH 09/16] drm/amd/display: fix FCLK pstate change underflow

2023-01-25 Thread Alex Hung
From: Vladimir Stempen [Why] Currently we set FCLK p-state change watermark calculated based on dummy p-state latency when UCLK p-state is not supported [How] Calculate FCLK p-state change watermark based on on FCLK pstate change latency in case UCLK p-state is not supported Reviewed-by:

[PATCH 08/16] drm/amd/display: Fix only one ABM pipe enabled under ODM combined case

2023-01-25 Thread Alex Hung
From: Leon Huang [Why] ABM set pipe before updating ODM status, it leads to incorrect ABM pipe setting when enabling ODM combine. [How] Call ABM set pipe flow after ODM status update in program pipe sequence. Reviewed-by: Chun-Liang Chang Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung

[PATCH 07/16] drm/amd/display: Add missing brackets in calculation

2023-01-25 Thread Alex Hung
From: Daniel Miess [Why] Brackets missing in the calculation for MIN_DST_Y_NEXT_START [How] Add missing brackets for this calculation Reviewed-by: Nicholas Kazlauskas Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung Signed-off-by: Daniel Miess ---

[PATCH 06/16] drm/amd/display: Correct bw_params population

2023-01-25 Thread Alex Hung
From: Daniel Miess [Why] Underflow observed during P010 video playback on dcn314 due to incorrectly populated bw_params [How] Populate fclk, memclk and voltage in bw_params with values from max pstate rather than min pstate Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung Signed-off-by:

[PATCH 05/16] drm/amd/display: Fix Z8 support configurations

2023-01-25 Thread Alex Hung
From: Nicholas Kazlauskas [Why] It's not supported in multi-display, but it is supported in 2nd eDP screen only. [How] Remove multi display support, restrict number of planes for all z-states support, but still allow Z8 if we're not using PWRSEQ0. Reviewed-by: Charlene Liu Acked-by: Alex Hung

[PATCH 04/16] drm/amd/display: Add Debug Log for MST and PCON

2023-01-25 Thread Alex Hung
From: Fangzhi Zuo Add log for MST/PCON specific use case: 1. If DP1.2 hub where gives reduced link bw and no dsc support. 2. If less than 4-lane configuration where gives reduced bw. 3. If FRL PCON enabled for asic. 4. Track MST sink count. Reviewed-by: Hersen Wu Acked-by: Alex Hung

[PATCH 03/16] drm/amd/display: fix MALL size hardcoded for DCN321

2023-01-25 Thread Alex Hung
From: Samson Tam [Why] MALL size available can vary for different SKUs MALL size was still hardcoded for DCN321 [How] Remove hardcoding MALL size for DCN321 Reviewed-by: Alvin Lee Acked-by: Alex Hung Signed-off-by: Samson Tam --- drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 1

[PATCH 02/16] drm/amd/display: add rc_params_override option in dc_dsc_config

2023-01-25 Thread Alex Hung
From: Wenjing Liu [why] Current RC params are based on VESA recommended configurations. Some DSC sink may prefer non standard rc params values due to hardware limitations. To support those DSC sink we will allow DM to optionally pass rc_params_ovrd in dc_dsc_config so DC will override the

[PATCH 01/16] drm/amd/display: Enable Freesync over PCon

2023-01-25 Thread Alex Hung
From: Sung Joon Kim [why] Enable Freesync over PCon on Linux environment. [how] Adding Freesync over PCon support in amdgpu_dm - Read DPCD for Freesync over PCon capabilitiy - Add whitelist for compatible branch devices Reviewed-by: Chao-kai Wang Acked-by: Alex Hung Signed-off-by: Sung Joon

[PATCH 00/16] DC Patches Jan 25, 2023

2023-01-25 Thread Alex Hung
This DC patchset brings improvements in multiple areas. In summary, we highlight: - Fix linux dp link lost handled only one time - Reset DMUB mailbox SW state after HW reset - Unassign does_plane_fit_in_mall function from dcn3.2 - Add Function delaration in dc_link - Fix crash when connecting 2

Re: [PATCH 8/8] drm/amd/pm: drop the support for manual fan speed setting on SMU13.0.7

2023-01-25 Thread Matt Coffin
On Wed Jan 11, 2023 at 7:47 AM MST, Alex Deucher wrote: > On Wed, Jan 11, 2023 at 8:23 AM Quan, Evan wrote: > > > > [AMD Official Use Only - General] > > > > Regarding the manual fan speed setting issue targeted by this patch, the > > SCPM feature of the new SMU13 asics prevents us from toggling

[PULL] amdgpu, drm drm-fixes-6.2

2023-01-25 Thread Alex Deucher
Hi Dave, Daniel, Fixes for 6.2. This contains a fix for DP MST that avoids the big revert. There are still some corner cases, but it fixes things for most users. The following changes since commit 3f30a6e67ce49c0068f8058893326db46b6db11f: Merge tag 'amd-drm-fixes-6.2-2023-01-19' of

Re: [PATCH v3 04/10] drm/fbdev-generic: Initialize fb-helper structure in generic setup

2023-01-25 Thread Sam Ravnborg
Hi Thomas, On Wed, Jan 25, 2023 at 09:04:09PM +0100, Thomas Zimmermann wrote: > Initialize the fb-helper structure immediately after its allocation > in drm_fbdev_generic_setup(). That will make it easier to fill it with > driver-specific values, such as the preferred BPP. > > Signed-off-by:

Re: [PATCH v3 02/10] drm/client: Add hotplug_failed flag

2023-01-25 Thread Sam Ravnborg
Hi Thomas, On Wed, Jan 25, 2023 at 09:04:07PM +0100, Thomas Zimmermann wrote: > Signal failed hotplugging with a flag in struct drm_client_dev. If set, > the client helpers will not further try to set up the fbdev display. > > This used to be signalled with a combination of cleared pointers in >

Re: [PATCH v3 01/10] drm/client: Test for connectors before sending hotplug event

2023-01-25 Thread Sam Ravnborg
Hi Thomas, On Wed, Jan 25, 2023 at 09:04:06PM +0100, Thomas Zimmermann wrote: > Test for connectors in the client code and remove a similar test > from the generic fbdev emulation. Do nothing if the test fails. > Not having connectors indicates a driver bug. > > Signed-off-by: Thomas Zimmermann

[PATCH v3 19/19] jump_label: RFC / temporary for CI - tolerate toggled state

2023-01-25 Thread Jim Cromie
__jump_label_patch currently will "crash the box" if it finds a jump_entry not as expected; it makes no allowances for the well-formed but incorrect "toggled" state. This patch changes panic-on-toggled into a warning, allowing to reduce the problem to a repeatable script. note: this patch is

[PATCH v3 15/19] test-dyndbg: build test_dynamic_debug_submod

2023-01-25 Thread Jim Cromie
CONFIG_DRM_USE_DYNAMIC_DEBUG=y has a regression; drm subsystem modules, which depend upon drm.ko and use the drm.debug API, do not get enabled when __drm_debug is set by `modprobe drm debug=0x1f`. With =N, __drm_debug is checked before logging the msg, so the end-of-modprobe debug=$init affected

[PATCH v3 10/19] dyndbg-API: split DECLARE_(DYNDBG_CLASSMAP) to $1(_DEFINE|_USE)

2023-01-25 Thread Jim Cromie
DECLARE_DYNDBG_CLASSMAP's job was to allow modules to declare the debug classes/categories they want dyndbg to >control on their behalf. Its args give the class-names, their mapping to class_ids, and the sysfs interface style (usually a class-bitmap). Modules wanting a drm.debug style knob need

[PATCH v3 18/19] test-dyndbg: tune sub-module behavior

2023-01-25 Thread Jim Cromie
lib/test_dynamic_debug.c is used to build 2 modules: test_dynamic_debug.ko and test_dynamic_debug_submod.ko Define DEBUG only in the main module, not in the submod. Its purpose is to insure that prdbgs are enabled by default, so that a modprobe without params actually logs something, showing

[PATCH v3 08/19] dyndbg: tighten ddebug_class_name() 1st arg

2023-01-25 Thread Jim Cromie
Change function's 1st arg-type, by derefing 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

[PATCH v3 11/19] dyndbg-API: specialize DYNDBG_CLASSMAP_(DEFINE|USE)

2023-01-25 Thread Jim Cromie
Now that the DECLARE_DYNDBG_CLASSMAP macro has been split into DYNDBG_CLASSMAP_DEFINE and DYNDBG_CLASSMAP_USE, lets differentiate them according to their separate jobs. Dyndbg's existing __dyndbg_classes[] section does: . catalogs the classmaps defined by the module (or builtin modules) .

[PATCH v3 16/19] test-dyndbg: rename DD_SYS_WRAP to DYNDBG_CLASSMAP_PARAM

2023-01-25 Thread Jim Cromie
Original name was a punt; but the macro is maybe general enough to put in the API later. Rename and improve the macro towards that end. Also tweak internal name constructed in the macro, to add a '_' between the name components. This changes the .i file only. no functional change.

[PATCH v3 17/19] test-dyndbg: disable WIP dyndbg-trace params

2023-01-25 Thread Jim Cromie
The dyndbg-to-trace feature is WIP, and not in mainline, so the presence of the interface to use/test it is unhelpful/confusing. So define DYNDBG_CLASSMAP_PARAM_T() as DYNDBG_CLASSMAP_PARAM() or blank, depending upon ifdef DYDBG_TRACE, and update 4 params controlling the T-flag to use it.

[PATCH v3 13/19] dyndbg-API: DYNDBG_CLASSMAP_DEFINE() improvements

2023-01-25 Thread Jim Cromie
patch 1 in this series fixed a CLASSMAP usage error, this improves the api so that misuse is less likely. changes here: 0- Add William Swanson's public domain map macro: https://github.com/swansontec/map-macro/blob/master/map.h this makes 1 possible. 1- classname args to CLASSMAP macros

[PATCH v3 12/19] dyndbg-API: DYNDBG_CLASSMAP_USE drop extra args

2023-01-25 Thread Jim Cromie
Drop macro args after _var. Since DYNDBG_CLASSMAP_USE no longer forwards to DYNDBG_CLASSMAP_DEFINE, it doesn't need those args to forward. Keep only the _var arg, which is the extern'd struct classmap with all the class info. Signed-off-by: Jim Cromie ---

[PATCH v3 14/19] drm_print: fix stale macro-name in comment

2023-01-25 Thread Jim Cromie
Cited commit uses stale macro name, fix this, and explain better. When DRM_USE_DYNAMIC_DEBUG=y, DYNDBG_CLASSMAP_DEFINE() maps DRM_UT_* onto BITs in drm.debug. This still uses enum drm_debug_category, but it is somewhat indirect, with the ordered set of DRM_UT_* enum-vals. This requires that the

[PATCH v3 09/19] dyndbg: constify ddebug_apply_class_bitmap args

2023-01-25 Thread Jim Cromie
ddebug_apply_class_bitmap() does not alter its 2 bitmap args, make this guarantee in the interface. NOTE: the bitmap is also available in the dcp arg, but the 2 vars serve a 2nd purpose; the CLASS_TYPE callers use them to translate levels into their underlying disjoint representation. no

[PATCH v3 05/19] dyndbg: split param_set_dyndbg_classes to inner/outer fns

2023-01-25 Thread Jim Cromie
Inner fn adds mod_name param, allowing caller to guarantee that only one module is affected by a prdbgs update. Outer fn preserves kernel_param interface, passing NULL to inner fn. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 36

[PATCH v3 06/19] dyndbg: drop NUM_TYPE_ARRAY

2023-01-25 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

[PATCH v3 07/19] dyndbg: reduce verbose/debug clutter

2023-01-25 Thread Jim Cromie
currently, for verbose=3, this is logged: 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="" lineno=0-0

[PATCH v3 03/19] dyndbg: replace classmap list with a vector

2023-01-25 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

[PATCH v3 04/19] dyndbg: make ddebug_apply_class_bitmap more selective

2023-01-25 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

[PATCH v3 02/19] test-dyndbg: show that DEBUG enables prdbgs at compiletime

2023-01-25 Thread Jim Cromie
Dyndbg is required to enable prdbgs at compile-time if DEBUG is defined. Show this works; add the defn to test_dynamic_debug.c, and manually inspect/verify its effect at module load: [ 15.292810] dyndbg: module:test_dynamic_debug attached 4 classes [ 15.293189] dyndbg: 32 debug prints in

[PATCH v3 01/19] test-dyndbg: fixup CLASSMAP usage error

2023-01-25 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

[PATCH v3 00/19] fix DRM_USE_DYNAMIC_DEBUG regression

2023-01-25 Thread Jim Cromie
Hi everyone, In v6.1 DRM_USE_DYNAMIC_DEBUG=y has a regression enabling drm.debug in drivers at modprobe. It is due to a chicken-egg problem loading modules; on `modprobe i915`, drm is loaded 1st, and drm/parameters/debug is set. When drm_debug_enabled() tested __drm_debug at runtime, this just

[PATCH 09/32] drm/amdgpu: add gfx9.4.2 hw debug mode enable and disable calls

2023-01-25 Thread Jonathan Kim
GFX9.4.2 now supports per-VMID debug mode controls registers (SPI_GDBG_PER_VMID_CNTL). Because the KFD lets the HWS handle PASID-VMID mapping, the KFD will forward all debug mode setting register writes to the HWS scheduler using a new MAP_PROCESS API, so instead of writing to registers, return

[PATCH v3 10/10] drm/fbdev-generic: Rename struct fb_info 'fbi' to 'info'

2023-01-25 Thread Thomas Zimmermann
The generic fbdev emulation names variables of type struct fb_info both 'fbi' and 'info'. The latter seems to be more common in fbdev code, so name fbi accordingly. Also replace the duplicate variable in drm_fbdev_fb_destroy(). Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez

[PATCH v3 08/10] drm/fbdev-generic: Minimize client unregistering

2023-01-25 Thread Thomas Zimmermann
For uninitialized framebuffers, only release the DRM client and free the fbdev memory. Do not attempt to clean up the framebuffer. DRM fbdev clients have a two-step initialization: first create the DRM client; then create the framebuffer device on the first successful hotplug event. In cases

[PATCH v3 06/10] drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function

2023-01-25 Thread Thomas Zimmermann
Initialize the fb-helper's preferred_bpp field early from within drm_fb_helper_prepare(); instead of the later client hot-plugging callback. This simplifies the generic fbdev setup function. No real changes, but all drivers' fbdev code has to be adapted. v3: * build with

[PATCH v3 07/10] drm/fbdev-generic: Minimize hotplug error handling

2023-01-25 Thread Thomas Zimmermann
Call drm_fb_helper_fini() in the generic-fbdev hotplug helper to revert the effects of drm_fb_helper_init(). No full cleanup is required. v3: * fix error in commit message (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas ---

[PATCH v3 09/10] drm/fbdev-generic: Inline clean-up helpers into drm_fbdev_fb_destroy()

2023-01-25 Thread Thomas Zimmermann
The fbdev framebuffer cleanup in drm_fbdev_fb_destroy() calls drm_fbdev_release() and drm_fbdev_cleanup(). Inline both into the caller. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/drm_fbdev_generic.c | 17 ++---

[PATCH v3 05/10] drm/fb-helper: Remove preferred_bpp parameter from fbdev internals

2023-01-25 Thread Thomas Zimmermann
Store the console's preferred BPP value in struct drm_fb_helper and remove the respective function parameters from the internal fbdev code. The BPP value is only required as a fallback and will now always be available in the fb-helper instance. No functional changes. Signed-off-by: Thomas

[PATCH v3 00/10] drm/fb-helper: Various cleanups

2023-01-25 Thread Thomas Zimmermann
Add various cleanups and changes to DRM's fbdev helpers and the generic fbdev emulation. There's no clear theme here, just lots of small things that need to be updated. In the end, the code will better reflect which parts are in the DRM client, which is fbdev emulation, and which are shared

[PATCH v3 03/10] drm/fb-helper: Introduce drm_fb_helper_unprepare()

2023-01-25 Thread Thomas Zimmermann
Move the fb-helper clean-up code into drm_fb_helper_unprepare(). No functional changes. v2: * declare as static inline (kernel test robot) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/drm_fb_helper.c | 14 +-

[PATCH v3 04/10] drm/fbdev-generic: Initialize fb-helper structure in generic setup

2023-01-25 Thread Thomas Zimmermann
Initialize the fb-helper structure immediately after its allocation in drm_fbdev_generic_setup(). That will make it easier to fill it with driver-specific values, such as the preferred BPP. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas ---

[PATCH v3 02/10] drm/client: Add hotplug_failed flag

2023-01-25 Thread Thomas Zimmermann
Signal failed hotplugging with a flag in struct drm_client_dev. If set, the client helpers will not further try to set up the fbdev display. This used to be signalled with a combination of cleared pointers in struct drm_fb_helper, which prevents us from initializing these pointers early after

[PATCH v3 01/10] drm/client: Test for connectors before sending hotplug event

2023-01-25 Thread Thomas Zimmermann
Test for connectors in the client code and remove a similar test from the generic fbdev emulation. Do nothing if the test fails. Not having connectors indicates a driver bug. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/drm_client.c| 5

[PATCH 31/32] drm/amdkfd: add debug device snapshot operation

2023-01-25 Thread Jonathan Kim
Similar to queue snapshot, return an array of device information using an entry_size check and return. Unlike queue snapshots, the debugger needs to pass to correct number of devices that exist. If it fails to do so, the KFD will return the number of actual devices so that the debugger can make a

[PATCH 25/32] drm/amdkfd: add debug suspend and resume process queues operation

2023-01-25 Thread Jonathan Kim
In order to inspect waves from the saved context at any point during a debug session, the debugger must be able to preempt queues to trigger context save by suspending them. On queue suspend, the KFD will copy the context save header information so that the debugger can correctly crawl the

[PATCH 18/32] drm/amdkfd: add send exception operation

2023-01-25 Thread Jonathan Kim
Add a debug operation that allows the debugger to send an exception directly to runtime through a payload address. For memory violations, normal vmfault signals will be applied to notify runtime instead after passing in the saved exception data when a memory violation was raised to the debugger.

[PATCH 16/32] drm/amdkfd: add per process hw trap enable and disable functions

2023-01-25 Thread Jonathan Kim
To enable HW debug mode per process, all devices must be debug enabled successfully. If a failure occures, rewind the enablement of debug mode on the enabled devices. A power management scenario that needs to be considered is HW debug mode setting during GFXOFF. During GFXOFF, these registers

[PATCH 26/32] drm/amdkfd: add debug set and clear address watch points operation

2023-01-25 Thread Jonathan Kim
Shader read, write and atomic memory operations can be alerted to the debugger as an address watch exception. Allow the debugger to pass in a watch point to a particular memory address per device. Note that there exists only 4 watch points per devices to date, so have the KFD keep track of what

[PATCH 29/32] drm/amdkfd: add debug query exception info operation

2023-01-25 Thread Jonathan Kim
Allow the debugger to query additional info based on an exception code. For device exceptions, it's currently only memory violation information. For process exceptions, it's currently only runtime information. Queue exception only report the queue exception status. The debugger has the option of

[PATCH 30/32] drm/amdkfd: add debug queue snapshot operation

2023-01-25 Thread Jonathan Kim
Allow the debugger to get a snapshot of a specified number of queues containing various queue property information that is copied to the debugger. Since the debugger doesn't know how many queues exist at any given time, allow the debugger to pass the requested number of snapshots as 0 to get the

[PATCH 05/32] drm/amdgpu: setup hw debug registers on driver initialization

2023-01-25 Thread Jonathan Kim
Add missing debug trap registers references and initialize all debug registers on boot by clearing the hardware exception overrides and the wave allocation ID index. The debugger requires that TTMPs 6 & 7 save the dispatch ID to map waves onto dispatch during compute context inspection. In order

[PATCH 22/32] drm/amdkfd: add debug set exceptions enabled operation

2023-01-25 Thread Jonathan Kim
The debugger subscibes to nofication for requested exceptions on attach. Allow the debugger to change its subsciption later on. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++ drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 36

[PATCH 21/32] drm/amdkfd: update process interrupt handling for debug events

2023-01-25 Thread Jonathan Kim
The debugger must be notified by any debugger subscribed exception that comes from hardware interrupts. If a debugger session exits, any exceptions it subscribed to may still have interrupts in the interrupt ring buffer or KGD/KFD pipeline. To prevent a new session from inheriting stale

[PATCH 23/32] drm/amdkfd: add debug wave launch override operation

2023-01-25 Thread Jonathan Kim
This operation allows the debugger to override the enabled HW exceptions on the device. On debug devices that only support the debugging of a single process, the HW exceptions are global and set through the SPI_GDBG_TRAP_MASK register. Because they are global, only address watch exceptions are

[PATCH 27/32] drm/amdkfd: add debug set flags operation

2023-01-25 Thread Jonathan Kim
Allow the debugger to set single memory and single ALU operations. Some exceptions are imprecise (memory violations, address watch) in the sense that a trap occurs only when the exception interrupt occurs and not at the non-halting faulty instruction. Trap temporaries 0 & 1 save the program

[PATCH 28/32] drm/amdkfd: add debug query event operation

2023-01-25 Thread Jonathan Kim
Allow the debugger to query a single queue, device and process exception. The KFD should also return the GPU or Queue id of the exception. The debugger also has the option of clearing exceptions after being queried. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling ---

[PATCH 15/32] drm/amdkfd: prepare trap workaround for gfx11

2023-01-25 Thread Jonathan Kim
Due to a HW bug, waves in only half the shader arrays can enter trap. When starting a debug session, relocate all waves to the first shader array of each shader engine and mask off the 2nd shader array as unavailable. When ending a debug session, re-enable the 2nd shader array per shader engine.

[PATCH 24/32] drm/amdkfd: add debug wave launch mode operation

2023-01-25 Thread Jonathan Kim
Allow the debugger to set wave behaviour on to either normally operate, halt at launch, trap on every instruction, terminate immediately or stall on allocation. v2: add gfx11 support and remove deprecated launch mode options Signed-off-by: Jonathan Kim ---

[PATCH 14/32] drm/amdgpu: expose debug api for mes

2023-01-25 Thread Jonathan Kim
Similar to the F32 HWS, the RS64 HWS for GFX11 now supports a multi-process debug API. The skip_process_ctx_clear ADD_QUEUE requirement is to prevent the MES from clearing the process context when the first queue is added to the scheduler in order to maintain debug mode settings during queue

[PATCH 11/32] drm/amdgpu: add configurable grace period for unmap queues

2023-01-25 Thread Jonathan Kim
The HWS schedule allows a grace period for wave completion prior to preemption for better performance by avoiding CWSR on waves that can potentially complete quickly. The debugger, on the other hand, will want to inspect wave status immediately after it actively triggers preemption (a suspend

[PATCH 17/32] drm/amdkfd: add raise exception event function

2023-01-25 Thread Jonathan Kim
Exception events can be generated from interrupts or queue activitity. The raise event function will save exception status of a queue, device or process then notify the debugger of the status change by writing to a debugger polled file descriptor that the debugger provides during debug attach.

[PATCH 19/32] drm/amdkfd: add runtime enable operation

2023-01-25 Thread Jonathan Kim
The debugger can attach to a process prior to HSA enablement (i.e. inferior is spawned by the debugger and attached to immediately before target process has been enabled for HSA dispatches) or it can attach to a running target that is already HSA enabled. Either way, the debugger needs to know

[PATCH 32/32] drm/amdkfd: bump kfd ioctl minor version for debug api availability

2023-01-25 Thread Jonathan Kim
Bump the minor version to declare debugging capability is now available. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 - include/uapi/linux/kfd_ioctl.h | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 10/32] drm/amdgpu: add gfx11 hw debug mode enable and disable calls

2023-01-25 Thread Jonathan Kim
Implement the per-device calls to enable or disable HW debug mode for GFX11. Signed-off-by: Jonathan Kim --- .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c| 39 +++ 1 file changed, 39 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c

[PATCH 20/32] drm/amdkfd: add debug trap enabled flag to tma

2023-01-25 Thread Jonathan Kim
From: Jay Cornwall Trap handler behavior will differ when a debugger is attached. Make the debug trap flag available in the trap handler TMA. Update it when the debug trap ioctl is invoked. v4: fix up comments to clarify flagging implementation. v3: Rebase for upstream v2: Add missing debug

[PATCH 12/32] drm/amdkfd: prepare map process for single process debug devices

2023-01-25 Thread Jonathan Kim
Older HW only supports debugging on a single process because the SPI debug mode setting registers are device global. The HWS has supplied a single pinned VMID (0xf) for MAP_PROCESS for debug purposes. To pin the VMID, the KFD will remove the VMID from the HWS dynamic VMID allocation via

[PATCH 01/32] drm/amdkfd: add debug and runtime enable interface

2023-01-25 Thread Jonathan Kim
Introduce the GPU debug operations interface. For ROCm-GDB to extend the GNU Debugger's ability to inspect the AMD GPU instruction set, provide the necessary interface to allow the debugger to HW debug-mode set and query exceptions per HSA queue, process or device. The runtime_enable interface

[PATCH 13/32] drm/amdgpu: prepare map process for multi-process debug devices

2023-01-25 Thread Jonathan Kim
Unlike single process debug devices, multi-process debug devices allow debug mode setting per-VMID (non-device-global). Because the HWS manages PASID-VMID mapping, the new MAP_PROCESS API allows the KFD to forward the required SPI debug register write requests. To request a new debug mode

[PATCH 08/32] drm/amdgpu: add gfx10 hw debug mode enable and disable calls

2023-01-25 Thread Jonathan Kim
Similar to GFX9 debug devices, set the hardware debug mode by draining the SPI appropriately prior the mode setting request. Because GFX10 has waves allocated by the work group boundaray and each SE's SPI instances do not communicate, the SPI drain time is much longer. This long drain time will

[PATCH 03/32] drm/amdkfd: prepare per-process debug enable and disable

2023-01-25 Thread Jonathan Kim
The ROCm debugger will attach to a process to debug by PTRACE and will expect the KFD to prepare a process for the target PID, whether the target PID has opened the KFD device or not. This patch is to explicity handle this requirement. Further HW mode setting and runtime coordination

[PATCH 07/32] drm/amdgpu: add gfx9.4.1 hw debug mode enable and disable calls

2023-01-25 Thread Jonathan Kim
On GFX9.4.1, the implicit wait count instruction on s_barrier is disabled by default in the driver during normal operation for performance requirements. There is a hardware bug in GFX9.4.1 where if the implicit wait count instruction after an s_barrier instruction is disabled, any wave that hits

[PATCH 04/32] drm/amdgpu: add kgd hw debug mode setting interface

2023-01-25 Thread Jonathan Kim
Introduce the require KGD debug calls that will execute hardware debug mode setting. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling --- .../gpu/drm/amd/include/kgd_kfd_interface.h | 34 +++ 1 file changed, 34 insertions(+) diff --git

[PATCH 02/32] drm/amdkfd: display debug capabilities

2023-01-25 Thread Jonathan Kim
Expose debug capabilities in the KFD topology node's HSA capabilities and debug properties flags. Ensure correct capabilities are exposed based on firmware support. Flag definitions can be referenced in uapi/linux/kfd_sysfs.h. v2: v1 was reviewed but re-requesting review for the following. -

[PATCH 06/32] drm/amdgpu: add gfx9 hw debug mode enable and disable calls

2023-01-25 Thread Jonathan Kim
Implement the per-device calls to enable or disable HW debug mode for GFX9 prior to GFX9.4.1. GFX9.4.1 and onward will require their own enable/disable sequence as follow on patches. When hardware debug mode setting is requested, waves will inherit these settings in the Shader Processor Input's

[PATCH 00/32] Upstream of kernel support for AMDGPU ISA debugging

2023-01-25 Thread Jonathan Kim
AMDGPU kernel upstream support for debugging of compute ISA. Current production ROCm GDB interface for ISA debugging: https://rocmdocs.amd.com/en/latest/ROCm_Tools/ROCgdb.html WIP upstream source for ROCm GDB API, ROC Kernel and ROC Thunk can be referenced here:

RE: [PATCH] drm/amdgpu: update wave data type to 3 for gfx11

2023-01-25 Thread Joshi, Mukul
[AMD Official Use Only - General] Reviewed-by: Mukul Joshi > -Original Message- > From: amd-gfx On Behalf Of > Graham Sider > Sent: Tuesday, January 17, 2023 2:42 PM > To: amd-gfx@lists.freedesktop.org > Cc: Sider, Graham > Subject: [PATCH] drm/amdgpu: update wave data type to 3 for

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 10:33 AM Matthew Wilcox wrote: > > On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > > +/* Use when VMA is not part of the VMA tree and needs no locking */ > > +static inline void init_vm_flags(struct vm_area_struct *vma, > > +

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 10:37 AM Matthew Wilcox wrote: > > On Wed, Jan 25, 2023 at 08:49:50AM -0800, Suren Baghdasaryan wrote: > > On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote: > > > > + /* > > > > + * Flags, see mm.h. > > > > + * WARNING! Do not modify directly. > > > > +

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Matthew Wilcox
On Wed, Jan 25, 2023 at 08:49:50AM -0800, Suren Baghdasaryan wrote: > On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote: > > > + /* > > > + * Flags, see mm.h. > > > + * WARNING! Do not modify directly. > > > + * Use {init|reset|set|clear|mod}_vm_flags() functions instead. >

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Matthew Wilcox
On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > +/* Use when VMA is not part of the VMA tree and needs no locking */ > +static inline void init_vm_flags(struct vm_area_struct *vma, > + unsigned long flags) > +{ > + vma->vm_flags = flags;

Re: [PATCH] drm/amd: Allow s0ix without BIOS support

2023-01-25 Thread Alex Deucher
On Wed, Jan 25, 2023 at 1:33 PM Mario Limonciello wrote: > > We guard the suspend entry code from running unless we have proper > BIOS support for either S3 mode or s0ix mode. > > If a user's system doesn't support either of these modes the kernel > still does offer s2idle in

[PATCH] drm/amd: Allow s0ix without BIOS support

2023-01-25 Thread Mario Limonciello
We guard the suspend entry code from running unless we have proper BIOS support for either S3 mode or s0ix mode. If a user's system doesn't support either of these modes the kernel still does offer s2idle in `/sys/power/mem_sleep` so there is an expectation from users that it works even if the

[PATCH] drm/amd/display: disable S/G display on DCN 3.1.2/3

2023-01-25 Thread Alex Deucher
Causes flickering or white screens in some configurations. Disable it for now until we can fix the issue. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2352 Cc: roman...@amd.com Cc: yifan1.zh...@amd.com Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 9:08 AM Michal Hocko wrote: > > On Wed 25-01-23 08:57:48, Suren Baghdasaryan wrote: > > On Wed, Jan 25, 2023 at 1:38 AM 'Michal Hocko' via kernel-team > > wrote: > > > > > > On Wed 25-01-23 00:38:49, Suren Baghdasaryan wrote: > > > > Replace indirect modifications to

[PATCH 2/3] drm/amdgpu: always sending PSP messages LOAD_ASD and UNLOAD_TA

2023-01-25 Thread vitaly.prosyak
From: Vitaly Prosyak We allow sending PSP messages LOAD_ASD and UNLOAD_TA without acquiring a lock in drm_dev_enter during driver unload because we must call drm_dev_unplug as the beginning of unload driver sequence. Added WARNING if other PSP messages are sent without a lock. After this commit,

[PATCH 2/3] drm/amdgpu: always sending PSP messages LOAD_ASD and UNLOAD_TA

2023-01-25 Thread vitaly.prosyak
From: Vitaly Prosyak We allow sending PSP messages LOAD_ASD and UNLOAD_TA without acquiring a lock in drm_dev_enter during driver unload because we must call drm_dev_unplug as the beginning of unload driver sequence. Added WARNING if other PSP messages are sent without a lock. After this commit,

[PATCH 3/3] drm/amdgpu: use pci_dev_is_disconnected

2023-01-25 Thread vitaly.prosyak
From: Vitaly Prosyak Added condition for pci_dev_is_disconnected and keeps drm_dev_is_unplugged to check whether we should unmap MMIO. Suggested by Alex regarding pci_dev_is_disconnected. Suggested by Christian keeping drm_dev_is_unplugged. Signed-off-by: Vitaly Prosyak Reviewed-by Alex

  1   2   >