Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Thu, 2025-01-23 at 09:10 +0100, Philipp Stanner wrote: > On Wed, 2025-01-22 at 19:07 -0300, Maíra Canal wrote: > > Hi Philipp, > > > > On 22/01/25 11:08, Philipp Stanner wrote: > > > drm_sched_init() has a great many parameters and upcoming new > > > functionality for the scheduler might add ev

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Boris Brezillon
On Thu, 23 Jan 2025 08:33:01 +0100 Philipp Stanner wrote: > On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > > On Wed, 22 Jan 2025 15:08:20 +0100 > > Philipp Stanner wrote: > > > > >  int drm_sched_init(struct drm_gpu_scheduler *sched, > > > -    const struct drm_sched_backend_ops

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Tvrtko Ursulin
On 23/01/2025 09:35, Philipp Stanner wrote: On Thu, 2025-01-23 at 10:29 +0100, Danilo Krummrich wrote: On Thu, Jan 23, 2025 at 08:33:01AM +0100, Philipp Stanner wrote: On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: On Wed, 22 Jan 2025 15:08:20 +0100 Philipp Stanner wrote:  int

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Danilo Krummrich
On Thu, Jan 23, 2025 at 08:33:01AM +0100, Philipp Stanner wrote: > On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > > On Wed, 22 Jan 2025 15:08:20 +0100 > > Philipp Stanner wrote: > > > > >  int drm_sched_init(struct drm_gpu_scheduler *sched, > > > -    const struct drm_sched_backend_o

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Danilo Krummrich
On Thu, Jan 23, 2025 at 10:35:43AM +0100, Philipp Stanner wrote: > On Thu, 2025-01-23 at 10:29 +0100, Danilo Krummrich wrote: > > On Thu, Jan 23, 2025 at 08:33:01AM +0100, Philipp Stanner wrote: > > > On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > > > > On Wed, 22 Jan 2025 15:08:20 +01

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Maíra Canal
Hi Philipp, On 23/01/25 05:10, Philipp Stanner wrote: On Wed, 2025-01-22 at 19:07 -0300, Maíra Canal wrote: Hi Philipp, On 22/01/25 11:08, Philipp Stanner wrote: drm_sched_init() has a great many parameters and upcoming new functionality for the scheduler might add even more. Generally, the g

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Thu, 2025-01-23 at 10:29 +0100, Danilo Krummrich wrote: > On Thu, Jan 23, 2025 at 08:33:01AM +0100, Philipp Stanner wrote: > > On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > > > On Wed, 22 Jan 2025 15:08:20 +0100 > > > Philipp Stanner wrote: > > > > > > >  int drm_sched_init(struc

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > On Wed, 22 Jan 2025 15:08:20 +0100 > Philipp Stanner wrote: > > >  int drm_sched_init(struct drm_gpu_scheduler *sched, > > -    const struct drm_sched_backend_ops *ops, > > -    struct workqueue_struct *submit_wq, > > -    u32 num_rqs, u

Re: [PATCH v10 0/4] Introduce DRM device wedged event

2025-01-23 Thread Raag Jadav
On Tue, Jan 21, 2025 at 01:59:47AM +0100, Xaver Hugl wrote: > Hi, > > I experimented with using this in KWin, and > https://invent.kde.org/plasma/kwin/-/merge_requests/7027/diffs?commit_id=6da40f1b9e2bc94615a436de4778880cee16f940 > makes it fall back to a software renderer when a rebind is require

Re: [PATCH v10 2/4] drm/doc: Document device wedged event

2025-01-23 Thread Raag Jadav
On Tue, Jan 21, 2025 at 02:14:56AM +0100, Xaver Hugl wrote: > > +It is the responsibility of the consumer to make sure that the device or > > +its resources are not in use by any process before attempting recovery. > I'm not convinced this is actually doable in practice, outside of > killing all ap

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Maíra Canal
Hi Philipp, On 23/01/25 09:13, Philipp Stanner wrote: On Thu, 2025-01-23 at 08:10 -0300, Maíra Canal wrote: Hi Philipp, On 23/01/25 05:10, Philipp Stanner wrote: On Wed, 2025-01-22 at 19:07 -0300, Maíra Canal wrote: Hi Philipp, On 22/01/25 11:08, Philipp Stanner wrote: drm_sched_init() has

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Wed, 2025-01-22 at 19:07 -0300, Maíra Canal wrote: > Hi Philipp, > > On 22/01/25 11:08, Philipp Stanner wrote: > > drm_sched_init() has a great many parameters and upcoming new > > functionality for the scheduler might add even more. Generally, the > > great number of parameters reduces readabi

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Thu, 2025-01-23 at 08:10 -0300, Maíra Canal wrote: > Hi Philipp, > > On 23/01/25 05:10, Philipp Stanner wrote: > > On Wed, 2025-01-22 at 19:07 -0300, Maíra Canal wrote: > > > Hi Philipp, > > > > > > On 22/01/25 11:08, Philipp Stanner wrote: > > > > drm_sched_init() has a great many parameters

Re: [V7 29/45] drm/colorop: Add PQ 125 EOTF and its inverse

2025-01-23 Thread Harry Wentland
On 2025-01-15 03:00, Simon Ser wrote: > Is this 125 magic number something we can expect other hardware to > implement as well? > It's based on MS's CCCS interpretation of 80 nits as 1.0f [1]. Based on this definition one needs to use 125.0f to represent 10,000 nits, the maximum value PQ can r

Re: [V7 29/45] drm/colorop: Add PQ 125 EOTF and its inverse

2025-01-23 Thread Harry Wentland
On 2025-01-17 04:04, Pekka Paalanen wrote: > On Thu, 19 Dec 2024 21:33:35 -0700 > Alex Hung wrote: > >> From: Harry Wentland >> >> The PQ function defines a mapping of code values to nits (cd/m^2). >> The max code value maps to 10,000 nits. >> >> Windows DWM's canonical composition color spac

Re: [V7 31/45] drm/colorop: add BT2020/BT709 OETF and Inverse OETF

2025-01-23 Thread Harry Wentland
On 2025-01-15 03:04, Simon Ser wrote: >> The BT.709 and BT.2020 OETFs are the same, the only difference >> being that the BT.2020 variant is defined with more precision >> for 10 and 12-bit per color encodings. > > Just to make sure, the spec defines this precision, correct? It's > not an AMD-s

Re: [V7 31/45] drm/colorop: add BT2020/BT709 OETF and Inverse OETF

2025-01-23 Thread Harry Wentland
On 2025-01-17 04:06, Pekka Paalanen wrote: > On Thu, 16 Jan 2025 10:56:22 +0200 > Pekka Paalanen wrote: > >> On Thu, 19 Dec 2024 21:33:37 -0700 >> Alex Hung wrote: >> >>> From: Harry Wentland >>> >>> The BT.709 and BT.2020 OETFs are the same, the only difference >>> being that the BT.2020 va

RE: [PATCH] drm/amdkfd: only flush the validate MES contex

2025-01-23 Thread Kim, Jonathan
[Public] > -Original Message- > From: Liang, Prike > Sent: Wednesday, January 22, 2025 4:26 AM > To: amd-gfx@lists.freedesktop.org > Cc: Koenig, Christian ; Kuehling, Felix > ; Kim, Jonathan ; > Kasiviswanathan, Harish ; Liang, Prike > > Subject: [PATCH] drm/amdkfd: only flush the valida

[PATCH v2] drm/amdgpu/gfx10: Add cleaner shader for GFX10.1.10

2025-01-23 Thread Srinivasan Shanmugam
This commit adds the cleaner shader microcode for GFX10.1.0 GPUs. The cleaner shader is a piece of GPU code that is used to clear or initialize certain GPU resources, such as Local Data Share (LDS), Vector General Purpose Registers (VGPRs), and Scalar General Purpose Registers (SGPRs). Clearing th

Re: [PATCH v2] drm/amdgpu/gfx10: Add cleaner shader for GFX10.1.10

2025-01-23 Thread Alex Deucher
On Thu, Jan 23, 2025 at 12:47 PM Srinivasan Shanmugam wrote: > > This commit adds the cleaner shader microcode for GFX10.1.0 GPUs. The > cleaner shader is a piece of GPU code that is used to clear or > initialize certain GPU resources, such as Local Data Share (LDS), Vector > General Purpose Regis

Re: [PATCH] drm/amdgpu: update and cleanup PM4 headers

2025-01-23 Thread Xu, Feifei
Reviewed-by: Feifei Xu On 1/21/2025 3:40 AM, Alex Deucher wrote: Consolidate PM4 definitions. Most of these were previously only defined in UMDs. Add them here as well and sync with latest packets. Also no need to include soc15d.h on gfx10+. Suggested-by: Saurabh Verma Signed-off-by: Alex D

[PATCH] drm/amdgpu/gfx10: Enable cleaner shader for GFX10.1.1/10.1.2 GPUs

2025-01-23 Thread Srinivasan Shanmugam
Enable the cleaner shader for GFX10.1.1/10.1.2 GPUs to provide data isolation between GPU workloads. The cleaner shader is responsible for clearing the Local Data Store (LDS), Vector General Purpose Registers (VGPRs), and Scalar General Purpose Registers (SGPRs), which helps prevent data leakage an

RE: [PATCH v2 6/6] drm/amd/pm: Update pm attr for gc_9_5_0

2025-01-23 Thread Zhang, Hawking
[AMD Official Use Only - AMD Internal Distribution Only] Series is Reviewed-by: Hawking Zhang Regards, Hawking -Original Message- From: Kamal, Asad Sent: Wednesday, January 22, 2025 17:56 To: amd-gfx@lists.freedesktop.org; Lazar, Lijo Cc: Ma, Le ; Zhang, Hawking ; Zhang, Morris ; Kam

[v6 2/5] drm/amdgpu: fix use after free bug related to amdgpu_driver_release_kms()

2025-01-23 Thread Jiang Liu
If some GPU device failed to probe, `rmmod amdgpu` will trigger a use after free bug related to amdgpu_driver_release_kms() as: [16002.085540] BUG: kernel NULL pointer dereference, address: [16002.093792] #PF: supervisor read access in kernel mode [16002.03] #PF: error_code(0x0

[v6 5/5] drm/amdgpu: fix invalid memory access in amdgpu_fence_driver_sw_fini()

2025-01-23 Thread Jiang Liu
Introduce amdgpu_device_fini_schedulers() to clean scheduler related resources, and avoid possible invalid memory access. Signed-off-by: Jiang Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 29 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 9 --- 2 files changed,

[v6 0/5] Fix several bugs in error handling during device probe

2025-01-23 Thread Jiang Liu
This patchset tries to fix several memory leakages/invalid memory accesses on error handling path during GPU driver loading/unloading. They applies to: https://gitlab.freedesktop.org/agd5f/linux.git amd-staging-drm-next v6: 1) fix coding style of patch 5 v5: 1) drop first in v4, we have found a r

[v6 3/5] drm/amdgpu: fix invalid memory access in amdgpu_xcp_cfg_sysfs_fini()

2025-01-23 Thread Jiang Liu
When AMD gpu firmware files are missing, loading the amdgpu driver will cause following invalid memory access: [ 89.735573] amdgpu :0a:00.0: amdgpu: Fetched VBIOS from platform [ 89.735583] amdgpu: ATOM BIOS: 113-M3080202-101 [ 89.735676] amdgpu :0a:00.0: Direct firmware load for am

[v6 1/5] drm/amdxcp: introduce new API amdgpu_xcp_drm_dev_free()

2025-01-23 Thread Jiang Liu
Introduce new interface amdgpu_xcp_drm_dev_free() to free a specific drm_device crreated by amdgpu_xcp_drm_dev_alloc(), which will be used to do error recovery. Signed-off-by: Jiang Liu --- drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c | 63 + drivers/gpu/drm/amd/amdxcp/amdgpu_

[v6 4/5] drm/amdgpu: enhance error handling in function amdgpu_pci_probe()

2025-01-23 Thread Jiang Liu
Enhance error handling in function amdgpu_pci_probe() to avoid possible resource leakage. Signed-off-by: Jiang Liu Reviewed-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdg

Re: [v5 5/5] drm/amdgpu: fix invalid memory access in amdgpu_fence_driver_sw_fini()

2025-01-23 Thread Gerry Liu
> 2025年1月20日 17:04,Christian König 写道: > > Am 17.01.25 um 08:55 schrieb Jiang Liu: >> Introduce amdgpu_device_fini_schedulers() to clean scheduler related >> resources, and avoid possible invalid memory access. >> >> Signed-off-by: Jiang Liu >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_devic

Re: [V7 43/45] drm/amd/display: Add AMD color pipeline doc

2025-01-23 Thread Harry Wentland
On 2025-01-17 04:19, Pekka Paalanen wrote: > On Thu, 19 Dec 2024 21:33:49 -0700 > Alex Hung wrote: > >> From: Harry Wentland >> >> Add kernel doc for AMD color pipeline. >> >> Signed-off-by: Alex Hung >> Signed-off-by: Harry Wentland >> --- >> .../amd/display/amdgpu_dm/amdgpu_dm_color.c

Re: [V7 23/45] drm/amd/display: Ignore deprecated props when plane_color_pipeline set

2025-01-23 Thread Simon Ser
On Wednesday, January 22nd, 2025 at 22:05, Harry Wentland wrote: > On 2025-01-15 02:56, Simon Ser wrote: > > > Is this "ignore" something we could do at the core DRM level, instead > > of doing it in all drivers? e.g. by silently ignoring user-space requests > > to set the property? > > I thin

Re: [V7 29/45] drm/colorop: Add PQ 125 EOTF and its inverse

2025-01-23 Thread Simon Ser
On Thursday, January 23rd, 2025 at 21:06, Harry Wentland wrote: > On 2025-01-15 03:00, Simon Ser wrote: > > > Is this 125 magic number something we can expect other hardware to > > implement as well? > > It's based on MS's CCCS interpretation of 80 nits as 1.0f [1]. Based on > this definition

[PATCH v2] drm/amdgpu: Unlocked unmap only clear page table leaves

2025-01-23 Thread Philip Yang
SVM migration unmap pages from GPU and then update mapping to GPU to recover page fault. Currently unmap clears the PDE entry for range length >= huge page and may free PTB bo. Then update mapping should alloc new PT bo, but there is race bug that the freed entry bo maybe still on the pt_free list,

Re: [PATCH] drm/amdgpu: update and cleanup PM4 headers

2025-01-23 Thread Alex Deucher
Ping again? On Wed, Jan 22, 2025 at 10:41 AM Alex Deucher wrote: > > Ping? > > On Mon, Jan 20, 2025 at 2:47 PM Alex Deucher > wrote: > > > > Consolidate PM4 definitions. Most of these were previously > > only defined in UMDs. Add them here as well and sync with > > latest packets. Also no ne