Re: [PATCH 4/6] drm/amdgpu: Attach eviction fence on alloc

2023-01-13 Thread Chen, Xiaogang
Reviewed-by: Xiaogang Chen Regards Xiaogang On 1/11/2023 7:31 PM, Felix Kuehling wrote: Instead of attaching the eviction fence when a KFD BO is first mapped, attach it when it is allocated or imported. This in preparation to allow KFD BOs to be mapped using the render node API.

Re: [PATCH 3/6] drm/amdkfd: Improve amdgpu_vm_handle_moved

2023-01-13 Thread Chen, Xiaogang
Acked-by: Xiaogang Chen Regards Xiaogang On 1/11/2023 7:31 PM, Felix Kuehling wrote: Let amdgpu_vm_handle_moved update all BO VA mappings of BOs reserved by the caller. This will be useful for handling extra BO VA mappings in KFD VMs that are managed through the render node API.

Re: [PATCH 2/6] drm/amdkfd: Implement DMA buf fd export from KFD

2023-01-13 Thread Chen, Xiaogang
Reviewed-by: Xiaogang Chen Regards Xiaogang On 1/11/2023 7:31 PM, Felix Kuehling wrote: Exports a DMA buf fd of a given KFD buffer handle. This is intended for being able to import KFD BOs into GEM contexts to leverage the amdgpu_bo_va API for more flexible virtual address mappings. It

[PATCH] amdgpu: Avoid building on UML

2023-01-13 Thread Peter Foley
The amdgpu driver tries to use fields not supported by UML's cpuinfo struct. Disable the driver when targeting UML to avoid tripping up allyesconfig. e.g. ../drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c: In function ‘intel_core_rkl_chk’:

[PATCH] drm/amdgpu: revert part of a commit fac53471d0ea9

2023-01-13 Thread vitaly.prosyak
From: Vitaly Prosyak Revert the following change: move drm_dev_unplug call after amdgpu_driver_unload_kms in amdgpu_pci_remove. The reason is following: amdgpu_pci_remove calls drm_dev_unregister and it should be called first to ensure userspace can't access the device instance anymore. If we

Re: [PATCH] Revert "drm/display/dp_mst: Move all payload info into the atomic state"

2023-01-13 Thread Daniel Vetter
On Fri, Jan 13, 2023 at 12:16:57PM +0200, Jani Nikula wrote: > > Cc: intel-gfx, drm maintainers > > Please have the courtesy of Cc'ing us for changes impacting us, and > maybe try to involve us earlier instead of surprising us like > this. Looks like this has been debugged for at least three

[PATCH] drm/amdgpu/smu: skip pptable init under sriov

2023-01-13 Thread Jane Jian
sriov does not need to init pptable from amdgpu driver we finish it from PF Signed-off-by: Jane Jian --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

Re: [PATCH] drm/amdgpu: print bo inode number instead of ptr

2023-01-13 Thread Christian König
Am 12.01.23 um 17:59 schrieb Pierre-Eric Pelloux-Prayer: This allows to correlate the infos printed by /sys/kernel/debug/dri/n/amdgpu_gem_info to the ones found in /proc/.../fdinfo and /sys/kernel/debug/dma_buf/bufinfo. Signed-off-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Christian König

Re: [PATCH] Revert "drm/display/dp_mst: Move all payload info into the atomic state"

2023-01-13 Thread Jani Nikula
Cc: intel-gfx, drm maintainers Please have the courtesy of Cc'ing us for changes impacting us, and maybe try to involve us earlier instead of surprising us like this. Looks like this has been debugged for at least three months, and the huge revert at this point is going to set us back with

Re: [PATCH 1/2] drm/ttm: Check ttm_debugfs_root before creating files under it

2023-01-13 Thread Christian König
Am 13.01.23 um 06:34 schrieb Ma Jun: Check the ttm_debugfs_root before creating files under it. If the ttm_debugfs_root is NULL, all the files created for ttm/ will be placed in the /sys/kerne/debug/ but not /sys/kernel/debug/ttm/ Well NAK for upstreaming. Why should ttm_debugfs_root be NULL

Re: [PATCH 2/2] drm/ttm: Use debugfs_remove_recursive to remove ttm directory

2023-01-13 Thread Christian König
Am 13.01.23 um 06:34 schrieb Ma Jun: Use debugfs_remove_recursive to remove the /sys/kernel/debug/ttm directory for better compatibility. Becuase debugfs_remove fails on older kernel. Again NAK for upstreaming. The upstream kernel is made for the newest kernel version and should not contain

