Re: [PATCH] drm/amdkfd: not restore userptr buffer if kfd process has been removed

2024-10-03 Thread Chen, Xiaogang
sent a wrong version, please ignore it On 10/3/2024 3:28 PM, Xiaogang.Chen wrote: From: Xiaogang Chen When kfd process has been terminated not restore userptr buffer after mmu notifier invalidates a range. Signed-off-by: Xiaogang Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 1

[PATCH v2] drm/amdkfd: not restore userptr buffer if kfd process has been removed

2024-10-03 Thread Xiaogang . Chen
From: Xiaogang Chen When kfd process has been terminated not restore userptr buffer after mmu notifier invalidates a range. Signed-off-by: Xiaogang Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH] drm/amdkfd: Use dynamic allocation for CU occupancy array in 'kfd_get_cu_occupancy()'

2024-10-03 Thread Srinivasan Shanmugam
The `kfd_get_cu_occupancy` function previously declared a large `cu_occupancy` array as a local variable, which could lead to stack overflows due to excessive stack usage. This commit replaces the static array allocation with dynamic memory allocation using `kmalloc_array`, thereby reducing the sta

RE: [PATCH] drm/amdkfd: Move gfx12 trap handler to separate file

2024-10-03 Thread Kim, Jonathan
[Public] + David/Sreekant for KFD impact Acked-by: Jonathan Kim > -Original Message- > From: Cornwall, Jay > Sent: Thursday, October 3, 2024 3:31 PM > To: amd-gfx@lists.freedesktop.org > Cc: Cornwall, Jay ; Six, Lancelot > ; Kim, Jonathan > Subject: [PATCH] drm/amdkfd: Move gfx12 trap

[PATCH v6 44/44] drm/amd/display: Add AMD color pipeline doc

2024-10-03 Thread Harry Wentland
A short description about the AMD color pipeline. Signed-off-by: Harry Wentland --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 122 +++--- 1 file changed, 102 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/

[PATCH v6 43/44] drm/amd/display: add 3D LUT colorop

2024-10-03 Thread Harry Wentland
From: Alex Hung This adds support for a 3D LUT. The color pipeline now consists of the following colorops: 1. 1D curve colorop 2. Multiplier 3. 3x4 CTM 4. 1D curve colorop 5. 1D LUT 6. 3D LUT 7. 1D curve colorop 8. 1D LUT Signed-off-by: Alex Hung --- .../amd/display/amdgpu_dm/amdgpu_dm_color.

Re: [PATCH] drm/amdkfd: Add kfd driver function to support hot plug/unplug amdgpu devices

2024-10-03 Thread Felix Kuehling
On 2024-10-03 11:07, Chen, Xiaogang wrote: On 10/2/2024 1:56 PM, Felix Kuehling wrote: On 2024-10-01 18:38, Xiaogang.Chen wrote: From: Xiaogang Chen This patch allows kfd driver function correctly when AMD gpu devices got plug/unplug at run time. When an AMD gpu device got unplug kfd d

Re: [PATCH v2] drm/amdkfd: not restore userptr buffer if kfd process has been removed

2024-10-03 Thread Felix Kuehling
On 2024-10-03 16:55, Xiaogang.Chen wrote: From: Xiaogang Chen When kfd process has been terminated not restore userptr buffer after mmu notifier invalidates a range. Signed-off-by: Xiaogang Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 12 1 file changed, 8 ins

Re: [PATCH-next v2] Fix unintentional integer overflow

2024-10-03 Thread Alex Deucher
Applied. Thanks! On Thu, Oct 3, 2024 at 6:53 AM Sundararaju, Sathishkumar wrote: > > > The patch is Reviewed-by: Sathishkumar S > > Regards, > Sathish > > > On 10/3/2024 3:56 PM, Advait Dhamorikar wrote: > > Fix shift-count-overflow in JPEG instance > > multiplication. The expression's value ma

[PATCH 10/26] drm/amd/display: Fix low black values by increasing error

2024-10-03 Thread Rodrigo Siqueira
From: Peterson [WHY] Regamma resolution for the first few black levels can have problems for calibration. [HOW] HW LUT is divided into N power-of-2 regions each with K segments. For SDR mode we set min point at 2^-10 and increments of 2^-13. It's generally more than 8-bit SDR needs, but some ca

[PATCH 12/26] drm/amd/display: update sr_exit latency for z8

2024-10-03 Thread Rodrigo Siqueira
From: Charlene Liu This is based on real asic performance result. Reviewed-by: Alvin Lee Signed-off-by: Charlene Liu Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/

[PATCH 13/26] drm/amd/display: Clear update flags after update has been applied

