]> Git Repo - linux.git/commitdiff
Backmerge tag 'v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds...
authorDave Airlie <[email protected]>
Wed, 13 Jul 2022 00:54:56 +0000 (10:54 +1000)
committerDave Airlie <[email protected]>
Wed, 13 Jul 2022 00:54:56 +0000 (10:54 +1000)
Backmerge in rc6 so I can merge msm next easier.

Linux 5.19-rc6

Signed-off-by: Dave Airlie <[email protected]>
19 files changed:
1  2 
MAINTAINERS
drivers/dma-buf/udmabuf.c
drivers/gpu/drm/drm_panel_orientation_quirks.c
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
drivers/gpu/drm/sun4i/sun4i_layer.c
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/vc4/vc4_bo.c
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hvs.c
drivers/gpu/drm/vc4/vc4_kms.c
drivers/gpu/drm/vc4/vc4_plane.c
drivers/video/fbdev/core/fbcon.c
drivers/video/fbdev/core/fbmem.c
drivers/video/fbdev/simplefb.c

diff --combined MAINTAINERS
index ab50c102177b1458d9b177bd5673bf5a14291a78,f679152bdbadf9a2ef67d6b3aad70509ab46f453..b00360edb54a48a1b3ef5a4c3e3f722d43ce595e
@@@ -426,7 -426,7 +426,7 @@@ F: drivers/acpi/*thermal
  ACPI VIOT DRIVER
  M:    Jean-Philippe Brucker <[email protected]>
  L:    [email protected]
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  S:    Maintained
  F:    drivers/acpi/viot.c
  F:    include/linux/acpi_viot.h
@@@ -959,7 -959,7 +959,7 @@@ F: drivers/video/fbdev/geode
  AMD IOMMU (AMD-VI)
  M:    Joerg Roedel <[email protected]>
  R:    Suravee Suthikulpanit <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
  F:    drivers/iommu/amd/
@@@ -2467,6 -2467,7 +2467,7 @@@ ARM/NXP S32G ARCHITECTUR
  M:    Chester Lin <[email protected]>
  R:    Andreas Färber <[email protected]>
  R:    Matthias Brugger <[email protected]>
+ R:    NXP S32 Linux Team <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm64/boot/dts/freescale/s32g*.dts*
@@@ -2537,6 -2538,7 +2538,7 @@@ W:      http://www.armlinux.org.uk
  ARM/QUALCOMM SUPPORT
  M:    Andy Gross <[email protected]>
  M:    Bjorn Andersson <[email protected]>
+ R:    Konrad Dybcio <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git
@@@ -3614,16 -3616,18 +3616,18 @@@ S:   Maintaine
  F:    Documentation/devicetree/bindings/iio/accel/bosch,bma400.yaml
  F:    drivers/iio/accel/bma400*
  
- BPF (Safe dynamic programs and tools)
+ BPF [GENERAL] (Safe Dynamic Programs and Tools)
  M:    Alexei Starovoitov <[email protected]>
  M:    Daniel Borkmann <[email protected]>
  M:    Andrii Nakryiko <[email protected]>
- R:    Martin KaFai Lau <[email protected]>
- R:    Song Liu <song[email protected]>
+ R:    Martin KaFai Lau <[email protected]>
+ R:    Song Liu <song@kernel.org>
  R:    Yonghong Song <[email protected]>
  R:    John Fastabend <[email protected]>
  R:    KP Singh <[email protected]>
- L:    [email protected]
+ R:    Stanislav Fomichev <[email protected]>
+ R:    Hao Luo <[email protected]>
+ R:    Jiri Olsa <[email protected]>
  L:    [email protected]
  S:    Supported
  W:    https://bpf.io/
@@@ -3655,21 -3659,17 +3659,17 @@@ F:   scripts/pahole-version.s
  F:    tools/bpf/
  F:    tools/lib/bpf/
  F:    tools/testing/selftests/bpf/
- N:    bpf
- K:    bpf
  
  BPF JIT for ARM
  M:    Shubham Bansal <[email protected]>
- L:    [email protected]
  L:    [email protected]
- S:    Maintained
+ S:    Odd Fixes
  F:    arch/arm/net/
  
  BPF JIT for ARM64
  M:    Daniel Borkmann <[email protected]>
  M:    Alexei Starovoitov <[email protected]>
  M:    Zi Shen Lim <[email protected]>
- L:    [email protected]
  L:    [email protected]
  S:    Supported
  F:    arch/arm64/net/
  BPF JIT for MIPS (32-BIT AND 64-BIT)
  M:    Johan Almbladh <[email protected]>
  M:    Paul Burton <[email protected]>
- L:    [email protected]
  L:    [email protected]
  S:    Maintained
  F:    arch/mips/net/
  
  BPF JIT for NFP NICs
  M:    Jakub Kicinski <[email protected]>
- L:    [email protected]
  L:    [email protected]
- S:    Supported
+ S:    Odd Fixes
  F:    drivers/net/ethernet/netronome/nfp/bpf/
  
  BPF JIT for POWERPC (32-BIT AND 64-BIT)
  M:    Naveen N. Rao <[email protected]>
- L:    [email protected]
+ M:    Michael Ellerman <[email protected]>
  L:    [email protected]
- S:    Maintained
+ S:    Supported
  F:    arch/powerpc/net/
  
  BPF JIT for RISC-V (32-bit)
  M:    Luke Nelson <[email protected]>
  M:    Xi Wang <[email protected]>
- L:    [email protected]
  L:    [email protected]
  S:    Maintained
  F:    arch/riscv/net/
@@@ -3707,7 -3704,6 +3704,6 @@@ X:      arch/riscv/net/bpf_jit_comp64.
  
  BPF JIT for RISC-V (64-bit)
  M:    Björn Töpel <[email protected]>
- L:    [email protected]
  L:    [email protected]
  S:    Maintained
  F:    arch/riscv/net/
@@@ -3717,36 -3713,80 +3713,80 @@@ BPF JIT for S39
  M:    Ilya Leoshkevich <[email protected]>
  M:    Heiko Carstens <[email protected]>
  M:    Vasily Gorbik <[email protected]>
- L:    [email protected]
  L:    [email protected]
- S:    Maintained
+ S:    Supported
  F:    arch/s390/net/
  X:    arch/s390/net/pnet.c
  
  BPF JIT for SPARC (32-BIT AND 64-BIT)
  M:    David S. Miller <[email protected]>
- L:    [email protected]
  L:    [email protected]
- S:    Maintained
+ S:    Odd Fixes
  F:    arch/sparc/net/
  
  BPF JIT for X86 32-BIT
  M:    Wang YanQing <[email protected]>
- L:    [email protected]
  L:    [email protected]
- S:    Maintained
+ S:    Odd Fixes
  F:    arch/x86/net/bpf_jit_comp32.c
  
  BPF JIT for X86 64-BIT
  M:    Alexei Starovoitov <[email protected]>
  M:    Daniel Borkmann <[email protected]>
- L:    [email protected]
  L:    [email protected]
  S:    Supported
  F:    arch/x86/net/
  X:    arch/x86/net/bpf_jit_comp32.c
  
- BPF LSM (Security Audit and Enforcement using BPF)
+ BPF [CORE]
+ M:    Alexei Starovoitov <[email protected]>
+ M:    Daniel Borkmann <[email protected]>
+ R:    John Fastabend <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    kernel/bpf/verifier.c
+ F:    kernel/bpf/tnum.c
+ F:    kernel/bpf/core.c
+ F:    kernel/bpf/syscall.c
+ F:    kernel/bpf/dispatcher.c
+ F:    kernel/bpf/trampoline.c
+ F:    include/linux/bpf*
+ F:    include/linux/filter.h
+ BPF [BTF]
+ M:    Martin KaFai Lau <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    kernel/bpf/btf.c
+ F:    include/linux/btf*
+ BPF [TRACING]
+ M:    Song Liu <[email protected]>
+ R:    Jiri Olsa <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    kernel/trace/bpf_trace.c
+ F:    kernel/bpf/stackmap.c
+ BPF [NETWORKING] (tc BPF, sock_addr)
+ M:    Martin KaFai Lau <[email protected]>
+ M:    Daniel Borkmann <[email protected]>
+ R:    John Fastabend <[email protected]>
+ L:    [email protected]
+ L:    [email protected]
+ S:    Maintained
+ F:    net/core/filter.c
+ F:    net/sched/act_bpf.c
+ F:    net/sched/cls_bpf.c
+ BPF [NETWORKING] (struct_ops, reuseport)
+ M:    Martin KaFai Lau <[email protected]>
+ L:    [email protected]
+ L:    [email protected]
+ S:    Maintained
+ F:    kernel/bpf/bpf_struct*
+ BPF [SECURITY & LSM] (Security Audit and Enforcement using BPF)
  M:    KP Singh <[email protected]>
  R:    Florent Revest <[email protected]>
  R:    Brendan Jackman <[email protected]>
@@@ -3757,13 -3797,64 +3797,64 @@@ F:   include/linux/bpf_lsm.
  F:    kernel/bpf/bpf_lsm.c
  F:    security/bpf/
  
- BPFTOOL
+ BPF [STORAGE & CGROUPS]
+ M:    Martin KaFai Lau <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    kernel/bpf/cgroup.c
+ F:    kernel/bpf/*storage.c
+ F:    kernel/bpf/bpf_lru*
+ BPF [RINGBUF]
+ M:    Andrii Nakryiko <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    kernel/bpf/ringbuf.c
+ BPF [ITERATOR]
+ M:    Yonghong Song <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    kernel/bpf/*iter.c
+ BPF [L7 FRAMEWORK] (sockmap)
+ M:    John Fastabend <[email protected]>
+ M:    Jakub Sitnicki <[email protected]>
+ L:    [email protected]
+ L:    [email protected]
+ S:    Maintained
+ F:    include/linux/skmsg.h
+ F:    net/core/skmsg.c
+ F:    net/core/sock_map.c
+ F:    net/ipv4/tcp_bpf.c
+ F:    net/ipv4/udp_bpf.c
+ F:    net/unix/unix_bpf.c
+ BPF [LIBRARY] (libbpf)
+ M:    Andrii Nakryiko <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    tools/lib/bpf/
+ BPF [TOOLING] (bpftool)
  M:    Quentin Monnet <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    kernel/bpf/disasm.*
  F:    tools/bpf/bpftool/
  
+ BPF [SELFTESTS] (Test Runners & Infrastructure)
+ M:    Andrii Nakryiko <[email protected]>
+ R:    Mykola Lysenko <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    tools/testing/selftests/bpf/
+ BPF [MISC]
+ L:    [email protected]
+ S:    Odd Fixes
+ K:    (?:\b|_)bpf(?:\b|_)
  BROADCOM B44 10/100 ETHERNET DRIVER
  M:    Michael Chan <[email protected]>
  L:    [email protected]
@@@ -3796,12 -3887,12 +3887,12 @@@ N:   bcmbc
  N:    bcm[9]?47622
  
  BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE
- M:    Nicolas Saenz Julienne <[email protected]>
+ M:    Florian Fainelli <[email protected]>
  R:    Broadcom internal kernel review list <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
- T:    git git://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git
+ T:    git git://github.com/broadcom/stblinux.git
  F:    Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
  F:    drivers/pci/controller/pcie-brcmstb.c
  F:    drivers/staging/vc04_services
@@@ -4959,6 -5050,7 +5050,7 @@@ Q:      http://patchwork.kernel.org/project/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git
  F:    Documentation/devicetree/bindings/clock/
  F:    drivers/clk/
+ F:    include/dt-bindings/clock/
  F:    include/linux/clk-pr*
  F:    include/linux/clk/
  F:    include/linux/of_clk.h
@@@ -5009,7 -5101,7 +5101,7 @@@ COMPUTE EXPRESS LINK (CXL
  M:    Alison Schofield <[email protected]>
  M:    Vishal Verma <[email protected]>
  M:    Ira Weiny <[email protected]>
- M:    Ben Widawsky <b[email protected]>
+ M:    Ben Widawsky <b[email protected]>
  M:    Dan Williams <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -5961,7 -6053,7 +6053,7 @@@ DMA MAPPING HELPER
  M:    Christoph Hellwig <[email protected]>
  M:    Marek Szyprowski <[email protected]>
  R:    Robin Murphy <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  S:    Supported
  W:    http://git.infradead.org/users/hch/dma-mapping.git
  T:    git git://git.infradead.org/users/hch/dma-mapping.git
@@@ -5973,7 -6065,7 +6065,7 @@@ F:      kernel/dma
  
  DMA MAPPING BENCHMARK
  M:    Xiang Chen <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  F:    kernel/dma/map_benchmark.c
  F:    tools/testing/selftests/dma/
  
@@@ -6226,13 -6318,6 +6318,13 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/display/bridge/chipone,icn6211.yaml
  F:    drivers/gpu/drm/bridge/chipone-icn6211.c
  
 +DRM DRIVER FOR EBBG FT8719 PANEL
 +M:    Joel Selvaraj <[email protected]>
 +S:    Maintained
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
 +F:    Documentation/devicetree/bindings/display/panel/ebbg,ft8719.yaml
 +F:    drivers/gpu/drm/panel/panel-ebbg-ft8719.c
 +
  DRM DRIVER FOR FARADAY TVE200 TV ENCODER
  M:    Linus Walleij <[email protected]>
  S:    Maintained
@@@ -6291,12 -6376,6 +6383,12 @@@ S:    Orphan / Obsolet
  F:    drivers/gpu/drm/i810/
  F:    include/uapi/drm/i810_drm.h
  
 +DRM DRIVER FOR LOGICVC DISPLAY CONTROLLER
 +M:    Paul Kocialkowski <[email protected]>
 +S:    Supported
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
 +F:    drivers/gpu/drm/logicvc/
 +
  DRM DRIVER FOR LVDS PANELS
  M:    Laurent Pinchart <[email protected]>
  L:    [email protected]
@@@ -6473,17 -6552,12 +6565,17 @@@ S:   Orphan / Obsolet
  F:    drivers/gpu/drm/savage/
  F:    include/uapi/drm/savage_drm.h
  
 -DRM DRIVER FOR SIMPLE FRAMEBUFFERS
 +DRM DRIVER FOR FIRMWARE FRAMEBUFFERS
  M:    Thomas Zimmermann <[email protected]>
 +M:    Javier Martinez Canillas <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git git://anongit.freedesktop.org/drm/drm-misc
 +F:    drivers/gpu/drm/drm_aperture.c
  F:    drivers/gpu/drm/tiny/simpledrm.c
 +F:    drivers/video/aperture.c
 +F:    include/drm/drm_aperture.h
 +F:    include/linux/aperture.h
  
  DRM DRIVER FOR SIS VIDEO CARDS
  S:    Orphan / Obsolete
@@@ -6521,12 -6595,6 +6613,12 @@@ DRM DRIVER FOR TDFX VIDEO CARD
  S:    Orphan / Obsolete
  F:    drivers/gpu/drm/tdfx/
  
 +DRM DRIVER FOR TI DLPC3433 MIPI DSI TO DMD BRIDGE
 +M:    Jagan Teki <[email protected]>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/display/bridge/ti,dlpc3433.yaml
 +F:    drivers/gpu/drm/bridge/ti-dlpc3433.c
 +
  DRM DRIVER FOR TI SN65DSI86 BRIDGE CHIP
  R:    Douglas Anderson <[email protected]>
  F:    Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml
@@@ -6685,16 -6753,6 +6777,16 @@@ F:    Documentation/devicetree/bindings/di
  F:    drivers/gpu/drm/imx/
  F:    drivers/gpu/ipu-v3/
  
 +DRM DRIVERS FOR FREESCALE IMX BRIDGE
 +M:    Liu Ying <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-ldb.yaml
 +F:    Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-combiner.yaml
 +F:    Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-link.yaml
 +F:    Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml
 +F:    drivers/gpu/drm/bridge/imx/
 +
  DRM DRIVERS FOR GMA500 (Poulsbo, Moorestown and derivative chipsets)
  M:    Patrik Jakobsson <[email protected]>
  L:    [email protected]
@@@ -6748,7 -6806,7 +6840,7 @@@ L:      [email protected]
  L:    [email protected]
  S:    Supported
  T:    git git://anongit.freedesktop.org/tegra/linux.git
 -F:    Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt
 +F:    Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml
  F:    Documentation/devicetree/bindings/gpu/host1x/
  F:    drivers/gpu/drm/tegra/
  F:    drivers/gpu/host1x/
@@@ -6825,7 -6883,6 +6917,7 @@@ F:      drivers/gpu/drm/omapdrm
  
  DRM DRIVERS FOR V3D
  M:    Emma Anholt <[email protected]>
 +M:    Melissa Wen <[email protected]>
  S:    Supported
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  F:    Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml
@@@ -7592,7 -7649,7 +7684,7 @@@ F:      drivers/gpu/drm/exynos/exynos_dp
  
  EXYNOS SYSMMU (IOMMU) driver
  M:    Marek Szyprowski <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  S:    Maintained
  F:    drivers/iommu/exynos-iommu.c
  
@@@ -8514,6 -8571,7 +8606,7 @@@ F:      Documentation/devicetree/bindings/gp
  F:    Documentation/driver-api/gpio/
  F:    drivers/gpio/
  F:    include/asm-generic/gpio.h
+ F:    include/dt-bindings/gpio/
  F:    include/linux/gpio.h
  F:    include/linux/gpio/
  F:    include/linux/of_gpio.h
@@@ -9167,6 -9225,7 +9260,7 @@@ F:      drivers/media/platform/st/sti/hv
  
  HWPOISON MEMORY FAILURE HANDLING
  M:    Naoya Horiguchi <[email protected]>
+ R:    Miaohe Lin <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    mm/hwpoison-inject.c
@@@ -9311,6 -9370,7 +9405,7 @@@ T:      git git://git.kernel.org/pub/scm/lin
  F:    Documentation/devicetree/bindings/i2c/i2c.txt
  F:    Documentation/i2c/
  F:    drivers/i2c/*
+ F:    include/dt-bindings/i2c/i2c.h
  F:    include/linux/i2c-dev.h
  F:    include/linux/i2c-smbus.h
  F:    include/linux/i2c.h
@@@ -9326,6 -9386,7 +9421,7 @@@ T:      git git://git.kernel.org/pub/scm/lin
  F:    Documentation/devicetree/bindings/i2c/
  F:    drivers/i2c/algos/
  F:    drivers/i2c/busses/
+ F:    include/dt-bindings/i2c/
  
  I2C-TAOS-EVM DRIVER
  M:    Jean Delvare <[email protected]>
@@@ -9846,7 -9907,10 +9942,10 @@@ INTEL ASoC DRIVER
  M:    Cezary Rojewski <[email protected]>
  M:    Pierre-Louis Bossart <[email protected]>
  M:    Liam Girdwood <[email protected]>
- M:    Jie Yang <[email protected]>
+ M:    Peter Ujfalusi <[email protected]>
+ M:    Bard Liao <[email protected]>
+ M:    Ranjani Sridharan <[email protected]>
+ M:    Kai Vehmanen <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Supported
  F:    sound/soc/intel/
@@@ -10009,7 -10073,7 +10108,7 @@@ F:   drivers/hid/intel-ish-hid
  INTEL IOMMU (VT-d)
  M:    David Woodhouse <[email protected]>
  M:    Lu Baolu <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
  F:    drivers/iommu/intel/
@@@ -10388,7 -10452,7 +10487,7 @@@ F:   include/linux/iomap.
  IOMMU DRIVERS
  M:    Joerg Roedel <[email protected]>
  M:    Will Deacon <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
  F:    Documentation/devicetree/bindings/iommu/
@@@ -10865,6 -10929,7 +10964,7 @@@ M:   Marc Zyngier <[email protected]
  R:    James Morse <[email protected]>
  R:    Alexandru Elisei <[email protected]>
  R:    Suzuki K Poulose <[email protected]>
+ R:    Oliver Upton <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
@@@ -10907,7 -10972,6 +11007,6 @@@ F:   arch/riscv/include/asm/kvm
  F:    arch/riscv/include/uapi/asm/kvm*
  F:    arch/riscv/kvm/
  F:    tools/testing/selftests/kvm/*/riscv/