[PATCH v2 3/3] drm/vmwgfx: Remove redundant framebuffer format check

2023-01-13 Thread Maíra Canal
Now that framebuffer_check() verifies that the format is properly supported, there is no need to check it again on vmwgfx's inside helpers. Therefore, remove the redundant framebuffer format check from the vmw_kms_new_framebuffer_surface() and vmw_kms_new_framebuffer_bo() functions, letting

[PATCH v2 0/3] Check for valid framebuffer's format

2023-01-13 Thread Maíra Canal
This series is a follow-up of the [1] in which I introduced a check for valid formats on drm_gem_fb_create(). During the discussion, I realized that would be a better idea to put the check inside framebuffer_check() so that it wouldn't be needed to hit any driver-specific code path when the check

[PATCH v2 1/3] drm/framebuffer: Check for valid formats

2023-01-13 Thread Maíra Canal
Currently, framebuffer_check() doesn't check if the pixel format is supported, which can lead to the acceptance of invalid pixel formats e.g. the acceptance of invalid modifiers. Therefore, add a check for valid formats on framebuffer_check(), so that the ADDFB2 IOCTL rejects calls with invalid

[PATCH v2 2/3] drm/amdgpu: Remove redundant framebuffer format check

2023-01-13 Thread Maíra Canal
Now that framebuffer_check() verifies that the format is properly supported, there is no need to check it again on amdgpu's inside helpers. Therefore, remove the redundant framebuffer format check from the amdgpu_display_gem_fb_verify_and_init() function, letting framebuffer_check() perform the

Re: [PATCH 0/5] drm: Do not include unnecessarily

2023-01-13 Thread Thomas Zimmermann
Am 13.01.23 um 11:36 schrieb Maxime Ripard: On Mon, Jan 09, 2023 at 11:12:38AM +0100, Thomas Zimmermann wrote: Remove unnecessary include statements for . I recently changed this header and had to rebuild a good part of DRM. So avoid this by removing the dependency. Some source files require

Re: [PATCH v2 1/3] drm/framebuffer: Check for valid formats

2023-01-13 Thread Ville Syrjälä
On Fri, Jan 13, 2023 at 08:27:42AM -0300, Maíra Canal wrote: > Currently, framebuffer_check() doesn't check if the pixel format is > supported, which can lead to the acceptance of invalid pixel formats > e.g. the acceptance of invalid modifiers. Therefore, add a check for > valid formats on

Re: Wrong revert commit in stable channel

2023-01-13 Thread Alex Deucher
Looks like Sasha picked it up again for some reason. I'll revert that on 6.1.x. Alex On Fri, Jan 13, 2023 at 1:02 AM Yury Zhuravlev wrote: > > Yes, this is right in 6.2-rc3 > >

Re: [PATCH] drm/amdgpu: Renoir/Cezanne GPU power reporting issue

2023-01-13 Thread Alex Deucher
Reviewed-by: Alex Deucher On Thu, Jan 12, 2023 at 9:11 PM Liu, Aaron wrote: > > Reviewed-by: Aaron Liu aaron@amd.com > > > > From: amd-gfx On Behalf Of Zhang, > Jesse(Jie) > Sent: Friday, January 13, 2023 10:07 AM > To: Deucher, Alexander > Cc: amd-gfx@lists.freedesktop.org > Subject:

Re: Is "perfectly equal monitors" really required to reclock MCLK

2023-01-13 Thread Alex Deucher
On Fri, Jan 13, 2023 at 9:47 AM Braiam wrote: > > Hi, > > I have two monitors with the current following configuration: > > Screen 0: minimum 320 x 200, current 5120 x 1440, maximum 16384 x 16384 > DisplayPort-0 connected primary 2560x1440+0+0 (normal left inverted > right x axis y axis) 597mm x

Re: Is "perfectly equal monitors" really required to reclock MCLK

2023-01-13 Thread Christian König
Am 13.01.23 um 11:35 schrieb Braiam: Hi, I have two monitors with the current following configuration: Screen 0: minimum 320 x 200, current 5120 x 1440, maximum 16384 x 16384 DisplayPort-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm 2560x1440

Re: [PATCH v2 02/10] drm: Include where needed

2023-01-13 Thread Sam Ravnborg
Hi Ville, On Wed, Jan 11, 2023 at 06:08:42PM +0200, Ville Syrjälä wrote: > On Wed, Jan 11, 2023 at 02:01:58PM +0100, Thomas Zimmermann wrote: > > Include in source files that need it. Some of DRM's > > source code gets OF header via drm_crtc_helper.h and , > > which can leed to unnecessary