2024-10-03 Thread Rodrigo Siqueira
From: Josip Pavic [Why] Since the surface/stream update flags aren't cleared after applying updates, those same updates may be applied again in a future call to update surfaces/streams for surfaces/streams that aren't actually part of that update (i.e. applying an update for one surface/stream ca

[PATCH 11/26] drm/amd/display: Remove programming outstanding updates for dcn35

2024-10-03 Thread Rodrigo Siqueira
From: Dillon Varone [WHY&HOW] Programming outstanding updates is causing hangs on dcn35, so remove for now. Reviewed-by: Martin Leung Signed-off-by: Dillon Varone Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c | 1 - drivers/gpu/drm/amd/display/d

[PATCH 14/26] drm/amd/display: fix a memleak issue when driver is removed

2024-10-03 Thread Rodrigo Siqueira
From: Aurabindo Pillai Running "modprobe amdgpu" the second time (followed by a modprobe -r amdgpu) causes a call trace like: [ 845.212163] Memory manager not clean during takedown. [ 845.212170] WARNING: CPU: 4 PID: 2481 at drivers/gpu/drm/drm_mm.c:999 drm_mm_takedown+0x2b/0x40 [ 845.212177

[PATCH 16/26] drm/amd/display: Align static screen idle worker with IPX mode

2024-10-03 Thread Rodrigo Siqueira
From: Roman Li [Why] Idle worker thread serves for periodic detection of HPD while system is in IPS2. Currently it is used in headless and static screen scenarios. IPX can be configured not to execute IPS2 for static screen. In this case idle worker is redundant. [How] Only use periodic detectio

[PATCH 15/26] drm/amd/display: calculate final viewport before TAP optimization

2024-10-03 Thread Rodrigo Siqueira
From: Yihan Zhu Viewport size excess surface size observed sometime with some timings or resizing the MPO video window to cause MPO unsupported. Calculate final viewport size first with a 100x100 dummy viewport to get the max TAP support and then re-run final viewport calculation if TAP value cha

[PATCH 17/26] drm/amd/display: Skip Invalid Streams from DSC Policy

2024-10-03 Thread Rodrigo Siqueira
From: Fangzhi Zuo Streams with invalid new connector state should be elimiated from dsc policy. Reviewed-by: Aurabindo Pillai Signed-off-by: Fangzhi Zuo Signed-off-by: Rodrigo Siqueira --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 13 - 1 file changed, 12 insertions(+

[PATCH 21/26] drm/amd/display: Add DMUB debug offset

2024-10-03 Thread Rodrigo Siqueira
From: Taimur Hassan Add DMUB offset for future use. Signed-off-by: Taimur Hassan Acked-by: Rodrigo Siqueira Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_c

[PATCH 23/26] drm/amd/display: Remove redundant assignments

2024-10-03 Thread Rodrigo Siqueira
From: Alex Hung [WHAT & HOW] log2_blk_height and log2_blk_width are assigned to 0 and then immediately are updated to other values. The assignments to zero are redudant and removed. This fixes 18 UNUSED_VALUE issues reported by Coverity. Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Hung

[PATCH 22/26] drm/amd/display: Remove unnecessary assignments

2024-10-03 Thread Rodrigo Siqueira
From: Alex Hung [WHAT & HOW] TimeForFetchingMetaPTE, TimeForFetchingRowInVBlank and LinesToRequestPrefetchPixelData are local variables. They are freed when CalculatePrefetchSchedule() ends and need not clearing explicitly. This fixes 21 UNUSED_VALUE issues reported by Coverity. Reviewed-by: Ne

[PATCH 20/26] drm/amd/display: Update Interface to Check UCLK DPM

2024-10-03 Thread Rodrigo Siqueira
From: Austin Zheng [Why] Videos using YUV420 format may result in high power being used. Disabling MPO may result in lower power usage. Update interface that can be used to check power profile of a dc_state. [How] Add helper functions that can be used to determine power level: - get power profil

[PATCH 24/26] drm/amd/display: Initialize replay_config var

2024-10-03 Thread Rodrigo Siqueira
From: Kaitlyn Tse [Why] Uninitialized variables could cause some bits to be set, thus enabling features unintentionally. [How] Initialize replay_config variable to avoid future issues. Reviewed-by: Harry Vanzylldejong Reviewed-by: Iswara Nagulendran Reviewed-by: Anthony Koo Signed-off-by: Ka

[PATCH 25/26] drm/amd/display: Initialize new backlight_level_params structure

2024-10-03 Thread Rodrigo Siqueira
From: Kaitlyn Tse [Why] Initialize the new backlight_level_params structure as part of the ABC framework, the information in this structure is needed to be passed down to the DMCUB to identify the backlight control type, to adjust the backlight of the panel and to perform any required conversions

[PATCH 18/26] drm/amd/display: Allow Latency Increase For Last Strategy

2024-10-03 Thread Rodrigo Siqueira
From: Austin Zheng [Why] Playing 1080p video on 4k60 timing uses UCLK DPM5 and mode support determines that p-state switching is not supported. [How] Allow DML to increase latency as the last strategy so strategies such as VBlank p-state switching may become possible Reviewed-by: Alvin Lee Sig

[PATCH 19/26] drm/amd/display: Move Link Encoder Assignment Out Of dc_global_validate

2024-10-03 Thread Rodrigo Siqueira
From: Austin Zheng Assigning link encoder is not relevant to validating bandwidth so move the logic outside of dc_global_validate. Reviewed-by: Alvin Lee Signed-off-by: Austin Zheng Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 drivers/gp

[PATCH 26/26] drm/amd/display: 3.2.304

2024-10-03 Thread Rodrigo Siqueira
From: Aric Cyr This DC patchset brings improvements in multiple areas. In summary, we highlight: - Improvements to seemless boot. - Adjustments for DSC dock. - DML improvements - DMCUB fixes for D0/D3 and new register offset. - Code cleanup. Signed-off-by: Aric Cyr Signed-off-by: Rodrigo Sique

[PATCH 05/26] drm/amd/display: force TBT4 dock dsc on

2024-10-03 Thread Rodrigo Siqueira
From: Fudongwang [why] TBT4 dock have bandwidth limitation, need dsc always on to support all modes. [how] force dsc always on when detect TBT4 dock. Reviewed-by: Aric Cyr Signed-off-by: Fudongwang Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 4

[PATCH 04/26] drm/amd/display: Revert commit Update Interface to Check UCLK DPM

2024-10-03 Thread Rodrigo Siqueira
From: Austin Zheng This reverts commit 1b4ef7a2d5bcf9ab7e58e7c1efacd458f645b824. Reverting as regression discovered on certain systems and golden values need to updated. Reviewed-by: Alvin Lee Signed-off-by: Austin Zheng Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/cor

[PATCH 02/26] drm/amd/display: skip disable CRTC in seemless bootup case

2024-10-03 Thread Rodrigo Siqueira
From: Fudongwang Resync FIFO is a workaround to write the same value to DENTIST_DISPCLK_CNTL register after programming OTG_PIXEL_RATE_DIV register, in case seemless boot, there is no OTG_PIXEL_RATE_DIV register update, so skip CRTC disable when resync FIFO to avoid random FIFO error and garbage.

[PATCH 06/26] drm/amd/display: Assign socclk in dml

2024-10-03 Thread Rodrigo Siqueira
From: Sridevi Arvindekar Assign socclk_khz value from dcn4x. Reviewed-by: Ariel Bernstein Signed-off-by: Sridevi Arvindekar Signed-off-by: Rodrigo Siqueira --- .../gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/dr

[PATCH 07/26] drm/amd/display: Fix garbage or black screen when resetting otg

2024-10-03 Thread Rodrigo Siqueira
From: Zhongwei [Why] For some EDP to MIPI panel, disabling OTG when link is alive like boot case, the converter might output garbage or show no display because our GPU is not sending required pixel data. Alos Dig fifo underflow was found which might cause garbage, when resetting otg for other typ

[PATCH 08/26] drm/amd/display: Display lost signal on playing video

2024-10-03 Thread Rodrigo Siqueira
From: po-tchen [Why] When Source extend the vblank to reach the minimum panel refresh rate, the vtotal length could have 1 line longer than the maximum supported vtotal. The reason is we optimized the vtotal/refresh-rate calculation to get more accurate vtotal number by rounding the calculation r

[PATCH 09/26] drm/amd/display: Noitfy DMCUB of D0/D3 state in hardware init

2024-10-03 Thread Rodrigo Siqueira
From: "JinZe.Xu" [Why] Missing a dc_dmub_srv_notify_fw_dc_power_state in driver init. [How] Notify DMCUB of D0 state in hardware_init. Reviewed-by: Nicholas Kazlauskas Signed-off-by: JinZe.Xu Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + 1 file changed,

[PATCH 01/26] drm/amd/display: Unify blank_phantom and blank_pixel_data

2024-10-03 Thread Rodrigo Siqueira
From: Austin Zheng [Why] dcn32_blank_phantom() does not consider the subVP+ODM case when blanking. Only one of the pipes will get blanked. Remaining pipes are not blanked. Will cause underflow in the phantom pipe when enabling the CRTC. [How] Use blank_pixel_data() instead of blank_phantom(). re

[PATCH 03/26] drm/amd/display: Flip All Planes Under OTG Master When Flip Immediate

2024-10-03 Thread Rodrigo Siqueira
From: Austin Zheng [Why] The MPO plane will receive a flip but desktop plane may not receive a flip when GSL is enabled. As a result, system will be stuck waiting for a flip that was never sent. [How] Set update address update flag of all flip_immediate planes if there are multiple planes. Revi

[PATCH 00/26] DC Patches October 3rd, 2024

2024-10-03 Thread Rodrigo Siqueira
This DC patchset brings improvements in multiple areas. In summary, we highlight: - Improvements to seamless boot. - Adjustments for DSC dock. - DML improvements - DMCUB fixes for D0/D3 and new register offset. - Code cleanup. Cc: Daniel Wheeler Alex Hung (2): drm/amd/display: Remove unnecess

Re: [PATCH v2] drm/amdkfd: not restore userptr buffer if kfd process has been removed

2024-10-03 Thread Chen, Xiaogang
On 10/3/2024 4:11 PM, Felix Kuehling wrote: On 2024-10-03 16:55, Xiaogang.Chen wrote: From: Xiaogang Chen When kfd process has been terminated not restore userptr buffer after mmu notifier invalidates a range. Signed-off-by: Xiaogang Chen ---   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gp

[PATCH v6 37/44] drm/colorop: Add mutliplier type

2024-10-03 Thread Harry Wentland
From: Alex Hung This introduces a new drm_colorop_type: DRM_COLOROP_MULTIPLIER. It's a simple multiplier to all pixel values. The value is specified via a S31.32 fixed point provided via the "MULTIPLIER" property. Signed-off-by: Alex Hung --- drivers/gpu/drm/drm_atomic.c | 3 +++ driver

[PATCH v6 40/44] drm/colorop: Define LUT_1D interpolation

2024-10-03 Thread Harry Wentland
We want to make sure userspace is aware of the 1D LUT interpolation. While linear interpolation is common it might not be supported on all HW. Give driver implementers a way to specify their interpolation. Signed-off-by: Harry Wentland --- .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 6 ++--

[PATCH v6 42/44] drm/colorop: Add 3D LUT supports to color pipeline

2024-10-03 Thread Harry Wentland
From: Alex Hung It is to be used to enable HDR by allowing userpace to create and pass 3D LUTs to kernel and hardware. 1. new drm_colorop_type: DRM_COLOROP_3D_LUT. 2. 3D LUT modes define hardware capabilities to userspace applications. 3. mode index points to current 3D LUT mode in lut_3d_modes.

[PATCH v6 39/44] drm/amd/display: Swap matrix and multiplier

2024-10-03 Thread Harry Wentland
From: Alex Hung Swap the order of matrix and multiplier as designed in hardware. Signed-off-by: Alex Hung --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 22 ++--- .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 32 +-- 2 files changed, 27 insertions(+), 27 deletion

[PATCH v6 38/44] drm/amd/display: add multiplier colorop

2024-10-03 Thread Harry Wentland
From: Alex Hung This adds support for a multiplier. This multiplier is programmed via the HDR Multiplier in DCN. With this change the following IGT tests pass: kms_colorop --run plane-XR30-XR30-multiply_125 kms_colorop --run plane-XR30-XR30-multiply_inv_125 The color pipeline now consists of th

[PATCH v6 36/44] drm/amd/display: add 3x4 matrix colorop

2024-10-03 Thread Harry Wentland
From: Alex Hung This adds support for a 3x4 color transformation matrix. With this change the following IGT tests pass: kms_colorop --run plane-XR30-XR30-ctm_3x4_50_desat kms_colorop --run plane-XR30-XR30-ctm_3x4_overdrive kms_colorop --run plane-XR30-XR30-ctm_3x4_oversaturate kms_colorop --run

[PATCH v6 31/44] drm/amd/display: Enable support for PQ 125 EOTF and Inverse

2024-10-03 Thread Harry Wentland
This patchset enables support for the PQ_125 EOTF and its inverse on all existing plane 1D curve colorops, i.e., on DEGAM, SHAPER, and BLND blocks. With this patchset the following IGT subtests are passing: kms_colorop --run plane-XR30-XR30-pq_125_eotf kms_colorop --run plane-XR30-XR30-pq_125_inv_

[PATCH v6 35/44] drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUT

2024-10-03 Thread Harry Wentland
From: Alex Hung This patch adds colorops for custom 1D LUTs in the SHAPER and BLND HW blocks. With this change the following IGT tests pass: kms_colorop --run plane-XR30-XR30-srgb_inv_eotf_lut kms_colorop --run plane-XR30-XR30-srgb_inv_eotf_lut-srgb_eotf_lut The color pipeline now consists of t

[PATCH v6 26/44] drm/amd/display: Skip color pipeline initialization for cursor plane

2024-10-03 Thread Harry Wentland
From: Alex Hung Signed-off-by: Alex Hung --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index 22ff9a31b592..1bfb

[PATCH v6 34/44] drm/colorop: Add 1D Curve Custom LUT type

2024-10-03 Thread Harry Wentland
From: Alex Hung We've previously introduced DRM_COLOROP_1D_CURVE for pre-defined 1D curves. But we also have HW that supports custom curves and userspace needs the ability to pass custom curves, aka LUTs. This patch introduces a new colorop type, called DRM_COLOROP_1D_LUT that provides a SIZE pr

[PATCH v6 41/44] drm/colorop: allow non-bypass colorops

2024-10-03 Thread Harry Wentland
Not all HW will be able to do bypass on all color operations. Introduce an 'allow_bypass' boolean for all colorop init functions and only create the BYPASS property when it's true. Signed-off-by: Harry Wentland --- .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 22 +--- drivers/gpu/drm/drm_

Re: [PATCH v5 00/44] Color Pipeline API w/ VKMS

2024-10-03 Thread Harry Wentland
On 2024-09-10 16:37, Alex Goins wrote: > Hi Harry, > > Thanks for this. I just want to remind about a few things that would be > required > for NVIDIA hardware, as discussed at the Display Next Hackfest -- fully > understand that they aren't currently included in this series because they > aren't

[PATCH v6 01/44] drm: Add helper for conversion from signed-magnitude

2024-10-03 Thread Harry Wentland
CTM values are defined as signed-magnitude values. Add a helper that converts from CTM signed-magnitude fixed point value to the twos-complement value used by drm_fixed. Signed-off-by: Harry Wentland --- include/drm/drm_fixed.h | 18 ++ 1 file changed, 18 insertions(+) diff --gi

[PATCH v6 05/44] drm/colorop: Introduce new drm_colorop mode object

2024-10-03 Thread Harry Wentland
This patches introduces a new drm_colorop mode object. This object represents color transformations and can be used to define color pipelines. We also introduce the drm_colorop_state here, as well as various helpers and state tracking bits. Signed-off-by: Harry Wentland --- v6: - Comment that

[PATCH v6 11/44] drm/colorop: Add atomic state print for drm_colorop

2024-10-03 Thread Harry Wentland
Signed-off-by: Harry Wentland --- drivers/gpu/drm/drm_atomic.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 44c5b5dd8b33..0f4eba51ee4b 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b

[PATCH v6 13/44] drm/colorop: Add NEXT to colorop state print

2024-10-03 Thread Harry Wentland
Signed-off-by: Harry Wentland --- v5: - Drop unused header definitions v3: - Read NEXT ID from drm_colorop's next pointer drivers/gpu/drm/drm_atomic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 12e787e73c63..35136987d

[PATCH v6 07/44] drm/colorop: Add 1D Curve subtype

2024-10-03 Thread Harry Wentland
Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Co-developed-by: Alex Hung --- v5: - Add drm_get_colorop_curve_1d_type_name in header - Add drm_colorop_init - Set default curve - Add kernel docs v4: - Use drm_colorop_curve_1d_type_enum_list to get name (Pekka) - Create separate in

[PATCH v6 10/44] drm/colorop: Add NEXT property

2024-10-03 Thread Harry Wentland
We'll construct color pipelines out of drm_colorop by chaining them via the NEXT pointer. NEXT will point to the next drm_colorop in the pipeline, or by 0 if we're at the end of the pipeline. Signed-off-by: Harry Wentland --- v5: - move next comment here from Add 3x4 CTM patch (Sebastian) - Ad

[PATCH v6 08/44] Documentation/gpu: document drm_colorop

2024-10-03 Thread Harry Wentland
Signed-off-by: Harry Wentland --- v5: - Drop TODO Documentation/gpu/drm-kms.rst | 15 +++ drivers/gpu/drm/drm_colorop.c | 31 +++ 2 files changed, 46 insertions(+) diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst index abfe2207

[PATCH v6 16/44] drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE

2024-10-03 Thread Harry Wentland
With the introduction of the pre-blending color pipeline we can no longer have color operations that don't have a clear position in the color pipeline. We deprecate all existing plane properties. For upstream drivers those are: - COLOR_ENCODING - COLOR_RANGE Drivers are expected to ignore these

[PATCH v6 12/44] drm/plane: Add COLOR PIPELINE property

2024-10-03 Thread Harry Wentland
We're adding a new enum COLOR PIPELINE property. This property will have entries for each COLOR PIPELINE by referencing the DRM object ID of the first drm_colorop of the pipeline. 0 disables the entire COLOR PIPELINE. Userspace can use this to discover the available color pipelines, as well as set

[PATCH v6 09/44] drm/colorop: Add BYPASS property

2024-10-03 Thread Harry Wentland
We want to be able to bypass each colorop at all times. Introduce a new BYPASS boolean property for this. Signed-off-by: Harry Wentland --- v6: - clarify that bypass is only valid if BYPASS prop exists (Louis Chauvet) drivers/gpu/drm/drm_atomic_uapi.c | 6 +- drivers/gpu/drm/drm_colorop.

[PATCH v6 17/44] drm/colorop: Add 3x4 CTM type

2024-10-03 Thread Harry Wentland
This type is used to support a 3x4 matrix in colorops. A 3x4 matrix uses the last column as a "bias" column. Some HW exposes support for 3x4. The calculation looks like: out matrixin |R| |0 1 2 3 | | R | |G| = |4 5 6 7 | x | G | |B| |8 9 10 11| | B |

[PATCH v6 06/44] drm/colorop: Add TYPE property

2024-10-03 Thread Harry Wentland
Add a read-only TYPE property. The TYPE specifies the colorop type, such as enumerated curve, 1D LUT, CTM, 3D LUT, PWL LUT, etc. For now we're only introducing an enumerated 1D LUT type to illustrate the concept. Signed-off-by: Harry Wentland --- v6: - fix doc typo (Alex Hung) v5: - Add drm_

[PATCH v6 04/44] drm/doc/rfc: Describe why prescriptive color pipeline is needed

2024-10-03 Thread Harry Wentland
Signed-off-by: Harry Wentland --- v5: - Don't require BYPASS to succeed (Sebastian) - use DATA for 1D and 3D LUT types (Sebastian) - update 3DLUT ops to use 3DLUT_MODES and 3DLUT_MODE_INDEX - Add section on drm_colorop extensibility - Add color_pipeline.rst to RFC toc tree v4: - Drop IOCTL

[PATCH v6 02/44] drm/vkms: Round fixp2int conversion in lerp_u16

2024-10-03 Thread Harry Wentland
fixp2int always rounds down, fixp2int_ceil rounds up. We need the new fixp2int_round. Signed-off-by: Harry Wentland Reviewed-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/dri

[PATCH v6 15/44] drm/vkms: Add kunit tests for linear and sRGB LUTs

2024-10-03 Thread Harry Wentland
Signed-off-by: Harry Wentland --- drivers/gpu/drm/vkms/tests/vkms_color_test.c | 38 +++- drivers/gpu/drm/vkms/vkms_composer.c | 15 ++-- drivers/gpu/drm/vkms/vkms_composer.h | 13 +++ 3 files changed, 53 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH v6 00/44] Color Pipeline API w/ VKMS

2024-10-03 Thread Harry Wentland
This is an RFC set for a color pipeline API, along with implementations in VKMS and amdgpu. It is tested with a set of IGT tests that can be found at [1]. The IGT tests run a pixel-by-pixel comparison with an allowable delta variation as the goal for these transformations is perceptual correctness,

[PATCH v6 21/44] drm/vkms: Add tests for CTM handling

2024-10-03 Thread Harry Wentland
A whole slew of tests for CTM handling that greatly helped in debugging the CTM code. The extent of tests might seem a bit silly but they're fast and might someday help save someone else's day when debugging this. Signed-off-by: Harry Wentland --- v6: - update reference values since we're now r

[PATCH v6 22/44] drm/colorop: pass plane_color_pipeline client cap to atomic check

2024-10-03 Thread Harry Wentland
Drivers will need to know whether an atomic check/commit originated from a client with DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE so they can ignore deprecated properties, like COLOR_ENCODING and COLOR_RANGE. Pass the plane_color_pipeline bit to drm_atomic_state. Signed-off-by: Harry Wentland --- v5:

[PATCH v6 14/44] drm/vkms: Add enumerated 1D curve colorop

2024-10-03 Thread Harry Wentland
This patch introduces a VKMS color pipeline that includes two drm_colorops for named transfer functions. For now the only ones supported are sRGB EOTF, sRGB Inverse EOTF, and a Linear TF. We will expand this in the future but I don't want to do so without accompanying IGT tests. We introduce a new

[PATCH v6 25/44] drm/amd/display: Add bypass COLOR PIPELINE

2024-10-03 Thread Harry Wentland
Add the default Bypass pipeline and ensure it passes the kms_colorop test plane-XR30-XR30-bypass. Signed-off-by: Harry Wentland --- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_

[PATCH v6 28/44] drm/amd/display: Add support for sRGB Inverse EOTF in SHAPER block

2024-10-03 Thread Harry Wentland
From: Alex Hung Expose a 2nd curve colorop with support for DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF and program HW to perform the sRGB Inverse EOTF on the shaper block when the colorop is not in bypass. With this change the follow IGT tests pass: kms_colorop --run plane-XR30-XR30-srgb_inv_eotf kms_co

[PATCH v6 32/44] drm/colorop: add BT2020/BT709 OETF and Inverse OETF

2024-10-03 Thread Harry Wentland
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. Both are used as encoding functions for video content, and are therefore defined as OETF (opto-electronic transfer function) instead o

[PATCH v6 33/44] drm/amd/display: Add support for BT.709 and BT.2020 TFs

2024-10-03 Thread Harry Wentland
This adds support for the BT.709/BT.2020 transfer functions on all current 1D curve plane colorops, i.e., on DEGAM, SHAPER, and BLND blocks. With this change the following IGT subtests pass: kms_colorop --run plane-XR30-XR30-bt2020_inv_oetf kms_colorop --run plane-XR30-XR30-bt2020_oetf Signed-off

[PATCH v6 18/44] drm/vkms: Use s32 for internal color pipeline precision

2024-10-03 Thread Harry Wentland
Certain operations require us to preserve values below 0.0 and above 1.0 (0x0 and 0x respectively in 16 bpc unorm). One such operation is a BT709 encoding operation followed by its decoding operation, or the reverse. We'll use s32 values as intermediate in and outputs of our color operations,

[PATCH v6 29/44] drm/amd/display: Add support for sRGB EOTF in BLND block

2024-10-03 Thread Harry Wentland
From: Alex Hung Expose a 3rd 1D curve colorop, with support for DRM_COLOROP_1D_CURVE_SRGB_EOTF and program the BLND block to perform the sRGB transform when the colorop is not in bypass With this change the following IGT test passes: kms_colorop --run plane-XR30-XR30-srgb_eotf-srgb_inv_eotf-srgb

[PATCH v6 24/44] drm/amd/display: Ignore deprecated props when plane_color_pipeline set

2024-10-03 Thread Harry Wentland
When the plane_color_pipeline bit is set we should ignore deprecated properties, such as COLOR_RANGE and COLOR_ENCODING. Signed-off-by: Harry Wentland --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_

[PATCH v6 30/44] drm/colorop: Add PQ 125 EOTF and its inverse

2024-10-03 Thread 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 space (CCCS) defaults to composing SDR contents to 80 nits and uses a float value of 1.0 to represent this. For this reason AMD HW hard-codes a PQ f

[PATCH v6 27/44] drm/amd/display: Add support for sRGB EOTF in DEGAM block

2024-10-03 Thread Harry Wentland
From: Alex Hung Expose one 1D curve colorop with support for DRM_COLOROP_1D_CURVE_SRGB_EOTF and program HW to perform the sRGB transform when the colorop is not in bypass. With this change the following IGT test passes: kms_colorop --run plane-XR30-XR30-srgb_eotf The color pipeline now consists

[PATCH v6 19/44] drm/vkms: add 3x4 matrix in color pipeline

2024-10-03 Thread Harry Wentland
We add two 3x4 matrices into the VKMS color pipeline. The reason we're adding matrices is so that we can test that application of a matrix and its inverse yields an output equal to the input image. One complication with the matrix implementation has to do with the fact that the matrix entries are

[PATCH v6 20/44] drm/tests: Add a few tests around drm_fixed.h

2024-10-03 Thread Harry Wentland
While working on the CTM implementation of VKMS I had to ascertain myself of a few assumptions. One of those is whether drm_fixed.h treats its numbers using signed-magnitude or twos-complement. It is twos-complement. In order to make someone else's day easier I am adding the drm_test_int2fixp test

[PATCH v6 03/44] drm/vkms: Add kunit tests for VKMS LUT handling

2024-10-03 Thread Harry Wentland
Debugging LUT math is much easier when we can unit test it. Add kunit functionality to VKMS and add tests for - get_lut_index - lerp_u16 Signed-off-by: Harry Wentland Cc: Arthur Grillo --- v6: - Eliminate need to include test as .c file (Louis Chauvet) v5: - Bring back static for lerp_u16 a

[PATCH v6 23/44] drm/colorop: define a new macro for_each_new_colorop_in_state

2024-10-03 Thread Harry Wentland
From: Alex Hung Create a new macro for_each_new_colorop_in_state to access new drm_colorop_state updated from uapi. Signed-off-by: Alex Hung --- include/drm/drm_atomic.h | 20 1 file changed, 20 insertions(+) diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.

Re: [PATCH v5 00/44] Color Pipeline API w/ VKMS

2024-10-03 Thread Harry Wentland
On 2024-08-27 13:49, Louis Chauvet wrote: > Le 19/08/24 - 16:56, Harry Wentland a écrit : >> This is an RFC set for a color pipeline API, along with implementations >> in VKMS and amdgpu. It is tested with a set of IGT tests that can be >> found at [1]. The IGT tests run a pixel-by-pixel compari

[PATCH] drm/amdkfd: Move gfx12 trap handler to separate file

2024-10-03 Thread Jay Cornwall
gfx12 derivatives will have substantially different trap handler implementations from gfx10/gfx11. Add a separate source file for gfx12+ and remove unneeded conditional code. No functional change. Signed-off-by: Jay Cornwall Cc: Lancelot Six Cc: Jonathan Kim --- .../amd/amdkfd/cwsr_trap_handl

[PATCH] drm/amdkfd: not restore userptr buffer if kfd process has been removed

2024-10-03 Thread Xiaogang . Chen
From: Xiaogang Chen When kfd process has been terminated not restore userptr buffer after mmu notifier invalidates a range. Signed-off-by: Xiaogang Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/g

Re: [PATCH-next v2] Fix unintentional integer overflow

2024-10-03 Thread Sundararaju, Sathishkumar
The patch is Reviewed-by: Sathishkumar S Regards, Sathish On 10/3/2024 3:56 PM, Advait Dhamorikar wrote: Fix shift-count-overflow in JPEG instance multiplication. The expression's value may not be what the programmer intended, because the expression is evaluated using a narrower integer typ

Re: [PATCH 1/2] drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure

2024-10-03 Thread Ville Syrjälä
On Wed, Oct 02, 2024 at 09:21:59PM +0300, Ville Syrjala wrote: > From: Ville Syrjälä > > Hide the plane->fb/etc. footguns better by stashing them inside > a "legacy" sub struct. > > Eventually maybe we could turn 'legacy' into a pointer > that only exists on legacy drivers to completely prevent

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Louis Chauvet
Le 02/10/24 - 21:22, Ville Syrjala a écrit : > From: Ville Syrjälä > > Atomic drivers shouldn't be using the legacy state stored > directly under drm_crtc. Move that junk into a 'legacy' sub > structure to highlight the offenders, of which there are > quite a few unfortunately. Hi, Do we need t

[PATCH v5 1/6] drm: add DRM_SET_CLIENT_NAME ioctl

2024-10-03 Thread Pierre-Eric Pelloux-Prayer
Giving the opportunity to userspace to associate a free-form name with a drm_file struct is helpful for tracking and debugging. This is similar to the existing DMA_BUF_SET_NAME ioctl. Access to client_name is protected by a mutex, and the 'clients' debugfs file has been updated to print it. User

[PATCH v5 0/6] DRM_SET_CLIENT_NAME ioctl

2024-10-03 Thread Pierre-Eric Pelloux-Prayer
v5 of this series which is adding a new ioctl to let userspace associate a free-form name to a drm_file. Having this name is useful when debugging or tracking resource usage; in particular when using virtio native-context driver, where a single process (say QEMU), uses 1 drm_file per-guest applica

[PATCH v5 3/6] drm/amdgpu: delay the use of amdgpu_vm_set_task_info

2024-10-03 Thread Pierre-Eric Pelloux-Prayer
At the point the VM is locked (through the root PDs dma_resv object), so it's safer to call amdgpu_vm_set_task_info. The original place was not protected against concurrent access, but the risk was limited to mangled process/task name. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/d

[PATCH v5 5/6] drm/amdgpu: make process_name a flexible array

2024-10-03 Thread Pierre-Eric Pelloux-Prayer
And rename it process_desc, since it will soon contain more than just the process_name. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

[PATCH v5 4/6] drm/amdgpu: alloc and init vm::task_info from first submit

2024-10-03 Thread Pierre-Eric Pelloux-Prayer
This will allow to use flexible array to store the process name and other information. This also means that process name will be determined once and for all, instead of at each submit. Signed-off-by: Pierre-Eric Pelloux-Prayer --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 29

[PATCH v5 2/6] drm: use drm_file client_name in fdinfo

2024-10-03 Thread Pierre-Eric Pelloux-Prayer
Add an optional drm-client-name field to drm fdinfo's output. Reviewed-by: Christian König Reviewed-by: Tvrtko Ursulin Signed-off-by: Pierre-Eric Pelloux-Prayer --- Documentation/gpu/drm-usage-stats.rst | 5 + drivers/gpu/drm/drm_file.c| 5 + 2 files changed, 10 insertions(

[PATCH v5 6/6] drm/amdgpu: use drm_file::name in task_info::process_desc

2024-10-03 Thread Pierre-Eric Pelloux-Prayer
If a drm_file name is set append it to the process name. This information is useful with the virtio/native-context driver: this allows the guest applications identifier to visible in amdgpu's output. The output in amdgpu_vm_info/amdgpu_gem_info looks like this: pid:12255Process:glxgears/te

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Ville Syrjälä
On Thu, Oct 03, 2024 at 02:38:35PM +0200, Louis Chauvet wrote: > Le 02/10/24 - 21:22, Ville Syrjala a écrit : > > From: Ville Syrjälä > > > > Atomic drivers shouldn't be using the legacy state stored > > directly under drm_crtc. Move that junk into a 'legacy' sub > > structure to highlight the of

[PATCH v1] drm/amdgpu: Clean up duplicate ip_block object

2024-10-03 Thread Sunil Khatri
remove the duplicate ip_block object in the isp_hw_init function. Signed-off-by: Sunil Khatri --- drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c index 416e8b3fad79

Re: [PATCH v1] drm/amdgpu: Clean up duplicate ip_block object

2024-10-03 Thread Alex Deucher
Reviewed-by: Alex Deucher On Thu, Oct 3, 2024 at 9:50 AM Sunil Khatri wrote: > > remove the duplicate ip_block object in the > isp_hw_init function. > > Signed-off-by: Sunil Khatri > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/dri

[PATCH] drm/amdgpu: partially revert powerplay `__counted_by` changes

2024-10-03 Thread Alex Deucher
Partially revert commit 0ca9f757a0e2 ("drm/amd/pm: powerplay: Add `__counted_by` attribute for flexible arrays") The count attribute for these arrays does not get set until after the arrays are allocated and populated leading to false UBSAN warnings. Closes: https://gitlab.freedesktop.org/drm/am

Re: [lvc-project] [PATCH v2] drm/amd/pm: check return value of amdgpu_irq_add_id()

2024-10-03 Thread Alex Deucher
On Thu, Oct 3, 2024 at 10:28 AM Fedor Pchelkin wrote: > > On Wed, 02. Oct 16:01, Igor Artemiev wrote: > > amdgpu_irq_ad_id() may fail and the irq handlers will not be registered. > > This patch adds error code check. > > > > Found by Linux Verification Center (linuxtesting.org) with static > > ana

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Louis Chauvet
> > > diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c > > > b/drivers/gpu/drm/vkms/vkms_crtc.c > > > index a40295c18b48..780681ea77e4 100644 > > > --- a/drivers/gpu/drm/vkms/vkms_crtc.c > > > +++ b/drivers/gpu/drm/vkms/vkms_crtc.c > > > @@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_cr

  1   2   >