- F:    tools/testing/selftests/kvm/riscv/
  
  KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
  M:    Christian Borntraeger <[email protected]>
@@@ -10932,28 -10996,51 +11031,51 @@@ F:        tools/testing/selftests/kvm/*/s390x
  F:    tools/testing/selftests/kvm/s390x/
  
  KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)
+ M:    Sean Christopherson <[email protected]>
  M:    Paolo Bonzini <[email protected]>
- R:    Sean Christopherson <[email protected]>
- R:    Vitaly Kuznetsov <[email protected]>
- R:    Wanpeng Li <[email protected]>
- R:    Jim Mattson <[email protected]>
- R:    Joerg Roedel <[email protected]>
  L:    [email protected]
  S:    Supported
- W:    http://www.linux-kvm.org
  T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
  F:    arch/x86/include/asm/kvm*
- F:    arch/x86/include/asm/pvclock-abi.h
  F:    arch/x86/include/asm/svm.h
  F:    arch/x86/include/asm/vmx*.h
  F:    arch/x86/include/uapi/asm/kvm*
  F:    arch/x86/include/uapi/asm/svm.h
  F:    arch/x86/include/uapi/asm/vmx.h
- F:    arch/x86/kernel/kvm.c
- F:    arch/x86/kernel/kvmclock.c
  F:    arch/x86/kvm/
  F:    arch/x86/kvm/*/
  
+ KVM PARAVIRT (KVM/paravirt)
+ M:    Paolo Bonzini <[email protected]>
+ R:    Wanpeng Li <[email protected]>
+ R:    Vitaly Kuznetsov <[email protected]>
+ L:    [email protected]
+ S:    Supported
+ T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+ F:    arch/x86/kernel/kvm.c
+ F:    arch/x86/kernel/kvmclock.c
+ F:    arch/x86/include/asm/pvclock-abi.h
+ F:    include/linux/kvm_para.h
+ F:    include/uapi/linux/kvm_para.h
+ F:    include/uapi/asm-generic/kvm_para.h
+ F:    include/asm-generic/kvm_para.h
+ F:    arch/um/include/asm/kvm_para.h
+ F:    arch/x86/include/asm/kvm_para.h
+ F:    arch/x86/include/uapi/asm/kvm_para.h
+ KVM X86 HYPER-V (KVM/hyper-v)
+ M:    Vitaly Kuznetsov <[email protected]>
+ M:    Sean Christopherson <[email protected]>
+ M:    Paolo Bonzini <[email protected]>
+ L:    [email protected]
+ S:    Supported
+ T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+ F:    arch/x86/kvm/hyperv.*
+ F:    arch/x86/kvm/kvm_onhyperv.*
+ F:    arch/x86/kvm/svm/hyperv.*
+ F:    arch/x86/kvm/svm/svm_onhyperv.*
+ F:    arch/x86/kvm/vmx/evmcs.*
  KERNFS
  M:    Greg Kroah-Hartman <[email protected]>
  M:    Tejun Heo <[email protected]>
@@@ -11132,20 -11219,6 +11254,6 @@@ S:  Maintaine
  F:    include/net/l3mdev.h
  F:    net/l3mdev
  
- L7 BPF FRAMEWORK
- M:    John Fastabend <[email protected]>
- M:    Daniel Borkmann <[email protected]>
- M:    Jakub Sitnicki <[email protected]>
- L:    [email protected]
- L:    [email protected]
- S:    Maintained
- F:    include/linux/skmsg.h
- F:    net/core/skmsg.c
- F:    net/core/sock_map.c
- F:    net/ipv4/tcp_bpf.c
- F:    net/ipv4/udp_bpf.c
- F:    net/unix/unix_bpf.c
  LANDLOCK SECURITY MODULE
  M:    Mickaël Salaün <[email protected]>
  L:    [email protected]
@@@ -11625,6 -11698,7 +11733,7 @@@ F:   drivers/gpu/drm/bridge/lontium-lt891
  LOONGARCH
  M:    Huacai Chen <[email protected]>
  R:    WANG Xuerui <[email protected]>
+ L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git
  F:    arch/loongarch/
@@@ -12537,7 -12611,7 +12646,7 @@@ F:   drivers/i2c/busses/i2c-mt65xx.
  
  MEDIATEK IOMMU DRIVER
  M:    Yong Wu <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  L:    [email protected] (moderated for non-subscribers)
  S:    Supported
  F:    Documentation/devicetree/bindings/iommu/mediatek*
@@@ -12880,9 -12954,8 +12989,8 @@@ M:   Andrew Morton <akpm@linux-foundation
  L:    [email protected]
  S:    Maintained
  W:    http://www.linux-mm.org
- T:    quilt https://ozlabs.org/~akpm/mmotm/
- T:    quilt https://ozlabs.org/~akpm/mmots/
- T:    git git://github.com/hnaz/linux-mm.git
+ T:    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
+ T:    quilt git://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new
  F:    include/linux/gfp.h
  F:    include/linux/memory_hotplug.h
  F:    include/linux/mm.h
@@@ -12892,6 -12965,18 +13000,18 @@@ F: include/linux/vmalloc.
  F:    mm/
  F:    tools/testing/selftests/vm/
  
+ MEMORY HOT(UN)PLUG
+ M:    David Hildenbrand <[email protected]>
+ M:    Oscar Salvador <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    Documentation/admin-guide/mm/memory-hotplug.rst
+ F:    Documentation/core-api/memory-hotplug.rst
+ F:    drivers/base/memory.c
+ F:    include/linux/memory_hotplug.h
+ F:    mm/memory_hotplug.c
+ F:    tools/testing/selftests/memory-hotplug/
  MEMORY TECHNOLOGY DEVICES (MTD)
  M:    Miquel Raynal <[email protected]>
  M:    Richard Weinberger <[email protected]>
@@@ -13836,6 -13921,7 +13956,7 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    Documentation/devicetree/bindings/net/
  F:    drivers/connector/
  F:    drivers/net/
+ F:    include/dt-bindings/net/
  F:    include/linux/etherdevice.h
  F:    include/linux/fcdevice.h
  F:    include/linux/fddidevice.h
@@@ -13987,7 -14073,6 +14108,6 @@@ F:   net/ipv6/tcp*.
  NETWORKING [TLS]
  M:    Boris Pismenny <[email protected]>
  M:    John Fastabend <[email protected]>
- M:    Daniel Borkmann <[email protected]>
  M:    Jakub Kicinski <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -14296,7 -14381,7 +14416,7 @@@ F:   drivers/iio/gyro/fxas21002c_i2c.
  F:    drivers/iio/gyro/fxas21002c_spi.c
  
  NXP i.MX CLOCK DRIVERS
- M:    Abel Vesa <abel[email protected]>
+ M:    Abel Vesa <abel[email protected]>
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
@@@ -14384,9 -14469,8 +14504,8 @@@ F:   Documentation/devicetree/bindings/so
  F:    sound/soc/codecs/tfa989x.c
  
  NXP-NCI NFC DRIVER
- R:    Charles Gorand <[email protected]>
  L:    [email protected] (subscribers-only)
- S:    Supported
+ S:    Orphan
  F:    Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml
  F:    drivers/nfc/nxp-nci
  
@@@ -14904,6 -14988,7 +15023,7 @@@ F:   include/dt-bindings
  
  OPENCOMPUTE PTP CLOCK DRIVER
  M:    Jonathan Lemon <[email protected]>
+ M:    Vadim Fedorenko <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    drivers/ptp/ptp_ocp.c
@@@ -15774,7 -15859,7 +15894,7 @@@ F:   drivers/pinctrl/freescale
  PIN CONTROLLER - INTEL
  M:    Mika Westerberg <[email protected]>
  M:    Andy Shevchenko <[email protected]>
- S:    Maintained
+ S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git
  F:    drivers/pinctrl/intel/
  
@@@ -16296,7 -16381,7 +16416,7 @@@ F:   drivers/crypto/qat
  
  QCOM AUDIO (ASoC) DRIVERS
  M:    Srinivas Kandagatla <[email protected]>
- M:    Banajit Goswami <bgoswami@codeaurora.org>
+ M:    Banajit Goswami <bgoswami@quicinc.com>
  L:    [email protected] (moderated for non-subscribers)
  S:    Supported
  F:    sound/soc/codecs/lpass-va-macro.c
@@@ -16523,7 -16608,7 +16643,7 @@@ F:   Documentation/devicetree/bindings/op
  F:    drivers/cpufreq/qcom-cpufreq-nvmem.c
  
  QUALCOMM CRYPTO DRIVERS
- M:    Thara Gopinath <thara.gopinath@linaro.org>
+ M:    Thara Gopinath <thara.gopinath@gmail.com>
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
@@@ -16577,7 -16662,7 +16697,7 @@@ F:   drivers/i2c/busses/i2c-qcom-cci.
  
  QUALCOMM IOMMU
  M:    Rob Clark <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  L:    [email protected]
  S:    Maintained
  F:    drivers/iommu/arm/arm-smmu/qcom_iommu.c
@@@ -16633,7 -16718,7 +16753,7 @@@ F:   include/linux/if_rmnet.
  
  QUALCOMM TSENS THERMAL DRIVER
  M:    Amit Kucheria <[email protected]>
- M:    Thara Gopinath <thara.gopinath@linaro.org>
+ M:    Thara Gopinath <thara.gopinath@gmail.com>
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
@@@ -18090,6 -18175,7 +18210,7 @@@ F:   drivers/misc/sgi-xp
  
  SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
  M:    Karsten Graul <[email protected]>
+ M:    Wenjia Zhang <[email protected]>
  L:    [email protected]
  S:    Supported
  W:    http://www.ibm.com/developerworks/linux/linux390/
@@@ -18722,8 -18808,10 +18843,10 @@@ F: sound/soc
  SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS
  M:    Pierre-Louis Bossart <[email protected]>
  M:    Liam Girdwood <[email protected]>
+ M:    Peter Ujfalusi <[email protected]>
+ M:    Bard Liao <[email protected]>
  M:    Ranjani Sridharan <[email protected]>
M:    Kai Vehmanen <[email protected]>
R:    Kai Vehmanen <[email protected]>
  M:    Daniel Baluta <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Supported