Re: [PATCH v2 01/10] drm: Include where needed

2023-01-13 Thread Thomas Zimmermann
Hi Am 13.01.23 um 16:09 schrieb Sam Ravnborg: Hi Thomas, On Wed, Jan 11, 2023 at 02:01:57PM +0100, Thomas Zimmermann wrote: Include in source files that need it. Some of DRM's source code gets the backlight header via drm_crtc_helper.h and , which can leed to unnecessary recompilation. If

[PATCH v2 01/21] drm/display: Don't block HDR_OUTPUT_METADATA on unknown EOTF

2023-01-13 Thread Harry Wentland
The EDID of an HDR display defines EOTFs that are supported by the display and can be set in the HDR metadata infoframe. Userspace is expected to read the EDID and set an appropriate HDR_OUTPUT_METADATA. In drm_parse_hdr_metadata_block the kernel reads the supported EOTFs from the EDID and stores

[PATCH v2 02/21] drm/connector: print max_requested_bpc in state debugfs

2023-01-13 Thread Harry Wentland
This is useful to understand the bpc defaults and support of a driver. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Jani Nikula Cc: dri-de...@lists.freedesktop.org Cc:

[PATCH v2 00/21] Enable Colorspace connector property in amdgpu

2023-01-13 Thread Harry Wentland
This patchset enables the DP and HDMI infoframe properties in amdgpu. The first two patches are not completely related to the rest. The first patch allows for HDR_OUTPUT_METADATA with EOTFs that are unknown in the kernel. The second one prints a connector's max_bpc as part of the atomic state

[PATCH v2 10/21] drm/amd/display: Signal mode_changed if colorspace changed

2023-01-13 Thread Harry Wentland
We need to signal mode_changed to make sure we update the output colorspace. v2: No need to call drm_hdmi_avi_infoframe_colorimetry as DC does its own infoframe packing. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Uma Shankar Cc:

[PATCH v2 11/21] drm/amd/display: Send correct DP colorspace infopacket

2023-01-13 Thread Harry Wentland
Look at connector->colorimetry to determine output colorspace. We don't want to impact current SDR behavior, so DRM_MODE_COLORIMETRY_DEFAULT preserves current behavior. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Joshua Ashton Cc:

[PATCH v2 13/21] drm/amd/display: Add support for explicit BT601_YCC

2023-01-13 Thread Harry Wentland
We use this by default but if userspace passes this explicitly we should respect it. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Joshua Ashton Cc: dri-de...@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua

Re: [PATCH] drm/amdgpu/smu: skip pptable init under sriov

2023-01-13 Thread Alex Deucher
On Fri, Jan 13, 2023 at 5:56 AM Jane Jian wrote: > > sriov does not need to init pptable from amdgpu driver > we finish it from PF > > Signed-off-by: Jane Jian > --- > drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git

[PATCH] drm/amdgpu: Add a missing tab

2023-01-13 Thread Dan Carpenter
This tab was deleted accidentally and triggers a Smatch warning: drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:1006 gfx_v8_0_init_microcode() warn: inconsistent indenting Add it back. Fixes: 0aaafb7359d2 ("drm/amd: Use `amdgpu_ucode_*` helpers for GFX8") Signed-off-by: Dan Carpenter ---

Re: [PATCH 0/5] drm: Do not include unnecessarily

2023-01-13 Thread Maxime Ripard
On Mon, Jan 09, 2023 at 11:12:38AM +0100, Thomas Zimmermann wrote: > Remove unnecessary include statements for . I recently > changed this header and had to rebuild a good part of DRM. So avoid > this by removing the dependency. > > Some source files require the OF or backlight headers. Include

Is "perfectly equal monitors" really required to reclock MCLK

2023-01-13 Thread Braiam
Hi, I have two monitors with the current following configuration: Screen 0: minimum 320 x 200, current 5120 x 1440, maximum 16384 x 16384 DisplayPort-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm 2560x1440164.83 + 59.95 + 120.05* 96.01

Re: [PATCH] drm/amdgpu: revert part of a commit fac53471d0ea9

2023-01-13 Thread Alex Deucher
On Fri, Jan 13, 2023 at 4:44 AM wrote: > > From: Vitaly Prosyak > > Revert the following change: move drm_dev_unplug call after > amdgpu_driver_unload_kms in amdgpu_pci_remove. > The reason is following: amdgpu_pci_remove calls drm_dev_unregister > and it should be called first to ensure

