RE: [RFC PATCH 1/9] apple-gmux: use cpu_to_be32 instead of manual reorder

2023-02-10 Thread David Laight
From: Hans de Goede > Sent: 10 February 2023 19:33 > > Hi, > > On 2/10/23 20:09, Hans de Goede wrote: > > Hi, > > > > On 2/10/23 05:48, Orlando Chamberlain wrote: > >> Currently it manually flips the byte order, but we can instead use > >> cpu_to_be32(val) for this. > >> > >> Signed-off-by: Orlan

Re: [RFC PATCH 7/9] apple-gmux: add sysfs interface

2023-02-10 Thread Orlando Chamberlain
On Fri, 10 Feb 2023 21:23:15 +0100 Hans de Goede wrote: > Hi, > > On 2/10/23 21:15, Hans de Goede wrote: > > Hi, > > > > On 2/10/23 05:48, Orlando Chamberlain wrote: > >> Allow reading gmux ports from userspace. When the unsafe module > >> parameter allow_user_writes is true, writing 1 byte >

Re: [RFC PATCH 1/9] apple-gmux: use cpu_to_be32 instead of manual reorder

2023-02-10 Thread Orlando Chamberlain
On Fri, 10 Feb 2023 20:19:27 +0100 Hans de Goede wrote: > Hi, > > On 2/10/23 20:09, Hans de Goede wrote: > > Hi, > > > > On 2/10/23 05:48, Orlando Chamberlain wrote: > >> Currently it manually flips the byte order, but we can instead use > >> cpu_to_be32(val) for this. > >> > >> Signed-off-by

Re: [RFC PATCH 5/9] apple-gmux: Use GMSP acpi method for interrupt clear

2023-02-10 Thread Orlando Chamberlain
On Fri, 10 Feb 2023 20:43:58 +0100 Hans de Goede wrote: > Hi, > > On 2/10/23 05:48, Orlando Chamberlain wrote: > > This is needed for interrupts to be cleared correctly on MMIO based > > gmux's. It is untested if this helps/hinders other gmux types, but I > > have seen the GMSP method in the acp

Re: [RFC PATCH 2/9] apple-gmux: consolidate version reading