@@@ -19202,7 -19290,7 +19325,7 @@@ F:   arch/x86/boot/video
  
  SWIOTLB SUBSYSTEM
  M:    Christoph Hellwig <[email protected]>
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  S:    Supported
  W:    http://git.infradead.org/users/hch/dma-mapping.git
  T:    git git://git.infradead.org/users/hch/dma-mapping.git
@@@ -19340,7 -19428,7 +19463,7 @@@ R:   Andy Shevchenko <andriy.shevchenko@l
  R:    Mika Westerberg <[email protected]>
  R:    Jan Dabros <[email protected]>
  L:    [email protected]
- S:    Maintained
+ S:    Supported
  F:    drivers/i2c/busses/i2c-designware-*
  
  SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER
@@@ -19682,7 -19770,7 +19805,7 @@@ M:   Sowjanya Komatineni <skomatineni@nvi
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt
 +F:    Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.yaml
  F:    drivers/staging/media/tegra-video/
  
  TEGRA XUSB PADCTL DRIVER
@@@ -20747,6 -20835,7 +20870,7 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    Documentation/devicetree/bindings/usb/
  F:    Documentation/usb/
  F:    drivers/usb/
+ F:    include/dt-bindings/usb/
  F:    include/linux/usb.h
  F:    include/linux/usb/
  
@@@ -21876,7 -21965,7 +22000,7 @@@ XEN SWIOTLB SUBSYSTE
  M:    Juergen Gross <[email protected]>
  M:    Stefano Stabellini <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