Re: [PATCH v2 02/10] drm: Include where needed

2023-01-13 Thread Ville Syrjälä
On Fri, Jan 13, 2023 at 04:11:48PM +0100, Sam Ravnborg wrote: > Hi Ville, > On Wed, Jan 11, 2023 at 06:08:42PM +0200, Ville Syrjälä wrote: > > On Wed, Jan 11, 2023 at 02:01:58PM +0100, Thomas Zimmermann wrote: > > > Include in source files that need it. Some of DRM's > > > source code gets OF

[PATCH v2 20/21] drm/amd/display: Calculate output_color_space after pixel encoding adjustment

2023-01-13 Thread Harry Wentland
From: Joshua Ashton Code in get_output_color_space depends on knowing the pixel encoding to determine whether to pick between eg. COLOR_SPACE_SRGB or COLOR_SPACE_YCBCR709 for transparent RGB -> YCbCr 4:4:4 in the driver. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka

[PATCH v2 17/21] drm/amd/display: Format input and output CSC matrix

2023-01-13 Thread Harry Wentland
Format the input and output CSC matrix so they look like 3x4 matrixes. This will make parsing them much easier and allows us to quickly spot potential mistakes. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Joshua Ashton Cc:

[PATCH v2 16/21] drm/amd/display: Don't restrict bpc to 8 bpc

2023-01-13 Thread Harry Wentland
This will let us pass the kms_hdr.bpc_switch IGT test. The reason the bpc restriction was required is historical. At one point in time we were not falling back to a lower bpc when we didn't have enough bandwidth for the maximum bpc reported by a display. This meant that we couldn't enable some

[PATCH v2 15/21] drm/amd/display: Add default case for output_color_space switch

2023-01-13 Thread Harry Wentland
Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Joshua Ashton Cc: dri-de...@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 43 ++- 1 file

Re: Is "perfectly equal monitors" really required to reclock MCLK

2023-01-13 Thread Alex Deucher
On Fri, Jan 13, 2023 at 10:05 AM Braiam wrote: > > AMD RX 590. Forgot to include it. How do I know the blanking period? OK polaris falls into the first bucket. Look at the full modelines. E.g., xrandr --verbose. > Would variable refresh rate mess up with that? Probably. Alex > > On Fri, Jan

Re: Is "perfectly equal monitors" really required to reclock MCLK

2023-01-13 Thread Braiam
AMD RX 590. Forgot to include it. How do I know the blanking period? Would variable refresh rate mess up with that? On Fri, Jan 13, 2023 at 10:57 AM Alex Deucher wrote: > > On Fri, Jan 13, 2023 at 9:47 AM Braiam wrote: > > > > Hi, > > > > I have two monitors with the current following

Re: [PATCH v2 00/10] drm: Do not include unnecessarily

2023-01-13 Thread Sam Ravnborg
Hi Thomas. On Wed, Jan 11, 2023 at 02:01:56PM +0100, Thomas Zimmermann wrote: > Remove unnecessary include statements for . I recently > changed this header and had to rebuild a good part of DRM. So avoid > this by removing the dependency. > > Several files include via drm_fb_helper.h. So in v2

Re: Is "perfectly equal monitors" really required to reclock MCLK

2023-01-13 Thread Christian König
Am 13.01.23 um 16:09 schrieb Alex Deucher: On Fri, Jan 13, 2023 at 10:05 AM Braiam wrote: AMD RX 590. Forgot to include it. How do I know the blanking period? OK polaris falls into the first bucket. Look at the full modelines. E.g., xrandr --verbose. Would variable refresh rate mess up

Re: [PATCH v2 01/10] drm: Include where needed

2023-01-13 Thread Sam Ravnborg
Hi Thomas, On Wed, Jan 11, 2023 at 02:01:57PM +0100, Thomas Zimmermann wrote: > Include in source files that need it. Some of > DRM's source code gets the backlight header via drm_crtc_helper.h > and , which can leed to unnecessary recompilation. If > possible, do not include drm_crtc_helper.h

Re: [PATCH v2 05/10] drm/panel: Do not include

2023-01-13 Thread Sam Ravnborg
On Wed, Jan 11, 2023 at 02:02:01PM +0100, Thomas Zimmermann wrote: > Remove unnecessary include statements for . No functional > changes. Include where the driver got the header file via > . > > Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg > --- >

Re: [PATCH] Revert "drm/display/dp_mst: Move all payload info into the atomic state"

