]> Git Repo - linux.git/log
linux.git
2 years agodrm/i915/gvt: merge gvt.c into kvmgvt.c
Christoph Hellwig [Mon, 11 Apr 2022 14:13:58 +0000 (16:13 +0200)]
drm/i915/gvt: merge gvt.c into kvmgvt.c

The code in both files is deeply interconnected, so merge it and
keep a bunch of structures and functions static.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: convert to use vfio_register_emulated_iommu_dev
Christoph Hellwig [Mon, 11 Apr 2022 14:13:57 +0000 (16:13 +0200)]
drm/i915/gvt: convert to use vfio_register_emulated_iommu_dev

This is straightforward conversion, the intel_vgpu already has a pointer
to the vfio_dev, which can be replaced with the embedded structure and
we can replace all the mdev_get_drvdata() with a simple container_of().

Based on an patch from Jason Gunthorpe.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove kvmgt_guest_{init,exit}
Christoph Hellwig [Mon, 11 Apr 2022 14:13:56 +0000 (16:13 +0200)]
drm/i915/gvt: remove kvmgt_guest_{init,exit}

Merge these into their only callers.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: pass a struct intel_vgpu to the vfio read/write helpers
Christoph Hellwig [Mon, 11 Apr 2022 14:13:55 +0000 (16:13 +0200)]
drm/i915/gvt: pass a struct intel_vgpu to the vfio read/write helpers

Pass the structure we actually care about instead of deriving it from
the mdev_device in the lower level code.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: streamline intel_vgpu_create
Christoph Hellwig [Mon, 11 Apr 2022 14:13:54 +0000 (16:13 +0200)]
drm/i915/gvt: streamline intel_vgpu_create

Initialize variables at declaration time, avoid pointless gotos and
cater for the fact that intel_gvt_create_vgpu can't return NULL.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove the extra vfio_device refcounting for dmabufs
Christoph Hellwig [Mon, 11 Apr 2022 14:13:53 +0000 (16:13 +0200)]
drm/i915/gvt: remove the extra vfio_device refcounting for dmabufs

All the dmabufs are torn down when th VGPU is released, so there is
no need for extra refcounting here.

Based on an patch from Jason Gunthorpe.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove struct intel_gvt_mpt
Christoph Hellwig [Mon, 11 Apr 2022 14:13:52 +0000 (16:13 +0200)]
drm/i915/gvt: remove struct intel_gvt_mpt