- L:    [email protected]-foundation.org
+ L:    [email protected].dev
  S:    Supported
  F:    arch/x86/xen/*swiotlb*
  F:    drivers/xen/*swiotlb*
index 384cb3d06ff3b65e9ad8b4a1efaf0b3e27de1129,9631f2fd2faf7f2d575c2fae4872e7eccecad722..38e8767ec371531695a8aed5fd77c26099389ce2
@@@ -32,8 -32,11 +32,11 @@@ static vm_fault_t udmabuf_vm_fault(stru
  {
        struct vm_area_struct *vma = vmf->vma;
        struct udmabuf *ubuf = vma->vm_private_data;
+       pgoff_t pgoff = vmf->pgoff;
  
-       vmf->page = ubuf->pages[vmf->pgoff];
+       if (pgoff >= ubuf->pagecount)
+               return VM_FAULT_SIGBUS;
+       vmf->page = ubuf->pages[pgoff];
        get_page(vmf->page);
        return 0;
  }
@@@ -365,23 -368,7 +368,23 @@@ static struct miscdevice udmabuf_misc 
  
  static int __init udmabuf_dev_init(void)
  {
 -      return misc_register(&udmabuf_misc);
 +      int ret;
 +
 +      ret = misc_register(&udmabuf_misc);
 +      if (ret < 0) {
 +              pr_err("Could not initialize udmabuf device\n");
 +              return ret;
 +      }
 +
 +      ret = dma_coerce_mask_and_coherent(udmabuf_misc.this_device,
 +                                         DMA_BIT_MASK(64));
 +      if (ret < 0) {
 +              pr_err("Could not setup DMA mask for udmabuf device\n");
 +              misc_deregister(&udmabuf_misc);
 +              return ret;
 +      }
 +
 +      return 0;
  }
  
  static void __exit udmabuf_dev_exit(void)
index 1276edf0fc0df317c1a70716ed21cf32d1406143,df87ba99a87c053a59b58b013a7a343ffcd58573..7a9eeed239f35349374d01cb551d96dba585ebac
@@@ -152,6 -152,12 +152,12 @@@ static const struct dmi_system_id orien
                  DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AYA NEO 2021"),
                },
                .driver_data = (void *)&lcd800x1280_rightside_up,
+       }, {    /* AYA NEO NEXT */
+               .matches = {
+                 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
+                 DMI_MATCH(DMI_BOARD_NAME, "NEXT"),
+               },
+               .driver_data = (void *)&lcd800x1280_rightside_up,
        }, {    /* Chuwi HiBook (CWI514) */
                .matches = {
                        DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
                },
                .driver_data = (void *)&lcd800x1280_rightside_up,
        }, {    /*
 -               * GPD Pocket, note that the the DMI data is less generic then
 +               * GPD Pocket, note that the DMI data is less generic then
                 * it seems, devices with a board-vendor of "AMI Corporation"
                 * are quite rare, as are devices which have both board- *and*
                 * product-id set to "Default String"
index 45846c7833e5cb4b90900f9528d55aa473c16833,0ec809ab06e72a2bbf291ade1195179bf782d8e1..5b05e0ce7a2752b07dc288bb55cdca84606b52b8
@@@ -7,8 -7,6 +7,8 @@@
  
  #include <linux/debugfs.h>
  
 +#include <drm/drm_framebuffer.h>
 +
  #include "dpu_encoder_phys.h"
  #include "dpu_formats.h"
  #include "dpu_hw_top.h"
@@@ -254,11 -252,6 +254,6 @@@ static int dpu_encoder_phys_wb_atomic_c
        DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n",
                        phys_enc->wb_idx, mode->name, mode->hdisplay, mode->vdisplay);
  
-       if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
-               return 0;
-       fb = conn_state->writeback_job->fb;
        if (!conn_state || !conn_state->connector) {
                DPU_ERROR("invalid connector state\n");
                return -EINVAL;
                return -EINVAL;
        }
  
+       if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
+               return 0;
+       fb = conn_state->writeback_job->fb;
        DPU_DEBUG("[fb_id:%u][fb:%u,%u]\n", fb->base.id,
                        fb->width, fb->height);
  
index 1ea62ecafb2e984653728bc67a4a1b29afc2765c,2fd787079f9b024875e502e5b2c4fcaa2a11221a..088ec990a2f2656c9aeec06808e73b7b554042c2
@@@ -3,8 -3,6 +3,8 @@@
   * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
   */
  
 +#include <drm/drm_edid.h>
 +
  #include "dpu_writeback.h"
  
  static int dpu_wb_conn_get_modes(struct drm_connector *connector)
        struct msm_drm_private *priv = dev->dev_private;
        struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
  
-       return drm_add_modes_noedid(connector, dpu_kms->catalog->caps->max_linewidth,
+       /*
+        * We should ideally be limiting the modes only to the maxlinewidth but
+        * on some chipsets this will allow even 4k modes to be added which will
+        * fail the per SSPP bandwidth checks. So, till we have dual-SSPP support
+        * and source split support added lets limit the modes based on max_mixer_width
+        * as 4K modes can then be supported.
+        */
+       return drm_add_modes_noedid(connector, dpu_kms->catalog->caps->max_mixer_width,
                        dev->mode_config.max_height);
  }
  
index a0920e173fcc7fa14e6bee727c148abab0b0577b,85fb9e800ddf7d9eece48e8f2d84f76ca5328774..648dd0b5b1165f4036ab1ef8a465003d8dd9e299
@@@ -8,7 -8,6 +8,7 @@@
  
  #include <drm/drm_atomic.h>
  #include <drm/drm_atomic_helper.h>
 +#include <drm/drm_blend.h>
  #include <drm/drm_gem_atomic_helper.h>
  #include <drm/drm_plane_helper.h>
  
@@@ -118,7 -117,7 +118,7 @@@ static bool sun4i_layer_format_mod_supp
        struct sun4i_layer *layer = plane_to_sun4i_layer(plane);
  
        if (IS_ERR_OR_NULL(layer->backend->frontend))
-               sun4i_backend_format_is_supported(format, modifier);
+               return sun4i_backend_format_is_supported(format, modifier);
  
        return sun4i_backend_format_is_supported(format, modifier) ||
               sun4i_frontend_format_is_supported(format, modifier);
index f082b8ecfe2c924418cb2b9531e39395f42b019a,9ad09522947a5ebfa7d6c6920c71c1adbf65be2a..ab80d52a70bbee639a5739fd3f374cf7d29f891d
@@@ -9,7 -9,6 +9,6 @@@
  #include <drm/bridge/dw_hdmi.h>
  #include <drm/drm_encoder.h>
  #include <linux/clk.h>
- #include <linux/gpio/consumer.h>
  #include <linux/regmap.h>
  #include <linux/regulator/consumer.h>
  #include <linux/reset.h>
@@@ -151,11 -150,16 +150,11 @@@ struct sun8i_hdmi_phy
  struct sun8i_hdmi_phy_variant {
        bool has_phy_clk;
        bool has_second_pll;
 -      unsigned int is_custom_phy : 1;
        const struct dw_hdmi_curr_ctrl *cur_ctr;
        const struct dw_hdmi_mpll_config *mpll_cfg;
        const struct dw_hdmi_phy_config *phy_cfg;
 +      const struct dw_hdmi_phy_ops *phy_ops;
        void (*phy_init)(struct sun8i_hdmi_phy *phy);
 -      void (*phy_disable)(struct dw_hdmi *hdmi,
 -                          struct sun8i_hdmi_phy *phy);
 -      int  (*phy_config)(struct dw_hdmi *hdmi,
 -                         struct sun8i_hdmi_phy *phy,
 -                         unsigned int clk_rate);
  };
  
  struct sun8i_hdmi_phy {
        unsigned int                    rcal;
        struct regmap                   *regs;
        struct reset_control            *rst_phy;
 -      struct sun8i_hdmi_phy_variant   *variant;
 +      const struct sun8i_hdmi_phy_variant *variant;
  };
  
  struct sun8i_dw_hdmi_quirks {
@@@ -188,7 -192,6 +187,6 @@@ struct sun8i_dw_hdmi 
        struct regulator                *regulator;
        const struct sun8i_dw_hdmi_quirks *quirks;
        struct reset_control            *rst_ctrl;
-       struct gpio_desc                *ddc_en;
  };
  
  extern struct platform_driver sun8i_hdmi_phy_driver;
index 296af2b89951abdc4fd12a7769bba284551713af,406e9c324e76a824ca0e8e0ddbfc41626d5a0b58..0e210df65c305393477085e8cfcf6032587b2c8d
  
  #include "ttm_module.h"
  
 -/* default destructor */
 -static void ttm_bo_default_destroy(struct ttm_buffer_object *bo)
 -{
 -      kfree(bo);
 -}
 -
  static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo,
                                        struct ttm_placement *placement)
  {
@@@ -103,11 -109,11 +103,11 @@@ void ttm_bo_set_bulk_move(struct ttm_bu
                return;
  
        spin_lock(&bo->bdev->lru_lock);
-       if (bo->bulk_move && bo->resource)
-               ttm_lru_bulk_move_del(bo->bulk_move, bo->resource);
+       if (bo->resource)
+               ttm_resource_del_bulk_move(bo->resource, bo);
        bo->bulk_move = bulk;
-       if (bo->bulk_move && bo->resource)
-               ttm_lru_bulk_move_add(bo->bulk_move, bo->resource);
+       if (bo->resource)
+               ttm_resource_add_bulk_move(bo->resource, bo);
        spin_unlock(&bo->bdev->lru_lock);
  }
  EXPORT_SYMBOL(ttm_bo_set_bulk_move);
@@@ -683,8 -689,11 +683,11 @@@ void ttm_bo_pin(struct ttm_buffer_objec
  {
        dma_resv_assert_held(bo->base.resv);
        WARN_ON_ONCE(!kref_read(&bo->kref));
-       if (!(bo->pin_count++) && bo->bulk_move && bo->resource)
-               ttm_lru_bulk_move_del(bo->bulk_move, bo->resource);
+       spin_lock(&bo->bdev->lru_lock);
+       if (bo->resource)
+               ttm_resource_del_bulk_move(bo->resource, bo);
+       ++bo->pin_count;
+       spin_unlock(&bo->bdev->lru_lock);
  }
  EXPORT_SYMBOL(ttm_bo_pin);
  
@@@ -701,8 -710,11 +704,11 @@@ void ttm_bo_unpin(struct ttm_buffer_obj
        if (WARN_ON_ONCE(!bo->pin_count))
                return;
  
-       if (!(--bo->pin_count) && bo->bulk_move && bo->resource)
-               ttm_lru_bulk_move_add(bo->bulk_move, bo->resource);
+       spin_lock(&bo->bdev->lru_lock);
+       --bo->pin_count;
+       if (bo->resource)
+               ttm_resource_add_bulk_move(bo->resource, bo);
+       spin_unlock(&bo->bdev->lru_lock);
  }
  EXPORT_SYMBOL(ttm_bo_unpin);
  
@@@ -930,7 -942,8 +936,7 @@@ int ttm_bo_init_reserved(struct ttm_dev
        bool locked;
        int ret;
  
 -      bo->destroy = destroy ? destroy : ttm_bo_default_destroy;
 -
 +      bo->destroy = destroy;
        kref_init(&bo->kref);
        INIT_LIST_HEAD(&bo->ddestroy);
        bo->bdev = bdev;
index 3700d737ee7184aea3bd42d3ff98b4b73a9a2471,b8d856312846416151de3d6b2a5812f0ab34f857..0846d56f74f2d4ecc05444e5fe615919ab3f5b14
@@@ -18,8 -18,6 +18,8 @@@
  
  #include <linux/dma-buf.h>
  
 +#include <drm/drm_fourcc.h>
 +
  #include "vc4_drv.h"
  #include "uapi/drm/vc4_drm.h"
  
@@@ -250,6 -248,9 +250,9 @@@ void vc4_bo_add_to_purgeable_pool(struc
  {
        struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev);
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
        mutex_lock(&vc4->purgeable.lock);
        list_add_tail(&bo->size_head, &vc4->purgeable.list);
        vc4->purgeable.num++;
@@@ -261,6 -262,9 +264,9 @@@ static void vc4_bo_remove_from_purgeabl
  {
        struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev);
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
        /* list_del_init() is used here because the caller might release
         * the purgeable lock in order to acquire the madv one and update the
         * madv status.
@@@ -389,6 -393,9 +395,9 @@@ struct drm_gem_object *vc4_create_objec
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_bo *bo;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return ERR_PTR(-ENODEV);
        bo = kzalloc(sizeof(*bo), GFP_KERNEL);
        if (!bo)
                return ERR_PTR(-ENOMEM);
@@@ -415,6 -422,9 +424,9 @@@ struct vc4_bo *vc4_bo_create(struct drm
        struct drm_gem_cma_object *cma_obj;
        struct vc4_bo *bo;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return ERR_PTR(-ENODEV);
        if (size == 0)
                return ERR_PTR(-EINVAL);
  
        return bo;
  }
  
- int vc4_dumb_create(struct drm_file *file_priv,
-                   struct drm_device *dev,
-                   struct drm_mode_create_dumb *args)
+ int vc4_bo_dumb_create(struct drm_file *file_priv,
+                      struct drm_device *dev,
+                      struct drm_mode_create_dumb *args)
  {
-       int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_bo *bo = NULL;
        int ret;
  
-       if (args->pitch < min_pitch)
-               args->pitch = min_pitch;
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
  
-       if (args->size < args->pitch * args->height)
-               args->size = args->pitch * args->height;
+       ret = vc4_dumb_fixup_args(args);
+       if (ret)
+               return ret;
  
        bo = vc4_bo_create(dev, args->size, false, VC4_BO_TYPE_DUMB);
        if (IS_ERR(bo))
@@@ -603,8 -614,12 +616,12 @@@ static void vc4_bo_cache_time_work(stru
  
  int vc4_bo_inc_usecnt(struct vc4_bo *bo)
  {
+       struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev);
        int ret;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        /* Fast path: if the BO is already retained by someone, no need to
         * check the madv status.
         */
  
  void vc4_bo_dec_usecnt(struct vc4_bo *bo)
  {
+       struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev);
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
        /* Fast path: if the BO is still retained by someone, no need to test
         * the madv value.
         */
@@@ -758,6 -778,9 +780,9 @@@ int vc4_create_bo_ioctl(struct drm_devi
        struct vc4_bo *bo = NULL;
        int ret;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        ret = vc4_grab_bin_bo(vc4, vc4file);
        if (ret)
                return ret;
  int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data,
                      struct drm_file *file_priv)
  {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_vc4_mmap_bo *args = data;
        struct drm_gem_object *gem_obj;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        gem_obj = drm_gem_object_lookup(file_priv, args->handle);
        if (!gem_obj) {
                DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle);
@@@ -807,6 -834,9 +836,9 @@@ vc4_create_shader_bo_ioctl(struct drm_d
        struct vc4_bo *bo = NULL;
        int ret;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        if (args->size == 0)
                return -EINVAL;
  
@@@ -877,11 -907,15 +909,15 @@@ fail
  int vc4_set_tiling_ioctl(struct drm_device *dev, void *data,
                         struct drm_file *file_priv)
  {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_vc4_set_tiling *args = data;
        struct drm_gem_object *gem_obj;
        struct vc4_bo *bo;
        bool t_format;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        if (args->flags != 0)
                return -EINVAL;
  
  int vc4_get_tiling_ioctl(struct drm_device *dev, void *data,
                         struct drm_file *file_priv)
  {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_vc4_get_tiling *args = data;
        struct drm_gem_object *gem_obj;
        struct vc4_bo *bo;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        if (args->flags != 0 || args->modifier != 0)
                return -EINVAL;
  
@@@ -950,6 -988,9 +990,9 @@@ int vc4_bo_cache_init(struct drm_devic
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        int i;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        /* Create the initial set of BO labels that the kernel will
         * use.  This lets us avoid a bunch of string reallocation in
         * the kernel's draw and BO allocation paths.
@@@ -1009,6 -1050,9 +1052,9 @@@ int vc4_label_bo_ioctl(struct drm_devic
        struct drm_gem_object *gem_obj;
        int ret = 0, label;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        if (!args->len)
                return -EINVAL;
  
index fb95ed1e3515d42a249d7e7cb7ce09fdd8a032bd,9355213dc883c5c833787d427d77288f57d1a58a..029be98660b3043d794d582202f9711bb62b1b13
@@@ -38,7 -38,6 +38,7 @@@
  #include <drm/drm_atomic_helper.h>
  #include <drm/drm_atomic_uapi.h>
  #include <drm/drm_fb_cma_helper.h>
 +#include <drm/drm_framebuffer.h>
  #include <drm/drm_print.h>
  #include <drm/drm_probe_helper.h>
  #include <drm/drm_vblank.h>
@@@ -257,7 -256,7 +257,7 @@@ static u32 vc4_get_fifo_full_level(stru
                 * Removing 1 from the FIFO full level however
                 * seems to completely remove that issue.
                 */
-               if (!vc4->hvs->hvs5)
+               if (!vc4->is_vc5)
                        return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX - 1;
  
                return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX;
@@@ -317,13 -316,10 +317,13 @@@ static void vc4_crtc_config_pv(struct d
        struct drm_crtc_state *crtc_state = crtc->state;
        struct drm_display_mode *mode = &crtc_state->adjusted_mode;
        bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE;
 -      u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1;
 +      bool is_hdmi = vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0 ||
 +                     vc4_encoder->type == VC4_ENCODER_TYPE_HDMI1;
 +      u32 pixel_rep = ((mode->flags & DRM_MODE_FLAG_DBLCLK) && !is_hdmi) ? 2 : 1;
        bool is_dsi = (vc4_encoder->type == VC4_ENCODER_TYPE_DSI0 ||
                       vc4_encoder->type == VC4_ENCODER_TYPE_DSI1);
 -      u32 format = is_dsi ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24;
 +      bool is_dsi1 = vc4_encoder->type == VC4_ENCODER_TYPE_DSI1;
 +      u32 format = is_dsi1 ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24;
        u8 ppc = pv_data->pixels_per_clock;
        bool debug_dump_regs = false;
  
                                 PV_HORZB_HACTIVE));
  
        CRTC_WRITE(PV_VERTA,
 -                 VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end,
 +                 VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end +
 +                               interlace,
                                 PV_VERTA_VBP) |
                   VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start,
                                 PV_VERTA_VSYNC));
        if (interlace) {
                CRTC_WRITE(PV_VERTA_EVEN,
                           VC4_SET_FIELD(mode->crtc_vtotal -
 -                                       mode->crtc_vsync_end - 1,
 +                                       mode->crtc_vsync_end,
                                         PV_VERTA_VBP) |
                           VC4_SET_FIELD(mode->crtc_vsync_end -
                                         mode->crtc_vsync_start,
                           PV_VCONTROL_CONTINUOUS |
                           (is_dsi ? PV_VCONTROL_DSI : 0) |
                           PV_VCONTROL_INTERLACE |
 -                         VC4_SET_FIELD(mode->htotal * pixel_rep / 2,
 +                         VC4_SET_FIELD(mode->htotal * pixel_rep / (2 * ppc),
                                         PV_VCONTROL_ODD_DELAY));
                CRTC_WRITE(PV_VSYNCD_EVEN, 0);
        } else {
        if (is_dsi)
                CRTC_WRITE(PV_HACT_ACT, mode->hdisplay * pixel_rep);
  
-       if (vc4->hvs->hvs5)
+       if (vc4->is_vc5)
                CRTC_WRITE(PV_MUX_CFG,
                           VC4_SET_FIELD(PV_MUX_CFG_RGB_PIXEL_MUX_MODE_NO_SWAP,
                                         PV_MUX_CFG_RGB_PIXEL_MUX_MODE));
@@@ -780,17 -775,18 +780,18 @@@ struct vc4_async_flip_state 
        struct drm_framebuffer *old_fb;
        struct drm_pending_vblank_event *event;
  
-       struct vc4_seqno_cb cb;
+       union {
+               struct dma_fence_cb fence;
+               struct vc4_seqno_cb seqno;
+       } cb;
  };
  
  /* Called when the V3D execution for the BO being flipped to is done, so that
   * we can actually update the plane's address to point to it.
   */
  static void
- vc4_async_page_flip_complete(struct vc4_seqno_cb *cb)
+ vc4_async_page_flip_complete(struct vc4_async_flip_state *flip_state)
  {
-       struct vc4_async_flip_state *flip_state =
-               container_of(cb, struct vc4_async_flip_state, cb);
        struct drm_crtc *crtc = flip_state->crtc;
        struct drm_device *dev = crtc->dev;
        struct drm_plane *plane = crtc->primary;
        drm_crtc_vblank_put(crtc);
        drm_framebuffer_put(flip_state->fb);
  
-       /* Decrement the BO usecnt in order to keep the inc/dec calls balanced
-        * when the planes are updated through the async update path.
-        * FIXME: we should move to generic async-page-flip when it's
-        * available, so that we can get rid of this hand-made cleanup_fb()
-        * logic.
-        */
-       if (flip_state->old_fb) {
-               struct drm_gem_cma_object *cma_bo;
-               struct vc4_bo *bo;
+       if (flip_state->old_fb)
+               drm_framebuffer_put(flip_state->old_fb);
+       kfree(flip_state);
+ }
+ static void vc4_async_page_flip_seqno_complete(struct vc4_seqno_cb *cb)
+ {
+       struct vc4_async_flip_state *flip_state =
+               container_of(cb, struct vc4_async_flip_state, cb.seqno);
+       struct vc4_bo *bo = NULL;
  
-               cma_bo = drm_fb_cma_get_gem_obj(flip_state->old_fb, 0);
+       if (flip_state->old_fb) {
+               struct drm_gem_cma_object *cma_bo =
+                       drm_fb_cma_get_gem_obj(flip_state->old_fb, 0);
                bo = to_vc4_bo(&cma_bo->base);
-               vc4_bo_dec_usecnt(bo);
-               drm_framebuffer_put(flip_state->old_fb);
        }
  
-       kfree(flip_state);
+       vc4_async_page_flip_complete(flip_state);
+       /*
+        * Decrement the BO usecnt in order to keep the inc/dec
+        * calls balanced when the planes are updated through
+        * the async update path.
+        *
+        * FIXME: we should move to generic async-page-flip when
+        * it's available, so that we can get rid of this
+        * hand-made cleanup_fb() logic.
+        */
+       if (bo)
+               vc4_bo_dec_usecnt(bo);
  }
  
- /* Implements async (non-vblank-synced) page flips.
-  *
-  * The page flip ioctl needs to return immediately, so we grab the
-  * modeset semaphore on the pipe, and queue the address update for
-  * when V3D is done with the BO being flipped to.
-  */
- static int vc4_async_page_flip(struct drm_crtc *crtc,
-                              struct drm_framebuffer *fb,
-                              struct drm_pending_vblank_event *event,
-                              uint32_t flags)
+ static void vc4_async_page_flip_fence_complete(struct dma_fence *fence,
+                                              struct dma_fence_cb *cb)
  {
-       struct drm_device *dev = crtc->dev;
-       struct drm_plane *plane = crtc->primary;
-       int ret = 0;
-       struct vc4_async_flip_state *flip_state;
+       struct vc4_async_flip_state *flip_state =
+               container_of(cb, struct vc4_async_flip_state, cb.fence);
+       vc4_async_page_flip_complete(flip_state);
+       dma_fence_put(fence);
+ }
+ static int vc4_async_set_fence_cb(struct drm_device *dev,
+                                 struct vc4_async_flip_state *flip_state)
+ {
+       struct drm_framebuffer *fb = flip_state->fb;
        struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0);
-       struct vc4_bo *bo = to_vc4_bo(&cma_bo->base);
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
+       struct dma_fence *fence;
+       int ret;
  
-       /* Increment the BO usecnt here, so that we never end up with an
-        * unbalanced number of vc4_bo_{dec,inc}_usecnt() calls when the
-        * plane is later updated through the non-async path.
-        * FIXME: we should move to generic async-page-flip when it's
-        * available, so that we can get rid of this hand-made prepare_fb()
-        * logic.
-        */
-       ret = vc4_bo_inc_usecnt(bo);
+       if (!vc4->is_vc5) {
+               struct vc4_bo *bo = to_vc4_bo(&cma_bo->base);
+               return vc4_queue_seqno_cb(dev, &flip_state->cb.seqno, bo->seqno,
+                                         vc4_async_page_flip_seqno_complete);
+       }
+       ret = dma_resv_get_singleton(cma_bo->base.resv, DMA_RESV_USAGE_READ, &fence);
        if (ret)
                return ret;
  
+       /* If there's no fence, complete the page flip immediately */
+       if (!fence) {
+               vc4_async_page_flip_fence_complete(fence, &flip_state->cb.fence);
+               return 0;
+       }
+       /* If the fence has already been completed, complete the page flip */
+       if (dma_fence_add_callback(fence, &flip_state->cb.fence,
+                                  vc4_async_page_flip_fence_complete))
+               vc4_async_page_flip_fence_complete(fence, &flip_state->cb.fence);
+       return 0;
+ }
+ static int
+ vc4_async_page_flip_common(struct drm_crtc *crtc,
+                          struct drm_framebuffer *fb,
+                          struct drm_pending_vblank_event *event,
+                          uint32_t flags)
+ {
+       struct drm_device *dev = crtc->dev;
+       struct drm_plane *plane = crtc->primary;
+       struct vc4_async_flip_state *flip_state;
        flip_state = kzalloc(sizeof(*flip_state), GFP_KERNEL);
-       if (!flip_state) {
-               vc4_bo_dec_usecnt(bo);
+       if (!flip_state)
                return -ENOMEM;
-       }
  
        drm_framebuffer_get(fb);
        flip_state->fb = fb;
         */
        drm_atomic_set_fb_for_plane(plane->state, fb);
  
-       vc4_queue_seqno_cb(dev, &flip_state->cb, bo->seqno,
-                          vc4_async_page_flip_complete);
+       vc4_async_set_fence_cb(dev, flip_state);
  
        /* Driver takes ownership of state on successful async commit. */
        return 0;
  }
  
+ /* Implements async (non-vblank-synced) page flips.
+  *
+  * The page flip ioctl needs to return immediately, so we grab the
+  * modeset semaphore on the pipe, and queue the address update for
+  * when V3D is done with the BO being flipped to.
+  */
+ static int vc4_async_page_flip(struct drm_crtc *crtc,
+                              struct drm_framebuffer *fb,
+                              struct drm_pending_vblank_event *event,
+                              uint32_t flags)
+ {
+       struct drm_device *dev = crtc->dev;
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
+       struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0);
+       struct vc4_bo *bo = to_vc4_bo(&cma_bo->base);
+       int ret;
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+       /*
+        * Increment the BO usecnt here, so that we never end up with an
+        * unbalanced number of vc4_bo_{dec,inc}_usecnt() calls when the
+        * plane is later updated through the non-async path.
+        *
+        * FIXME: we should move to generic async-page-flip when
+        * it's available, so that we can get rid of this
+        * hand-made prepare_fb() logic.
+        */
+       ret = vc4_bo_inc_usecnt(bo);
+       if (ret)
+               return ret;
+       ret = vc4_async_page_flip_common(crtc, fb, event, flags);
+       if (ret) {
+               vc4_bo_dec_usecnt(bo);
+               return ret;
+       }
+       return 0;
+ }
+ static int vc5_async_page_flip(struct drm_crtc *crtc,
+                              struct drm_framebuffer *fb,
+                              struct drm_pending_vblank_event *event,
+                              uint32_t flags)
+ {
+       return vc4_async_page_flip_common(crtc, fb, event, flags);
+ }
  int vc4_page_flip(struct drm_crtc *crtc,
                  struct drm_framebuffer *fb,
                  struct drm_pending_vblank_event *event,
                  uint32_t flags,
                  struct drm_modeset_acquire_ctx *ctx)
  {
-       if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
-               return vc4_async_page_flip(crtc, fb, event, flags);
-       else
+       if (flags & DRM_MODE_PAGE_FLIP_ASYNC) {
+               struct drm_device *dev = crtc->dev;
+               struct vc4_dev *vc4 = to_vc4_dev(dev);
+               if (vc4->is_vc5)
+                       return vc5_async_page_flip(crtc, fb, event, flags);
+               else
+                       return vc4_async_page_flip(crtc, fb, event, flags);
+       } else {
                return drm_atomic_helper_page_flip(crtc, fb, event, flags, ctx);
+       }
  }
  
  struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc)
@@@ -1154,7 -1243,7 +1248,7 @@@ int vc4_crtc_init(struct drm_device *dr
                                  crtc_funcs, NULL);
        drm_crtc_helper_add(crtc, crtc_helper_funcs);
  
-       if (!vc4->hvs->hvs5) {
+       if (!vc4->is_vc5) {
                drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r));
  
                drm_crtc_enable_color_mgmt(crtc, 0, false, crtc->gamma_size);
index 680eaef7287f5faf16baee7ba02d43fd48d613a1,0f0f0263e744ccc6338f7ec9172be7efef1af104..292d1b6a01b6fcb54f453ca18c0efbb2f3773ec7
@@@ -63,6 -63,32 +63,32 @@@ void __iomem *vc4_ioremap_regs(struct p
        return map;
  }
  
+ int vc4_dumb_fixup_args(struct drm_mode_create_dumb *args)
+ {
+       int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
+       if (args->pitch < min_pitch)
+               args->pitch = min_pitch;
+       if (args->size < args->pitch * args->height)
+               args->size = args->pitch * args->height;
+       return 0;
+ }
+ static int vc5_dumb_create(struct drm_file *file_priv,
+                          struct drm_device *dev,
+                          struct drm_mode_create_dumb *args)
+ {
+       int ret;
+       ret = vc4_dumb_fixup_args(args);
+       if (ret)
+               return ret;
+       return drm_gem_cma_dumb_create_internal(file_priv, dev, args);
+ }
  static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
                               struct drm_file *file_priv)
  {
@@@ -73,6 -99,9 +99,9 @@@
        if (args->pad != 0)
                return -EINVAL;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        if (!vc4->v3d)
                return -ENODEV;
  
  
  static int vc4_open(struct drm_device *dev, struct drm_file *file)
  {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_file *vc4file;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
        vc4file = kzalloc(sizeof(*vc4file), GFP_KERNEL);
        if (!vc4file)
                return -ENOMEM;
+       vc4file->dev = vc4;
  
        vc4_perfmon_open_file(vc4file);
        file->driver_priv = vc4file;
@@@ -132,6 -166,9 +166,9 @@@ static void vc4_close(struct drm_devic
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_file *vc4file = file->driver_priv;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
        if (vc4file->bin_bo_used)
                vc4_v3d_bin_bo_put(vc4);
  
@@@ -160,7 -197,7 +197,7 @@@ static const struct drm_ioctl_desc vc4_
        DRM_IOCTL_DEF_DRV(VC4_PERFMON_GET_VALUES, vc4_perfmon_get_values_ioctl, DRM_RENDER_ALLOW),
  };
  
- static struct drm_driver vc4_drm_driver = {
+ static const struct drm_driver vc4_drm_driver = {
        .driver_features = (DRIVER_MODESET |
                            DRIVER_ATOMIC |
                            DRIVER_GEM |
  
        .gem_create_object = vc4_create_object,
  
-       DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(vc4_dumb_create),
+       DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(vc4_bo_dumb_create),
  
        .ioctls = vc4_drm_ioctls,
        .num_ioctls = ARRAY_SIZE(vc4_drm_ioctls),
        .patchlevel = DRIVER_PATCHLEVEL,
  };
  
+ static const struct drm_driver vc5_drm_driver = {
+       .driver_features = (DRIVER_MODESET |
+                           DRIVER_ATOMIC |
+                           DRIVER_GEM),
+ #if defined(CONFIG_DEBUG_FS)
+       .debugfs_init = vc4_debugfs_init,
+ #endif
+       DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(vc5_dumb_create),
+       .fops = &vc4_drm_fops,
+       .name = DRIVER_NAME,
+       .desc = DRIVER_DESC,
+       .date = DRIVER_DATE,
+       .major = DRIVER_MAJOR,
+       .minor = DRIVER_MINOR,
+       .patchlevel = DRIVER_PATCHLEVEL,
+ };
  static void vc4_match_add_drivers(struct device *dev,
                                  struct component_match **match,
                                  struct platform_driver *const *drivers,
        }
  }
  
 +static const struct of_device_id vc4_dma_range_matches[] = {
 +      { .compatible = "brcm,bcm2711-hvs" },
 +      { .compatible = "brcm,bcm2835-hvs" },
 +      { .compatible = "brcm,bcm2835-v3d" },
 +      { .compatible = "brcm,cygnus-v3d" },
 +      { .compatible = "brcm,vc4-v3d" },
 +      {}
 +};
 +
  static int vc4_drm_bind(struct device *dev)
  {
        struct platform_device *pdev = to_platform_device(dev);
+       const struct drm_driver *driver;
        struct rpi_firmware *firmware = NULL;
        struct drm_device *drm;
        struct vc4_dev *vc4;
        struct device_node *node;
        struct drm_crtc *crtc;
+       bool is_vc5;
        int ret = 0;
  
        dev->coherent_dma_mask = DMA_BIT_MASK(32);
  
-       /* If VC4 V3D is missing, don't advertise render nodes. */
-       node = of_find_matching_node_and_match(NULL, vc4_v3d_dt_match, NULL);
-       if (!node || !of_device_is_available(node))
-               vc4_drm_driver.driver_features &= ~DRIVER_RENDER;
-       of_node_put(node);
+       is_vc5 = of_device_is_compatible(dev->of_node, "brcm,bcm2711-vc5");
+       if (is_vc5)
+               driver = &vc5_drm_driver;
+       else
+               driver = &vc4_drm_driver;
  
-       vc4 = devm_drm_dev_alloc(dev, &vc4_drm_driver, struct vc4_dev, base);
 +      node = of_find_matching_node_and_match(NULL, vc4_dma_range_matches,
 +                                             NULL);
 +      if (node) {
 +              ret = of_dma_configure(dev, node, true);
 +              of_node_put(node);
 +
 +              if (ret)
 +                      return ret;
 +      }
 +
+       vc4 = devm_drm_dev_alloc(dev, driver, struct vc4_dev, base);
        if (IS_ERR(vc4))
                return PTR_ERR(vc4);
+       vc4->is_vc5 = is_vc5;
  
        drm = &vc4->base;
        platform_set_drvdata(pdev, drm);
        INIT_LIST_HEAD(&vc4->debugfs_list);
  
-       mutex_init(&vc4->bin_bo_lock);
+       if (!is_vc5) {
+               mutex_init(&vc4->bin_bo_lock);
  
-       ret = vc4_bo_cache_init(drm);
-       if (ret)
-               return ret;
+               ret = vc4_bo_cache_init(drm);
+               if (ret)
+                       return ret;
+       }
  
        ret = drmm_mode_config_init(drm);
        if (ret)
                return ret;
  
-       ret = vc4_gem_init(drm);
-       if (ret)
-               return ret;
+       if (!is_vc5) {
+               ret = vc4_gem_init(drm);
+               if (ret)
+                       return ret;
+       }
  
        node = of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware");
        if (node) {
                        return -EPROBE_DEFER;
        }
  
-       ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver);
+       ret = drm_aperture_remove_framebuffers(false, driver);
        if (ret)
                return ret;
  
index c4928a4d5763719029057ce36f243b76f59c84ff,93fd55b9e99ee2cd2e8c2f1dd68fd8af4378dda0..1beb96b77b8c68e64fbbb7e219a16666747b7cea
@@@ -6,7 -6,6 +6,7 @@@
  #define _VC4_DRV_H_
  
  #include <linux/delay.h>
 +#include <linux/of.h>
  #include <linux/refcount.h>
  #include <linux/uaccess.h>
  
@@@ -49,6 -48,8 +49,8 @@@ enum vc4_kernel_bo_type 
   * done. This way, only events related to a specific job will be counted.
   */
  struct vc4_perfmon {
+       struct vc4_dev *dev;
        /* Tracks the number of users of the perfmon, when this counter reaches
         * zero the perfmon is destroyed.
         */
@@@ -75,6 -76,8 +77,8 @@@
  struct vc4_dev {
        struct drm_device base;
  
+       bool is_vc5;
        unsigned int irq;
  
        struct vc4_hvs *hvs;
@@@ -317,6 -320,7 +321,7 @@@ struct vc4_v3d 
  };
  
  struct vc4_hvs {
+       struct vc4_dev *vc4;
        struct platform_device *pdev;
        void __iomem *regs;
        u32 __iomem *dlist;
        struct drm_mm_node mitchell_netravali_filter;
  
        struct debugfs_regset32 regset;
-       /* HVS version 5 flag, therefore requires updated dlist structures */
-       bool hvs5;
  };
  
  struct vc4_plane {
@@@ -581,6 -582,8 +583,8 @@@ to_vc4_crtc_state(struct drm_crtc_stat
  #define VC4_REG32(reg) { .name = #reg, .offset = reg }
  
  struct vc4_exec_info {
+       struct vc4_dev *dev;
        /* Sequence number for this bin/render job. */
        uint64_t seqno;
  
   * released when the DRM file is closed should be placed here.
   */
  struct vc4_file {
+       struct vc4_dev *dev;
        struct {
                struct idr idr;
                struct mutex lock;
@@@ -815,9 -820,9 +821,9 @@@ struct vc4_validated_shader_info 
  struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size);
  struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t size,
                             bool from_cache, enum vc4_kernel_bo_type type);
- int vc4_dumb_create(struct drm_file *file_priv,
-                   struct drm_device *dev,
-                   struct drm_mode_create_dumb *args);
+ int vc4_bo_dumb_create(struct drm_file *file_priv,
+                      struct drm_device *dev,
+                      struct drm_mode_create_dumb *args);
  int vc4_create_bo_ioctl(struct drm_device *dev, void *data,
                        struct drm_file *file_priv);
  int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data,
@@@ -886,6 -891,7 +892,7 @@@ static inline void vc4_debugfs_add_regs
  
  /* vc4_drv.c */
  void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index);
+ int vc4_dumb_fixup_args(struct drm_mode_create_dumb *args);
  
  /* vc4_dpi.c */
  extern struct platform_driver vc4_dpi_driver;
index e078f4ce0b4ba3d145b5549a681cc2dca2eb9696,ce9d16666d91f87cba3402cb852f3ee890d4fc47..6ab83296b0e4b87d5c80844e03a5c9411e5d06c6
  #define VC5_HDMI_VERTB_VSPO_SHIFT             16
  #define VC5_HDMI_VERTB_VSPO_MASK              VC4_MASK(29, 16)
  
 +#define VC4_HDMI_MISC_CONTROL_PIXEL_REP_SHIFT 0
 +#define VC4_HDMI_MISC_CONTROL_PIXEL_REP_MASK  VC4_MASK(3, 0)
 +#define VC5_HDMI_MISC_CONTROL_PIXEL_REP_SHIFT 0
 +#define VC5_HDMI_MISC_CONTROL_PIXEL_REP_MASK  VC4_MASK(3, 0)
 +
  #define VC5_HDMI_SCRAMBLER_CTL_ENABLE         BIT(0)
  
  #define VC5_HDMI_DEEP_COLOR_CONFIG_1_INIT_PACK_PHASE_SHIFT    8
@@@ -150,12 -145,6 +150,12 @@@ static int vc4_hdmi_debugfs_regs(struc
  
        drm_print_regset32(&p, &vc4_hdmi->hdmi_regset);
        drm_print_regset32(&p, &vc4_hdmi->hd_regset);
 +      drm_print_regset32(&p, &vc4_hdmi->cec_regset);
 +      drm_print_regset32(&p, &vc4_hdmi->csc_regset);
 +      drm_print_regset32(&p, &vc4_hdmi->dvp_regset);
 +      drm_print_regset32(&p, &vc4_hdmi->phy_regset);
 +      drm_print_regset32(&p, &vc4_hdmi->ram_regset);
 +      drm_print_regset32(&p, &vc4_hdmi->rm_regset);
  
        return 0;
  }
@@@ -429,7 -418,6 +429,7 @@@ static int vc4_hdmi_connector_init(stru
  
        connector->interlace_allowed = 1;
        connector->doublescan_allowed = 0;
 +      connector->stereo_allowed = 1;
  
        if (vc4_hdmi->variant->supports_hdr)
                drm_connector_attach_hdr_output_metadata_property(connector);
@@@ -467,11 -455,9 +467,11 @@@ static void vc4_hdmi_write_infoframe(st
        const struct vc4_hdmi_register *ram_packet_start =
                &vc4_hdmi->variant->registers[HDMI_RAM_PACKET_START];
        u32 packet_reg = ram_packet_start->offset + VC4_HDMI_PACKET_STRIDE * packet_id;
 +      u32 packet_reg_next = ram_packet_start->offset +
 +              VC4_HDMI_PACKET_STRIDE * (packet_id + 1);
        void __iomem *base = __vc4_hdmi_get_field_base(vc4_hdmi,
                                                       ram_packet_start->reg);
 -      uint8_t buffer[VC4_HDMI_PACKET_STRIDE];
 +      uint8_t buffer[VC4_HDMI_PACKET_STRIDE] = {};
        unsigned long flags;
        ssize_t len, i;
        int ret;
                packet_reg += 4;
        }
  
 +      /*
 +       * clear remainder of packet ram as it's included in the
 +       * infoframe and triggers a checksum error on hdmi analyser
 +       */
 +      for (; packet_reg < packet_reg_next; packet_reg += 4)
 +              writel(0, base + packet_reg);
 +
        HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
                   HDMI_READ(HDMI_RAM_PACKET_CONFIG) | BIT(packet_id));
  
@@@ -605,9 -584,7 +605,9 @@@ static void vc4_hdmi_set_audio_infofram
        union hdmi_infoframe frame;
  
        memcpy(&frame.audio, audio, sizeof(*audio));
 -      vc4_hdmi_write_infoframe(encoder, &frame);
 +
 +      if (vc4_hdmi->packet_ram_enabled)
 +              vc4_hdmi_write_infoframe(encoder, &frame);
  }
  
  static void vc4_hdmi_set_hdr_infoframe(struct drm_encoder *encoder)
@@@ -747,8 -724,6 +747,8 @@@ static void vc4_hdmi_encoder_post_crtc_
  
        mutex_lock(&vc4_hdmi->mutex);
  
 +      vc4_hdmi->packet_ram_enabled = false;
 +
        spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
  
        HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
@@@ -796,6 -771,15 +796,6 @@@ static void vc4_hdmi_encoder_post_crtc_
        mutex_unlock(&vc4_hdmi->mutex);
  }
  
 -static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder)
 -{
 -      struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
 -
 -      mutex_lock(&vc4_hdmi->mutex);
 -      vc4_hdmi->output_enabled = false;
 -      mutex_unlock(&vc4_hdmi->mutex);
 -}
 -
  static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
                               struct drm_connector_state *state,
                               const struct drm_display_mode *mode)
@@@ -986,15 -970,14 +986,15 @@@ static void vc4_hdmi_set_timings(struc
                                   VC4_HDMI_VERTA_VFP) |
                     VC4_SET_FIELD(mode->crtc_vdisplay, VC4_HDMI_VERTA_VAL));
        u32 vertb = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) |
 -                   VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end,
 +                   VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end +
 +                                 interlaced,
                                   VC4_HDMI_VERTB_VBP));
        u32 vertb_even = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) |
                          VC4_SET_FIELD(mode->crtc_vtotal -
 -                                      mode->crtc_vsync_end -
 -                                      interlaced,
 +                                      mode->crtc_vsync_end,
                                        VC4_HDMI_VERTB_VBP));
        unsigned long flags;
 +      u32 reg;
  
        spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
  
        HDMI_WRITE(HDMI_VERTB0, vertb_even);
        HDMI_WRITE(HDMI_VERTB1, vertb);
  
 +      reg = HDMI_READ(HDMI_MISC_CONTROL);
 +      reg &= ~VC4_HDMI_MISC_CONTROL_PIXEL_REP_MASK;
 +      reg |= VC4_SET_FIELD(pixel_rep - 1, VC4_HDMI_MISC_CONTROL_PIXEL_REP);
 +      HDMI_WRITE(HDMI_MISC_CONTROL, reg);
 +
        spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
  }
  