2023-01-13 Thread Harry Wentland
On 1/13/23 05:25, Daniel Vetter wrote: > On Fri, Jan 13, 2023 at 12:16:57PM +0200, Jani Nikula wrote: >> >> Cc: intel-gfx, drm maintainers >> >> Please have the courtesy of Cc'ing us for changes impacting us, and >> maybe try to involve us earlier instead of surprising us like >> this. Looks

[PATCH v2 03/21] drm/connector: Drop COLORIMETRY_NO_DATA

2023-01-13 Thread Harry Wentland
The value is the same as DEFAULT. The HDMI_COLORIMETRY_NO_DATA makes sense for the infopacket but it's meaningless for the connector colorspace. or, in otherwise, just means to go with driver default. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc:

[PATCH v2 12/21] drm/amd/display: Always set crtcinfo from create_stream_for_sink

2023-01-13 Thread Harry Wentland
From: Joshua Ashton Given that we always pass dm_state into here now, this won't ever trigger anymore. This is needed for we will always fail mode validation with invalid clocks or link bandwidth errors. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc:

[PATCH v2 14/21] drm/amd/display: Add debugfs for testing output colorspace

2023-01-13 Thread Harry Wentland
In order to IGT test colorspace we'll want to print the currently enabled colorspace on a stream. We add a new debugfs to do so, using the same scheme as current bpc reporting. This might also come in handy when debugging display issues. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc:

[PATCH v2 21/21] drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix

2023-01-13 Thread Harry Wentland
From: Joshua Ashton Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Joshua Ashton Cc: dri-de...@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Harry Wentland ---

[PATCH v2 19/21] drm/amd/display: Refactor avi_info_frame colorimetry determination

2023-01-13 Thread Harry Wentland
From: Joshua Ashton Replace the messy two if-else chains here that were on the same value with a switch on the enum. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Joshua Ashton Cc:

[PATCH v2 09/21] drm/amd/display: Register Colorspace property for DP and HDMI

2023-01-13 Thread Harry Wentland
We want compositors to be able to set the output colorspace on DP and HDMI outputs, based on the caps reported from the receiver via EDID. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Joshua Ashton Cc: dri-de...@lists.freedesktop.org Cc:

[PATCH v2 04/21] drm/connector: Convert DRM_MODE_COLORIMETRY to enum

2023-01-13 Thread Harry Wentland
This allows us to use strongly typed arguments. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Jani Nikula Cc: dri-de...@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org

[PATCH v2 05/21] drm/connector: Pull out common create_colorspace_property code

2023-01-13 Thread Harry Wentland
Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Jani Nikula Cc: dri-de...@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton ---

[PATCH v2 07/21] drm/connector: Print connector colorspace in state debugfs

2023-01-13 Thread Harry Wentland
v3: Fix kerneldocs (kernel test robot) Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: Jani Nikula Cc: dri-de...@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By:

[PATCH v2 08/21] drm/amd/display: Always pass connector_state to stream validation

2023-01-13 Thread Harry Wentland
We need the connector_state for colorspace and scaling information and can get it from connector->state. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: vitaly.pros...@amd.com Cc: Joshua Ashton Cc: dri-de...@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org

[PATCH v2 06/21] drm/connector: Allow drivers to pass list of supported colorspaces

2023-01-13 Thread Harry Wentland
Drivers might not support all colorspaces defined in dp_colorspaces and hdmi_colorspaces. This results in undefined behavior when userspace is setting an unsupported colorspace. Allow drivers to pass the list of supported colorspaces when creating the colorspace property. v2: - Use 0 to

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

2023-01-13 Thread Harry Wentland
From: Joshua Ashton Userspace might not aware whether we're sending RGB or YCbCr data to the display. If COLOR_SPACE_2020_RGB_FULLRANGE is requested but the output encoding is YCbCr we should send COLOR_SPACE_2020_YCBCR. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka

[PATCH] drm/amdgpu: fix cleaning up reserved VMID on release

2023-01-13 Thread Christian König
We need to reset this or otherwise run into list corruption later on./ Fixes: 16be3e9f6f03 ("drm/amdgpu: rework reserved VMID handling") Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCH v3 1/3] drm/framebuffer: Check for valid formats

