[Intel-gfx] [PATCH 5/7] drm/i915/wm: split out SKL+ watermark regs to a separate file

2023-03-16 Thread Jani Nikula
Clean up i915_reg.h by splitting out SKL+ watermark regs to display/skl_watermark_regs.h. Signed-off-by: Jani Nikula --- .../drm/i915/display/intel_display_power.c| 1 + drivers/gpu/drm/i915/display/skl_watermark.c | 1 + .../gpu/drm/i915/display/skl_watermark_regs.h | 165

[Intel-gfx] [PATCH 4/7] drm/i915/fdi: split out FDI regs to a separate file

2023-03-16 Thread Jani Nikula
Clean up i915_reg.h by splitting out FDI regs to display/intel_fdi_regs.h. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_crt.c | 1 + drivers/gpu/drm/i915/display/intel_fdi.c | 1 + drivers/gpu/drm/i915/display/intel_fdi_regs.h | 151 ++

Re: [Intel-gfx] [PATCH 03/14] drm/i915/tc: Fix the ICL PHY ownership check in TC-cold state

2023-03-16 Thread Souza, Jose
On Thu, 2023-03-16 at 15:17 +0200, Imre Deak wrote: > The commit renaming icl_tc_phy_is_in_safe_mode() to > icl_tc_phy_take_ownership() didn't flip the function's return value > accordingly, fix this up. > > This didn't cause an actual problem besides state check errors, since > the function is

[Intel-gfx] [PATCH 14/14] drm/i915/tc: Check the PLL type used by an enabled TC port

2023-03-16 Thread Imre Deak
The current way to determine during HW state sanitization if a PHY is connected in the expected way doesn't work in all cases. The check for this considers only the PHY ready/owned state and the initial TC mode which was determined earlier by the TC port HW readout - using the sink's HPD and the

[Intel-gfx] [PATCH 10/14] drm/i915/tc: Make the TC mode readout consistent in all PHY states

2023-03-16 Thread Imre Deak
For consistency detect the initial TC mode in the PHY owned state the same way this is done in the not owned state (w/o changing the behavior). While at it, add more details to the PHY state debug print. Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_tc.c | 43

[Intel-gfx] [PATCH 09/14] drm/i915/tc: Fix initial TC mode on disabled legacy ports

2023-03-16 Thread Imre Deak
Atm, a TC port's initial mode will be read out as TBT mode in any case the PHY ownership is not held. This isn't correct for legacy ports which should be used only in legacy mode. Fix the above initial mode to be disconnected mode for a legacy port and TBT mode for DP-alt/TBT ports. Determine the

[Intel-gfx] [PATCH 13/14] drm/i915/tc: Factor out a function querying active links on a TC port

2023-03-16 Thread Imre Deak
For clarity factor out the function to determine if there are active links on a TC port. This prepares for the next patch also checking the port's PLL type. No functional changes. Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_tc.c | 35 - 1 file

[Intel-gfx] [PATCH 12/14] drm/i915: Add encoder hook to get the PLL type used by TC ports

2023-03-16 Thread Imre Deak
Add an encoder hook, which can be called on enabled TC ports to determine if the port uses a TBT or a non-TBT PLL. An upcoming patch will use this to sanity check active TC port's PHY state wrt. the PLL type used by the port. Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_ddi.c

[Intel-gfx] [PATCH 11/14] drm/i915/tc: Assume a TC port is legacy if VBT says the port has HDMI

2023-03-16 Thread Imre Deak
Since an HDMI output can only be enabled in legacy mode on TC ports, assume that VBT is wrong and the port is legacy if VBT says the port is non-legacy and has HDMI. Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_ddi.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

[Intel-gfx] [PATCH 08/14] drm/i915/tc: Fix TC mode for a legacy port if the PHY is not ready

2023-03-16 Thread Imre Deak
A legacy TC port can't be switched to TBT mode, even if the PHY initialization wasn't ready yet for some reason, so prevent this. This shouldn't normally happen as the driver waits for the IOM/TCSS PHY initialization during driver loading and system resume. Signed-off-by: Imre Deak ---

[Intel-gfx] [PATCH 07/14] drm/i915/tc: Fix target TC mode for a disconnected legacy port

2023-03-16 Thread Imre Deak
Atm, the target TC mode - which the PHY should be switched to at any point it's used - is TBT in case there is no sink connected. However legacy ports are only used in the legacy mode regardless of the sink connected state. Fix the mode returned by intel_tc_port_get_target_mode() accordingly.

[Intel-gfx] [PATCH 05/14] drm/i915/tc: Wait for IOM/FW PHY initialization of legacy TC ports

2023-03-16 Thread Imre Deak
During boot-up/system resume, the TC PHY on legacy ports will be initialized by the IOM/TCSS firmware regardless of a sink being connected or not (as opposed to DP-alt/TBT ports, which the FW only inits once a sink is connected). Wait for the above initialization to complete during HW readout, so

[Intel-gfx] [PATCH 06/14] drm/i915/tc: Factor out helpers converting HPD mask to TC mode

2023-03-16 Thread Imre Deak
Factor out helpers used later in the patchset to convert an HPD status mask to TC mode or target TC mode. No functional changes. Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_tc.c | 44 ++--- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git