@@@ -1044,13 -1022,13 +1044,13 @@@ static void vc5_hdmi_set_timings(struc
                     VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay,
                                   VC5_HDMI_VERTA_VFP) |
                     VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL));
 -      u32 vertb = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) |
 +      u32 vertb = (VC4_SET_FIELD(mode->htotal >> (2 - pixel_rep),
 +                                 VC5_HDMI_VERTB_VSPO) |
                     VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end,
                                   VC4_HDMI_VERTB_VBP));
        u32 vertb_even = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) |
                          VC4_SET_FIELD(mode->crtc_vtotal -
 -                                      mode->crtc_vsync_end -
 -                                      interlaced,
 +                                      mode->crtc_vsync_end - interlaced,
                                        VC4_HDMI_VERTB_VBP));
        unsigned long flags;
        unsigned char gcp;
        reg |= gcp_en ? VC5_HDMI_GCP_CONFIG_GCP_ENABLE : 0;
        HDMI_WRITE(HDMI_GCP_CONFIG, reg);
  
 +      reg = HDMI_READ(HDMI_MISC_CONTROL);
 +      reg &= ~VC5_HDMI_MISC_CONTROL_PIXEL_REP_MASK;
 +      reg |= VC4_SET_FIELD(pixel_rep - 1, VC5_HDMI_MISC_CONTROL_PIXEL_REP);
 +      HDMI_WRITE(HDMI_MISC_CONTROL, reg);
 +
        HDMI_WRITE(HDMI_CLOCK_STOP, 0);
  
        spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