2023-01-13 Thread Simon Ser
On Friday, January 13th, 2023 at 17:59, Maíra Canal wrote: > + /* Verify that the modifier is supported. */ > + if (r->modifier[0] && drm_drv_uses_atomic_modeset(dev) && > + !drm_any_plane_has_format(dev, r->pixel_format, r->modifier[0])) { > + drm_dbg_kms(dev,

Re: [PATCH] drm/amdgpu: fix cleaning up reserved VMID on release

2023-01-13 Thread Alex Deucher
On Fri, Jan 13, 2023 at 11:35 AM Christian König wrote: > > We need to reset this or otherwise run into list corruption later on./ Drop the / above. Reviewed-by: Alex Deucher > > Fixes: 16be3e9f6f03 ("drm/amdgpu: rework reserved VMID handling") > Signed-off-by: Christian König > --- >

[PATCH v3 2/3] drm/amdgpu: Remove redundant framebuffer format check

2023-01-13 Thread Maíra Canal
Now that framebuffer_check() verifies that the format is properly supported, there is no need to check it again on amdgpu's inside helpers. Therefore, remove the redundant framebuffer format check from the amdgpu_display_gem_fb_verify_and_init() function, letting framebuffer_check() perform the

[PATCH v3 1/3] drm/framebuffer: Check for valid formats

2023-01-13 Thread Maíra Canal
Currently, framebuffer_check() doesn't check if the pixel format is supported, which can lead to the acceptance of invalid pixel formats e.g. the acceptance of invalid modifiers. Therefore, add a check for valid formats on framebuffer_check(), so that the ADDFB2 IOCTL rejects calls with invalid

[PATCH v3 0/3] Check for valid framebuffer's format

2023-01-13 Thread Maíra Canal
This series is a follow-up of the [1] in which I introduced a check for valid formats on drm_gem_fb_create(). During the discussion, I realized that would be a better idea to put the check inside framebuffer_check() so that it wouldn't be needed to hit any driver-specific code path when the check

[PATCH v3 3/3] drm/vmwgfx: Remove redundant framebuffer format check

2023-01-13 Thread Maíra Canal
Now that framebuffer_check() verifies that the format is properly supported, there is no need to check it again on vmwgfx's inside helpers. Therefore, remove the redundant framebuffer format check from the vmw_kms_new_framebuffer_surface() and vmw_kms_new_framebuffer_bo() functions, letting

Re: [PATCH v3 2/3] drm/amdgpu: Remove redundant framebuffer format check

2023-01-13 Thread Simon Ser
Hm, unfortunately I think we need to keep the check in amdgpu for the same reason as i915: amdgpu will pick a modifier if user-space didn't supply one on GFX9+. I wonder if that also applies to vmwgfx? Maybe that would be a reason to have the check in framebuffer_init()? (Not sure!)

Re: [PATCH v3 2/3] drm/amdgpu: Remove redundant framebuffer format check

2023-01-13 Thread Maíra Canal
On 1/13/23 14:06, Simon Ser wrote: Hm, unfortunately I think we need to keep the check in amdgpu for the same reason as i915: amdgpu will pick a modifier if user-space didn't supply one on GFX9+. I wonder if that also applies to vmwgfx? Maybe that would be a reason to have the check in

Re: [RFC PATCH 00/17] DRM_USE_DYNAMIC_DEBUG regression

2023-01-13 Thread jim . cromie
On Wed, Jan 11, 2023 at 4:09 PM Daniel Vetter wrote: > > On Mon, Dec 05, 2022 at 05:34:07PM -0700, Jim Cromie wrote: > > Hi everyone, > > > > DRM_USE_DYNAMIC_DEBUG=y has a regression on rc-* > > > > Regression is due to a chicken-egg problem loading modules; on > > `modprobe i915`, drm is loaded

Re: [RFC PATCH 00/17] DRM_USE_DYNAMIC_DEBUG regression

2023-01-13 Thread Daniel Vetter
On Fri, Jan 13, 2023 at 11:29:57AM -0700, jim.cro...@gmail.com wrote: > On Wed, Jan 11, 2023 at 4:09 PM Daniel Vetter wrote: > > > > On Mon, Dec 05, 2022 at 05:34:07PM -0700, Jim Cromie wrote: > > > Hi everyone, > > > > > > DRM_USE_DYNAMIC_DEBUG=y has a regression on rc-* > > > > > > Regression

[PATCH v2 03/20] dyndbg: replace classmap list with a vector

2023-01-13 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 v2 10/20] dyndbg-API: split DECLARE_(DYNDBG_CLASSMAP) to $1(_DEFINE|_USE)

2023-01-13 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 v2 12/20] dyndbg-API: DYNDBG_CLASSMAP_USE drop extra args

2023-01-13 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 v2 05/20] dyndbg: split param_set_dyndbg_classes to inner/outer