[Intel-gfx] [PATCH 01/14] drm/i915/tc: Abort DP AUX transfer on a disconnected TC port

2023-03-16 Thread Imre Deak
On TC ports the 4ms AUX timeout combined with the 5 * 32 retry attempts during DPCD accesses adds a 640ms delay to each access if the sink is disconnected. This in turn slows down a modeset during which the sink is disconnected (for instance a disabling modeset). Prevent the above delay by

[Intel-gfx] [PATCH 02/14] drm/i915/tc: Fix TC port link ref init for DP MST during HW readout

2023-03-16 Thread Imre Deak
An enabled TC MST port holds one TC port link reference, regardless of the number of enabled streams on it, but the TC port HW readout takes one reference for each active MST stream. Fix the HW readout, taking only one reference for MST ports. This didn't cause an actual problem, since the

[Intel-gfx] [PATCH 03/14] drm/i915/tc: Fix the ICL PHY ownership check in TC-cold state

2023-03-16 Thread Imre Deak
The commit renaming icl_tc_phy_is_in_safe_mode() to icl_tc_phy_take_ownership() didn't flip the function's return value accordingly, fix this up. This didn't cause an actual problem besides state check errors, since the function is only used during HW readout. Cc: José Roberto de Souza Fixes:

[Intel-gfx] [PATCH 04/14] drm/i915/tc: Fix system resume MST mode restore for DP-alt sinks

2023-03-16 Thread Imre Deak
At least restoring the MST topology during system resume needs to use AUX before the display HW readout->sanitization sequence is complete, but on TC ports the PHY may be in the wrong mode for this, resulting in the AUX transfers to fail. The initial TC port mode is kept fixed as BIOS left it for

[Intel-gfx] [PATCH 00/14] drm/i915/tc: Fix a few TypeC / MST issues

2023-03-16 Thread Imre Deak
This patchset fixes a few issues on TypeC ports, related to the legacy port handling, HW state readout/verification. It also fixes an issue on TC port/MST outputs during system suspend/resume, where the modeset restoring the pre-suspend state fails atm. Tested on ICL, TGL, ADLP. Imre Deak (14):

[Intel-gfx] [PATCH 3/7] drm/i915/aux: split out DP AUX regs to a separate file

2023-03-16 Thread Jani Nikula
Clean up i915_reg.h by splitting out DP AUX regs to display/intel_dp_aux_regs.h. Signed-off-by: Jani Nikula --- .../i915/display/intel_display_power_well.c | 1 + drivers/gpu/drm/i915/display/intel_dp_aux.c | 1 + .../gpu/drm/i915/display/intel_dp_aux_regs.h | 84 +++

[Intel-gfx] [PATCH 2/7] drm/i915/tv: split out TV regs to a separate file

2023-03-16 Thread Jani Nikula
Clean up i915_reg.h by splitting out TV regs to display/intel_tv_regs.h. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_tv.c | 3 +- drivers/gpu/drm/i915/display/intel_tv_regs.h | 490 +++ drivers/gpu/drm/i915/i915_reg.h | 479

[Intel-gfx] [PATCH 1/7] drm/i915/pps: split out PPS regs to a separate file

2023-03-16 Thread Jani Nikula
Clean up i915_reg.h by splitting out PPS regs to display/intel_pps_regs.h. Signed-off-by: Jani Nikula --- .../drm/i915/display/intel_display_power.c| 1 + drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 1 + drivers/gpu/drm/i915/display/intel_lvds.c | 1 +

[Intel-gfx] [PATCH 0/7] drm/i915/regs: split display regs by function

2023-03-16 Thread Jani Nikula
Shave off 1.2k lines from i915_reg.h. Jani Nikula (7): drm/i915/pps: split out PPS regs to a separate file drm/i915/tv: split out TV regs to a separate file drm/i915/aux: split out DP AUX regs to a separate file drm/i915/fdi: split out FDI regs to a separate file drm/i915/wm: split out

Re: [Intel-gfx] [PATCH v6 12/24] vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

2023-03-16 Thread Liu, Yi L
> From: Nicolin Chen > Sent: Thursday, March 16, 2023 2:49 PM > > On Thu, Mar 16, 2023 at 06:28:28AM +, Liu, Yi L wrote: > > > > Anyway let's not wait here. Send your v7 and we can have more > > > focused discussion in your split series about hot reset. > > > > Sure. Once Nicolin's patch is

[Intel-gfx] [PULL] drm-intel-gt-next

2023-03-16 Thread Joonas Lahtinen
Hi Dave & Daniel, Here's the first batch of drm-intel-gt-next towards v6.4. There is an important performance monitoring fix (#6333), more resiliency to pcode load delay and avoiding caching problems on LLC systems for ring buffers. Stolen memory probing fix and a missing register whitelisting

[Intel-gfx] [PATCH v7 22/22] docs: vfio: Add vfio device cdev description

2023-03-16 Thread Yi Liu
This gives notes for userspace applications on device cdev usage. Signed-off-by: Yi Liu --- Documentation/driver-api/vfio.rst | 125 ++ 1 file changed, 125 insertions(+) diff --git a/Documentation/driver-api/vfio.rst b/Documentation/driver-api/vfio.rst index