@@@ -1357,12 -1330,14 +1357,12 @@@ static void vc4_hdmi_encoder_post_crtc_
  
                WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) &
                          VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE));
 -              HDMI_WRITE(HDMI_SCHEDULER_CONTROL,
 -                         HDMI_READ(HDMI_SCHEDULER_CONTROL) |
 -                         VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWAYS_KEEPOUT);
  
                HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
                           VC4_HDMI_RAM_PACKET_ENABLE);
  
                spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
 +              vc4_hdmi->packet_ram_enabled = true;
  
                vc4_hdmi_set_infoframes(encoder);
        }
        mutex_unlock(&vc4_hdmi->mutex);
  }
  
 -static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder)
 -{
 -      struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
 -
 -      mutex_lock(&vc4_hdmi->mutex);
 -      vc4_hdmi->output_enabled = true;
 -      mutex_unlock(&vc4_hdmi->mutex);
 -}
 -
  static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder,
                                             struct drm_crtc_state *crtc_state,
                                             struct drm_connector_state *conn_state)
@@@ -1497,7 -1481,7 +1497,7 @@@ vc4_hdmi_encoder_compute_mode_clock(con
                                    unsigned int bpc,
                                    enum vc4_hdmi_output_format fmt)
  {
-       unsigned long long clock = mode->clock * 1000;
+       unsigned long long clock = mode->clock * 1000ULL;
  
        if (mode->flags & DRM_MODE_FLAG_DBLCLK)
                clock = clock * 2;
@@@ -1613,37 -1597,18 +1613,37 @@@ static int vc4_hdmi_encoder_atomic_chec
                                         struct drm_crtc_state *crtc_state,
                                         struct drm_connector_state *conn_state)
  {
 +      struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
 +      struct drm_connector *connector = &vc4_hdmi->connector;
 +      struct drm_connector_state *old_conn_state =
 +              drm_atomic_get_old_connector_state(conn_state->state, connector);
 +      struct vc4_hdmi_connector_state *old_vc4_state =
 +              conn_state_to_vc4_hdmi_conn_state(old_conn_state);
        struct vc4_hdmi_connector_state *vc4_state = conn_state_to_vc4_hdmi_conn_state(conn_state);
        struct drm_display_mode *mode = &crtc_state->adjusted_mode;
 -      struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
        unsigned long long tmds_char_rate = mode->clock * 1000;
        unsigned long long tmds_bit_rate;
        int ret;
  
 -      if (vc4_hdmi->variant->unsupported_odd_h_timings &&
 -          !(mode->flags & DRM_MODE_FLAG_DBLCLK) &&
 -          ((mode->hdisplay % 2) || (mode->hsync_start % 2) ||
 -           (mode->hsync_end % 2) || (mode->htotal % 2)))
 -              return -EINVAL;
 +      if (vc4_hdmi->variant->unsupported_odd_h_timings) {
 +              if (mode->flags & DRM_MODE_FLAG_DBLCLK) {
 +                      /* Only try to fixup DBLCLK modes to get 480i and 576i
 +                       * working.
 +                       * A generic solution for all modes with odd horizontal
 +                       * timing values seems impossible based on trying to
 +                       * solve it for 1366x768 monitors.
 +                       */
 +                      if ((mode->hsync_start - mode->hdisplay) & 1)
 +                              mode->hsync_start--;
 +                      if ((mode->hsync_end - mode->hsync_start) & 1)
 +                              mode->hsync_end--;
 +              }
 +
 +              /* Now check whether we still have odd values remaining */
 +              if ((mode->hdisplay % 2) || (mode->hsync_start % 2) ||
 +                  (mode->hsync_end % 2) || (mode->htotal % 2))
 +                      return -EINVAL;
 +      }
  
        /*
         * The 1440p@60 pixel rate is in the same range than the first
        if (ret)
                return ret;
  
 +      /* vc4_hdmi_encoder_compute_config may have changed output_bpc and/or output_format */
 +      if (vc4_state->output_bpc != old_vc4_state->output_bpc ||
 +          vc4_state->output_format != old_vc4_state->output_format)
 +              crtc_state->mode_changed = true;
 +
        return 0;
  }
  
@@@ -1690,6 -1650,8 +1690,6 @@@ static const struct drm_encoder_helper_
        .atomic_check = vc4_hdmi_encoder_atomic_check,
        .atomic_mode_set = vc4_hdmi_encoder_atomic_mode_set,
        .mode_valid = vc4_hdmi_encoder_mode_valid,
 -      .disable = vc4_hdmi_encoder_disable,
 -      .enable = vc4_hdmi_encoder_enable,
  };
  
  static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
@@@ -1786,15 -1748,19 +1786,15 @@@ static inline struct vc4_hdmi *dai_to_h
  
  static bool vc4_hdmi_audio_can_stream(struct vc4_hdmi *vc4_hdmi)
  {
 -      lockdep_assert_held(&vc4_hdmi->mutex);
 +      struct drm_display_info *display = &vc4_hdmi->connector.display_info;
  
 -      /*
 -       * If the controller is disabled, prevent any ALSA output.
 -       */
 -      if (!vc4_hdmi->output_enabled)
 -              return false;
 +      lockdep_assert_held(&vc4_hdmi->mutex);
  
        /*
         * If the encoder is currently in DVI mode, treat the codec DAI
         * as missing.
         */
 -      if (!(HDMI_READ(HDMI_RAM_PACKET_CONFIG) & VC4_HDMI_RAM_PACKET_ENABLE))
 +      if (!display->is_hdmi)
                return false;
  
        return true;
@@@ -1975,10 -1941,10 +1975,10 @@@ static int vc4_hdmi_audio_prepare(struc
  
        /* Set the MAI threshold */
        HDMI_WRITE(HDMI_MAI_THR,
 -                 VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) |
 -                 VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) |
 -                 VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) |
 -                 VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW));
 +                 VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_PANICHIGH) |
 +                 VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_PANICLOW) |
 +                 VC4_SET_FIELD(0x06, VC4_HD_MAI_THR_DREQHIGH) |
 +                 VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_DREQLOW));
  
        HDMI_WRITE(HDMI_MAI_CONFIG,
                   VC4_HDMI_MAI_CONFIG_BIT_REVERSE |
@@@ -2069,12 -2035,12 +2069,12 @@@ static int vc4_hdmi_audio_init(struct v
        struct device *dev = &vc4_hdmi->pdev->dev;
        struct platform_device *codec_pdev;
        const __be32 *addr;
 -      int index;
 +      int index, len;
        int ret;
  
 -      if (!of_find_property(dev->of_node, "dmas", NULL)) {
 +      if (!of_find_property(dev->of_node, "dmas", &len) || !len) {
                dev_warn(dev,
 -                       "'dmas' DT property is missing, no HDMI audio\n");
 +                       "'dmas' DT property is missing or empty, no HDMI audio\n");
                return 0;
        }
  
@@@ -2555,6 -2521,8 +2555,6 @@@ static int vc4_hdmi_cec_init(struct vc4
        struct cec_connector_info conn_info;
        struct platform_device *pdev = vc4_hdmi->pdev;
        struct device *dev = &pdev->dev;
 -      unsigned long flags;
 -      u32 value;
        int ret;
  
        if (!of_find_property(dev->of_node, "interrupts", NULL)) {
        cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector);
        cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info);
  
 -      spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
 -      value = HDMI_READ(HDMI_CEC_CNTRL_1);
 -      /* Set the logical address to Unregistered */
 -      value |= VC4_HDMI_CEC_ADDR_MASK;
 -      HDMI_WRITE(HDMI_CEC_CNTRL_1, value);
 -      spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
 -
 -      vc4_hdmi_cec_update_clk_div(vc4_hdmi);
 -
        if (vc4_hdmi->variant->external_irq_controller) {
                ret = request_threaded_irq(platform_get_irq_byname(pdev, "cec-rx"),
                                           vc4_cec_irq_handler_rx_bare,
                if (ret)
                        goto err_remove_cec_rx_handler;
        } else {
 -              spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
 -              HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, 0xffffffff);
 -              spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
 -
                ret = request_threaded_irq(platform_get_irq(pdev, 0),
                                           vc4_cec_irq_handler,
                                           vc4_cec_irq_handler_thread, 0,
@@@ -2638,6 -2619,7 +2638,6 @@@ static int vc4_hdmi_cec_init(struct vc4
  }
  
  static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {};
 -
  #endif
  
  static int vc4_hdmi_build_regset(struct vc4_hdmi *vc4_hdmi,
@@@ -2722,7 -2704,6 +2722,7 @@@ static int vc5_hdmi_init_resources(stru
        struct platform_device *pdev = vc4_hdmi->pdev;
        struct device *dev = &pdev->dev;
        struct resource *res;
 +      int ret;
  
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi");
        if (!res)
                return PTR_ERR(vc4_hdmi->reset);
        }
  
 +      ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->hdmi_regset, VC4_HDMI);
 +      if (ret)
 +              return ret;
 +
 +      ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->hd_regset, VC4_HD);
 +      if (ret)
 +              return ret;
 +
 +      ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->cec_regset, VC5_CEC);
 +      if (ret)
 +              return ret;
 +
 +      ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->csc_regset, VC5_CSC);
 +      if (ret)
 +              return ret;
 +
 +      ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->dvp_regset, VC5_DVP);
 +      if (ret)
 +              return ret;
 +
 +      ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->phy_regset, VC5_PHY);
 +      if (ret)
 +              return ret;
 +
 +      ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->ram_regset, VC5_RAM);
 +      if (ret)
 +              return ret;
 +
 +      ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->rm_regset, VC5_RM);
 +      if (ret)
 +              return ret;
 +
        return 0;
  }
  
@@@ -2866,34 -2815,12 +2866,34 @@@ static int __maybe_unused vc4_hdmi_runt
  static int vc4_hdmi_runtime_resume(struct device *dev)
  {
        struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
 +      unsigned long __maybe_unused flags;
 +      u32 __maybe_unused value;
        int ret;
  
        ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
        if (ret)
                return ret;
  
 +      if (vc4_hdmi->variant->reset)
 +              vc4_hdmi->variant->reset(vc4_hdmi);
 +
 +#ifdef CONFIG_DRM_VC4_HDMI_CEC
 +      spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
 +      value = HDMI_READ(HDMI_CEC_CNTRL_1);
 +      /* Set the logical address to Unregistered */
 +      value |= VC4_HDMI_CEC_ADDR_MASK;
 +      HDMI_WRITE(HDMI_CEC_CNTRL_1, value);
 +      spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
 +
 +      vc4_hdmi_cec_update_clk_div(vc4_hdmi);
 +
 +      if (!vc4_hdmi->variant->external_irq_controller) {
 +              spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
 +              HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, 0xffffffff);
 +              spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
 +      }
 +#endif
 +
        return 0;
  }
  