Just call the initializion and exit functions directly and remove
this abstraction entirely.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize dma_pin_guest_page
Christoph Hellwig [Mon, 11 Apr 2022 14:13:51 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize dma_pin_guest_page

Just call the function directly and remove a pointless wrapper.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->dma_{,un}map_guest_page
Christoph Hellwig [Mon, 11 Apr 2022 14:13:50 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->dma_{,un}map_guest_page

Just call the functions directly.  Also remove a pointless wrapper.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->{enable,disable}_page_track
Christoph Hellwig [Mon, 11 Apr 2022 14:13:49 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->{enable,disable}_page_track

Just call the kvmgt functions directly.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->gfn_to_mfn
Christoph Hellwig [Mon, 11 Apr 2022 14:13:48 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->gfn_to_mfn

Just open code it in the only caller.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->is_valid_gfn
Christoph Hellwig [Mon, 11 Apr 2022 14:13:47 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->is_valid_gfn

Just call the code directly and move towards the callers.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->inject_msi
Christoph Hellwig [Mon, 11 Apr 2022 14:13:46 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->inject_msi

Just open code the MSI injection in a single place instead of going
through the method table.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->detach_vgpu
Christoph Hellwig [Mon, 11 Apr 2022 14:13:45 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->detach_vgpu

Just call the function directly.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->set_edid and ->set_opregion
Christoph Hellwig [Mon, 11 Apr 2022 14:13:44 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->set_edid and ->set_opregion

Just call the code to setup the opregions and EDID data directly.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->{get,put}_vfio_device
Christoph Hellwig [Mon, 11 Apr 2022 14:13:43 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->{get,put}_vfio_device

Just open code the calls to the VFIO APIs.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: devirtualize ->{read,write}_gpa
Christoph Hellwig [Mon, 11 Apr 2022 14:13:42 +0000 (16:13 +0200)]
drm/i915/gvt: devirtualize ->{read,write}_gpa

Just call the VFIO functions directly instead of through the method
table.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove vgpu->handle
Christoph Hellwig [Mon, 11 Apr 2022 14:13:41 +0000 (16:13 +0200)]
drm/i915/gvt: remove vgpu->handle

Always pass the actual vgpu structure instead of encoding it as a
"handle" and add a bool flag to denote if a VGPU is attached.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: merge struct kvmgt_guest_info into strut intel_vgpu
Christoph Hellwig [Mon, 11 Apr 2022 14:13:40 +0000 (16:13 +0200)]
drm/i915/gvt: merge struct kvmgt_guest_info into strut intel_vgpu

Consolidate the per-VGPU structures into a single one.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: merge struct kvmgt_vdev into struct intel_vgpu
Christoph Hellwig [Mon, 11 Apr 2022 14:13:39 +0000 (16:13 +0200)]
drm/i915/gvt: merge struct kvmgt_vdev into struct intel_vgpu

Move towards having only a single structure for the per-VGPU state.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove the unused from_virt_to_mfn op
Christoph Hellwig [Mon, 11 Apr 2022 14:13:38 +0000 (16:13 +0200)]
drm/i915/gvt: remove the unused from_virt_to_mfn op

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove the map_gfn_to_mfn and set_trap_area ops
Christoph Hellwig [Mon, 11 Apr 2022 14:13:37 +0000 (16:13 +0200)]
drm/i915/gvt: remove the map_gfn_to_mfn and set_trap_area ops

The map_gfn_to_mfn and set_trap_area ops are never defined, so remove
them and clean up code that depends on them in the callers.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove intel_gvt_ops
Christoph Hellwig [Mon, 11 Apr 2022 14:13:36 +0000 (16:13 +0200)]
drm/i915/gvt: remove intel_gvt_ops

Remove these pointless indirect alls by just calling the only instance
of each method directly.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: move the gvt code into kvmgt.ko
Christoph Hellwig [Mon, 11 Apr 2022 14:13:35 +0000 (16:13 +0200)]
drm/i915/gvt: move the gvt code into kvmgt.ko

Instead of having an option to build the gvt code into the main i915
module, just move it into the kvmgt.ko module.  This only requires
a new struct with three entries that the KVMGT modules needs to register
with the main i915 module, and a proper list of GVT-enabled devices
instead of global device pointer.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: rename intel_vgpu_ops to intel_vgpu_mdev_ops
Christoph Hellwig [Mon, 11 Apr 2022 14:13:32 +0000 (16:13 +0200)]
drm/i915/gvt: rename intel_vgpu_ops to intel_vgpu_mdev_ops

Free the intel_vgpu_ops symbol name for something that fits better.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove enum hypervisor_type
Christoph Hellwig [Mon, 11 Apr 2022 14:13:31 +0000 (16:13 +0200)]
drm/i915/gvt: remove enum hypervisor_type

The only supported hypervisor is KVM, so don't bother with dead code
enumerating hypervisors.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: remove module refcounting in intel_gvt_{,un}register_hypervisor
Christoph Hellwig [Mon, 11 Apr 2022 14:13:30 +0000 (16:13 +0200)]
drm/i915/gvt: remove module refcounting in intel_gvt_{,un}register_hypervisor

THIS_MODULE always is reference when a symbol called by it is used, so
don't bother with the additional reference.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Zhi Wang <[email protected]>
2 years agodrm/i915/gvt: better align the Makefile with i915 Makefile
Jani Nikula [Wed, 13 Apr 2022 12:25:39 +0000 (15:25 +0300)]
drm/i915/gvt: better align the Makefile with i915 Makefile

Drop extra ccflags, drop extra intermediate variables, list object files
one per line alphabetically.

Cc: Zhi Wang <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/8bc0895376c077156a671e24ac6a5c75b7db4c9c.1649852517.git.jani.nikula@intel.com
Reviewed-by: Zhi Wang <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
2 years agodrm/i915/gvt: fix trace TRACE_INCLUDE_PATH
Jani Nikula [Wed, 13 Apr 2022 12:25:38 +0000 (15:25 +0300)]
drm/i915/gvt: fix trace TRACE_INCLUDE_PATH

TRACE_INCLUDE_PATH should be a path relative to define_trace.h, not the
file including it. (See the comment in include/trace/define_trace.h.)

Cc: Zhi Wang <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/48b772795b7ab674f609ecad53b4882c66a8262a.1649852517.git.jani.nikula@intel.com
Reviewed-by: Zhi Wang <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
2 years agoi915/gvt: Use the initial HW state snapshot saved in i915
Zhi Wang [Thu, 7 Apr 2022 07:19:45 +0000 (03:19 -0400)]
i915/gvt: Use the initial HW state snapshot saved in i915

The code of saving initial HW state snapshot has been moved into i915.
Let the GVT-g core logic use that snapshot.

Cc: Christoph Hellwig <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Vivi Rodrigo <[email protected]>
Cc: Zhenyu Wang <[email protected]>
Cc: Zhi Wang <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Tested-by: Christoph Hellwig <[email protected]>
Reviewed-by: Zhenyu Wang <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agoi915/gvt: Save the initial HW state snapshot in i915
Zhi Wang [Thu, 7 Apr 2022 07:19:44 +0000 (03:19 -0400)]
i915/gvt: Save the initial HW state snapshot in i915

Save the initial HW state snapshot in i915 so that the rest code of GVT-g
can be moved into a dedicated module while it can still get a clean
initial HW state saved at the correct time during the initialization of
i915. The futhrer vGPU created by GVT-g will use this HW state as the
initial HW state.

v6:
- Remove the reference of intel_gvt_device_info.(Christoph)
- Refine the save_mmio() function. (Christoph)

Cc: Christoph Hellwig <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Vivi Rodrigo <[email protected]>
Cc: Zhenyu Wang <[email protected]>
Cc: Zhi Wang <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Tested-by: Christoph Hellwig <[email protected]>
Reviewed-by: Zhenyu Wang <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agoi915/gvt: Separate the MMIO tracking table from GVT-g
Zhi Wang [Thu, 7 Apr 2022 07:19:43 +0000 (03:19 -0400)]
i915/gvt: Separate the MMIO tracking table from GVT-g

To support the new mdev interfaces and the re-factor patches from
Christoph, which moves the GVT-g code into a dedicated module, the GVT-g
MMIO tracking table needs to be separated from GVT-g.

v9:
- Fix a problem might cause kernel panic.
- Remove the redaundant definitation of intel_get_device_type(). (Jani)
- Sort the list of header reference in intel_gvt_mmio.c (Jani)
- Include minimum header insted in intel_gvt_mmio.c (Jani)

v8:
- Use SPDX header in the intel_gvt_mmio_table.c
- Reference the gvt.h with path. (Jani)
- Add a missing fix on mmio emulation path during the debug.
- Fix a building problem on refreshed gvt-staging branch. (Christoph)

v7:
- Keep the marcos of device generation in GVT-g. (Christoph, Jani)

v6:
- Move the mmio_table.c into i915. (Christoph)
- Keep init_device_info and related structures in GVT-g. (Christoph)
- Refine the callbacks of the iterator. (Christoph)
- Move the flags of MMIO register defination to GVT-g. (Chrsitoph)
- Move the mmio block handling to GVT-g.

v5:
- Re-design the mmio table framework. (Christoph)

v4:
- Fix the errors of patch checking scripts.

v3:
- Fix the errors when CONFIG_DRM_I915_WERROR is turned on. (Jani)

v2:
- Implement a mmio table instead of generating it by marco in i915. (Jani)

Cc: Christoph Hellwig <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Vivi Rodrigo <[email protected]>
Cc: Zhenyu Wang <[email protected]>
Cc: Zhi Wang <[email protected]>
Signed-off-by: Zhi Wang <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Tested-by: Christoph Hellwig <[email protected]>
Reviewed-by: Zhenyu Wang <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/selftests: tweak the misaligned_case
Matthew Auld [Wed, 20 Apr 2022 18:16:13 +0000 (19:16 +0100)]
drm/i915/selftests: tweak the misaligned_case

The compact-pt layout restrictions should only apply to the ppGTT. Also
make this play nice on platforms that only have the 64K GTT restriction,
and not the compact-pt thing.

Signed-off-by: Matthew Auld <[email protected]>
Cc: Thomas Hellström <[email protected]>
Cc: Nirmoy Das <[email protected]>
Cc: Ramalingam C <[email protected]>
Reviewed-by: Nirmoy Das <[email protected]>
Reviewed-by: Ramalingam C <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/selftests: fixup min_alignment usage
Matthew Auld [Wed, 20 Apr 2022 18:16:12 +0000 (19:16 +0100)]
drm/i915/selftests: fixup min_alignment usage

Trying to cast the region id into the region type doesn't work too well,
since the i915_vm_min_alignment() won't give us the correct value for
the stolen-lmem case.

Signed-off-by: Matthew Auld <[email protected]>
Cc: Thomas Hellström <[email protected]>
Cc: Nirmoy Das <[email protected]>
Cc: Ramalingam C <[email protected]>
Reviewed-by: Nirmoy Das <[email protected]>
Reviewed-by: Ramalingam C <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/buddy: sanity check the size
Matthew Auld [Wed, 20 Apr 2022 18:16:11 +0000 (19:16 +0100)]
drm/i915/buddy: sanity check the size

Ensure we check that the size is compatible with the requested
page_size. For tiny objects that are automatically annotated with
TTM_PL_FLAG_CONTIGUOUS(since they fit within a single page), we
currently end up silently overriding the min_page_size, which ends up
hiding bugs elsewhere.

Signed-off-by: Matthew Auld <[email protected]>
Cc: Thomas Hellström <[email protected]>
Cc: Nirmoy Das <[email protected]>
Reviewed-by: Nirmoy Das <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: consider min_page_size when migrating
Matthew Auld [Wed, 20 Apr 2022 18:16:10 +0000 (19:16 +0100)]
drm/i915: consider min_page_size when migrating

We can only force migrate an object if the existing object size is
compatible with the new destinations min_page_size for the region.
Currently we blow up with something like:

[ 2857.497462] kernel BUG at drivers/gpu/drm/i915/gt/intel_migrate.c:431!
[ 2857.497497] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[ 2857.497502] CPU: 1 PID: 8921 Comm: i915_selftest Tainted: G     U  W         5.18.0-rc1-drm-tip+ #27
[ 2857.497513] RIP: 0010:emit_pte.cold+0x11a/0x17e [i915]
[ 2857.497646] Code: 00 48 c7 c2 f0 cd c1 a0 48 c7 c7 e9 99 bd a0 e8 d2 77 5d e0 bf 01 00 00 00 e8 08 47 5d e0 31 f6 bf 09 00 00 00 e8 3c 7b 4d e0 <0f> 0b 48 c7 c1 e0 2a c5 a0 ba 34 00 00 00 48 c7 c6 00 ce c1 a0 48
[ 2857.497654] RSP: 0018:ffffc900000f7748 EFLAGS: 00010246
[ 2857.497658] RAX: 0000000000000000 RBX: ffffc900000f77c8 RCX: 0000000000000006
[ 2857.497662] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000009
[ 2857.497665] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
[ 2857.497668] R10: 0000000000022302 R11: ffff88846dea08f0 R12: 0000000000010000
[ 2857.497672] R13: 0000000001880000 R14: 000000000000081b R15: ffff888106b7c040
[ 2857.497675] FS:  00007f0d4c4e0600(0000) GS:ffff88845da80000(0000) knlGS:0000000000000000
[ 2857.497679] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2857.497682] CR2: 00007f113966c088 CR3: 0000000211e60003 CR4: 00000000003706e0
[ 2857.497686] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 2857.497689] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 2857.497692] Call Trace:
[ 2857.497694]  <TASK>
[ 2857.497697]  intel_context_migrate_copy+0x1e5/0x4f0 [i915]

Signed-off-by: Matthew Auld <[email protected]>
Cc: Thomas Hellström <[email protected]>
Cc: Nirmoy Das <[email protected]>
Reviewed-by: Nirmoy Das <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/radeon: Use TTM builtin resource manager debugfs code
Zack Rusin [Tue, 12 Apr 2022 03:35:26 +0000 (23:35 -0400)]
drm/radeon: Use TTM builtin resource manager debugfs code

Switch to using the TTM resource manager debugfs helpers. The
functionality is largely the same.
The TTM resource managers need to stay valid for as long as the
drm debugfs_root is valid.

Signed-off-by: Zack Rusin <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: "Pan, Xinhui" <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Christian König <[email protected]>
2 years agodrm/qxl: Use TTM builtin resource manager debugfs code
Zack Rusin [Tue, 12 Apr 2022 03:35:25 +0000 (23:35 -0400)]
drm/qxl: Use TTM builtin resource manager debugfs code

Switch to using the TTM resource manager debugfs helpers. The
functionality is largely the same.
The TTM resource managers need to stay valid for as long as the
drm debugfs_root is valid.

Signed-off-by: Zack Rusin <[email protected]>
Cc: Dave Airlie <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Christian König <[email protected]>
2 years agodrm/amdgpu: Use TTM builtin resource manager debugfs code
Zack Rusin [Tue, 12 Apr 2022 03:35:24 +0000 (23:35 -0400)]
drm/amdgpu: Use TTM builtin resource manager debugfs code

Switch to using the TTM resource manager debugfs helpers. It's
exactly the same functionality but the debugfs code is shared with
other drivers.

The TTM resource managers need to stay valid for as long as the
drm debugfs_root is valid.

Signed-off-by: Zack Rusin <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: "Pan, Xinhui" <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Felix Kuehling <[email protected]>
Cc: Nirmoy Das <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Christian König <[email protected]>
2 years agodrm/vmwgfx: Add debugfs entries for various ttm resource managers
Zack Rusin [Tue, 12 Apr 2022 03:35:23 +0000 (23:35 -0400)]
drm/vmwgfx: Add debugfs entries for various ttm resource managers

Use the newly added TTM's ability to automatically create debugfs entries
for specified placements. This creates debugfs files that can be read to
get information about various TTM resource managers which are used by
vmwgfx.

Signed-off-by: Zack Rusin <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Christian König <[email protected]>
2 years agodrm/ttm: Add common debugfs code for resource managers
Zack Rusin [Tue, 12 Apr 2022 03:35:22 +0000 (23:35 -0400)]
drm/ttm: Add common debugfs code for resource managers

Drivers duplicate the code required to add debugfs entries for various
ttm resource managers. To fix it add common TTM resource manager debugfs
code that each driver can reuse.

Specific resource managers can overwrite
ttm_resource_manager_func::debug to get more information from those
debugfs entries.

Signed-off-by: Zack Rusin <[email protected]>
Cc: Huang Rui <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Christian König <[email protected]>
2 years agodrm/i915: Fixup merge of the power well refactor patchset
Imre Deak [Wed, 20 Apr 2022 18:05:41 +0000 (21:05 +0300)]
drm/i915: Fixup merge of the power well refactor patchset

The wrong v2 version of
drm/i915: Move per-platform power well hooks to intel_display_power_well.c

patch was pushed to drm-intel-next branch instead of v3, fix this up
applying the difference between v2 and v3.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Remove the XELPD specific AUX and DDI power domains
Imre Deak [Thu, 14 Apr 2022 21:06:57 +0000 (00:06 +0300)]
drm/i915: Remove the XELPD specific AUX and DDI power domains

The spec calls the XELPD_D/E ports just D/E, the platform prefix in the
domain names was only needed by the port->domain mapping relying on
matching enum values for the whole port/domain range (and the
corresponding aliasing between the platform specific domain enums).
Since a previous patch we can define the port->domain mapping explicitly
so do this by reusing the already existing D/E power domain names.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Remove duplicate DDI/AUX power domain mappings
Imre Deak [Thu, 14 Apr 2022 21:06:56 +0000 (00:06 +0300)]
drm/i915: Remove duplicate DDI/AUX power domain mappings

The DDI and AUX domain -> power well mappings are identical for a few
platforms/power well instances, reuse the mappings of earlier platforms
for these removing the duplicate mapping of new platforms.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Remove the ICL specific TBT power domains
Imre Deak [Thu, 14 Apr 2022 21:06:55 +0000 (00:06 +0300)]
drm/i915: Remove the ICL specific TBT power domains

The spec calls the ICL TBT AUX power well instances TBT1-4 (similarly to
all later platforms), align the power domain names with the spec.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Remove the aliasing of power domain enum values
Imre Deak [Thu, 14 Apr 2022 21:06:54 +0000 (00:06 +0300)]
drm/i915: Remove the aliasing of power domain enum values

Aliasing the intel_display_power_domain enum values was required because
of the u64 power domain mask size limit. This makes the dmesg/debugfs
printouts of the domain names somewhat unclear, for instance domain
names for port D are shown on D12+ platforms where the corresponding
port is called TC1. Make this clearer by removing the aliasing which is
possible after a previous patch converting the mask to a bitmap.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Sanitize the port -> DDI/AUX power domain mapping for each platform
Imre Deak [Thu, 14 Apr 2022 21:06:53 +0000 (00:06 +0300)]
drm/i915: Sanitize the port -> DDI/AUX power domain mapping for each platform

Atm the port -> DDI and AUX power domain mapping is specified by relying
on the aliasing of the platform specific intel_display_power_domain enum
values. For instance D12+ platforms refer to the 'D' port and power
domain instances, which doesn't match the bspec terminology, on these
platforms the corresponding port is TC1. To make it clear what
port/domain the code refers to add a mapping between them which matches
the bspec terms on different display versions.

This also allows for removing the aliasing in enum values in a follow-up
patch.

v2: Add the functions to intel_display_power.c, use
    intel_display_power_ prefix.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Sanitize the ADL-S power well definition
Imre Deak [Thu, 14 Apr 2022 21:06:52 +0000 (00:06 +0300)]
drm/i915: Sanitize the ADL-S power well definition

Instead of the skip_mask special casing of the ADL-S power well
descriptors, add a power well descriptor list for ADL-S as well reusing
the TGL descriptors, w/o the TC-cold power well. ADL-S doesn't have
TypeC PHYs, so a better way would be having ADL-S specific AUX
descriptors, but I left changing this for a follow-up.

This changes the ordering of the AUX and TC-cold vs. PW_4/5 power wells
on TGL and ADL-S, but this shouldn't make a difference (PW_4/5 don't
depend on the AUX/TC-cold power wells).

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Simplify the DG1 power well descriptors
Imre Deak [Thu, 14 Apr 2022 21:06:51 +0000 (00:06 +0300)]
drm/i915: Simplify the DG1 power well descriptors

Simplify the definition of DG1 power wells by reusing the identical
RKL DDI/AUX descriptors.

This reorders the DG1 DDI/AUX vs. PW4/5 power wells, but this shouldn't
make a difference (it is the order on RKL and the DDI/AUX power wells
don't have a dependency on PW4/5).

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Allow platforms to share power well descriptors
Imre Deak [Thu, 14 Apr 2022 21:06:50 +0000 (00:06 +0300)]
drm/i915: Allow platforms to share power well descriptors

Some power wells - like always-on and skl+/icl+ PW_1 - with the same
name, domain list, flags, ops are used by multiple platforms, so allow
platforms to reuse the descriptors of such power wells.

This change also lets the follow up patches to simplify the DG1/RKL
power well definitions, and remove the ADL-S skip_mask special casing.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Simplify power well definitions by adding power well instances
Imre Deak [Thu, 14 Apr 2022 21:06:49 +0000 (00:06 +0300)]
drm/i915: Simplify power well definitions by adding power well instances

All the port specific AUX/DDI_IO power wells share the same power well
ops struct and flags, so we can save some space and simplify the
definition of these by listing for all such power wells only the params
specific to them (name, domains, power well register index, id). Move
these params to a new i915_power_well_instance struct and convert the
per-platform power well definitions accordingly.

For all power well instance the name and power domain list params must
be specified, while the register index and id are optional, add the
I915_PW() macro that both simplifies the definitions and ensures that
the required params are set.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Convert the u64 power well domains mask to a bitmap
Imre Deak [Thu, 14 Apr 2022 21:06:48 +0000 (00:06 +0300)]
drm/i915: Convert the u64 power well domains mask to a bitmap

To remove the aliasing of the power domain enum values in a follow-up
patch in this patchset (requiring a bigger mask) and allow for defining
additional power domains in the future (at least some upcoming TypeC
changes requires this) convert the u64 i915_power_well_desc::domains
mask to a bitmap.

For simplicity I changed the for_each_power_domain_well() macros to
accept one domain only instead of a mask, as there isn't any current
user passing multiple domains.

v2: Don't add a typedef for the bitmap struct. (Jani)

Cc: Jani Nikula <[email protected]>
Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Convert the power well descriptor domain mask to an array of domains
Imre Deak [Thu, 14 Apr 2022 21:06:47 +0000 (00:06 +0300)]
drm/i915: Convert the power well descriptor domain mask to an array of domains

The next patch converts the i915_power_well_desc::domain mask from a u64
mask to a bitmap. I didn't find a reasonably simple way to initialize
bitmaps statically, so prepare for the next patch here by converting the
masks to an array of domain enums and initing the masks from these
arrays during module loading.

v2: Clarify list vs. array in the commit message. (Jani)

Cc: Jani Nikula <[email protected]>
Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Sanitize the power well names
Imre Deak [Thu, 14 Apr 2022 21:06:46 +0000 (00:06 +0300)]
drm/i915: Sanitize the power well names

Use the shortest descriptive name for all power wells for simplicity and
to use the same name for the same type of power wells on multiple
platforms.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Rename the power domain names to end with pipes/ports
Imre Deak [Thu, 14 Apr 2022 21:06:45 +0000 (00:06 +0300)]
drm/i915: Rename the power domain names to end with pipes/ports

Make all power domain names end with the pipe/port instance for
consistency.

No functional changes.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Move the HSW power well flags to a common bitfield
Imre Deak [Thu, 14 Apr 2022 21:06:44 +0000 (00:06 +0300)]
drm/i915: Move the HSW power well flags to a common bitfield

Save some space by grouping the HSW power well descriptor flags along
with other flags in one bitfield.

This change also lets simplifying the definition of power well
descriptors sharing the same flags in an upcoming patch.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Move the dg2 fixed_enable_delay power well param to a common bitfield
Imre Deak [Thu, 14 Apr 2022 21:06:43 +0000 (00:06 +0300)]
drm/i915: Move the dg2 fixed_enable_delay power well param to a common bitfield

The DG2 fixed delay duration is always 600usec, so save some space in
the power well descriptors by converting the parameter to a flag. While
at it also use a bitfield for both the always_on and fixed_enable_delay
flag.

This change also lets simplifying the definiton of power wells sharing
the same flags in an upcoming patch.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Move the power domain->well mappings to intel_display_power_map.c
Imre Deak [Thu, 14 Apr 2022 21:06:42 +0000 (00:06 +0300)]
drm/i915: Move the power domain->well mappings to intel_display_power_map.c

Move the list of platform specific power domain -> power well
definitions to intel_display_power_map.c. While at it group the
platforms' power domain macros with the corresponding power well lists
and keep all the power domain lists in the same order (matching the enum
order).

No functional changes.

v2:
- s/intel_display_power_internal.h/intel_display_power_map.h/ (Jani)
- Simplify intel_cleanup_power_wells().
- Don't move intel_display_power_domain_str().
v3:
- Rename intel_init/cleanup_power_wells() to
  intel_display_power_map_init/cleanup().
- Add documentation to intel_display_power_map_init/cleanup().

Cc: Jani Nikula <[email protected]>
Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Unexport the for_each_power_well() macros
Imre Deak [Thu, 14 Apr 2022 21:06:41 +0000 (00:06 +0300)]
drm/i915: Unexport the for_each_power_well() macros

The for_each_power_well() macros are only used in intel_display_power.c
and intel_display_power_well.c, so unexport them.

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Move per-platform power well hooks to intel_display_power_well.c
Imre Deak [Thu, 14 Apr 2022 21:06:40 +0000 (00:06 +0300)]
drm/i915: Move per-platform power well hooks to intel_display_power_well.c

Move the implementation of platform specific power well hooks to
intel_display_power_well.c, to reduce the clutter in
intel_display_power.c.

The locking of all the power domain/power well state is handled in the
power domain functions in intel_display_power.c using
i915_power_domains::lock. This patch also moves the
chy_phy_powergate_ch/lanes() functions to intel_display_power_well.c
which borrow the same lock to protect the DISPLAY_PHY_CONTROL register
state, which the HW uses both for toggling power wells and power gating
PHY lanes.

No functional change.

v2:
- Clarify in the commit log why CHV functions using the
  i915_power_domains::lock were moved, while others locking the power
  domain/well state were kept in intel_display_power.c . (Jouni)
- Move forward declaration of chv_phy_powergate_ch/lanes() to
  intel_display_power_well.h .

Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/dg2: Add workaround 18019627453
José Roberto de Souza [Tue, 19 Apr 2022 18:27:53 +0000 (11:27 -0700)]
drm/i915/dg2: Add workaround 18019627453

A new DG2 workaround added to fix some corner cases hangs.

v2:
- implementing the second and preferred option for this workaround

BSpec: 54077
BSpec: 68173
BSpec: 71488
Cc: Matt Roper <[email protected]>
Signed-off-by: José Roberto de Souza <[email protected]>
Reviewed-by: Matt Roper <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/solomon: Add SSD130x OLED displays SPI support
Javier Martinez Canillas [Tue, 19 Apr 2022 21:48:23 +0000 (23:48 +0200)]
drm/solomon: Add SSD130x OLED displays SPI support

The ssd130x driver only provides the core support for these devices but it
does not have any bus transport logic. Add a driver to interface over SPI.

There is a difference in the communication protocol when using 4-wire SPI
instead of I2C. For the latter, a control byte that contains a D/C# field
has to be sent. This field tells the controller whether the data has to be
written to the command register or to the graphics display data memory.

But for 4-wire SPI that control byte is not used, instead a real D/C# line
must be pulled HIGH for commands data and LOW for graphics display data.

For this reason the standard SPI regmap can't be used and a custom .write
bus handler is needed.

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Mark Brown <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/solomon: Move device info from ssd130x-i2c to the core driver
Javier Martinez Canillas [Tue, 19 Apr 2022 21:48:22 +0000 (23:48 +0200)]
drm/solomon: Move device info from ssd130x-i2c to the core driver

These are declared in the ssd130x-i2c transport driver but the information
is not I2C specific, and could be used by other SSD130x transport drivers.

Move them to the ssd130x core driver and just set the OF device entries to
an ID that could be used to lookup the correct device info from an array.

While being there, also move the SSD130X_DATA and SSD130X_COMMAND control
bytes. Since even though they are used by the I2C interface, they could
also be useful for other transport protocols such as SPI.

Suggested-by: Chen-Yu Tsai <[email protected]>
Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Mark Brown <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/solomon: Add ssd130x new compatible strings and deprecate old ones.
Javier Martinez Canillas [Tue, 19 Apr 2022 21:48:21 +0000 (23:48 +0200)]
drm/solomon: Add ssd130x new compatible strings and deprecate old ones.

The current compatible strings for SSD130x I2C controllers contain an "fb"
and "-i2c" suffixes. These have been deprecated and more correct ones were
added, that don't encode a subsystem or bus used to interface the devices.

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Mark Brown <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodt-bindings: display: ssd1307fb: Extend schema for SPI controllers
Javier Martinez Canillas [Tue, 19 Apr 2022 21:48:20 +0000 (23:48 +0200)]
dt-bindings: display: ssd1307fb: Extend schema for SPI controllers

The Solomon SSD130x OLED displays can either have an I2C or SPI interface,
add to the schema the properties and examples for OLED devices under SPI.

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Mark Brown <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings
Javier Martinez Canillas [Tue, 19 Apr 2022 21:48:19 +0000 (23:48 +0200)]
dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings

The current compatible strings for SSD130x I2C controllers contain both an
"fb" and "-i2c" suffixes. It seems to indicate that are for a fbdev driver
and also that are for devices that can be accessed over an I2C bus.

But a DT is supposed to describe the hardware and not Linux implementation
details. So let's deprecate those compatible strings and add new ones that
only contain the vendor and device name, without any of these suffixes.

These will just describe the device and can be matched by both I2C and SPI
DRM drivers. The required properties should still be enforced for old ones.

While being there, just drop the "sinowealth,sh1106-i2c" compatible string
since that was never present in a released Linux version.

Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Mark Brown <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/display: Add workaround 22014263786
José Roberto de Souza [Tue, 19 Apr 2022 18:27:52 +0000 (11:27 -0700)]
drm/i915/display: Add workaround 22014263786

This workaround fixes screen flickers with FBC.

BSpec: 33450
BSpec: 52890
BSpec: 54369
BSpec: 66624
Reviewed-by: Matt Roper <[email protected]>
Cc: Matt Roper <[email protected]>
Signed-off-by: José Roberto de Souza <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Program i830 DPLL FP register later
Ville Syrjälä [Mon, 21 Mar 2022 19:50:04 +0000 (21:50 +0200)]
drm/i915: Program i830 DPLL FP register later

Follow the new i9xx DPLL FP register programming sequence
introduced in commit 62d66b218386 ("drm/i915: Fold
i9xx_set_pll_dividers() into i9xx_enable_pll()") in the
i830 "power well" code as well. Just for consistency.

Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jani Nikula <[email protected]>
2 years agodrm/i915: program wm blocks to at least blocks required per line
Vinod Govindapillai [Sun, 17 Apr 2022 09:31:05 +0000 (12:31 +0300)]
drm/i915: program wm blocks to at least blocks required per line

In configurations with single DRAM channel, for usecases like
4K 60 Hz, FIFO underruns are observed quite frequently. Looks
like the wm0 watermark values need to bumped up because the wm0
memory latency calculations are probably not taking the DRAM
channel's impact into account.

As per the Bspec 49325, if the ddb allocation can hold at least
one plane_blocks_per_line we should have selected method2.
Assuming that modern HW versions have enough dbuf to hold
at least one line, set the wm blocks to equivalent to blocks
per line.

v2: styling and comments changes (Ville)
v3: Updated the reviewed-by tag
v4: max_t to max and patch styling (Ville)

References: https://gitlab.freedesktop.org/drm/intel/-/issues/4321
Cc: Ville Syrjälä <[email protected]>
Cc: Stanislav Lisovskiy <[email protected]>
Signed-off-by: Vinod Govindapillai <[email protected]>
Reviewed-by: Stanislav Lisovskiy <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Fix DISP_POS_Y and DISP_HEIGHT defines
Hans de Goede [Mon, 18 Apr 2022 15:09:36 +0000 (17:09 +0200)]
drm/i915: Fix DISP_POS_Y and DISP_HEIGHT defines

Commit 428cb15d5b00 ("drm/i915: Clean up pre-skl primary plane registers")
introduced DISP_POS_Y and DISP_HEIGHT defines but accidentally set these
their masks to REG_GENMASK(31, 0) instead of REG_GENMASK(31, 16).

This breaks the primary display pane on at least pineview machines, fix
the mask to fix the primary display pane only showing black.

Tested on an Acer One AO532h with an Intel N450 SoC.

Fixes: 428cb15d5b00 ("drm/i915: Clean up pre-skl primary plane registers")
Cc: José Roberto de Souza <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: José Roberto de Souza <[email protected]>
2 years agofbdev: Warn in hot-unplug workaround for framebuffers without device
Thomas Zimmermann [Tue, 19 Apr 2022 10:04:05 +0000 (12:04 +0200)]
fbdev: Warn in hot-unplug workaround for framebuffers without device

A workaround makes fbdev hot-unplugging work for framebuffers without
device. The only user for this feature was offb. As each OF framebuffer
now has an associated platform device, the workaround hould no longer
be triggered. Update it with a warning and rewrite the comment. Fbdev
drivers that trigger the hot-unplug workaround really need to be fixed.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Suggested-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agoof: Create platform devices for OF framebuffers
Thomas Zimmermann [Tue, 19 Apr 2022 10:04:04 +0000 (12:04 +0200)]
of: Create platform devices for OF framebuffers

Create a platform device for each OF-declared framebuffer and have
offb bind to these devices. Allows for real hot-unplugging and other
drivers besides offb.

Originally, offb created framebuffer devices while initializing its
module by parsing the OF device tree. No actual Linux device was set
up. This tied OF framebuffers to offb and makes writing other drivers
for the OF framebuffers complicated. The absence of a Linux device
further prevented real hot-unplugging. Adding a distinct platform
device for each OF framebuffer solves both problems. Specifically, a
DRM driver can now provide graphics output for modern userspace.

Some of the offb init code is now located in the OF initialization.
There's now also an implementation of of_platform_default_populate_init(),
which was missing before. The OF side creates different devices for
either OF display nodes or BootX displays as they require different
handling by the driver. The offb drivers picks up each type of device
and runs the appropriate fbdev initialization.

Tested with OF display nodes on qemu's ppc64le target.

v3:
* declare variable 'node' with function scope (Rob)
v2:
* run PPC code as part of existing initialization (Rob)
* add a few more error warnings (Javier)

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/gma500: fix a potential repeat execution in psb_driver_load
Xiaomeng Tong [Wed, 13 Apr 2022 05:11:05 +0000 (13:11 +0800)]
drm/gma500: fix a potential repeat execution in psb_driver_load

Instead of exiting the loop as expected when an entry is found, the
list_for_each_entry() continues until the traversal is complete. To
avoid potential executing 'ret = gma_backlight_init(dev);' repeatly,
goto outside the loop when found entry by replacing switch/case with
if statement.

Signed-off-by: Xiaomeng Tong <[email protected]>
Signed-off-by: Patrik Jakobsson <[email protected]>
[Fixed indentation]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/rpl-p: Add PCI IDs
Matt Atwood [Mon, 18 Apr 2022 06:21:57 +0000 (11:51 +0530)]
drm/i915/rpl-p: Add PCI IDs

Adding initial PCI ids for RPL-P.
RPL-P behaves identically to ADL-P from i915's point of view.

Changes since V1 :
- SUBPLATFORM ADL_N and RPL_P clash as both are ADLP
  based - Matthew R

Bspec: 55376
Signed-off-by: Matt Atwood <[email protected]>
Signed-off-by: Madhumitha Tolakanahalli Pradeep <[email protected]>
Signed-off-by: Tejas Upadhyay <[email protected]>
[mattrope: Corrected comment formatting to match coding style]
Signed-off-by: Matt Roper <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20220418062157.2974665-1-tejaskumarx.surendrakumar.upadhyay@intel.com
2 years agodrm/i915/dg2: Enable Wa_22012727170/Wa_22012727685
John Harrison [Fri, 15 Apr 2022 22:40:25 +0000 (15:40 -0700)]
drm/i915/dg2: Enable Wa_22012727170/Wa_22012727685

The above two workaronuds regarding context isolation are implemented
by GuC. The KMD just needs to enable them.

Signed-off-by: John Harrison <[email protected]>
Reviewed-by: Umesh Nerlige Ramappa <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/dg2: Enable Wa_14014475959 - RCS / CCS context exit
Matthew Brost [Fri, 15 Apr 2022 22:40:24 +0000 (15:40 -0700)]
drm/i915/dg2: Enable Wa_14014475959 - RCS / CCS context exit

There is bug in DG2 where if the CCS contexts switches out while the RCS
is running it can cause memory corruption. To workaround this add an
atomic to a memory address with a value 1 and semaphore wait to the same
address for a value of 0. The GuC firmware is responsible for writing 0
to the memory address when it is safe for the context to switch out.

Signed-off-by: Matthew Brost <[email protected]>
Reviewed-by: John Harrison <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/guc: Apply Wa_16011777198
Vinay Belgaumkar [Fri, 15 Apr 2022 22:40:23 +0000 (15:40 -0700)]
drm/i915/guc: Apply Wa_16011777198

Enable GuC Wa to reset RCS/CCS before it goes into RC6.

Signed-off-by: Vinay Belgaumkar <[email protected]>
Reviewed-by: John Harrison <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/guc: Enable GuC based workarounds for DG2
John Harrison [Fri, 15 Apr 2022 22:40:22 +0000 (15:40 -0700)]
drm/i915/guc: Enable GuC based workarounds for DG2

There are some workarounds for DG2 that are implemented in the GuC
firmware. However, the KMD is required to enable these by setting the
appropriate flag as GuC does not know what platform it is running on.
  Wa_16011759253
  Wa_14012630569
  Wa_14013746162

Signed-off-by: John Harrison <[email protected]>
CC: Matt Roper <[email protected]>
Reviewed-by: Daniele Ceraolo Spurio <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/guc: Enable Wa_22011802037 for gen12 GuC based platforms
Umesh Nerlige Ramappa [Fri, 15 Apr 2022 22:40:21 +0000 (15:40 -0700)]
drm/i915/guc: Enable Wa_22011802037 for gen12 GuC based platforms

Initiating a reset when the command streamer is not idle or in the
middle of executing an MI_FORCE_WAKE can result in a hang. Multiple
command streamers can be part of a single reset domain, so resetting one
would mean resetting all command streamers in that domain.

To workaround this, before initiating a reset, ensure that all command
streamers within that reset domain are either IDLE or are not executing
a MI_FORCE_WAKE.

Enable GuC PRE_PARSER WA bit so that GuC follows the WA sequence when
initiating engine-resets.

For gt-resets, ensure that i915 applies the WA sequence.

Opens to address in future patches:
- The part of the WA to wait for pending forcewakes is also applicable
  to execlists backend.
- The WA also needs to be applied for gen11

Signed-off-by: Umesh Nerlige Ramappa <[email protected]>
Reviewed-by: Daniele Ceraolo Spurio <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Add Wa_22011802037 force cs halt
Tilak Tangudu [Fri, 15 Apr 2022 22:40:20 +0000 (15:40 -0700)]
drm/i915: Add Wa_22011802037 force cs halt

Prior to doing a reset, SW must ensure command streamer is stopped,
as a workaround, to eliminate a race condition in GPM flow.
Setting both the ring stop and prefetch disable bits, will cause the
command streamer to halt.

Signed-off-by: Tilak Tangudu <[email protected]>
Reviewed-by: John Harrison <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm: bridge: icn6211: Add DSI lane count DT property parsing
Marek Vasut [Thu, 7 Apr 2022 18:56:17 +0000 (20:56 +0200)]
drm: bridge: icn6211: Add DSI lane count DT property parsing

The driver currently hard-codes DSI lane count to two, however the chip
is capable of operating in 1..4 DSI lanes mode. Parse 'data-lanes' DT
property and program the result into DSI_CTRL register.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
To: [email protected]
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodt-bindings: display: bridge: icn6211: Document DSI data-lanes property
Marek Vasut [Thu, 7 Apr 2022 18:56:16 +0000 (20:56 +0200)]
dt-bindings: display: bridge: icn6211: Document DSI data-lanes property

It is necessary to specify the number of connected/used DSI data lanes when
using the DSI input port of this bridge. Document the 'data-lanes' property
of the DSI input port.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: [email protected]
To: [email protected]
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/bridge: anx7625: Use uint8 for lane-swing arrays
Nícolas F. R. A. Prado [Fri, 8 Apr 2022 01:30:34 +0000 (21:30 -0400)]
drm/bridge: anx7625: Use uint8 for lane-swing arrays

As defined in the anx7625 dt-binding, the analogix,lane0-swing and
analogix,lane1-swing properties are uint8 arrays. Yet, the driver was
reading the array as if it were of uint32 and masking to 8-bit before
writing to the registers. This means that a devicetree written in
accordance to the dt-binding would have its values incorrectly parsed.

Fix the issue by reading the array as uint8 and storing them as uint8
internally, so that we can also drop the masking when writing the
registers.

Fixes: fd0310b6fe7d ("drm/bridge: anx7625: add MIPI DPI input feature")
Signed-off-by: Nícolas F. R. A. Prado <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm: bridge: dw_hdmi: Audio: Add General Parallel Audio (GPA) driver
Sandor Yu [Fri, 15 Apr 2022 02:42:50 +0000 (10:42 +0800)]
drm: bridge: dw_hdmi: Audio: Add General Parallel Audio (GPA) driver

General Parallel Audio (GPA) interface is one of the supported
audio interface for synopsys HDMI module, which has verified for
i.MX8MPlus platform.
This is initial version for GPA.

Signed-off-by: Shengjiu Wang <[email protected]>
Signed-off-by: Sandor Yu <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/f21ba3e8c4d9d028ac74c6f3c588ddbffe739399.1649989179.git.Sandor.yu@nxp.com
2 years agodrm: bridge: dw_hdmi: add reset function for PHY GEN1
Sandor Yu [Fri, 15 Apr 2022 02:42:49 +0000 (10:42 +0800)]
drm: bridge: dw_hdmi: add reset function for PHY GEN1

PHY reset register(MC_PHYRSTZ) active high reset control for PHY GEN2,
and active low reset control for PHY GEN1.

Rename function dw_hdmi_phy_reset to dw_hdmi_phy_gen2_reset.
Add dw_hdmi_phy_gen1_reset function for PHY GEN1.

Signed-off-by: Sandor Yu <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Acked-by: Jernej Skrabec <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/e0b3be2d63fe3e95246fb8b8b0dcd57415b29e04.1649989179.git.Sandor.yu@nxp.com
2 years agodrm: bridge: dw_hdmi: Enable GCP only for Deep Color
Sandor Yu [Fri, 15 Apr 2022 02:42:48 +0000 (10:42 +0800)]
drm: bridge: dw_hdmi: Enable GCP only for Deep Color

HDMI1.4b specification section 6.5.3:
Source shall only send GCPs with non-zero CD to sinks
that indicate support for Deep Color.

DW HDMI GCP default enabled, but only transmit CD
and do not handle AVMUTE, PP norDefault_Phase (yet).
Disable Auto GCP when 24-bit color for sinks that not support Deep Color.

Signed-off-by: Sandor Yu <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/78fa41e4fb3d3d53354034bc221fcf870dbac617.1649989179.git.Sandor.yu@nxp.com
2 years agodrm: bridge: dw_hdmi: default enable workaround to clear the overflow
Sandor Yu [Fri, 15 Apr 2022 02:42:47 +0000 (10:42 +0800)]
drm: bridge: dw_hdmi: default enable workaround to clear the overflow

i.MX8MPlus (v2.13a) has verified need the workaround to clear the
overflow with one iteration.
Only i.MX6Q(v1.30a) need the workaround with 4 iterations,
the others versions later than v1.3a have been identified as needing
the workaround with a single iteration.

Default enable the workaround with one iteration for all versions
later than v1.30a.

Signed-off-by: Sandor Yu <[email protected]>
Acked-by: Neil Armstrong <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/561951005a85574dcdd108e5d6a3a87df930ea3d.1649989179.git.Sandor.yu@nxp.com
2 years agodrm: bridge: panel: Register connector if DRM device is already registered
Marek Szyprowski [Tue, 19 Apr 2022 09:14:22 +0000 (11:14 +0200)]
drm: bridge: panel: Register connector if DRM device is already registered

If panel_bridge_attach() happens after DRM device registration, the
created connector will not be registered by the DRM core anymore. Fix
this by registering it explicitly in such case.

This fixes the following issue observed on Samsung Exynos4210-based Trats
board with a DSI panel (the panel driver is registered after the Exynos DRM
component device is bound):

$ ./modetest -c -Mexynos
could not get connector 56: No such file or directory
Segmentation fault

While touching this, move the connector reset() call also under the DRM
device registered check, because otherwise it is not really needed.

Fixes: 934aef885f9d ("drm: bridge: panel: Reset the connector state pointer")
Signed-off-by: Marek Szyprowski <[email protected]>
Reviewed-by: Jagan Teki <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm: bridge: adv7511: Enable DRM_BRIDGE_OP_HPD based on HPD interrupt
Biju Das [Tue, 19 Apr 2022 14:24:53 +0000 (15:24 +0100)]
drm: bridge: adv7511: Enable DRM_BRIDGE_OP_HPD based on HPD interrupt

Connector detection using poll method won't work in case of bridge
attached to the encoder with the flag DRM_BRIDGE_ATTACH_NO_CONNECTOR, as
the code defaults to HPD.

Enable DRM_BRIDGE_OP_HPD based on HPD interrupt availability, so that
it will fall back to polling, if HPD is not available.

Signed-off-by: Biju Das <[email protected]>
Reviewed-by: Robert Foss <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/bridge: lt9211: Add Lontium LT9211 bridge driver
Marek Vasut [Tue, 19 Apr 2022 14:39:58 +0000 (16:39 +0200)]
drm/bridge: lt9211: Add Lontium LT9211 bridge driver

Add driver for Lontium LT9211 Single/Dual-Link DSI/LVDS or Single DPI to
Single-link/Dual-Link DSI/LVDS or Single DPI bridge. This chip is highly
capable at converting formats, but sadly it is also highly undocumented.

This driver is written without any documentation from Lontium and based
only on shreds of information available in various obscure example codes,
hence long runs of unknown register patches and lengthy delays in various
places. Whichever register meaning could be divined from its behavior has
at least a comment around it.

Currently the only mode tested is Single-link DSI to Single-link LVDS.
Dual-link LVDS might work as well, the register programming is in place,
but is untested.

Reviewed-by: Robert Foss <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
To: [email protected]
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodt-bindings: display: bridge: lt9211: Add Lontium LT9211 bridge driver
Marek Vasut [Tue, 19 Apr 2022 14:39:57 +0000 (16:39 +0200)]
dt-bindings: display: bridge: lt9211: Add Lontium LT9211 bridge driver

Add bindings for Lontium LT9211 Single/Dual-Link DSI/LVDS or Single DPI to
Single-link/Dual-Link DSI/LVDS or Single DPI bridge. This chip is highly
capable at converting formats, but sadly it is also highly undocumented.

Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: [email protected]
To: [email protected]
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/bridge: anx7625: Fill in empty ELD when no connector
Hsin-Yi Wang [Thu, 14 Apr 2022 09:00:04 +0000 (17:00 +0800)]
drm/bridge: anx7625: Fill in empty ELD when no connector

Speaker may share I2S with DP and .get_eld callback will be called when
speaker is playing. When HDMI wans't connected, the connector will be
null. Instead of return an error, fill in empty ELD.

Signed-off-by: Hsin-Yi Wang <[email protected]>
Reviewed-by: Xin Ji <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/display/psr: Clear more PSR state during disable
José Roberto de Souza [Thu, 14 Apr 2022 15:11:18 +0000 (08:11 -0700)]
drm/i915/display/psr: Clear more PSR state during disable

After commit 805f04d42a6b ("drm/i915/display/psr: Use continuos full
frame to handle frontbuffer invalidations") was merged we started to
get some drm_WARN_ON(&dev_priv->drm, !(tmp & PSR2_MAN_TRK_CTL_ENABLE))
in tests that are executed in pipe B.

This is probably due psr2_sel_fetch_cff_enabled being left set during
PSR disable in the pipe A, so the PSR2_MAN_TRK_CTL write in
intel_psr2_program_trans_man_trk_ctl() is skipped in pipe B and then
we get the warning when actually enabling PSR after planes programing.
We don't get such warnings when running tests in pipe A because
PSR2_MAN_TRK_CTL is only cleared when enabling PSR2 with hardware
tracking.

Was not able to reproduce this issue but cleaning the PSR state
disable will not harm anything at all.

Fixes: 805f04d42a6b ("drm/i915/display/psr: Use continuos full frame to handle frontbuffer invalidations")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5634
Cc: Jouni Högander <[email protected]>
Signed-off-by: José Roberto de Souza <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_confi...
José Roberto de Souza [Thu, 14 Apr 2022 15:11:17 +0000 (08:11 -0700)]
drm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_config_valid() fails

If any of the PSR2 checks after intel_psr2_sel_fetch_config_valid()
fails, enable_psr2_sel_fetch will be kept enabled causing problems
in the functions that only checks for it and not for has_psr2.

So here moving the check that do not depend on enable_psr2_sel_fetch
and for the remaning ones jumping to a section that unset
enable_psr2_sel_fetch in case of failure to support PSR2.

Fixes: 6e43e276b8c9 ("drm/i915: Initial implementation of PSR2 selective fetch")
Cc: Jouni Högander <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Signed-off-by: José Roberto de Souza <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/tidss: Soft Reset DISPC on startup
Devarsh Thakkar [Mon, 14 Mar 2022 11:37:39 +0000 (17:07 +0530)]
drm/tidss: Soft Reset DISPC on startup

Soft reset the display subsystem controller on startup and wait for
the reset to complete. This helps the scenario where display was
already in use by some other core before the linux was booted.

Signed-off-by: Devarsh Thakkar <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agoMerge drm/drm-next into drm-misc-next
Paul Cercueil [Mon, 18 Apr 2022 19:44:36 +0000 (20:44 +0100)]
Merge drm/drm-next into drm-misc-next

drm/drm-next has a build fix for the NewVision NV3052C panel
(drivers/gpu/drm/panel/panel-newvision-nv3052c.c), which needs to be
merged back to drm-misc-next, as it was failing to build there.

Signed-off-by: Paul Cercueil <[email protected]>
2 years agodrm/nouveau/gr/gf100-: change gf108_gr_fwif from global to static
Tom Rix [Mon, 18 Apr 2022 15:28:10 +0000 (11:28 -0400)]
drm/nouveau/gr/gf100-: change gf108_gr_fwif from global to static

Smatch reports this issue
gf108.c:147:1: warning: symbol 'gf108_gr_fwif'
  was not declared. Should it be static?

gf108_gr_fwif is only used in gf108.c.  Single
file variables should not be global so change
gf108_gr_fwif's storage-class specifier to static.

Signed-off-by: Tom Rix <[email protected]>
Reviewed-by: Lyude Paul <[email protected]>
Signed-off-by: Lyude Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/nouveau: change base917c_format from global to static
Tom Rix [Mon, 18 Apr 2022 14:18:42 +0000 (10:18 -0400)]
drm/nouveau: change base917c_format from global to static

Smatch reports this issue
base917c.c:26:1: warning: symbol 'base917c_format'
  was not declared. Should it be static?

base917c_format is only used in base917.c.  Single
file variables should not be global so change
base917c_format's storage-class specifier to static.

Signed-off-by: Tom Rix <[email protected]>
Reviewed-by: Lyude Paul <[email protected]>
Signed-off-by: Lyude Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/hwconfig: Add DG2 support
Rodrigo Vivi [Thu, 31 Mar 2022 23:17:37 +0000 (16:17 -0700)]
drm/i915/hwconfig: Add DG2 support

v2:
 * Jordan: Drop stepping/skew checking as suggested by John.

Signed-off-by: Rodrigo Vivi <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Signed-off-by: Ramalingam C <[email protected]>
Tested-by: Jordan Justen <[email protected]>
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: John Harrison <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915: Don't show engine information in fdinfo with GuC submission
Ashutosh Dixit [Fri, 15 Apr 2022 00:25:11 +0000 (17:25 -0700)]
drm/i915: Don't show engine information in fdinfo with GuC submission

At present i915 does not fetch busyness information from GuC, resulting in
incorrect busyness values in fdinfo. Because engine information is coupled
with busyness in fdinfo, skip showing client engine information in fdinfo
with GuC submission till fetching busyness is supported in the i915 GuC
submission backend.

v2 (Daniele):
  Make commit title and description more precise
  Add FIXME with brief description at code change
  s/intel_guc_submission_is_used/intel_uc_uses_guc_submission/

v3 (Daniele):
  Drop FIXME in comment

Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/5564
Fixes: 055634e4b62f ("drm/i915: Expose client engine utilisation via fdinfo")
Cc: Daniele Ceraolo Spurio <[email protected]>
Cc: Umesh Nerlige Ramappa <[email protected]>
Signed-off-by: Ashutosh Dixit <[email protected]>
Reviewed-by: Daniele Ceraolo Spurio <[email protected]>
Signed-off-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/b614c2c61a954de06fbe2c3a7c70d3a91804407e.1649982207.git.ashutosh.dixit@intel.com
This page took 0.121731 seconds and 4 git commands to generate.