[Intel-gfx] [PATCH v7 21/22] vfio: Compile group optionally

2023-03-16 Thread Yi Liu
group code is not needed for vfio device cdev, so with vfio device cdev introduced, the group infrastructures can be compiled out if only cdev is needed. Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- drivers/iommu/iommufd/Kconfig | 4 +- drivers/vfio/Kconfig | 16 -

[Intel-gfx] [PATCH v7 13/22] vfio-iommufd: Split bind/attach into two steps

2023-03-16 Thread Yi Liu
to align with the coming vfio device cdev support. Signed-off-by: Yi Liu --- drivers/vfio/group.c | 18 ++ drivers/vfio/iommufd.c | 33 ++--- drivers/vfio/vfio.h| 9 + 3 files changed, 37 insertions(+), 23 deletions(-) diff --git

[Intel-gfx] [PATCH v7 20/22] vfio: Add VFIO_DEVICE_AT[DE]TACH_IOMMUFD_PT

2023-03-16 Thread Yi Liu
This adds ioctl for userspace to attach device cdev fd to and detach from IOAS/hw_pagetable managed by iommufd. VFIO_DEVICE_ATTACH_IOMMUFD_PT: attach vfio device to IOAS, hw_pagetable managed by iommufd. Attach can be undo

[Intel-gfx] [PATCH v7 19/22] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-03-16 Thread Yi Liu
This adds ioctl for userspace to bind device cdev fd to iommufd. VFIO_DEVICE_BIND_IOMMUFD: bind device to an iommufd, hence gain DMA control provided by the iommufd. open_device op is called after bind_iommufd op.

[Intel-gfx] [PATCH v7 16/22] iommufd/device: Add iommufd_access_detach() API

2023-03-16 Thread Yi Liu
From: Nicolin Chen Previously, the detach routine is only done by the destroy(). And it was called by vfio_iommufd_emulated_unbind() when the device runs close(), so all the mappings in iopt were cleaned in that setup, when the call trace reaches this detach() routine. Now, there's a need of a

[Intel-gfx] [PATCH v7 17/22] vfio-iommufd: Add detach_ioas support for emulated VFIO devices

2023-03-16 Thread Yi Liu
this prepares for adding DETACH ioctl for emulated VFIO devices. Reviewed-by: Kevin Tian Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Signed-off-by: Yi Liu --- drivers/gpu/drm/i915/gvt/kvmgt.c | 1 + drivers/s390/cio/vfio_ccw_ops.c | 1 +

[Intel-gfx] [PATCH v7 18/22] vfio: Add cdev for vfio_device

2023-03-16 Thread Yi Liu
This allows user to directly open a vfio device w/o using the legacy container/group interface, as a prerequisite for supporting new iommu features like nested translation. The device fd opened in this manner doesn't have the capability to access the device as the fops open() doesn't open the

[Intel-gfx] [PATCH v7 15/22] vfio-iommufd: Add detach_ioas support for physical VFIO devices

2023-03-16 Thread Yi Liu
this prepares for adding DETACH ioctl for physical VFIO devices. Reviewed-by: Kevin Tian Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Signed-off-by: Yi Liu --- Documentation/driver-api/vfio.rst | 8 +--- drivers/vfio/fsl-mc/vfio_fsl_mc.c

[Intel-gfx] [PATCH v7 10/22] vfio: Make vfio_device_open() single open for device cdev path

2023-03-16 Thread Yi Liu
VFIO group has historically allowed multi-open of the device FD. This was made secure because the "open" was executed via an ioctl to the group FD which is itself only single open. However, no known use of multiple device FDs today. It is kind of a strange thing to do because new device FDs can

[Intel-gfx] [PATCH v7 11/22] vfio: Make vfio_device_first_open() to accept NULL iommufd for noiommu

2023-03-16 Thread Yi Liu
vfio_device_first_open() requires the caller to provide either a valid iommufd (the group path in iommufd compat mode) or a valid container (the group path in legacy container mode). As preparation for noiommu support in device cdev path it's extended to allow both being NULL. The caller is

[Intel-gfx] [PATCH v7 12/22] vfio-iommufd: Move noiommu support out of vfio_iommufd_bind()

2023-03-16 Thread Yi Liu
into vfio_device_group_open(). This is also more consistent with what will be done in vfio device cdev path. Signed-off-by: Yi Liu --- drivers/vfio/group.c | 9 + drivers/vfio/iommufd.c | 35 ++- drivers/vfio/vfio.h| 9 + 3 files changed,

[Intel-gfx] [PATCH v7 09/22] vfio: Add cdev_device_open_cnt to vfio_group

2023-03-16 Thread Yi Liu
for counting the devices that are opened via the cdev path. This count is increased and decreased by the cdev path. The group path checks it to achieve exclusion with the cdev path. With this, only one path (group path or cdev path) will claim DMA ownership. This avoids scenarios in which devices

[Intel-gfx] [PATCH v7 14/22] vfio: Record devid in vfio_device_file