@@@ -2983,6 -2910,9 +2983,6 @@@ static int vc4_hdmi_bind(struct device 
        pm_runtime_set_active(dev);
        pm_runtime_enable(dev);
  
 -      if (vc4_hdmi->variant->reset)
 -              vc4_hdmi->variant->reset(vc4_hdmi);
 -
        if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") ||
             of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) &&
            HDMI_READ(HDMI_VID_CTL) & VC4_HD_VID_CTL_ENABLE) {
index 5fdfc01fbc5a965b110d5a6366ca1c9f74bc4363,ba2c8e5a9b6457bb02513799ff8a7d76e1743b50..fbaa741dda5f98badb605439956a783de8b35058
@@@ -94,46 -94,6 +94,46 @@@ static int vc4_hvs_debugfs_underrun(str
        return 0;
  }
  
 +static int vc4_hvs_debugfs_dlist(struct seq_file *m, void *data)
 +{
 +      struct drm_info_node *node = m->private;
 +      struct drm_device *dev = node->minor->dev;
 +      struct vc4_dev *vc4 = to_vc4_dev(dev);
 +      struct vc4_hvs *hvs = vc4->hvs;
 +      struct drm_printer p = drm_seq_file_printer(m);
 +      unsigned int next_entry_start = 0;
 +      unsigned int i, j;
 +      u32 dlist_word, dispstat;
 +
 +      for (i = 0; i < SCALER_CHANNELS_COUNT; i++) {
 +              dispstat = VC4_GET_FIELD(HVS_READ(SCALER_DISPSTATX(i)),
 +                                       SCALER_DISPSTATX_MODE);
 +              if (dispstat == SCALER_DISPSTATX_MODE_DISABLED ||
 +                  dispstat == SCALER_DISPSTATX_MODE_EOF) {
 +                      drm_printf(&p, "HVS chan %u disabled\n", i);
 +                      continue;
 +              }
 +
 +              drm_printf(&p, "HVS chan %u:\n", i);
 +
 +              for (j = HVS_READ(SCALER_DISPLISTX(i)); j < 256; j++) {
 +                      dlist_word = readl((u32 __iomem *)vc4->hvs->dlist + j);
 +                      drm_printf(&p, "dlist: %02d: 0x%08x\n", j,
 +                                 dlist_word);
 +                      if (!next_entry_start ||
 +                          next_entry_start == j) {
 +                              if (dlist_word & SCALER_CTL0_END)
 +                                      break;
 +                              next_entry_start = j +
 +                                      VC4_GET_FIELD(dlist_word,
 +                                                    SCALER_CTL0_SIZE);
 +                      }
 +              }
 +      }
 +
 +      return 0;
 +}
 +
  /* The filter kernel is composed of dwords each containing 3 9-bit
   * signed integers packed next to each other.
   */
@@@ -260,10 -220,11 +260,11 @@@ u8 vc4_hvs_get_fifo_frame_count(struct 
  
  int vc4_hvs_get_fifo_from_output(struct vc4_hvs *hvs, unsigned int output)
  {
+       struct vc4_dev *vc4 = hvs->vc4;
        u32 reg;
        int ret;
  
-       if (!hvs->hvs5)
+       if (!vc4->is_vc5)
                return output;
  
        switch (output) {
  static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc,
                                struct drm_display_mode *mode, bool oneshot)
  {
+       struct vc4_dev *vc4 = hvs->vc4;
        struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
        struct vc4_crtc_state *vc4_crtc_state = to_vc4_crtc_state(crtc->state);
        unsigned int chan = vc4_crtc_state->assigned_channel;
         */
        dispctrl = SCALER_DISPCTRLX_ENABLE;
  
-       if (!hvs->hvs5)
+       if (!vc4->is_vc5)
                dispctrl |= VC4_SET_FIELD(mode->hdisplay,
                                          SCALER_DISPCTRLX_WIDTH) |
                            VC4_SET_FIELD(mode->vdisplay,
  
        HVS_WRITE(SCALER_DISPBKGNDX(chan), dispbkgndx |
                  SCALER_DISPBKGND_AUTOHS |
-                 ((!hvs->hvs5) ? SCALER_DISPBKGND_GAMMA : 0) |
+                 ((!vc4->is_vc5) ? SCALER_DISPBKGND_GAMMA : 0) |
                  (interlace ? SCALER_DISPBKGND_INTERLACE : 0));
  
        /* Reload the LUT, since the SRAMs would have been disabled if
@@@ -657,11 -619,9 +659,9 @@@ static int vc4_hvs_bind(struct device *
        if (!hvs)
                return -ENOMEM;
  
+       hvs->vc4 = vc4;
        hvs->pdev = pdev;
  
-       if (of_device_is_compatible(pdev->dev.of_node, "brcm,bcm2711-hvs"))
-               hvs->hvs5 = true;
        hvs->regs = vc4_ioremap_regs(pdev, 0);
        if (IS_ERR(hvs->regs))
                return PTR_ERR(hvs->regs);
        hvs->regset.regs = hvs_regs;
        hvs->regset.nregs = ARRAY_SIZE(hvs_regs);
  
-       if (hvs->hvs5) {
+       if (vc4->is_vc5) {
                hvs->core_clk = devm_clk_get(&pdev->dev, NULL);
                if (IS_ERR(hvs->core_clk)) {
                        dev_err(&pdev->dev, "Couldn't get core clock\n");
                }
        }
  
-       if (!hvs->hvs5)
+       if (!vc4->is_vc5)
                hvs->dlist = hvs->regs + SCALER_DLIST_START;
        else
                hvs->dlist = hvs->regs + SCALER5_DLIST_START;
         * between planes when they don't overlap on the screen, but
         * for now we just allocate globally.
         */
-       if (!hvs->hvs5)
+       if (!vc4->is_vc5)
                /* 48k words of 2x12-bit pixels */
                drm_mm_init(&hvs->lbm_mm, 0, 48 * 1024);
        else
        vc4_debugfs_add_regset32(drm, "hvs_regs", &hvs->regset);
        vc4_debugfs_add_file(drm, "hvs_underrun", vc4_hvs_debugfs_underrun,
                             NULL);
 +      vc4_debugfs_add_file(drm, "hvs_dlists", vc4_hvs_debugfs_dlist,
 +                           NULL);
  
        return 0;
  }
index 6f5ccefc92ec380d30fcdcbfd9e84c206c4ed5e7,893d831b24aa0b73f1c009e69566dd6fa58d1fc5..b45dcdfd73064ae8f59035f663624a282ee674ee
@@@ -16,7 -16,6 +16,7 @@@
  #include <drm/drm_atomic.h>
  #include <drm/drm_atomic_helper.h>
  #include <drm/drm_crtc.h>
 +#include <drm/drm_fourcc.h>
  #include <drm/drm_gem_framebuffer_helper.h>
  #include <drm/drm_plane_helper.h>
  #include <drm/drm_probe_helper.h>
@@@ -394,7 -393,7 +394,7 @@@ static void vc4_atomic_commit_tail(stru
                old_hvs_state->fifo_state[channel].pending_commit = NULL;
        }
  
-       if (vc4->hvs->hvs5) {
+       if (vc4->is_vc5) {
                unsigned long state_rate = max(old_hvs_state->core_clock_rate,
                                               new_hvs_state->core_clock_rate);
                unsigned long core_rate = max_t(unsigned long,
                 * Do a temporary request on the core clock during the
                 * modeset.
                 */
 -              clk_set_min_rate(hvs->core_clk, core_rate);
 +              WARN_ON(clk_set_min_rate(hvs->core_clk, core_rate));
        }
  
        drm_atomic_helper_commit_modeset_disables(dev, state);
  
        vc4_ctm_commit(vc4, state);
  
-       if (vc4->hvs->hvs5)
+       if (vc4->is_vc5)
                vc5_hvs_pv_muxing_commit(vc4, state);
        else
                vc4_hvs_pv_muxing_commit(vc4, state);
  
        drm_atomic_helper_cleanup_planes(dev, state);
  
-       if (vc4->hvs->hvs5) {
+       if (vc4->is_vc5) {
                drm_dbg(dev, "Running the core clock at %lu Hz\n",
                        new_hvs_state->core_clock_rate);
  
                 * Request a clock rate based on the current HVS
                 * requirements.
                 */
 -              clk_set_min_rate(hvs->core_clk, new_hvs_state->core_clock_rate);
 +              WARN_ON(clk_set_min_rate(hvs->core_clk, new_hvs_state->core_clock_rate));
  
                drm_dbg(dev, "Core clock actual rate: %lu Hz\n",
                        clk_get_rate(hvs->core_clk));
@@@ -480,8 -479,12 +480,12 @@@ static struct drm_framebuffer *vc4_fb_c
                                             struct drm_file *file_priv,
                                             const struct drm_mode_fb_cmd2 *mode_cmd)
  {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_mode_fb_cmd2 mode_cmd_local;
  
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return ERR_PTR(-ENODEV);
        /* If the user didn't specify a modifier, use the
         * vc4_set_tiling_ioctl() state for the BO.
         */
@@@ -947,9 -950,7 +951,9 @@@ vc4_core_clock_atomic_check(struct drm_
                        continue;
  
                num_outputs++;
 -              cob_rate += hvs_new_state->fifo_state[i].fifo_load;
 +              cob_rate = max_t(unsigned long,
 +                               hvs_new_state->fifo_state[i].fifo_load,
 +                               cob_rate);
        }
  
        pixel_rate = load_state->hvs_load;
@@@ -1000,11 -1001,15 +1004,15 @@@ static const struct drm_mode_config_fun
        .fb_create = vc4_fb_create,
  };
  
+ static const struct drm_mode_config_funcs vc5_mode_funcs = {
+       .atomic_check = vc4_atomic_check,
+       .atomic_commit = drm_atomic_helper_commit,
+       .fb_create = drm_gem_fb_create,
+ };
  int vc4_kms_load(struct drm_device *dev)
  {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
-       bool is_vc5 = of_device_is_compatible(dev->dev->of_node,
-                                             "brcm,bcm2711-vc5");
        int ret;
  
        /*
         * the BCM2711, but the load tracker computations are used for
         * the core clock rate calculation.
         */
-       if (!is_vc5) {
+       if (!vc4->is_vc5) {
                /* Start with the load tracker enabled. Can be
                 * disabled through the debugfs load_tracker file.
                 */
                return ret;
        }
  
-       if (is_vc5) {
+       if (vc4->is_vc5) {
                dev->mode_config.max_width = 7680;
                dev->mode_config.max_height = 7680;
        } else {
                dev->mode_config.max_height = 2048;
        }
  
-       dev->mode_config.funcs = &vc4_mode_funcs;
+       dev->mode_config.funcs = vc4->is_vc5 ? &vc5_mode_funcs : &vc4_mode_funcs;
        dev->mode_config.helper_private = &vc4_mode_config_helpers;
        dev->mode_config.preferred_depth = 24;
        dev->mode_config.async_page_flip = true;
index 5507f2cd7a275d708b90f45929c60e50e981a411,1e866dc00ac3225a8007962670fce1f1e814a35f..f27e87a23df77c4daa2b22c8247be317cf7bb310
  #include <drm/drm_atomic.h>
  #include <drm/drm_atomic_helper.h>
  #include <drm/drm_atomic_uapi.h>
 +#include <drm/drm_blend.h>
  #include <drm/drm_fb_cma_helper.h>
  #include <drm/drm_fourcc.h>
 +#include <drm/drm_framebuffer.h>
  #include <drm/drm_gem_atomic_helper.h>
  #include <drm/drm_plane_helper.h>
  
@@@ -312,16 -310,16 +312,16 @@@ static int vc4_plane_margins_adj(struc
                                               adjhdisplay,
                                               crtc_state->mode.hdisplay);
        vc4_pstate->crtc_x += left;
 -      if (vc4_pstate->crtc_x > crtc_state->mode.hdisplay - left)
 -              vc4_pstate->crtc_x = crtc_state->mode.hdisplay - left;
 +      if (vc4_pstate->crtc_x > crtc_state->mode.hdisplay - right)
 +              vc4_pstate->crtc_x = crtc_state->mode.hdisplay - right;
  
        adjvdisplay = crtc_state->mode.vdisplay - (top + bottom);
        vc4_pstate->crtc_y = DIV_ROUND_CLOSEST(vc4_pstate->crtc_y *
                                               adjvdisplay,
                                               crtc_state->mode.vdisplay);
        vc4_pstate->crtc_y += top;
 -      if (vc4_pstate->crtc_y > crtc_state->mode.vdisplay - top)
 -              vc4_pstate->crtc_y = crtc_state->mode.vdisplay - top;
 +      if (vc4_pstate->crtc_y > crtc_state->mode.vdisplay - bottom)
 +              vc4_pstate->crtc_y = crtc_state->mode.vdisplay - bottom;
  
        vc4_pstate->crtc_w = DIV_ROUND_CLOSEST(vc4_pstate->crtc_w *
                                               adjhdisplay,
@@@ -341,6 -339,7 +341,6 @@@ static int vc4_plane_setup_clipping_and
        struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
        struct drm_framebuffer *fb = state->fb;
        struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0);
 -      u32 subpixel_src_mask = (1 << 16) - 1;
        int num_planes = fb->format->num_planes;
        struct drm_crtc_state *crtc_state;
        u32 h_subsample = fb->format->hsub;
        for (i = 0; i < num_planes; i++)
                vc4_state->offsets[i] = bo->paddr + fb->offsets[i];
  
 -      /* We don't support subpixel source positioning for scaling. */
 -      if ((state->src.x1 & subpixel_src_mask) ||
 -          (state->src.x2 & subpixel_src_mask) ||
 -          (state->src.y1 & subpixel_src_mask) ||
 -          (state->src.y2 & subpixel_src_mask)) {
 -              return -EINVAL;
 -      }
 -
 -      vc4_state->src_x = state->src.x1 >> 16;
 -      vc4_state->src_y = state->src.y1 >> 16;
 -      vc4_state->src_w[0] = (state->src.x2 - state->src.x1) >> 16;
 -      vc4_state->src_h[0] = (state->src.y2 - state->src.y1) >> 16;
 +      /*
 +       * We don't support subpixel source positioning for scaling,
 +       * but fractional coordinates can be generated by clipping
 +       * so just round for now
 +       */
 +      vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1 << 16);
 +      vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1 << 16);
 +      vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1 << 16) - vc4_state->src_x;
 +      vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1 << 16) - vc4_state->src_y;
  
        vc4_state->crtc_x = state->dst.x1;
        vc4_state->crtc_y = state->dst.y1;
@@@ -487,10 -489,10 +487,10 @@@ static u32 vc4_lbm_size(struct drm_plan
        }
  
        /* Align it to 64 or 128 (hvs5) bytes */
-       lbm = roundup(lbm, vc4->hvs->hvs5 ? 128 : 64);
+       lbm = roundup(lbm, vc4->is_vc5 ? 128 : 64);
  
        /* Each "word" of the LBM memory contains 2 or 4 (hvs5) pixels */
-       lbm /= vc4->hvs->hvs5 ? 4 : 2;
+       lbm /= vc4->is_vc5 ? 4 : 2;
  
        return lbm;
  }
@@@ -606,7 -608,7 +606,7 @@@ static int vc4_plane_allocate_lbm(struc
                ret = drm_mm_insert_node_generic(&vc4->hvs->lbm_mm,
                                                 &vc4_state->lbm,
                                                 lbm_size,
-                                                vc4->hvs->hvs5 ? 64 : 32,
+                                                vc4->is_vc5 ? 64 : 32,
                                                 0, 0);
                spin_unlock_irqrestore(&vc4->hvs->mm_lock, irqflags);
  
@@@ -666,48 -668,6 +666,48 @@@ static const u32 colorspace_coeffs[2][D
        }
  };
  
 +static u32 vc4_hvs4_get_alpha_blend_mode(struct drm_plane_state *state)
 +{
 +      if (!state->fb->format->has_alpha)
 +              return VC4_SET_FIELD(SCALER_POS2_ALPHA_MODE_FIXED,
 +                                   SCALER_POS2_ALPHA_MODE);
 +
 +      switch (state->pixel_blend_mode) {
 +      case DRM_MODE_BLEND_PIXEL_NONE:
 +              return VC4_SET_FIELD(SCALER_POS2_ALPHA_MODE_FIXED,
 +                                   SCALER_POS2_ALPHA_MODE);
 +      default:
 +      case DRM_MODE_BLEND_PREMULTI:
 +              return VC4_SET_FIELD(SCALER_POS2_ALPHA_MODE_PIPELINE,
 +                                   SCALER_POS2_ALPHA_MODE) |
 +                      SCALER_POS2_ALPHA_PREMULT;
 +      case DRM_MODE_BLEND_COVERAGE:
 +              return VC4_SET_FIELD(SCALER_POS2_ALPHA_MODE_PIPELINE,
 +                                   SCALER_POS2_ALPHA_MODE);
 +      }
 +}
 +
 +static u32 vc4_hvs5_get_alpha_blend_mode(struct drm_plane_state *state)
 +{
 +      if (!state->fb->format->has_alpha)
 +              return VC4_SET_FIELD(SCALER5_CTL2_ALPHA_MODE_FIXED,
 +                                   SCALER5_CTL2_ALPHA_MODE);
 +
 +      switch (state->pixel_blend_mode) {
 +      case DRM_MODE_BLEND_PIXEL_NONE:
 +              return VC4_SET_FIELD(SCALER5_CTL2_ALPHA_MODE_FIXED,
 +                                   SCALER5_CTL2_ALPHA_MODE);
 +      default:
 +      case DRM_MODE_BLEND_PREMULTI:
 +              return VC4_SET_FIELD(SCALER5_CTL2_ALPHA_MODE_PIPELINE,
 +                                   SCALER5_CTL2_ALPHA_MODE) |
 +                      SCALER5_CTL2_ALPHA_PREMULT;
 +      case DRM_MODE_BLEND_COVERAGE:
 +              return VC4_SET_FIELD(SCALER5_CTL2_ALPHA_MODE_PIPELINE,
 +                                   SCALER5_CTL2_ALPHA_MODE);
 +      }
 +}
 +
  /* Writes out a full display list for an active plane to the plane's
   * private dlist state.
   */
@@@ -957,7 -917,7 +957,7 @@@ static int vc4_plane_mode_set(struct dr
        mix_plane_alpha = state->alpha != DRM_BLEND_ALPHA_OPAQUE &&
                          fb->format->has_alpha;
  
-       if (!vc4->hvs->hvs5) {
+       if (!vc4->is_vc5) {
        /* Control word */
                vc4_dlist_write(vc4_state,
                                SCALER_CTL0_VALID |
                /* Position Word 2: Source Image Size, Alpha */
                vc4_state->pos2_offset = vc4_state->dlist_count;
                vc4_dlist_write(vc4_state,
 -                              VC4_SET_FIELD(fb->format->has_alpha ?
 -                                            SCALER_POS2_ALPHA_MODE_PIPELINE :
 -                                            SCALER_POS2_ALPHA_MODE_FIXED,
 -                                            SCALER_POS2_ALPHA_MODE) |
                                (mix_plane_alpha ? SCALER_POS2_ALPHA_MIX : 0) |
 -                              (fb->format->has_alpha ?
 -                                              SCALER_POS2_ALPHA_PREMULT : 0) |
 +                              vc4_hvs4_get_alpha_blend_mode(state) |
                                VC4_SET_FIELD(vc4_state->src_w[0],
                                              SCALER_POS2_WIDTH) |
                                VC4_SET_FIELD(vc4_state->src_h[0],
                vc4_dlist_write(vc4_state,
                                VC4_SET_FIELD(state->alpha >> 4,
                                              SCALER5_CTL2_ALPHA) |
 -                              (fb->format->has_alpha ?
 -                                      SCALER5_CTL2_ALPHA_PREMULT : 0) |
 +                              vc4_hvs5_get_alpha_blend_mode(state) |
                                (mix_plane_alpha ?
 -                                      SCALER5_CTL2_ALPHA_MIX : 0) |
 -                              VC4_SET_FIELD(fb->format->has_alpha ?
 -                                    SCALER5_CTL2_ALPHA_MODE_PIPELINE :
 -                                    SCALER5_CTL2_ALPHA_MODE_FIXED,
 -                                    SCALER5_CTL2_ALPHA_MODE)
 +                                      SCALER5_CTL2_ALPHA_MIX : 0)
                               );
  
                /* Position Word 1: Scaled Image Dimensions. */
@@@ -1351,6 -1321,10 +1351,10 @@@ static int vc4_plane_atomic_async_check
  
        old_vc4_state = to_vc4_plane_state(plane->state);
        new_vc4_state = to_vc4_plane_state(new_plane_state);
+       if (!new_vc4_state->hw_dlist)
+               return -EINVAL;
        if (old_vc4_state->dlist_count != new_vc4_state->dlist_count ||
            old_vc4_state->pos0_offset != new_vc4_state->pos0_offset ||
            old_vc4_state->pos2_offset != new_vc4_state->pos2_offset ||
@@@ -1415,6 -1389,13 +1419,13 @@@ static const struct drm_plane_helper_fu
        .atomic_async_update = vc4_plane_atomic_async_update,
  };
  
+ static const struct drm_plane_helper_funcs vc5_plane_helper_funcs = {
+       .atomic_check = vc4_plane_atomic_check,
+       .atomic_update = vc4_plane_atomic_update,
+       .atomic_async_check = vc4_plane_atomic_async_check,
+       .atomic_async_update = vc4_plane_atomic_async_update,
+ };
  static bool vc4_format_mod_supported(struct drm_plane *plane,
                                     uint32_t format,
                                     uint64_t modifier)
@@@ -1483,14 -1464,13 +1494,13 @@@ static const struct drm_plane_funcs vc4
  struct drm_plane *vc4_plane_init(struct drm_device *dev,
                                 enum drm_plane_type type)
  {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_plane *plane = NULL;
        struct vc4_plane *vc4_plane;
        u32 formats[ARRAY_SIZE(hvs_formats)];
        int num_formats = 0;
        int ret = 0;
        unsigned i;
-       bool hvs5 = of_device_is_compatible(dev->dev->of_node,
-                                           "brcm,bcm2711-vc5");
        static const uint64_t modifiers[] = {
                DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
                DRM_FORMAT_MOD_BROADCOM_SAND128,
                return ERR_PTR(-ENOMEM);
  
        for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) {
-               if (!hvs_formats[i].hvs5_only || hvs5) {
+               if (!hvs_formats[i].hvs5_only || vc4->is_vc5) {
                        formats[num_formats] = hvs_formats[i].drm;
                        num_formats++;
                }
        if (ret)
                return ERR_PTR(ret);
  
-       drm_plane_helper_add(plane, &vc4_plane_helper_funcs);
+       if (vc4->is_vc5)
+               drm_plane_helper_add(plane, &vc5_plane_helper_funcs);
+       else
+               drm_plane_helper_add(plane, &vc4_plane_helper_funcs);
  
        drm_plane_create_alpha_property(plane);
 +      drm_plane_create_blend_mode_property(plane,
 +                                           BIT(DRM_MODE_BLEND_PIXEL_NONE) |
 +                                           BIT(DRM_MODE_BLEND_PREMULTI) |
 +                                           BIT(DRM_MODE_BLEND_COVERAGE));
        drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0,
                                           DRM_MODE_ROTATE_0 |
                                           DRM_MODE_ROTATE_180 |
index 1be8aa9f80747987a255c2f5f09761ccea7a24f2,1a9aa12cf8860849b32c617da82a43946b5fa2b1..f114242b5a70e21adb10338412122f7f65480036
@@@ -125,8 -125,8 +125,8 @@@ static int logo_lines
     enums.  */
  static int logo_shown = FBCON_LOGO_CANSHOW;
  /* console mappings */
 -static int first_fb_vc;
 -static int last_fb_vc = MAX_NR_CONSOLES - 1;
 +static unsigned int first_fb_vc;
 +static unsigned int last_fb_vc = MAX_NR_CONSOLES - 1;
  static int fbcon_is_default = 1; 
  static int primary_device = -1;
  static int fbcon_has_console_bind;
@@@ -440,12 -440,10 +440,12 @@@ static int __init fb_console_setup(cha
                        options += 3;
                        if (*options)
                                first_fb_vc = simple_strtoul(options, &options, 10) - 1;
 -                      if (first_fb_vc < 0)
 +                      if (first_fb_vc >= MAX_NR_CONSOLES)
                                first_fb_vc = 0;
                        if (*options++ == '-')
                                last_fb_vc = simple_strtoul(options, &options, 10) - 1;
 +                      if (last_fb_vc < first_fb_vc || last_fb_vc >= MAX_NR_CONSOLES)
 +                              last_fb_vc = MAX_NR_CONSOLES - 1;
                        fbcon_is_default = 0; 
                        continue;
                }
@@@ -1760,6 -1758,8 +1760,6 @@@ static bool fbcon_scroll(struct vc_dat
        case SM_UP:
                if (count > vc->vc_rows)        /* Maximum realistic size */
                        count = vc->vc_rows;
 -              if (logo_shown >= 0)
 -                      goto redraw_up;
                switch (fb_scrollmode(p)) {
                case SCROLL_MOVE:
                        fbcon_redraw_blit(vc, info, p, t, b - t - count,
        case SM_DOWN:
                if (count > vc->vc_rows)        /* Maximum realistic size */
                        count = vc->vc_rows;
 -              if (logo_shown >= 0)
 -                      goto redraw_down;
                switch (fb_scrollmode(p)) {
                case SCROLL_MOVE:
                        fbcon_redraw_blit(vc, info, p, b - 1, b - t - count,
@@@ -2180,6 -2182,7 +2180,6 @@@ static int fbcon_switch(struct vc_data 
        if (logo_shown == FBCON_LOGO_DRAW) {
  
                logo_shown = fg_console;
 -              /* This is protected above by initmem_freed */
                fb_show_logo(info, ops->rotate);
                update_region(vc,
                              vc->vc_origin + vc->vc_size_row * vc->vc_top,
@@@ -2466,6 -2469,11 +2466,11 @@@ static int fbcon_set_font(struct vc_dat
        if (charcount != 256 && charcount != 512)
                return -EINVAL;
  
+       /* font bigger than screen resolution ? */
+       if (w > FBCON_SWAP(info->var.rotate, info->var.xres, info->var.yres) ||
+           h > FBCON_SWAP(info->var.rotate, info->var.yres, info->var.xres))
+               return -EINVAL;
        /* Make sure drawing engine can handle the font */
        if (!(info->pixmap.blit_x & (1 << (font->width - 1))) ||
            !(info->pixmap.blit_y & (1 << (font->height - 1))))
@@@ -2728,6 -2736,34 +2733,34 @@@ void fbcon_update_vcs(struct fb_info *i
  }
  EXPORT_SYMBOL(fbcon_update_vcs);
  
+ /* let fbcon check if it supports a new screen resolution */
+ int fbcon_modechange_possible(struct fb_info *info, struct fb_var_screeninfo *var)
+ {
+       struct fbcon_ops *ops = info->fbcon_par;
+       struct vc_data *vc;
+       unsigned int i;
+       WARN_CONSOLE_UNLOCKED();
+       if (!ops)
+               return 0;
+       /* prevent setting a screen size which is smaller than font size */
+       for (i = first_fb_vc; i <= last_fb_vc; i++) {
+               vc = vc_cons[i].d;
+               if (!vc || vc->vc_mode != KD_TEXT ||
+                          fbcon_info_from_console(i) != info)
+                       continue;
+               if (vc->vc_font.width  > FBCON_SWAP(var->rotate, var->xres, var->yres) ||
+                   vc->vc_font.height > FBCON_SWAP(var->rotate, var->yres, var->xres))
+                       return -EINVAL;
+       }
+       return 0;
+ }
+ EXPORT_SYMBOL_GPL(fbcon_modechange_possible);
  int fbcon_mode_deleted(struct fb_info *info,
                       struct fb_videomode *mode)
  {
index c4a18322dee99d05e9b76ddd479cffbb03832cff,7ee6eb2fa715179b4548316ac6c680e795094cb0..02b0cf2cfafed195fe86bfd07983cf5b8e93c107
@@@ -511,7 -511,7 +511,7 @@@ static int fb_show_logo_line(struct fb_
  
                while (n && (n * (logo->width + 8) - 8 > xres))
                        --n;
-               image.dx = (xres - n * (logo->width + 8) - 8) / 2;
+               image.dx = (xres - (n * (logo->width + 8) - 8)) / 2;
                image.dy = y ?: (yres - logo->height) / 2;
        } else {
                image.dx = 0;
@@@ -1017,6 -1017,16 +1017,16 @@@ fb_set_var(struct fb_info *info, struc
        if (ret)
                return ret;
  
+       /* verify that virtual resolution >= physical resolution */
+       if (var->xres_virtual < var->xres ||
+           var->yres_virtual < var->yres) {
+               pr_warn("WARNING: fbcon: Driver '%s' missed to adjust virtual screen size (%ux%u vs. %ux%u)\n",
+                       info->fix.id,
+                       var->xres_virtual, var->yres_virtual,
+                       var->xres, var->yres);
+               return -EINVAL;
+       }
        if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW)
                return 0;
  
@@@ -1107,7 -1117,9 +1117,9 @@@ static long do_fb_ioctl(struct fb_info 
                        return -EFAULT;
                console_lock();
                lock_fb_info(info);
-               ret = fb_set_var(info, &var);
+               ret = fbcon_modechange_possible(info, &var);
+               if (!ret)
+                       ret = fb_set_var(info, &var);
                if (!ret)
                        fbcon_update_vcs(info, var.activate & FB_ACTIVATE_ALL);
                unlock_fb_info(info);
@@@ -1556,7 -1568,6 +1568,7 @@@ static void do_remove_conflicting_frame
  {
        int i;
  
 +restart_removal:
        /* check all firmware fbs and kick off if the base addr overlaps */
        for_each_registered_fb(i) {
                struct apertures_struct *gen_aper;
                                pr_warn("fb%d: no device set\n", i);
                                do_unregister_framebuffer(registered_fb[i]);
                        } else if (dev_is_platform(device)) {
 -                              registered_fb[i]->forced_out = true;
 +                              /*
 +                               * Drop the lock because if the device is unregistered, its
 +                               * driver will call to unregister_framebuffer(), that takes
 +                               * this lock.
 +                               */
 +                              mutex_unlock(&registration_lock);
                                platform_device_unregister(to_platform_device(device));
 +                              mutex_lock(&registration_lock);
                        } else {
                                pr_warn("fb%d: cannot remove device\n", i);
                                do_unregister_framebuffer(registered_fb[i]);
                        }
 +                      /*
 +                       * Restart the removal loop now that the device has been
 +                       * unregistered and its associated framebuffer gone.
 +                       */
 +                      goto restart_removal;
                }
        }
  }
@@@ -1876,9 -1876,13 +1888,9 @@@ EXPORT_SYMBOL(register_framebuffer)
  void
  unregister_framebuffer(struct fb_info *fb_info)
  {
 -      bool forced_out = fb_info->forced_out;
 -
 -      if (!forced_out)
 -              mutex_lock(&registration_lock);
 +      mutex_lock(&registration_lock);
        do_unregister_framebuffer(fb_info);
 -      if (!forced_out)
 -              mutex_unlock(&registration_lock);
 +      mutex_unlock(&registration_lock);
  }
  EXPORT_SYMBOL(unregister_framebuffer);
  
index 991a31846ae76a40cbd261795f3bb637e394ec22,f96ce8801be49c91130014e99af151a0854ca8c7..cf2a90ecd64e0a8b4cd718e3068fe4b88deccbfa
@@@ -237,8 -237,7 +237,7 @@@ static int simplefb_clocks_get(struct s
                if (IS_ERR(clock)) {
                        if (PTR_ERR(clock) == -EPROBE_DEFER) {
                                while (--i >= 0) {
-                                       if (par->clks[i])
-                                               clk_put(par->clks[i]);
+                                       clk_put(par->clks[i]);
                                }
                                kfree(par->clks);
                                return -EPROBE_DEFER;
@@@ -419,6 -418,17 +418,6 @@@ static int simplefb_probe(struct platfo
        struct simplefb_par *par;
        struct resource *res, *mem;
  
 -      /*
 -       * Generic drivers must not be registered if a framebuffer exists.
 -       * If a native driver was probed, the display hardware was already
 -       * taken and attempting to use the system framebuffer is dangerous.
 -       */
 -      if (num_registered_fb > 0) {
 -              dev_err(&pdev->dev,
 -                      "simplefb: a framebuffer is already registered\n");
 -              return -EINVAL;
 -      }
 -
        if (fb_get_options("simplefb", NULL))
                return -ENODEV;
  
This page took 0.339508 seconds and 4 git commands to generate.