2023-01-13 Thread Jim Cromie
Split param_set_dyndbg_classes() to interface-preserving wrapper & inner function with an additional param: mod_name, which is passed into ddebug_apply_class_bitmap() to allow adjusting a single module's prdbgs. Wrapper passes NULL, preserving current behavior for now. no functional change.

[PATCH v2 07/20] dyndbg: reduce verbose/debug clutter

2023-01-13 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 v2 08/20] dyndbg: tighten ddebug_class_name() 1st arg

2023-01-13 Thread Jim Cromie
Change function's 1st arg-type, by derefing in the caller. The fn doesnt need any other fields in the old type. 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 v2 09/20] dyndbg: constify ddebug_apply_class_bitmap args

2023-01-13 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.

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

2023-01-13 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 v2 14/20] drm_print: fix stale macro-name in comment

2023-01-13 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 v2 02/20] test-dyndbg: show that DEBUG enables prdbgs at compiletime

2023-01-13 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 v2 06/20] dyndbg: drop NUM_TYPE_ARRAY

2023-01-13 Thread Jim Cromie
ARRAY_SIZE works here, since array decl is complete. 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 bf47bcfad8e6..81b643ab7f6e 100644 ---

[PATCH v2 01/20] test-dyndbg: fixup CLASSMAP usage error

2023-01-13 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 v2 04/20] dyndbg: make ddebug_apply_class_bitmap more selective

2023-01-13 Thread Jim Cromie
ddebug_apply_class_bitmap() currently applies the class settings to all modules, by calling ddebug_exec_queries(query, NULL), where NULL is wildcard ("*" does the same). Make it more selective, by adding query_module param, and passing it into ddebug_exec_queries, instead of the NULL. This

Re: [PATCH] drm/amdkfd: Support process XNACK mode dynamic change

2023-01-13 Thread Felix Kuehling
On 2023-01-12 16:18, Philip Yang wrote: Update queue qpd is done for the first queue creation of the process, if the device support XNACK mode per process, update qpd setup sh_mem_config based on the process XNACK mode, to support the process destory all queues, change XNACK mode, and then

[PATCH v2 00/20] DRM_USE_DYNAMIC_DEBUG regression

2023-01-13 Thread Jim Cromie
Hi everyone, DRM_USE_DYNAMIC_DEBUG=y has a regression enabling drm.debug in drivers 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 it at runtime, things just worked. But with

Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO

2023-01-13 Thread Alex Deucher
On Fri, Jan 13, 2023 at 4:02 PM Marek Olšák wrote: > > i've added the comments and indeed pahole shows the hole as expected. What about on 32-bit? Alex > > Marek > > On Thu, Jan 12, 2023 at 11:44 AM Alex Deucher wrote: >> >> On Thu, Jan 12, 2023 at 6:50 AM Christian König >> wrote: >> > >> >

[PATCH] drm/amd: Fix renoir/green sardine MP0 IP version detection

2023-01-13 Thread Mario Limonciello
The existing codebase never had a case for detecting MP0 version on Renoir and instead relied upon hardcoded chip name. This was missed as part of the changes to migrate all IP blocks to build filenames from `amdgpu_ucode.c`. Consequently, Renoir tries to fetch a binary with 11_0_3 in the

Re: [PATCH] Revert "drm/display/dp_mst: Move all payload info into the atomic state"

2023-01-13 Thread Lyude Paul
On Fri, 2023-01-13 at 11:25 +0100, Daniel Vetter wrote: > On Fri, Jan 13, 2023 at 12:16:57PM +0200, Jani Nikula wrote: > > > > Cc: intel-gfx, drm maintainers > > > > Please have the courtesy of Cc'ing us for changes impacting us, and > > maybe try to involve us earlier instead of surprising us

Re: [PATCH] Revert "drm/display/dp_mst: Move all payload info into the atomic state"

2023-01-13 Thread Limonciello, Mario
On 1/13/2023 13:28, Lyude Paul wrote: On Fri, 2023-01-13 at 11:25 +0100, Daniel Vetter wrote: On Fri, Jan 13, 2023 at 12:16:57PM +0200, Jani Nikula wrote: Cc: intel-gfx, drm maintainers Please have the courtesy of Cc'ing us for changes impacting us, and maybe try to involve us earlier

Re: [PATCH 1/6] drm/amdgpu: Generalize KFD dmabuf import

2023-01-13 Thread Felix Kuehling
On 2023-01-13 18:00, Chen, Xiaogang wrote: On 1/13/2023 4:26 PM, Felix Kuehling wrote: On 2023-01-12 17:41, Chen, Xiaogang wrote: On 1/11/2023 7:31 PM, Felix Kuehling wrote: Use proper amdgpu_gem_prime_import function to handle all kinds of imports. Remember the dmabuf reference to enable