2023-03-16 Thread Yi Liu
.bind_iommufd() will generate an ID to represent this bond, which is needed by userspace for further usage. Store devid in vfio_device_file to avoid passing the pointer in multiple places. Signed-off-by: Yi Liu --- drivers/vfio/iommufd.c | 12 +++- drivers/vfio/vfio.h | 10

[Intel-gfx] [PATCH v7 07/22] vfio: Pass struct vfio_device_file * to vfio_device_open/close()

2023-03-16 Thread Yi Liu
This avoids passing too much parameters in multiple functions. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Signed-off-by: Yi Liu --- drivers/vfio/group.c | 20 ++-- drivers/vfio/vfio.h

[Intel-gfx] [PATCH v7 08/22] vfio: Block device access via device fd until device is opened

2023-03-16 Thread Yi Liu
Allow the vfio_device file to be in a state where the device FD is opened but the device cannot be used by userspace (i.e. its .open_device() hasn't been called). This inbetween state is not used when the device FD is spawned from the group FD, however when we create the device FD directly by

[Intel-gfx] [PATCH v7 06/22] kvm/vfio: Accept vfio device file from userspace

2023-03-16 Thread Yi Liu
This defines KVM_DEV_VFIO_FILE* and make alias with KVM_DEV_VFIO_GROUP*. Old userspace uses KVM_DEV_VFIO_GROUP* works as well. Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Signed-off-by: Yi Liu ---

[Intel-gfx] [PATCH v7 05/22] kvm/vfio: Rename kvm_vfio_group to prepare for accepting vfio device fd

2023-03-16 Thread Yi Liu
Meanwhile, rename related helpers. No functional change is intended. Reviewed-by: Kevin Tian Reviewed-by: Eric Auger Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Signed-off-by: Yi Liu --- virt/kvm/vfio.c | 115

[Intel-gfx] [PATCH v7 04/22] vfio: Accept vfio device file in the KVM facing kAPI

2023-03-16 Thread Yi Liu
This makes the vfio file kAPIs to accept vfio device files, also a preparation for vfio device cdev support. For the kvm set with vfio device file, kvm pointer is stored in struct vfio_device_file, and use kvm_ref_lock to protect kvm set and kvm pointer usage within VFIO. This kvm pointer will be

[Intel-gfx] [PATCH v7 01/22] vfio: Allocate per device file structure

2023-03-16 Thread Yi Liu
This is preparation for adding vfio device cdev support. vfio device cdev requires: 1) A per device file memory to store the kvm pointer set by KVM. It will be propagated to vfio_device:kvm after the device cdev file is bound to an iommufd. 2) A mechanism to block device access through

[Intel-gfx] [PATCH v7 03/22] vfio: Remove vfio_file_is_group()

2023-03-16 Thread Yi Liu
since no user of vfio_file_is_group() now. Signed-off-by: Yi Liu --- drivers/vfio/group.c | 10 -- include/linux/vfio.h | 1 - 2 files changed, 11 deletions(-) diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index ede4723c5f72..4f937ebaf6f7 100644 --- a/drivers/vfio/group.c

[Intel-gfx] [PATCH v7 02/22] vfio: Refine vfio file kAPIs for KVM

2023-03-16 Thread Yi Liu
This prepares for making the below kAPIs to accept both group file and device file instead of only vfio group file. bool vfio_file_enforced_coherent(struct file *file); void vfio_file_set_kvm(struct file *file, struct kvm *kvm); Reviewed-by: Kevin Tian Reviewed-by: Eric Auger Reviewed-by:

[Intel-gfx] [PATCH v7 00/22] Add vfio_device cdev for iommufd support

2023-03-16 Thread Yi Liu
Existing VFIO provides group-centric user APIs for userspace. Userspace opens the /dev/vfio/$group_id first before getting device fd and hence getting access to device. This is not the desired model for iommufd. Per the conclusion of community discussion[1], iommufd provides device-centric kAPIs

[Intel-gfx] [PATCH 6/7] vfio: Accpet device file from vfio PCI hot reset path

2023-03-16 Thread Yi Liu
This extends both vfio_file_is_valid() and vfio_file_has_dev() to accept device file from the vfio PCI hot reset. Signed-off-by: Yi Liu --- drivers/vfio/vfio_main.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_main.c

[Intel-gfx] [PATCH 4/7] vfio/pci: Renaming for accepting device fd in hot reset path

2023-03-16 Thread Yi Liu
No functional change is intended. Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 55 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index

[Intel-gfx] [PATCH 7/7] vfio/pci: Accept device fd in VFIO_DEVICE_PCI_HOT_RESET ioctl

2023-03-16 Thread Yi Liu
Now user can also provide an array of device fds as a 3rd method to verify the reset ownership. It's not useful at this point when the device fds are acquired via group fds. But it's necessary when moving to device cdev which allows the user to directly acquire device fds by skipping group. In

[Intel-gfx] [PATCH 5/7] vfio: Refine vfio file kAPIs for vfio PCI hot reset

2023-03-16 Thread Yi Liu
This prepares vfio core to accept vfio device file from the vfio PCI hot reset path. vfio_file_is_group() is still kept for KVM usage. Signed-off-by: Yi Liu --- drivers/vfio/group.c | 32 ++-- drivers/vfio/pci/vfio_pci_core.c | 4 ++--