2023-02-10 Thread Orlando Chamberlain
On Fri, 10 Feb 2023 20:41:19 +0100 Hans de Goede wrote: > Hi, > > On 2/10/23 05:48, Orlando Chamberlain wrote: > > Read gmux version in one go as 32 bits on both indexed and classic > > gmux's. > > > > Classic gmux's used to read the version as > > > > major = inb(base + 0x4); > > minor = inb(

Re: [RFC PATCH 9/9] drm/amdgpu: register a vga_switcheroo client for all GPUs that are not thunderbolt attached

2023-02-10 Thread Orlando Chamberlain
On Fri, 10 Feb 2023 11:37:08 -0500 Alex Deucher wrote: > On Fri, Feb 10, 2023 at 11:07 AM Hans de Goede > wrote: > > > > Hi, > > > > On 2/10/23 16:53, Alex Deucher wrote: > > > On Fri, Feb 10, 2023 at 3:04 AM Orlando Chamberlain > > > wrote: > > >> > > >> From: Kerem Karabay > > >> > > >>

[linux-next:master] BUILD REGRESSION 6ba8a227fd19d19779005fb66ad7562608e1df83

2023-02-10 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master branch HEAD: 6ba8a227fd19d19779005fb66ad7562608e1df83 Add linux-next specific files for 20230210 Error/Warning reports: https://lore.kernel.org/oe-kbuild-all/202301302110.metnwkbd-...@intel.com https

RE: [PATCH] drm/amd: Don't allow s0ix on APUs older than Raven

2023-02-10 Thread Limonciello, Mario
[Public] > -Original Message- > From: Limonciello, Mario > Sent: Friday, February 10, 2023 14:47 > To: amd-gfx@lists.freedesktop.org > Cc: Limonciello, Mario ; Deucher, Alexander > > Subject: [PATCH] drm/amd: Don't allow s0ix on APUs older than Raven > > APUs before Raven didn't suppo

[PATCH] drm/amd: Don't allow s0ix on APUs older than Raven

2023-02-10 Thread Mario Limonciello
APUs before Raven didn't support s0ix. As we just relieved some of the safety checks for s0ix to improve power consumption on APUs that support it but that are missing BIOS support a new blind spot was introduced that a user could "try" to run s0ix. Plug this hole so that if users try to run s0ix

Re: [RFC PATCH 7/9] apple-gmux: add sysfs interface

2023-02-10 Thread Hans de Goede
Hi, On 2/10/23 05:48, Orlando Chamberlain wrote: > Allow reading gmux ports from userspace. When the unsafe module > parameter allow_user_writes is true, writing 1 byte > values is also allowed. > > For example: > > cd /sys/bus/acpi/devices/APP000B:00/physical_node/ > echo 4 > gmux_selected_port

Re: [RFC PATCH 7/9] apple-gmux: add sysfs interface

2023-02-10 Thread Hans de Goede
Hi, On 2/10/23 21:15, Hans de Goede wrote: > Hi, > > On 2/10/23 05:48, Orlando Chamberlain wrote: >> Allow reading gmux ports from userspace. When the unsafe module >> parameter allow_user_writes is true, writing 1 byte >> values is also allowed. >> >> For example: >> >> cd /sys/bus/acpi/devices/

Re: [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface

2023-02-10 Thread Harry Wentland
On 2/10/23 04:28, Pekka Paalanen wrote: > On Thu, 9 Feb 2023 13:27:02 -0100 > Melissa Wen wrote: > >> On 01/31, Pekka Paalanen wrote: >>> On Mon, 9 Jan 2023 14:38:09 -0100 >>> Melissa Wen wrote: >>> On 01/09, Melissa Wen wrote: > Hi, > > After collecting comments in diff

Re: [RFC PATCH 1/9] apple-gmux: use cpu_to_be32 instead of manual reorder

2023-02-10 Thread Hans de Goede
Hi, On 2/10/23 20:09, Hans de Goede wrote: > Hi, > > On 2/10/23 05:48, Orlando Chamberlain wrote: >> Currently it manually flips the byte order, but we can instead use >> cpu_to_be32(val) for this. >> >> Signed-off-by: Orlando Chamberlain >> --- >> drivers/platform/x86/apple-gmux.c | 18 ++-

Re: [RFC PATCH 1/9] apple-gmux: use cpu_to_be32 instead of manual reorder

2023-02-10 Thread Hans de Goede
Hi, On 2/10/23 20:09, Hans de Goede wrote: > Hi, > > On 2/10/23 05:48, Orlando Chamberlain wrote: >> Currently it manually flips the byte order, but we can instead use >> cpu_to_be32(val) for this. >> >> Signed-off-by: Orlando Chamberlain >> --- >> drivers/platform/x86/apple-gmux.c | 18 ++-

Re: [RFC PATCH 5/9] apple-gmux: Use GMSP acpi method for interrupt clear

2023-02-10 Thread Hans de Goede
Hi, On 2/10/23 05:48, Orlando Chamberlain wrote: > This is needed for interrupts to be cleared correctly on MMIO based > gmux's. It is untested if this helps/hinders other gmux types, but I > have seen the GMSP method in the acpi tables of a MacBook with an > indexed gmux. > > If this turns out t

Re: [RFC PATCH 2/9] apple-gmux: consolidate version reading

2023-02-10 Thread Hans de Goede
Hi, On 2/10/23 05:48, Orlando Chamberlain wrote: > Read gmux version in one go as 32 bits on both indexed and classic > gmux's. > > Classic gmux's used to read the version as > > major = inb(base + 0x4); > minor = inb(base + 0x5); > release = inb(base + 0x6); > > but this can instead be done th

Re: [PATCH] drm/amd/display: Remove duplicate/repeating expressions

2023-02-10 Thread Harry Wentland
On 2/10/23 05:00, Deepak R Varma wrote: > Remove duplicate or repeating expressions in the if condition > evaluation. Issue identified using doubletest.cocci Coccinelle semantic > patch. > > Signed-off-by: Deepak R Varma Reviewed-by: Harry Wentland Harry > --- > .../gpu/drm/amd/display/dc/dm

Re: [RFC PATCH 1/9] apple-gmux: use cpu_to_be32 instead of manual reorder

2023-02-10 Thread Hans de Goede
Hi, On 2/10/23 05:48, Orlando Chamberlain wrote: > Currently it manually flips the byte order, but we can instead use > cpu_to_be32(val) for this. > > Signed-off-by: Orlando Chamberlain > --- > drivers/platform/x86/apple-gmux.c | 18 ++ > 1 file changed, 2 insertions(+), 16 dele

Re: [PATCH] drm/amd/display: Remove duplicate/repeating expression

2023-02-10 Thread Deepak R Varma
On Fri, Feb 10, 2023 at 10:22:00AM -0500, Harry Wentland wrote: > On 2/10/23 05:11, Deepak R Varma wrote: > > Remove duplicate or repeating expressions in the if condition > > evaluation. Issue identified using doubletest.cocci Coccinelle semantic > > patch. > > > > Signed-off-by: Deepak R Varma

Re: [RFC PATCH 9/9] drm/amdgpu: register a vga_switcheroo client for all GPUs that are not thunderbolt attached

2023-02-10 Thread Alex Deucher
On Fri, Feb 10, 2023 at 11:07 AM Hans de Goede wrote: > > Hi, > > On 2/10/23 16:53, Alex Deucher wrote: > > On Fri, Feb 10, 2023 at 3:04 AM Orlando Chamberlain > > wrote: > >> > >> From: Kerem Karabay > >> > >> Commit 3840c5bcc245 ("drm/amdgpu: disentangle runtime pm and > >> vga_switcheroo") ma

Re: [RFC PATCH 0/9] apple-gmux: support MMIO gmux type on T2 Macs

2023-02-10 Thread Alex Deucher
On Fri, Feb 10, 2023 at 3:04 AM Orlando Chamberlain wrote: > > Hi All, > > This patch series adds support for the MMIO based gmux present on these > Dual GPU Apple T2 Macs: MacBookPro15,1, MacBookPro15,3, MacBookPro16,1, > MacBookPro16,4 (although amdgpu isn't working on MacBookPro16,4 [1]). > > I

Re: error: 'const struct dc_dsc_config' has no member named 'is_frl'

2023-02-10 Thread Alex Deucher
On Thu, Feb 9, 2023 at 11:38 PM Randy Dunlap wrote: > > Hi, > > The 'is_frl' struct field is conditional: > > #if defined(CONFIG_DRM_AMD_DC_DCN) > bool is_frl; /* indicate if DSC is applied based on HDMI FRL sink's > capability */ > #endif > > so code that uses it should be careful, other

Re: [RFC PATCH 9/9] drm/amdgpu: register a vga_switcheroo client for all GPUs that are not thunderbolt attached

2023-02-10 Thread Hans de Goede
Hi, On 2/10/23 16:53, Alex Deucher wrote: > On Fri, Feb 10, 2023 at 3:04 AM Orlando Chamberlain > wrote: >> >> From: Kerem Karabay >> >> Commit 3840c5bcc245 ("drm/amdgpu: disentangle runtime pm and >> vga_switcheroo") made amdgpu only register a vga_switcheroo client for >> GPU's with PX, howeve

[PATCH] drm/amd/display: Remove duplicate/repeating expression

2023-02-10 Thread Deepak R Varma
Remove duplicate or repeating expressions in the if condition evaluation. Issue identified using doubletest.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH] drm/amd/display: Remove duplicate/repeating expressions

2023-02-10 Thread Deepak R Varma
Remove duplicate or repeating expressions in the if condition evaluation. Issue identified using doubletest.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c| 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) d

Re: [RFC PATCH 9/9] drm/amdgpu: register a vga_switcheroo client for all GPUs that are not thunderbolt attached

2023-02-10 Thread Alex Deucher
On Fri, Feb 10, 2023 at 3:04 AM Orlando Chamberlain wrote: > > From: Kerem Karabay > > Commit 3840c5bcc245 ("drm/amdgpu: disentangle runtime pm and > vga_switcheroo") made amdgpu only register a vga_switcheroo client for > GPU's with PX, however AMD GPUs in dual gpu Apple Macbooks do need to > re

Re: [PATCH] drm/amd/display: Remove duplicate/repeating expression

2023-02-10 Thread Harry Wentland
On 2/10/23 05:11, Deepak R Varma wrote: > Remove duplicate or repeating expressions in the if condition > evaluation. Issue identified using doubletest.cocci Coccinelle semantic > patch. > > Signed-off-by: Deepak R Varma Reviewed-by: Harry Wentland Harry > --- > .../gpu/drm/amd/display/dc/dm

RE: [PATCH] drm/amdgpu: don't increase UMC RAS UE count if no new bad page

2023-02-10 Thread Zhang, Hawking
[AMD Official Use Only - General] + /* if no new bad page is found, no need to increase ue count */ + if (ret == -EEXIST) + err_data->ue_count = 0; Returning EEXIST in such case is not reasonable. Might consider return a b

Re: [PATCH] drm/amdgpu: only WARN freeing buffers when DMA is unavailable

2023-02-10 Thread Christian König
Am 10.02.23 um 12:30 schrieb Xiao, Jack: [AMD Official Use Only - General] >> The driver are resumed before the core Linux memory management is ready to serve allocations. E.g. swap for example isn't turned on yet. >> This means that this stuff only worked because we were able to allocate m

RE: [PATCH] drm/amdgpu: only WARN freeing buffers when DMA is unavailable

2023-02-10 Thread Xiao, Jack
[AMD Official Use Only - General] >> The driver are resumed before the core Linux memory management is ready to >> serve allocations. E.g. swap for example isn't turned on yet. >> This means that this stuff only worked because we were able to allocate >> memory from the pool which isn't guarant

Re: [PATCH] drm/amdgpu: only WARN freeing buffers when DMA is unavailable

2023-02-10 Thread Christian König
Hi Jack, Am 10.02.23 um 10:51 schrieb Xiao, Jack: [AMD Official Use Only - General] Hi Christian, >> Allocating buffers temporary for stuff like that is illegal during resume. Can you **deeply** explain why it is illegal during ip late_init stage which is a part stage of resume? Well

RE: [PATCH] drm/amdgpu: only WARN freeing buffers when DMA is unavailable

2023-02-10 Thread Xiao, Jack
[AMD Official Use Only - General] Hi Christian, >> Allocating buffers temporary for stuff like that is illegal during resume. Can you *deeply* explain why it is illegal during ip late_init stage which is a part stage of resume? In my understanding, after gmc ready, driver can allocate/free kern

Re: [PATCH 3/3] drm/connector: Deprecate split for BT.2020 in drm_colorspace enum

2023-02-10 Thread Simon Ser
On Friday, February 10th, 2023 at 10:37, Pekka Paalanen wrote: > On Thu, 09 Feb 2023 17:03:19 + > Simon Ser cont...@emersion.fr wrote: > > > On Thursday, February 9th, 2023 at 17:38, Joshua Ashton jos...@froggi.es > > wrote: > > > > > > I mean, the strings are the uAPI, not the integers,

Re: [PATCH 3/3] drm/connector: Deprecate split for BT.2020 in drm_colorspace enum

2023-02-10 Thread Pekka Paalanen
On Thu, 09 Feb 2023 17:03:19 + Simon Ser wrote: > On Thursday, February 9th, 2023 at 17:38, Joshua Ashton > wrote: > > > > I mean, the strings are the uAPI, not the integers, right? > > > > Both are uAPI these days. > > Yes. The integers are uAPI, if you change them you'll break libli

Re: [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface

2023-02-10 Thread Pekka Paalanen
On Thu, 9 Feb 2023 13:27:02 -0100 Melissa Wen wrote: > On 01/31, Pekka Paalanen wrote: > > On Mon, 9 Jan 2023 14:38:09 -0100 > > Melissa Wen wrote: > > > > > On 01/09, Melissa Wen wrote: > > > > Hi, > > > > > > > > After collecting comments in different places, here is a second version > >

[PATCH] drm/amdgpu: don't increase UMC RAS UE count if no new bad page

2023-02-10 Thread Tao Zhou
If a UMC bad page is reserved but not freed by an application, the application may trigger uncorrectable error repeatly by accessing the page. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 9 - drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 6 +- 2 files changed, 1

Re: [PATCH] drm/amdgpu: only WARN freeing buffers when DMA is unavailable

2023-02-10 Thread Christian König
Hi Evan, yeah, exactly that's what this warning should prevent. Allocating buffers temporary for stuff like that is illegal during resume. I strongly suggest to just remove the MES test. It's abusing the kernel ring interface in a way we didn't want anyway and is currently replaced by Shahan

[RFC PATCH 9/9] drm/amdgpu: register a vga_switcheroo client for all GPUs that are not thunderbolt attached

2023-02-10 Thread Orlando Chamberlain
From: Kerem Karabay Commit 3840c5bcc245 ("drm/amdgpu: disentangle runtime pm and vga_switcheroo") made amdgpu only register a vga_switcheroo client for GPU's with PX, however AMD GPUs in dual gpu Apple Macbooks do need to register, but don't have PX. Instead of AMD's PX, they use apple-gmux. Rev

[RFC PATCH 4/9] apple-gmux: refactor gmux types

2023-02-10 Thread Orlando Chamberlain
Add apple_gmux_config struct containing operations and data specific to each mux type. This is in preparation for adding a third, MMIO based, gmux type. Signed-off-by: Orlando Chamberlain --- drivers/platform/x86/apple-gmux.c | 91 --- include/linux/apple-gmux.h

[RFC PATCH 0/9] apple-gmux: support MMIO gmux type on T2 Macs

2023-02-10 Thread Orlando Chamberlain
Hi All, This patch series adds support for the MMIO based gmux present on these Dual GPU Apple T2 Macs: MacBookPro15,1, MacBookPro15,3, MacBookPro16,1, MacBookPro16,4 (although amdgpu isn't working on MacBookPro16,4 [1]). It's only been tested by people on T2 Macs with MMIO based gmux's using t2l

[RFC PATCH 2/9] apple-gmux: consolidate version reading

2023-02-10 Thread Orlando Chamberlain
Read gmux version in one go as 32 bits on both indexed and classic gmux's. Classic gmux's used to read the version as major = inb(base + 0x4); minor = inb(base + 0x5); release = inb(base + 0x6); but this can instead be done the same way as indexed gmux's with gmux_read32(), so the same version r

[PATCH] drm/amd/display: Remove the unused variable ds_port

2023-02-10 Thread Jiapeng Chong
Variable ds_port is not effectively used, so delete it. drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c:280:35: warning: variable ‘ds_port’ set but not used. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4030 Signed-off-by: Jiapeng Ch

[PATCH -next] drm/amd/display: Simplify bool conversion

2023-02-10 Thread Yang Li
./drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c:1610:68-73: WARNING: conversion to bool not needed here Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4025 Signed-off-by: Yang Li --- .../gpu/drm/amd/display/dc/link/protocols/link_dp_capabilit

[RFC PATCH 7/9] apple-gmux: add sysfs interface

2023-02-10 Thread Orlando Chamberlain
Allow reading gmux ports from userspace. When the unsafe module parameter allow_user_writes is true, writing 1 byte values is also allowed. For example: cd /sys/bus/acpi/devices/APP000B:00/physical_node/ echo 4 > gmux_selected_port cat gmux_selected_port_data | xxd -p Will show the gmux version

error: 'const struct dc_dsc_config' has no member named 'is_frl'

2023-02-10 Thread Randy Dunlap
Hi, The 'is_frl' struct field is conditional: #if defined(CONFIG_DRM_AMD_DC_DCN) bool is_frl; /* indicate if DSC is applied based on HDMI FRL sink's capability */ #endif so code that uses it should be careful, otherwise build errors may happen: ../drivers/gpu/drm/amd/amdgpu/../display/

[RFC PATCH 1/9] apple-gmux: use cpu_to_be32 instead of manual reorder

2023-02-10 Thread Orlando Chamberlain
Currently it manually flips the byte order, but we can instead use cpu_to_be32(val) for this. Signed-off-by: Orlando Chamberlain --- drivers/platform/x86/apple-gmux.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/platform/x86/apple-gmux.c b/driv

[RFC PATCH 8/9] hda/hdmi: Register with vga_switcheroo on Dual GPU Macbooks

2023-02-10 Thread Orlando Chamberlain
Commit 586bc4aab878 ("ALSA: hda/hdmi - fix vgaswitcheroo detection for AMD") caused only AMD gpu's with PX to have their audio component register with vga_switcheroo. This meant that Apple Macbooks with apple-gmux as the gpu switcher no longer had the audio client registering, so when the gpu is po

[RFC PATCH 3/9] apple-gmux: use first bit to check switch state

2023-02-10 Thread Orlando Chamberlain
On T2 Macs with MMIO gmux, when GMUX_PORT_SWITCH_DISPLAY is read, it can have values of 2, 3, 4, and 5. Odd values correspond to the discrete gpu, and even values correspond to the integrated gpu. The current logic is that only 2 corresponds to IGD, but this doesn't work for T2 Macs. Instead, check

[PATCH] drm/amd/display: Remove the unused variable pre_connection_type

2023-02-10 Thread Jiapeng Chong
Variable pre_connection_type is not effectively used, so delete it. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4031 Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/amd/display/dc/link/link_detection.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drive

[RFC PATCH 5/9] apple-gmux: Use GMSP acpi method for interrupt clear

2023-02-10 Thread Orlando Chamberlain
This is needed for interrupts to be cleared correctly on MMIO based gmux's. It is untested if this helps/hinders other gmux types, but I have seen the GMSP method in the acpi tables of a MacBook with an indexed gmux. If this turns out to break support for older gmux's, this can instead be only don

[PATCH -next] drm/amd/display: clean up some inconsistent indentings

2023-02-10 Thread Yang Li
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c:145 get_ddc_line() warn: inconsistent indenting drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c:201 dc_link_construct_phy() warn: inconsistent indenting Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_b

[RFC PATCH 6/9] apple-gmux: support MMIO gmux on T2 Macs

2023-02-10 Thread Orlando Chamberlain
In some newer dual gpu MacBooks, gmux is controlled by the T2 security chip, and acessed with MMIO. Add support for these gmux controllers Interestingly, the ACPI table only allocates 8 bytes for GMUX, but we actually need 16, and as such we request 16 with request_mem_region. Reading and writing