Re: [PATCH] drm/amdgpu: Add a missing tab

2023-01-13 Thread Alex Deucher
Applied. Thanks! Alex On Fri, Jan 13, 2023 at 9:46 AM Dan Carpenter wrote: > > This tab was deleted accidentally and triggers a Smatch warning: > > drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:1006 gfx_v8_0_init_microcode() > warn: inconsistent indenting > > Add it back. > > Fixes:

Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO

2023-01-13 Thread Marek Olšák
i've added the comments and indeed pahole shows the hole as expected. Marek On Thu, Jan 12, 2023 at 11:44 AM Alex Deucher wrote: > On Thu, Jan 12, 2023 at 6:50 AM Christian König > wrote: > > > > Am 11.01.23 um 21:48 schrieb Alex Deucher: > > > On Wed, Jan 4, 2023 at 3:17 PM Marek Olšák

Re: [PATCH 1/6] drm/amdgpu: Generalize KFD dmabuf import

2023-01-13 Thread Felix Kuehling
On 2023-01-12 17:41, Chen, Xiaogang wrote: On 1/11/2023 7:31 PM, Felix Kuehling wrote: Use proper amdgpu_gem_prime_import function to handle all kinds of imports. Remember the dmabuf reference to enable proper multi-GPU attachment to multiple VMs without erroneously re-exporting the underlying

Re: [PATCH 6/6] drm/amdgpu: Do bo_va ref counting for KFD BOs

2023-01-13 Thread Chen, Xiaogang
Reviewed-by: Xiaogang Chen Regards Xiaogang On 1/11/2023 7:31 PM, Felix Kuehling wrote: This is needed to correctly handle BOs imported into the GEM API, which would otherwise get added twice to the same VM. Signed-off-by: Felix Kuehling --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO

2023-01-13 Thread Marek Olšák
Valve would like this in kernel 6.2, but if put it there, we also need to backport INFO ioctl changes for DRM driver version 3.50.0. Marek On Fri, Jan 13, 2023 at 6:33 PM Marek Olšák wrote: > There is no hole on 32-bit unfortunately. It looks like the hole on 64-bit > is now ABI. > > I moved

Re: [PATCH 2/2] drm/amdgpu/pm: update hwmon power documentation

2023-01-13 Thread Alex Deucher
Can someone review this patch (2/2)? 1/2 is superseded by Jesse's patch, but this one still makes sense. Thanks On Thu, Jan 12, 2023 at 11:25 AM Alex Deucher wrote: > > Power reporting is socket power. On APUs this includes > the CPU. Update the documentation to clarify this. > >

Re: [PATCH 5/6] drm/amdgpu: update mappings not managed by KFD

2023-01-13 Thread Chen, Xiaogang
Reviewed-by: Xiaogang Chen Regards Xiaogang On 1/11/2023 7:31 PM, Felix Kuehling wrote: When restoring after an eviction, use amdgpu_vm_handle_moved to update BO VA mappings in KFD VMs that are not managed through the KFD API. This should allow using the render node API to create more

Re: [PATCH 1/6] drm/amdgpu: Generalize KFD dmabuf import

2023-01-13 Thread Chen, Xiaogang
On 1/13/2023 4:26 PM, Felix Kuehling wrote: On 2023-01-12 17:41, Chen, Xiaogang wrote: On 1/11/2023 7:31 PM, Felix Kuehling wrote: Use proper amdgpu_gem_prime_import function to handle all kinds of imports. Remember the dmabuf reference to enable proper multi-GPU attachment to multiple VMs

Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO

2023-01-13 Thread Marek Olšák
There is no hole on 32-bit unfortunately. It looks like the hole on 64-bit is now ABI. I moved the field to replace _pad1. The patch is attached (with your Rb). Marek On Fri, Jan 13, 2023 at 4:20 PM Alex Deucher wrote: > On Fri, Jan 13, 2023 at 4:02 PM Marek Olšák wrote: > > > > i've added

[PATCH v2 20/20] jump_label: RFC - tolerate toggled state

2023-01-13 Thread Jim Cromie
__jump_label_patch currently will "crash the box" if it finds a jump_entry not as expected. ISTM this overly harsh; it doesn't distinguish between "alternate/opposite" state, and truly "insane/corrupted". The "opposite" (but well-formed) state is a milder mis-initialization problem, and some

[PATCH v2 18/20] test-dyndbg: tune sub-module behavior

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

  1   2   >