[Intel-gfx] [PATCH 2/7] vfio/pci: Only check ownership of opened devices in hot reset

2023-03-16 Thread Yi Liu
If the affected device is not opened by any user, it's safe to reset it given it's not in use. Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 14 +++--- include/uapi/linux/vfio.h| 8 2 files changed, 19 insertions(+), 3

[Intel-gfx] [PATCH 3/7] vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

2023-03-16 Thread Yi Liu
as an alternative method for ownership check when iommufd is used. In this case all opened devices in the affected dev_set are verified to be bound to a same valid iommufd value to allow reset. It's simpler and faster as user does not need to pass a set of fds and kernel no need to search the

[Intel-gfx] [PATCH 0/7] Introduce new methods for verifying ownership in vfio PCI hot reset

2023-03-16 Thread Yi Liu
VFIO_DEVICE_PCI_HOT_RESET requires user to pass an array of group fds to prove that it owns all devices affected by resetting the calling device. This series introduces several extensions to allow the ownership check better aligned with iommufd and coming vfio device cdev support. First,

[Intel-gfx] [PATCH 1/7] vfio/pci: Update comment around group_fd get in vfio_pci_ioctl_pci_hot_reset()

2023-03-16 Thread Yi Liu
this suits more on what the code does. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gvt: KVM: KVMGT fixes and page-track cleanups (rev5)

2023-03-16 Thread Patchwork
== Series Details == Series: drm/i915/gvt: KVM: KVMGT fixes and page-track cleanups (rev5) URL : https://patchwork.freedesktop.org/series/112196/ State : warning == Summary == Error: dim checkpatch failed 25a3d4a31296 drm/i915/gvt: Verify pfn is "valid" before dereferencing "struct page"

[Intel-gfx] [PATCH v2 2/5] vfio-iommufd: No need to record iommufd_ctx in vfio_device

2023-03-16 Thread Yi Liu
iommufd_ctx is stored in vfio_device for emulated devices per bind_iommufd. However, as iommufd_access is created in bind, no more need to stored it since iommufd_access implicitly stores it. Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/iommufd.c | 10 +-

[Intel-gfx] [PATCH v2 3/5] vfio-iommufd: Make vfio_iommufd_emulated_bind() return iommufd_access ID

2023-03-16 Thread Yi Liu
vfio device cdev needs to return iommufd_access ID to userspace if bind_iommufd succeeds. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/iommu/iommufd/device.c | 4 +++- drivers/iommu/iommufd/selftest.c | 3 ++- drivers/vfio/iommufd.c | 2 +-

[Intel-gfx] [PATCH v2 4/5] vfio/mdev: Uses the vfio emulated iommufd ops set in the mdev sample drivers

2023-03-16 Thread Yi Liu
This harmonizes the no-DMA devices (the vfio-mdev sample drivers) with the emulated devices (gvt-g, vfio-ap etc.). It makes it easier to add BIND_IOMMUFD user interface which requires to return an iommufd ID to represent the device/iommufd bond. Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu

[Intel-gfx] [PATCH v2 5/5] vfio: Check the presence for iommufd callbacks in __vfio_register_dev()

2023-03-16 Thread Yi Liu
After making the no-DMA drivers (samples/vfio-mdev) providing iommufd callbacks, __vfio_register_dev() should check the presence of the iommufd callbacks if CONFIG_IOMMUFD is enabled. Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/iommufd.c | 3 ---

[Intel-gfx] [PATCH v2 0/5] vfio: Make emulated devices prepared for vfio device cdev

2023-03-16 Thread Yi Liu
The .bind_iommufd op of vfio emulated devices are either empty or does nothing. This is different with the vfio physical devices, to add vfio device cdev, need to make them act the same. This series first makes the .bind_iommufd op of vfio emulated devices to create iommufd_access, this

[Intel-gfx] [PATCH v2 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-16 Thread Yi Liu
From: Nicolin Chen There are needs to created iommufd_access prior to have an IOAS and set IOAS later. Like the vfio device cdev needs to have an iommufd object to represent the bond (iommufd_access) and IOAS replacement. Moves the iommufd_access_create() call into vfio_iommufd_emulated_bind(),

Re: [Intel-gfx] [PATCH] drm/i915/hdcp: Remove drm_modeset_lock in intel_conn_to_vcpi

2023-03-16 Thread Kandpal, Suraj
> > On Thu, Mar 16, 2023 at 01:52:32PM +0530, Suraj Kandpal wrote: > > Remove drm_modeset_lock in intel_conn_to_vcpi as we don't need it > > anymore since all the required locks are taken in atomic check and > > prepare phases. > > > > Signed-off-by: Suraj Kandpal > > --- > >

Re: [Intel-gfx] [PATCH 7/7] drm/debugfs: remove debugfs_root pointer from minor

2023-03-16 Thread kernel test robot
Hi Christian, I love your patch! Yet something to improve: [auto build test ERROR on drm-misc/drm-misc-next] [also build test ERROR on drm-intel/for-linux-next-fixes linus/master v6.3-rc2] [cannot apply to drm-tip/drm-tip drm-intel/for-linux-next tegra/for-next next-20230316] [If your patch

Re: [Intel-gfx] [PATCH v11 08/11] drm/i915/dp: Avoid DSC with output_format YCBCR420

2023-03-16 Thread Nautiyal, Ankit K
Hi Manasi, I just realized that there is a newer version of the patch in another series for DSC 420 support [1]. I added this patch when I was debugging an issue with PCON + 8k YCbCr420 only mode, and noticed that we set the output_format first and then check for DSC. Later this patch was

[Intel-gfx] [PATCH v5 20/22] drm/i915/mtl: Power up TCSS

2023-03-16 Thread Mika Kahola
Add register writes to enable powering up Type-C subsystem i.e. TCSS. For MeteorLake we need to request TCSS to power up and check the TCSS power state after 500 us. In addition, for PICA we need to set/clear the Type-C PHY ownnership bit when Type-C device is connected/disconnected. v2: Call

[Intel-gfx] [PATCH v5 22/22] drm/i915/mtl: Pin assignment for TypeC

2023-03-16 Thread Mika Kahola
From: Anusha Srivatsa Unlike previous platforms that used PORT_TX_DFLEXDPSP for max_lane calculation, MTL uses only PORT_TX_DFLEXPA1 from which the max_lanes has to be calculated. Bspec: 50235, 65380 Cc: Mika Kahola Cc: Imre Deak Cc: Matt Roper Signed-off-by: Anusha Srivatsa Signed-off-by:

[Intel-gfx] [PATCH v5 21/22] drm/i915/mtl: TypeC HPD live status query

2023-03-16 Thread Mika Kahola
From: Imre Deak The HPD live status for MTL has to be read from different set of registers. MTL deserves a new function for this purpose and cannot reuse the existing HPD live status detection Signed-off-by: Anusha Srivatsa Signed-off-by: Imre Deak Signed-off-by: Mika Kahola ---

[Intel-gfx] [PATCH v5 17/22] drm/i915/mtl: Enable TC ports

2023-03-16 Thread Mika Kahola
Finally, we can enable TC ports for Meteorlake. Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/display/intel_display.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index

[Intel-gfx] [PATCH v5 15/22] drm/i915/mtl: Enabling/disabling sequence Thunderbolt pll

2023-03-16 Thread Mika Kahola
Enabling and disabling sequence for Thunderbolt PLL. v2: Use __intel_de_wait_for_register() instead of __intel_wait_for_register() (Jani) Use '0' instead of ~XELPDP_TBT_CLOCK_ACK (Gustavo) Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 136

[Intel-gfx] [PATCH v5 14/22] drm/i915/mtl: For DP2.0 10G and 20G rates use MPLLA

2023-03-16 Thread Mika Kahola
Use MPLLA for DP2.0 rates 20G and 20G, when ssc is enabled. Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c

[Intel-gfx] [PATCH v5 12/22] drm/i915/mtl: C20 HDMI state calculations

2023-03-16 Thread Mika Kahola
Add C20 HDMI state calculations and put HDMI table definitions in use. Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c

[Intel-gfx] [PATCH v5 16/22] drm/i915/mtl: Readout Thunderbolt HW state

2023-03-16 Thread Mika Kahola
Readout hw state for Thunderbolt. Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 27 drivers/gpu/drm/i915/display/intel_cx0_phy.h | 2 +- drivers/gpu/drm/i915/display/intel_ddi.c | 5 +++- 3 files changed, 32 insertions(+), 2

[Intel-gfx] [PATCH v5 19/22] drm/i915/mtl: Define mask for DDI AUX interrupts

2023-03-16 Thread Mika Kahola
From: Gustavo Sousa Xe_LPD+ defines interrupt bits for only DDI ports in the DE Port Interrupt registers. The bits for Type-C ports are defined in the PICA interrupt registers. BSpec: 50064 Signed-off-by: Gustavo Sousa --- drivers/gpu/drm/i915/i915_irq.c | 5 - 1 file changed, 4

[Intel-gfx] [PATCH v5 18/22] drm/i915/mtl: MTL PICA hotplug detection

2023-03-16 Thread Mika Kahola
PICA is used for DP alt mode and TBT modes. Hotplug interruption is routed from PICA chip to south display engine and from there to north display engine. This patch adds functionality to enable hotplug detection for all Type-C ports (4 ports available). Differently from HPD in south display, PICA

[Intel-gfx] [PATCH v5 13/22] drm/i915/mtl: Add voltage swing sequence for C20

2023-03-16 Thread Mika Kahola
DP1.4 and DP20 voltage swing sequence for C20 phy. Bspec: 65449, 67636, 67610 v2: DP2.0 Tx Eq tables has been updated in BSpec. Update also the driver code as per BSpec 65449 Signed-off-by: Mika Kahola Signed-off-by: Radhakrishna Sripada Signed-off-by: Clint Taylor ---

[Intel-gfx] [PATCH v5 11/22] drm/i915/mtl: C20 port clock calculation

2023-03-16 Thread Mika Kahola
Calculate port clock with C20 phy. v2: Initialize parameters v3: Revised formula for port clock check Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 70 ++- drivers/gpu/drm/i915/display/intel_cx0_phy.h | 2 +

[Intel-gfx] [PATCH v5 10/22] drm/i915/mtl: Dump C20 pll hw state

2023-03-16 Thread Mika Kahola
As we already do with C10 chip, let's dump the pll hw state for C20 as well. Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/display/intel_cx0_phy.c | 20 drivers/gpu/drm/i915/display/intel_cx0_phy.h | 2 ++ drivers/gpu/drm/i915/display/intel_ddi.c | 1 + 3 files

[Intel-gfx] [PATCH v5 08/22] drm/i915/mtl: C20 PLL programming

2023-03-16 Thread Mika Kahola
C20 phy PLL programming sequence for DP, DP2.0, HDMI2.x non-FRL and HDMI2.x FRL. This enables C20 MPLLA and MPLLB programming sequence. add 4 lane support for c20. v2: Rename intel_c20_write() to intel_c20_sram_write() (Gustavo) Remove unnecessary bit masks (Gustavo) Fix comments on C20

[Intel-gfx] [PATCH v5 09/22] drm/i915/mtl: C20 HW readout

2023-03-16 Thread Mika Kahola
Create a table for C20 DP1.4, DP2.0 and HDMI2.1 rates. The PLL settings are based on table, not for algorithmic alternative. For DP 1.4 only MPLLB is in use. Once register settings are done, we read back C20 HW state. BSpec: 64568 v2: Update rbr, hbr1, hbr2, and hbr3 pll configurations 4 and 5

[Intel-gfx] [PATCH v5 05/22] drm/i915/mtl: Add C10 phy programming for HDMI

2023-03-16 Thread Mika Kahola
From: Radhakrishna Sripada Like DG2, we still don't have a proper algorithm that can be used for calculating PHY settings, but we do have tables of register values for a handful of the more common link rates. Some support is better than none, so let's go ahead and add/use these tables when we

[Intel-gfx] [PATCH v5 06/22] drm/i915/mtl: Add vswing programming for C10 phys

2023-03-16 Thread Mika Kahola
From: Radhakrishna Sripada C10 phys uses direct mapping internally for voltage and pre-emphasis levels. Program the levels directly to the fields in the VDR Registers. Bspec: 65449 v2: From table "C10: Tx EQ settings for DP 1.4x" it shows level 1 and preemphasis 1 instead of two times of

[Intel-gfx] [PATCH v5 07/22] drm/i915/mtl: Add support for PM DEMAND

2023-03-16 Thread Mika Kahola
XE_LPD+ introduces a new way to instruct the PUnit with power and bandwidth requirements of DE. Add the functionality to program the registers and handle waits using interrupts. The current wait time for timeouts is programmed for 10 msecs to factor in the worst case scenarios. Changes made to use

[Intel-gfx] [PATCH v5 03/22] drm/i915/mtl: Create separate reg file for PICA registers

2023-03-16 Thread Mika Kahola
Create a separate file to store registers for PICA chips C10 and C20. v2: Rename file (Jani) v3: Use _PICK_EVEN_2RANGES() macro (Lucas) Signed-off-by: Radhakrishna Sripada Signed-off-by: Mika Kahola --- .../gpu/drm/i915/display/intel_cx0_phy_regs.h | 139 ++ 1 file changed,

[Intel-gfx] [PATCH v5 04/22] drm/i915/mtl: Add Support for C10 PHY message bus and pll programming

2023-03-16 Thread Mika Kahola
From: Radhakrishna Sripada XELPDP has C10 and C20 phys from Synopsys to drive displays. Each phy has a dedicated PIPE 5.2 Message bus for configuration. This message bus is used to configure the phy internal registers. XELPDP has C10 phys to drive output to the EDP and the native output from

[Intel-gfx] [PATCH v5 02/22] drm/i915/mtl: Add DP rates

2023-03-16 Thread Mika Kahola
Add DP rates for Meteorlake. Signed-off-by: Radhakrishna Sripada Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/display/intel_dp.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c

[Intel-gfx] [PATCH v5 01/22] drm/i915/mtl: Initial DDI port setup

2023-03-16 Thread Mika Kahola
From: Clint Taylor Initialize c10 combo phy ports. TODO Type-C ports. Cc: Radhakrishna Sripada Signed-off-by: Clint Taylor --- drivers/gpu/drm/i915/display/intel_display.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c

[Intel-gfx] [PATCH v5 00/22] drm/i915/mtl: Add C10 and C20 phy support

2023-03-16 Thread Mika Kahola
PHY programming support for PICA C10 and C20 Type-C chips. v2: Move intel_cx0_reg_defs.h to intel_cx0_phy_regs.h (Jani) Move pmdemand as part of intel_display structure PLL table updates v3: Renaming C20 read/write functions (Gustavo) Code readibility fixes (Gustavo) HDMI PLL

[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/hdcp: Remove drm_modeset_lock in intel_conn_to_vcpi

2023-03-16 Thread Patchwork
== Series Details == Series: drm/i915/hdcp: Remove drm_modeset_lock in intel_conn_to_vcpi URL : https://patchwork.freedesktop.org/series/115240/ State : success == Summary == CI Bug Log - changes from CI_DRM_12867_full -> Patchwork_115240v1_full

[Intel-gfx] [PATCH i-g-t 2/2] intel_gpu_top: Use full console width for global metrics

2023-03-16 Thread Tvrtko Ursulin
From: Tvrtko Ursulin It appears we had an off by one of a kind where we were not using the full width of the terminal window for the global metrics section. Signed-off-by: Tvrtko Ursulin --- tools/intel_gpu_top.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[Intel-gfx] [PATCH i-g-t 1/2] intel_gpu_top: Display large pids nicely in interactive mode

2023-03-16 Thread Tvrtko Ursulin
From: Tvrtko Ursulin So far the width of the PID column was hardcoded to six characters which is not enough on systems with high uptime, where PID numbers can grow large, and results in broken line formatting. Fix it by tracking the largest width for both the pid and name fields and use them

Re: [Intel-gfx] [PATCH] drm/i915/hdcp: Remove drm_modeset_lock in intel_conn_to_vcpi

2023-03-16 Thread Ville Syrjälä
On Thu, Mar 16, 2023 at 01:52:32PM +0530, Suraj Kandpal wrote: > Remove drm_modeset_lock in intel_conn_to_vcpi as we don't need it > anymore since all the required locks are taken in atomic check and > prepare phases. > > Signed-off-by: Suraj Kandpal > --- >

Re: [Intel-gfx] [PATCH v2 20/27] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-03-16 Thread Yan Zhao
On Wed, Mar 15, 2023 at 09:21:34AM -0700, Sean Christopherson wrote: > On Wed, Mar 15, 2023, Yan Zhao wrote: > > Nit: there is a typo in the commit header: "iff" -> "if" > > > > > -void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 > > > *new, > > > - int

Re: [Intel-gfx] [PATCH v2 14/27] KVM: x86: Reject memslot MOVE operations if KVMGT is attached

2023-03-16 Thread Yan Zhao
On Wed, Mar 15, 2023 at 08:43:54AM -0700, Sean Christopherson wrote: > > So, in theory, the new GFNs are not write tracked though the old ones are. > > > > Is that acceptable for the internal page-track user? > > It works because KVM zaps all SPTEs when a memslot is moved, i.e. the fact > that

Re: [Intel-gfx] [PATCH 3/9] drm/i915: Define more pipe timestamp registers

2023-03-16 Thread Ville Syrjälä
On Thu, Mar 16, 2023 at 08:43:12AM +, Hogander, Jouni wrote: > On Tue, 2023-03-14 at 15:02 +0200, Ville Syrjala wrote: > > From: Ville Syrjälä > > > > Add definitions for various pipe timestamp registers: > > - frame timestamp (last start of vblank) (g4x+), already had this > > defined > > -

Re: [Intel-gfx] [PATCH v2 19/27] KVM: x86/mmu: Move KVM-only page-track declarations to internal header

2023-03-16 Thread Yan Zhao
On Wed, Mar 15, 2023 at 08:13:37AM -0700, Sean Christopherson wrote: > > A curious question: > > are arch/x86/include/asm/kvm_*.h all expected to be external accessible? > > Depends on what you mean by "expected". Currently, yes, everything in there > is > globally visible. But the vast

Re: [Intel-gfx] [PATCH 6/9] drm/i915: Define vlv/chv sprite plane SURFLIVE registers

2023-03-16 Thread Ville Syrjälä
On Thu, Mar 16, 2023 at 09:12:00AM +, Hogander, Jouni wrote: > On Tue, 2023-03-14 at 15:02 +0200, Ville Syrjala wrote: > > From: Ville Syrjälä > > > > Might as well complete the SURFLIVE register definitions > > for all platforms/plane types. We are only missing the > > VLV/CHV sprite

Re: [Intel-gfx] [PATCH 4/9] drm/i915: Program VLV/CHV PIPE_MSA_MISC register

2023-03-16 Thread Ville Syrjälä
On Thu, Mar 16, 2023 at 08:55:01AM +, Hogander, Jouni wrote: > On Tue, 2023-03-14 at 15:02 +0200, Ville Syrjala wrote: > > From: Ville Syrjälä > > > > VLV/CHV have an extra register to configure some stereo3d > > signalling details via DP MSA. Make sure we reset that > > register to zero

[Intel-gfx] [PATCH v13 3/6] drm/i915/hdcp: HDCP2.x Refactoring to agnostic hdcp

2023-03-16 Thread Suraj Kandpal
There are more than type of content protection security firmware. Make the name generic %s/_mei_/_ --v3 -Changing names to drop cp_fw to make naming more agnostic[Jani] --v4 -remove header reference in intel_display_core.h [Uma] -fix commit message and prefix drm [Uma] Cc: Tomas Winkler Cc:

[Intel-gfx] [PATCH v13 5/6] drm/i915/mtl: Add function to send command to GSC CS

2023-03-16 Thread Suraj Kandpal
Add function that takes care of sending command to gsc cs. We start of with allocation of memory for our command intel_hdcp_gsc_message that contains gsc cs memory header as directed in specs followed by the actual payload hdcp message that we want to send. Spec states that we need to poll pending

<    1   2   3   >