]> Git Repo - linux.git/commitdiff
Merge tag 'drm-next-2019-09-18' of git://anongit.freedesktop.org/drm/drm
authorLinus Torvalds <[email protected]>
Thu, 19 Sep 2019 23:24:24 +0000 (16:24 -0700)
committerLinus Torvalds <[email protected]>
Thu, 19 Sep 2019 23:24:24 +0000 (16:24 -0700)
Pull drm updates from Dave Airlie:
 "This is the main pull request for 5.4-rc1 merge window. I don't think
  there is anything outstanding so next week should just be fixes, but
  we'll see if I missed anything. I landed some fixes earlier in the
  week but got delayed writing summary and sending it out, due to a mix
  of sick kid and jetlag!

  There are some fixes pending, but I'd rather get the main merge out of
  the way instead of delaying it longer.

  It's also pretty large in commit count and new amd header file size.
  The largest thing is four new amdgpu products (navi12/14, arcturus and
  renoir APU support).

  Otherwise it's pretty much lots of work across the board, i915 has
  started landing tigerlake support, lots of icelake fixes and lots of
  locking reworking for future gpu support, lots of header file rework
  (drmP.h is nearly gone), some old legacy hacks (DRM_WAIT_ON) have been
  put into the places they are needed.

  uapi:
   - content protection type property for HDCP

  core:
   - rework include dependencies
   - lots of drmP.h removals
   - link rate calculation robustness fix
   - make fb helper map only when required
   - add connector->DDC adapter link
   - DRM_WAIT_ON removed
   - drop DRM_AUTH usage from drivers

  dma-buf:
   - reservation object fence helper

  dma-fence:
   - shrink dma_fence struct
   - merge signal functions
   - store timestamps in dma_fence
   - selftests

  ttm:
   - embed drm_get_object struct into ttm_buffer_object
   - release_notify callback

  bridges:
   - sii902x - audio graph card support
   - tc358767 - aux data handling rework
   - ti-snd64dsi86 - debugfs support, DSI mode flags support

  panels:
   - Support for GiantPlus GPM940B0, Sharp LQ070Y3DG3B, Ortustech
     COM37H3M, Novatek NT39016, Sharp LS020B1DD01D, Raydium RM67191, Boe
     Himax8279d, Sharp LD-D5116Z01B
   - TI nspire, NEC NL8048HL11, LG Philips LB035Q02, Sharp LS037V7DW01,
     Sony ACX565AKM, Toppoly TD028TTEC1 Toppoly TD043MTEA1

  i915:
   - Initial tigerlake platform support
   - Locking simplification work, general all over refactoring.
   - Selftests
   - HDCP debug info improvements
   - DSI properties
   - Icelake display PLL fixes, colorspace fixes, bandwidth fixes, DSI
     suspend/resume
   - GuC fixes
   - Perf fixes
   - ElkhartLake enablement
   - DP MST fixes
   - GVT - command parser enhancements

  amdgpu:
   - add wipe memory on release flag for buffer creation
   - Navi12/14 support (may be marked experimental)
   - Arcturus support
   - Renoir APU support
   - mclk DPM for Navi
   - DC display fixes
   - Raven scatter/gather support
   - RAS support for GFX
   - Navi12 + Arcturus power features
   - GPU reset for Picasso
   - smu11 i2c controller support

  amdkfd:
   - navi12/14 support
   - Arcturus support

  radeon:
   - kexec fix

  nouveau:
   - improved display color management
   - detect lack of GPU power cables

  vmwgfx:
   - evicition priority support
   - remove unused security feature

  msm:
   - msm8998 display support
   - better async commit support for cursor updates

  etnaviv:
   - per-process address space support
   - performance counter fixes
   - softpin support

  mcde:
   - DCS transfers fix

  exynos:
   - drmP.h cleanup

  lima:
   - reduce logging

  kirin:
   - misc clenaups

  komeda:
   - dual-link support
   - DT memory regions

  hisilicon:
   - misc fixes

  imx:
   - IPUv3 image converter fixes
   - 32-bit RGB V4L2 pixel format support

  ingenic:
   - more support for panel related cases

  mgag200:
   - cursor support fix

  panfrost:
   - export GPU features register to userspace
   - gpu heap allocations
   - per-fd address space support

  pl111:
   - CLD pads wiring support removed from DT

  rockchip:
   - rework to use DRM PSR helpers
   - fix bug in VOP_WIN_GET macro
   - DSI DT binding rework

  sun4i:
   - improve support for color encoding and range
   - DDC enabled GPIO

  tinydrm:
   - rework SPI support
   - improve MIPI-DBI support
   - moved to drm/tiny

  vkms:
   - rework CRC tracking

  dw-hdmi:
   - get_eld and i2s improvements

  gm12u320:
   - misc fixes

  meson:
   - global code cleanup
   - vpu feature detect

  omap:
   - alpha/pixel blend mode properties

  rcar-du:
   - misc fixes"

* tag 'drm-next-2019-09-18' of git://anongit.freedesktop.org/drm/drm: (2112 commits)
  drm/nouveau/bar/gm20b: Avoid BAR1 teardown during init
  drm/nouveau: Fix ordering between TTM and GEM release
  drm/nouveau/prime: Extend DMA reservation object lock
  drm/nouveau: Fix fallout from reservation object rework
  drm/nouveau/kms/nv50-: Don't create MSTMs for eDP connectors
  drm/i915: Use NOEVICT for first pass on attemping to pin a GGTT mmap
  drm/i915: to make vgpu ppgtt notificaiton as atomic operation
  drm/i915: Flush the existing fence before GGTT read/write
  drm/i915: Hold irq-off for the entire fake lock period
  drm/i915/gvt: update RING_START reg of vGPU when the context is submitted to i915
  drm/i915/gvt: update vgpu workload head pointer correctly
  drm/mcde: Fix DSI transfers
  drm/msm: Use the correct dma_sync calls harder
  drm/msm: remove unlikely() from WARN_ON() conditions
  drm/msm/dsi: Fix return value check for clk_get_parent
  drm/msm: add atomic traces
  drm/msm/dpu: async commit support
  drm/msm: async commit support
  drm/msm: split power control from prepare/complete_commit
  drm/msm: add kms->flush_commit()
  ...

34 files changed:
1  2 
Documentation/devicetree/bindings/vendor-prefixes.yaml
Documentation/media/uapi/v4l/subdev-formats.rst
MAINTAINERS
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
drivers/gpu/drm/arm/display/komeda/komeda_dev.c
drivers/gpu/drm/arm/display/komeda/komeda_kms.c
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
drivers/gpu/drm/ast/ast_main.c
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/ast/ast_post.c
drivers/gpu/drm/drm_modes.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/i915/display/intel_dp_mst.c
drivers/gpu/drm/i915/display/intel_vdsc.c
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/gem/i915_gem_userptr.c
drivers/gpu/drm/i915/gt/intel_workarounds.c
drivers/gpu/drm/i915/gvt/scheduler.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/ingenic/ingenic-drm.c
drivers/gpu/drm/lima/lima_gem.c
drivers/gpu/drm/mcde/mcde_drv.c
drivers/gpu/drm/mediatek/mtk_drm_drv.c
drivers/gpu/drm/nouveau/dispnv50/disp.c
drivers/gpu/drm/omapdrm/omap_drv.c
drivers/gpu/drm/panfrost/panfrost_mmu.c
drivers/gpu/drm/qxl/qxl_drv.c
drivers/gpu/drm/rcar-du/rcar_lvds.c
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
drivers/gpu/drm/sun4i/sun4i_tcon.c
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c

index c5877ad800e202a9b5da45abff6fe9a42a279194,29dcc6f8a64a0d7d3d9beae5077cb2b3152f89ce..967e78c5ec0a12173d070cf4936fcf0f6cb4f209
@@@ -27,8 -27,6 +27,8 @@@ patternProperties
      description: Abilis Systems
    "^abracon,.*":
      description: Abracon Corporation
 +  "^acme,.*":
 +    description: Acme Systems srl
    "^actions,.*":
      description: Actions Semiconductor Co., Ltd.
    "^active-semi,.*":
@@@ -83,8 -81,6 +83,8 @@@
      description: Analogix Semiconductor, Inc.
    "^andestech,.*":
      description: Andes Technology Corporation
 +  "^anvo,.*":
 +    description: Anvo-Systems Dresden GmbH
    "^apm,.*":
      description: Applied Micro Circuits Corporation (APM)
    "^aptina,.*":
      description: Emerging Display Technologies
    "^eeti,.*":
      description: eGalax_eMPIA Technology Inc
 +  "^einfochips,.*":
 +    description: Einfochips
    "^elan,.*":
      description: Elan Microelectronic Corp.
    "^elgin,.*":
      description: Innolux Corporation
    "^inside-secure,.*":
      description: INSIDE Secure
 +  "^inspur,.*":
 +    description: Inspur Corporation
    "^intel,.*":
      description: Intel Corporation
    "^intercontrol,.*":
      description: Lantiq Semiconductor
    "^lattice,.*":
      description: Lattice Semiconductor
 +  "^leez,.*":
 +    description: Leez
    "^lego,.*":
      description: LEGO Systems A/S
    "^lemaker,.*":
      description: Lenovo Group Ltd.
    "^lg,.*":
      description: LG Corporation
+   "^lgphilips,.*":
+     description: LG Display
    "^libretech,.*":
      description: Shenzhen Libre Technology Co., Ltd
    "^licheepi,.*":
      description: Linear Technology Corporation
    "^logicpd,.*":
      description: Logic PD, Inc.
 +  "^longcheer,.*":
 +    description: Longcheer Technology (Shanghai) Co., Ltd.
    "^lsi,.*":
      description: LSI Corp. (LSI Logic)
    "^lwn,.*":
      description: mCube
    "^meas,.*":
      description: Measurement Specialties
 +  "^mecer,.*":
 +    description: Mustek Limited
    "^mediatek,.*":
      description: MediaTek Inc.
    "^megachips,.*":
      description: Micro Crystal AG
    "^micron,.*":
      description: Micron Technology Inc.
 +  "^microsoft,.*":
 +    description: Microsoft Corporation
    "^mikroe,.*":
      description: MikroElektronika d.o.o.
    "^miniand,.*":
      description: Semtech Corporation
    "^sensirion,.*":
      description: Sensirion AG
 +  "^sensortek,.*":
 +    description: Sensortek Technology Corporation
    "^sff,.*":
      description: Small Form Factor Committee
    "^sgd,.*":
      description: Tecon Microprocessor Technologies, LLC.
    "^topeet,.*":
      description: Topeet
+   "^toppoly,.*":
+     description: TPO (deprecated, use tpo)
+     deprecated: true
    "^toradex,.*":
      description: Toradex AG
    "^toshiba,.*":
index 7b8e17c7b68b4ed7840232f18f7a7f497662caac,f4f8de31ac6306f07db2194e43aecdca5472a659..15e11f27b4c8f6a569130561e4b96c51237948a0
@@@ -85,14 -85,6 +85,14 @@@ formats in memory (a raw Bayer image wo
  JPEG just by storing it to memory), there is no one-to-one
  correspondence between them.
  
 +The media bus pixel codes document parallel formats. Should the pixel data be
 +transported over a serial bus, the media bus pixel code that describes a
 +parallel format that transfers a sample on a single clock cycle is used. For
 +instance, both MEDIA_BUS_FMT_BGR888_1X24 and MEDIA_BUS_FMT_BGR888_3X8 are used
 +on parallel busses for transferring an 8 bits per sample BGR data, whereas on
 +serial busses the data in this format is only referred to using
 +MEDIA_BUS_FMT_BGR888_1X24. This is because there is effectively only a single
 +way to transport that format on the serial busses.
  
  Packed RGB Formats
  ^^^^^^^^^^^^^^^^^^
@@@ -1313,6 -1305,113 +1313,113 @@@ The following tables list existing pack
        - g\ :sub:`6`
        - g\ :sub:`5`
        - g\ :sub:`4`
+     * .. _MEDIA-BUS-FMT-RGB888-3X8:
+       - MEDIA_BUS_FMT_RGB888_3X8
+       - 0x101c
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       - r\ :sub:`7`
+       - r\ :sub:`6`
+       - r\ :sub:`5`
+       - r\ :sub:`4`
+       - r\ :sub:`3`
+       - r\ :sub:`2`
+       - r\ :sub:`1`
+       - r\ :sub:`0`
+     * -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       - g\ :sub:`7`
+       - g\ :sub:`6`
+       - g\ :sub:`5`
+       - g\ :sub:`4`
+       - g\ :sub:`3`
+       - g\ :sub:`2`
+       - g\ :sub:`1`
+       - g\ :sub:`0`
+     * -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       -
+       - b\ :sub:`7`
+       - b\ :sub:`6`
+       - b\ :sub:`5`
+       - b\ :sub:`4`
+       - b\ :sub:`3`
+       - b\ :sub:`2`
+       - b\ :sub:`1`
+       - b\ :sub:`0`
      * .. _MEDIA-BUS-FMT-ARGB888-1X32:
  
        - MEDIA_BUS_FMT_ARGB888_1X32
diff --combined MAINTAINERS
index 3e449fad6cad1074739f8788dd9e78b0a43c9dc3,c2d975da561f7f301118068bbb19f8f5f476da89..c740cf3f93efc3d09505fa95aea4629b02f6311a
@@@ -183,7 -183,7 +183,7 @@@ M: Realtek linux nic maintainers <nic_s
  M:    Heiner Kallweit <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    drivers/net/ethernet/realtek/r8169.c
 +F:    drivers/net/ethernet/realtek/r8169*
  
  8250/16?50 (AND CLONE UARTS) SERIAL DRIVER
  M:    Greg Kroah-Hartman <[email protected]>
@@@ -517,6 -517,14 +517,6 @@@ W:        http://ez.analog.com/community/linux
  S:    Supported
  F:    drivers/video/backlight/adp8860_bl.c
  
 -ADS1015 HARDWARE MONITOR DRIVER
 -M:    Dirk Eibach <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    Documentation/hwmon/ads1015.rst
 -F:    drivers/hwmon/ads1015.c
 -F:    include/linux/platform_data/ads1015.h
 -
  ADT746X FAN DRIVER
  M:    Colin Leroy <[email protected]>
  S:    Maintained
@@@ -641,12 -649,6 +641,12 @@@ M:       Lino Sanfilippo <LinoSanfilippo@gmx.
  S:    Maintained
  F:    drivers/net/ethernet/alacritech/*
  
 +FORCEDETH GIGABIT ETHERNET DRIVER
 +M:    Rain River <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/net/ethernet/nvidia/*
 +
  ALCATEL SPEEDTOUCH USB DRIVER
  M:    Duncan Sands <[email protected]>
  L:    [email protected]
@@@ -664,7 -666,7 +664,7 @@@ ALI1563 I2C DRIVE
  M:    Rudolf Marek <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-ali1563
 +F:    Documentation/i2c/busses/i2c-ali1563.rst
  F:    drivers/i2c/busses/i2c-ali1563.c
  
  ALLEGRO DVT VIDEO IP CORE DRIVER
@@@ -674,13 -676,6 +674,13 @@@ L:       [email protected]
  S:    Maintained
  F:    drivers/staging/media/allegro-dvt/
  
 +ALLWINNER CPUFREQ DRIVER
 +M:    Yangtao Li <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/opp/sun50i-nvmem-cpufreq.txt
 +F:    drivers/cpufreq/sun50i-cpufreq-nvmem.c
 +
  ALLWINNER SECURITY SYSTEM
  M:    Corentin Labbe <[email protected]>
  L:    [email protected]
@@@ -688,7 -683,7 +688,7 @@@ S: Maintaine
  F:    drivers/crypto/sunxi-ss/
  
  ALLWINNER VPU DRIVER
 -M:    Maxime Ripard <m[email protected]>
 +M:    Maxime Ripard <m[email protected]>
  M:    Paul Kocialkowski <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -834,17 -829,11 +834,11 @@@ F:      drivers/iommu/amd_iommu*.[ch
  F:    include/linux/amd-iommu.h
  
  AMD KFD
- M:    Oded Gabbay <[email protected]>
- L:    [email protected]
- T:    git git://people.freedesktop.org/~gabbayo/linux.git
- S:    Supported
- F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
- F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
- F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
- F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c
- F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
- F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
- F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+ M:    Felix Kuehling <[email protected]>
+ L:    [email protected]
+ T:    git git://people.freedesktop.org/~agd5f/linux
+ S:    Supported
+ F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd*.[ch]
  F:    drivers/gpu/drm/amd/amdkfd/
  F:    drivers/gpu/drm/amd/include/cik_structs.h
  F:    drivers/gpu/drm/amd/include/kgd_kfd_interface.h
@@@ -908,12 -897,11 +902,12 @@@ F:      Documentation/devicetree/bindings/ii
  
  ANALOG DEVICES INC AD7606 DRIVER
  M:    Stefan Popa <[email protected]>
 +M:    Beniamin Bia <[email protected]>
  L:    [email protected]
  W:    http://ez.analog.com/community/linux-device-drivers
  S:    Supported
  F:    drivers/iio/adc/ad7606.c
 -F:    Documentation/devicetree/bindings/iio/adc/adi,ad7606.txt
 +F:    Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml
  
  ANALOG DEVICES INC AD7768-1 DRIVER
  M:    Stefan Popa <[email protected]>
@@@ -944,14 -932,6 +938,14 @@@ S:       Supporte
  F:    drivers/mux/adgs1408.c
  F:    Documentation/devicetree/bindings/mux/adi,adgs1408.txt
  
 +ANALOG DEVICES INC ADIN DRIVER
 +M:    Alexandru Ardelean <[email protected]>
 +L:    [email protected]
 +W:    http://ez.analog.com/community/linux-device-drivers
 +S:    Supported
 +F:    drivers/net/phy/adin.c
 +F:    Documentation/devicetree/bindings/net/adi,adin.yaml
 +
  ANALOG DEVICES INC ADIS DRIVER LIBRARY
  M:    Alexandru Ardelean <[email protected]>
  S:    Supported
@@@ -959,14 -939,6 +953,14 @@@ L:       [email protected]
  F:    include/linux/iio/imu/adis.h
  F:    drivers/iio/imu/adis.c
  
 +ANALOG DEVICES INC ADIS16460 DRIVER
 +M:    Dragos Bogdan <[email protected]>
 +S:    Supported
 +L:    [email protected]
 +W:    http://ez.analog.com/community/linux-device-drivers
 +F:    drivers/iio/imu/adis16460.c
 +F:    Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
 +
  ANALOG DEVICES INC ADP5061 DRIVER
  M:    Stefan Popa <[email protected]>
  L:    [email protected]
@@@ -1372,7 -1344,8 +1366,7 @@@ M:      Will Deacon <[email protected]
  R:    Robin Murphy <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
 -F:    drivers/iommu/arm-smmu.c
 -F:    drivers/iommu/arm-smmu-v3.c
 +F:    drivers/iommu/arm-smmu*
  F:    drivers/iommu/io-pgtable-arm.c
  F:    drivers/iommu/io-pgtable-arm-v7s.c
  
@@@ -1400,7 -1373,7 +1394,7 @@@ F:      drivers/pinctrl/actions/
  F:    drivers/soc/actions/
  F:    include/dt-bindings/power/owl-*
  F:    include/linux/soc/actions/
 -F:    Documentation/devicetree/bindings/arm/actions.txt
 +F:    Documentation/devicetree/bindings/arm/actions.yaml
  F:    Documentation/devicetree/bindings/clock/actions,owl-cmu.txt
  F:    Documentation/devicetree/bindings/dma/owl-dma.txt
  F:    Documentation/devicetree/bindings/i2c/i2c-owl.txt
@@@ -1429,7 -1402,7 +1423,7 @@@ S:      Maintaine
  F:    drivers/clk/sunxi/
  
  ARM/Allwinner sunXi SoC support
 -M:    Maxime Ripard <m[email protected]>
 +M:    Maxime Ripard <m[email protected]>
  M:    Chen-Yu Tsai <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
@@@ -1442,14 -1415,6 +1436,14 @@@ F:    drivers/pinctrl/sunxi
  F:    drivers/soc/sunxi/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git
  
 +Allwinner A10 CSI driver
 +M:    Maxime Ripard <[email protected]>
 +L:    [email protected]
 +T:    git git://linuxtv.org/media_tree.git
 +F:    drivers/media/platform/sunxi/sun4i-csi/
 +F:    Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml
 +S:    Maintained
 +
  ARM/Amlogic Meson SoC CLOCK FRAMEWORK
  M:    Neil Armstrong <[email protected]>
  M:    Jerome Brunet <[email protected]>
@@@ -1500,7 -1465,6 +1494,7 @@@ F:      arch/arm/mach-artpe
  F:    arch/arm/boot/dts/artpec6*
  F:    drivers/clk/axis
  F:    drivers/crypto/axis
 +F:    drivers/mmc/host/usdhi6rol0.c
  F:    drivers/pinctrl/pinctrl-artpec*
  F:    Documentation/devicetree/bindings/pinctrl/axis,artpec6-pinctrl.txt
  
@@@ -1612,8 -1576,8 +1606,8 @@@ R:      Suzuki K Poulose <suzuki.poulose@arm
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    drivers/hwtracing/coresight/*
 -F:    Documentation/trace/coresight.txt
 -F:    Documentation/trace/coresight-cpu-debug.txt
 +F:    Documentation/trace/coresight.rst
 +F:    Documentation/trace/coresight-cpu-debug.rst
  F:    Documentation/devicetree/bindings/arm/coresight.txt
  F:    Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt
  F:    Documentation/ABI/testing/sysfs-bus-coresight-devices-*
@@@ -1656,21 -1620,6 +1650,21 @@@ F:    drivers/clocksource/timer-atlas7.
  N:    [^a-z]sirf
  X:    drivers/gnss
  
 +ARM/CZ.NIC TURRIS MOX SUPPORT
 +M:    Marek Behun <[email protected]>
 +W:    http://mox.turris.cz
 +S:    Maintained
 +F:    Documentation/ABI/testing/debugfs-moxtet
 +F:    Documentation/ABI/testing/sysfs-bus-moxtet-devices
 +F:    Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm
 +F:    Documentation/devicetree/bindings/bus/moxtet.txt
 +F:    Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt
 +F:    Documentation/devicetree/bindings/gpio/gpio-moxtet.txt
 +F:    include/linux/moxtet.h
 +F:    drivers/bus/moxtet.c
 +F:    drivers/firmware/turris-mox-rwtm.c
 +F:    drivers/gpio/gpio-moxtet.c
 +
  ARM/EBSA110 MACHINE SUPPORT
  M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-pxa/colibri-pxa270-income.c
  
 -ARM/INTEL IOP13XX ARM ARCHITECTURE
 -M:    Lennert Buytenhek <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 -S:    Maintained
 -
  ARM/INTEL IOP32X ARM ARCHITECTURE
  M:    Lennert Buytenhek <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  
 -ARM/INTEL IOP33X ARM ARCHITECTURE
 -L:    [email protected] (moderated for non-subscribers)
 -S:    Orphan
 -
  ARM/INTEL IQ81342EX MACHINE SUPPORT
  M:    Lennert Buytenhek <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -1957,6 -1915,12 +1951,6 @@@ S:     Maintaine
  F:    drivers/phy/mediatek/
  F:    Documentation/devicetree/bindings/phy/phy-mtk-*
  
 -ARM/MICREL KS8695 ARCHITECTURE
 -M:    Greg Ungerer <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 -F:    arch/arm/mach-ks8695/
 -S:    Odd Fixes
 -
  ARM/Microchip (AT91) SoC support
  M:    Nicolas Ferre <[email protected]>
  M:    Alexandre Belloni <[email protected]>
@@@ -1998,7 -1962,6 +1992,7 @@@ F:      Documentation/devicetree/bindings/i2
  F:    arch/arm/mach-nomadik/
  F:    arch/arm/mach-u300/
  F:    arch/arm/mach-ux500/
 +F:    drivers/soc/ux500/
  F:    arch/arm/boot/dts/ste-*
  F:    drivers/clk/clk-nomadik.c
  F:    drivers/clk/clk-u300.c
@@@ -2042,6 -2005,22 +2036,6 @@@ F:     drivers/*/*npcm
  F:    Documentation/devicetree/bindings/*/*npcm*
  F:    Documentation/devicetree/bindings/*/*/*npcm*
  
 -ARM/NUVOTON W90X900 ARM ARCHITECTURE
 -M:    Wan ZongShun <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.mcuos.com
 -S:    Maintained
 -F:    arch/arm/mach-w90x900/
 -F:    drivers/input/keyboard/w90p910_keypad.c
 -F:    drivers/input/touchscreen/w90p910_ts.c
 -F:    drivers/watchdog/nuc900_wdt.c
 -F:    drivers/net/ethernet/nuvoton/w90p910_ether.c
 -F:    drivers/mtd/nand/raw/nuc900_nand.c
 -F:    drivers/rtc/rtc-nuc900.c
 -F:    drivers/spi/spi-nuc900.c
 -F:    drivers/usb/host/ehci-w90x900.c
 -F:    drivers/video/fbdev/nuc900fb.c
 -
  ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT
  L:    [email protected] (subscribers-only)
  W:    http://wiki.openmoko.org/wiki/Neo_FreeRunner
@@@ -2166,7 -2145,7 +2160,7 @@@ M:      Andreas Färber <[email protected]
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm64/boot/dts/realtek/
 -F:    Documentation/devicetree/bindings/arm/realtek.txt
 +F:    Documentation/devicetree/bindings/arm/realtek.yaml
  
  ARM/RENESAS ARM64 ARCHITECTURE
  M:    Simon Horman <[email protected]>
@@@ -2234,9 -2213,8 +2228,9 @@@ F:      drivers/*/*s3c24
  F:    drivers/*/*/*s3c24*
  F:    drivers/*/*s3c64xx*
  F:    drivers/*/*s5pv210*
 -F:    drivers/memory/samsung/*
 -F:    drivers/soc/samsung/*
 +F:    drivers/memory/samsung/
 +F:    drivers/soc/samsung/
 +F:    include/linux/soc/samsung/
  F:    Documentation/arm/samsung/
  F:    Documentation/devicetree/bindings/arm/samsung/
  F:    Documentation/devicetree/bindings/sram/samsung-sram.txt
@@@ -2931,7 -2909,6 +2925,7 @@@ BATMAN ADVANCE
  M:    Marek Lindner <[email protected]>
  M:    Simon Wunderlich <[email protected]>
  M:    Antonio Quartulli <[email protected]>
 +M:    Sven Eckelmann <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  W:    https://www.open-mesh.org/
  B:    https://www.open-mesh.org/projects/batman-adv/issues
@@@ -3594,7 -3571,7 +3588,7 @@@ F:      Documentation/filesystems/caching/ca
  F:    fs/cachefiles/
  
  CADENCE MIPI-CSI2 BRIDGES
 -M:    Maxime Ripard <m[email protected]>
 +M:    Maxime Ripard <m[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    Documentation/devicetree/bindings/media/cdns,*.txt
@@@ -3652,12 -3629,9 +3646,12 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/net/can/
  F:    drivers/net/can/
  F:    include/linux/can/dev.h
 +F:    include/linux/can/led.h
 +F:    include/linux/can/rx-offload.h
  F:    include/linux/can/platform/
  F:    include/uapi/linux/can/error.h
  F:    include/uapi/linux/can/netlink.h
 +F:    include/uapi/linux/can/vxcan.h
  
  CAN NETWORK LAYER
  M:    Oliver Hartkopp <[email protected]>
@@@ -3670,23 -3644,11 +3664,23 @@@ S:   Maintaine
  F:    Documentation/networking/can.rst
  F:    net/can/
  F:    include/linux/can/core.h
 +F:    include/linux/can/skb.h
 +F:    include/net/netns/can.h
  F:    include/uapi/linux/can.h
  F:    include/uapi/linux/can/bcm.h
  F:    include/uapi/linux/can/raw.h
  F:    include/uapi/linux/can/gw.h
  
 +CAN-J1939 NETWORK LAYER
 +M:    Robin van der Gracht <[email protected]>
 +M:    Oleksij Rempel <[email protected]>
 +R:    Pengutronix Kernel Team <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/networking/j1939.txt
 +F:    net/can/j1939/
 +F:    include/uapi/linux/can/j1939.h
 +
  CAPABILITIES
  M:    Serge Hallyn <[email protected]>
  L:    [email protected]
@@@ -3836,9 -3798,14 +3830,9 @@@ F:     scripts/sign-file.
  F:    scripts/extract-cert.c
  
  CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
 -L:    [email protected]
 -S:    Orphan
 -F:    Documentation/usb/wusb-design-overview.rst
 -F:    Documentation/usb/wusb-cbaf
 -F:    drivers/usb/host/hwa-hc.c
 -F:    drivers/usb/host/whci/
 -F:    drivers/usb/wusbcore/
 -F:    include/linux/usb/wusb*
 +L:    [email protected]
 +S:    Obsolete
 +F:    drivers/staging/wusbcore/
  
  CFAG12864B LCD DRIVER
  M:    Miguel Ojeda Sandonis <[email protected]>
@@@ -4130,7 -4097,7 +4124,7 @@@ L:      [email protected] (mod
  W:    http://linux-cifs.samba.org/
  T:    git git://git.samba.org/sfrench/cifs-2.6.git
  S:    Supported
 -F:    Documentation/filesystems/cifs/
 +F:    Documentation/admin-guide/cifs/
  F:    fs/cifs/
  
  COMPACTPCI HOTPLUG CORE
@@@ -4317,14 -4284,6 +4311,14 @@@ S:    Supporte
  F:    drivers/cpuidle/cpuidle-exynos.c
  F:    arch/arm/mach-exynos/pm.c
  
 +CPUIDLE DRIVER - ARM PSCI
 +M:    Lorenzo Pieralisi <[email protected]>
 +M:    Sudeep Holla <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +S:    Supported
 +F:    drivers/cpuidle/cpuidle-psci.c
 +
  CPU IDLE TIME MANAGEMENT FRAMEWORK
  M:    "Rafael J. Wysocki" <[email protected]>
  M:    Daniel Lezcano <[email protected]>
@@@ -4986,9 -4945,7 +4980,9 @@@ M:      Jonathan Corbet <[email protected]
  L:    [email protected]
  S:    Maintained
  F:    Documentation/
 +F:    scripts/documentation-file-ref-check
  F:    scripts/kernel-doc
 +F:    scripts/sphinx-pre-install
  X:    Documentation/ABI/
  X:    Documentation/firmware-guide/acpi/
  X:    Documentation/devicetree/
  S:    Maintained
  F:    Documentation/translations/it_IT
  
 +DOCUMENTATION SCRIPTS
 +M:    Mauro Carvalho Chehab <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    scripts/documentation-file-ref-check
 +F:    scripts/sphinx-pre-install
 +F:    Documentation/sphinx/parse-headers.pl
 +
  DONGWOON DW9714 LENS VOICE COIL DRIVER
  M:    Sakari Ailus <[email protected]>
  L:    [email protected]
@@@ -5144,17 -5093,24 +5138,24 @@@ S:   Maintaine
  F:    drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
  F:    Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt
  
+ DRM DRIVER FOR GRAIN MEDIA GM12U320 PROJECTORS
+ M:    Hans de Goede <[email protected]>
+ T:    git git://anongit.freedesktop.org/drm/drm-misc
+ S:    Maintained
+ F:    drivers/gpu/drm/tiny/gm12u320.c
  DRM DRIVER FOR ILITEK ILI9225 PANELS
  M:    David Lechner <[email protected]>
+ T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
- F:    drivers/gpu/drm/tinydrm/ili9225.c
+ F:    drivers/gpu/drm/tiny/ili9225.c
  F:    Documentation/devicetree/bindings/display/ilitek,ili9225.txt
  
  DRM DRIVER FOR HX8357D PANELS
  M:    Eric Anholt <[email protected]>
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
- F:    drivers/gpu/drm/tinydrm/hx8357d.c
+ F:    drivers/gpu/drm/tiny/hx8357d.c
  F:    Documentation/devicetree/bindings/display/himax,hx8357d.txt
  
  DRM DRIVER FOR INTEL I810 VIDEO CARDS
@@@ -5174,8 -5130,9 +5175,9 @@@ F:      drivers/gpu/drm/mgag200
  
  DRM DRIVER FOR MI0283QT
  M:    Noralf Trønnes <[email protected]>
+ T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
- F:    drivers/gpu/drm/tinydrm/mi0283qt.c
+ F:    drivers/gpu/drm/tiny/mi0283qt.c
  F:    Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt
  
  DRM DRIVER FOR MSM ADRENO GPU
@@@ -5207,8 -5164,9 +5209,9 @@@ F:      Documentation/devicetree/bindings/di
  
  DRM DRIVER FOR PERVASIVE DISPLAYS REPAPER PANELS
  M:    Noralf Trønnes <[email protected]>
+ T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
- F:    drivers/gpu/drm/tinydrm/repaper.c
+ F:    drivers/gpu/drm/tiny/repaper.c
  F:    Documentation/devicetree/bindings/display/repaper.txt
  
  DRM DRIVER FOR QEMU'S CIRRUS DEVICE
@@@ -5230,6 -5188,12 +5233,12 @@@ S:    Maintaine
  F:    drivers/gpu/drm/qxl/
  F:    include/uapi/drm/qxl_drm.h
  
+ DRM DRIVER FOR RAYDIUM RM67191 PANELS
+ M:    Robert Chiras <[email protected]>
+ S:    Maintained
+ F:    drivers/gpu/drm/panel/panel-raydium-rm67191.c
+ F:    Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
  DRM DRIVER FOR RAGE 128 VIDEO CARDS
  S:    Orphan / Obsolete
  F:    drivers/gpu/drm/r128/
@@@ -5237,6 -5201,7 +5246,7 @@@ F:      include/uapi/drm/r128_drm.
  
  DRM DRIVER FOR ROCKTECH JH057N00900 PANELS
  M:    Guido Günther <[email protected]>
+ R:    Purism Kernel Team <[email protected]>
  S:    Maintained
  F:    drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
  F:    Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt
@@@ -5259,14 -5224,16 +5269,16 @@@ F:   Documentation/devicetree/bindings/di
  
  DRM DRIVER FOR SITRONIX ST7586 PANELS
  M:    David Lechner <[email protected]>
+ T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
- F:    drivers/gpu/drm/tinydrm/st7586.c
+ F:    drivers/gpu/drm/tiny/st7586.c
  F:    Documentation/devicetree/bindings/display/sitronix,st7586.txt
  
  DRM DRIVER FOR SITRONIX ST7735R PANELS
  M:    David Lechner <[email protected]>
+ T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
- F:    drivers/gpu/drm/tinydrm/st7735r.c
+ F:    drivers/gpu/drm/tiny/st7735r.c
  F:    Documentation/devicetree/bindings/display/sitronix,st7735r.txt
  
  DRM DRIVER FOR ST-ERICSSON MCDE
@@@ -5285,7 -5252,7 +5297,7 @@@ M:      Linus Walleij <linus.walleij@linaro.
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
  F:    drivers/gpu/drm/panel/panel-tpo-tpg110.c
- F:    Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt
+ F:    Documentation/devicetree/bindings/display/panel/tpo,tpg110.yaml
  
  DRM DRIVER FOR USB DISPLAYLINK VIDEO ADAPTERS
  M:    Dave Airlie <[email protected]>
@@@ -5340,7 -5307,7 +5352,7 @@@ F:      include/linux/vga
  
  DRM DRIVERS AND MISC GPU PATCHES
  M:    Maarten Lankhorst <[email protected]>
 -M:    Maxime Ripard <m[email protected]>
 +M:    Maxime Ripard <m[email protected]>
  M:    Sean Paul <[email protected]>
  W:    https://01.org/linuxgraphics/gfx-docs/maintainer-tools/drm-misc.html
  S:    Maintained
@@@ -5353,7 -5320,7 +5365,7 @@@ F:      include/uapi/drm/drm
  F:    include/linux/vga*
  
  DRM DRIVERS FOR ALLWINNER A10
 -M:    Maxime Ripard  <[email protected]>
 +M:    Maxime Ripard <[email protected]>
  L:    [email protected]
  S:    Supported
  F:    drivers/gpu/drm/sun4i/
  W:    http://linux-meson.com/
  S:    Supported
  F:    drivers/gpu/drm/meson/
- F:    Documentation/devicetree/bindings/display/amlogic,meson-vpu.txt
- F:    Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.txt
+ F:    Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml
+ F:    Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
  F:    Documentation/gpu/meson.rst
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  
  DRM DRIVERS FOR ATMEL HLCDC
+ M:    Sam Ravnborg <[email protected]>
  M:    Boris Brezillon <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -5382,7 -5350,10 +5395,10 @@@ T:    git git://anongit.freedesktop.org/dr
  
  DRM DRIVERS FOR BRIDGE CHIPS
  M:    Andrzej Hajda <[email protected]>
+ M:    Neil Armstrong <[email protected]>
  R:    Laurent Pinchart <[email protected]>
+ R:    Jonas Karlman <[email protected]>
+ R:    Jernej Skrabec <[email protected]>
  S:    Maintained
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  F:    drivers/gpu/drm/bridge/
@@@ -5570,14 -5541,6 +5586,6 @@@ F:     drivers/gpu/drm/panel
  F:    include/drm/drm_panel.h
  F:    Documentation/devicetree/bindings/display/panel/
  
- DRM TINYDRM DRIVERS
- M:    Noralf Trønnes <[email protected]>
- W:    https://github.com/notro/tinydrm/wiki/Development
- T:    git git://anongit.freedesktop.org/drm/drm-misc
- S:    Maintained
- F:    drivers/gpu/drm/tinydrm/
- F:    include/drm/tinydrm/
  DRM DRIVERS FOR XEN
  M:    Oleksandr Andrushchenko <[email protected]>
  T:    git git://anongit.freedesktop.org/drm/drm-misc
@@@ -5603,6 -5566,12 +5611,6 @@@ T:     git git://linuxtv.org/media_tree.gi
  S:    Maintained
  F:    drivers/media/radio/dsbr100.c
  
 -DSCC4 DRIVER
 -M:    Francois Romieu <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    drivers/net/wan/dscc4.c
 -
  DT3155 MEDIA DRIVER
  M:    Hans Verkuil <[email protected]>
  L:    [email protected]
@@@ -5800,11 -5769,6 +5808,11 @@@ S:    Supporte
  F:    drivers/edac/aspeed_edac.c
  F:    Documentation/devicetree/bindings/edac/aspeed-sdram-edac.txt
  
 +EDAC-BLUEFIELD
 +M:    Shravan Kumar Ramani <[email protected]>
 +S:    Supported
 +F:    drivers/edac/bluefield_edac.c
 +
  EDAC-CALXEDA
  M:    Robert Richter <[email protected]>
  L:    [email protected]
@@@ -5829,11 -5793,10 +5837,11 @@@ F:   drivers/edac/thunderx_edac
  EDAC-CORE
  M:    Borislav Petkov <[email protected]>
  M:    Mauro Carvalho Chehab <[email protected]>
 +M:    Tony Luck <[email protected]>
  R:    James Morse <[email protected]>
 +R:    Robert Richter <[email protected]>
  L:    [email protected]
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git for-next
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac.git linux_next
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git edac-for-next
  S:    Supported
  F:    Documentation/admin-guide/ras.rst
  F:    Documentation/driver-api/edac.rst
@@@ -6083,13 -6046,6 +6091,13 @@@ T:    git git://git.kernel.org/pub/scm/lin
  F:    drivers/video/fbdev/s1d13xxxfb.c
  F:    include/video/s1d13xxxfb.h
  
 +EROFS FILE SYSTEM
 +M:    Gao Xiang <[email protected]>
 +M:    Chao Yu <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    fs/erofs/
 +
  ERRSEQ ERROR TRACKING INFRASTRUCTURE
  M:    Jeff Layton <[email protected]>
  S:    Maintained
@@@ -6117,7 -6073,7 +6125,7 @@@ M:      Florian Fainelli <[email protected]
  M:    Heiner Kallweit <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/ABI/testing/sysfs-bus-mdio
 +F:    Documentation/ABI/testing/sysfs-class-net-phydev
  F:    Documentation/devicetree/bindings/net/ethernet-phy.yaml
  F:    Documentation/devicetree/bindings/net/mdio*
  F:    Documentation/networking/phy.rst
@@@ -6134,11 -6090,6 +6142,11 @@@ F:    include/trace/events/mdio.
  F:    include/uapi/linux/mdio.h
  F:    include/uapi/linux/mii.h
  
 +EXFAT FILE SYSTEM
 +M:    Valdis Kletnieks <[email protected]>
 +S:    Maintained
 +F:    drivers/staging/exfat/
 +
  EXT2 FILE SYSTEM
  M:    Jan Kara <[email protected]>
  L:    [email protected]
@@@ -6325,14 -6276,12 +6333,14 @@@ S:   Maintaine
  F:    drivers/hwmon/f75375s.c
  F:    include/linux/f75375s.h
  
 -FIREWIRE AUDIO DRIVERS
 +FIREWIRE AUDIO DRIVERS and IEC 61883-1/6 PACKET STREAMING ENGINE
  M:    Clemens Ladisch <[email protected]>
 +M:    Takashi Sakamoto <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
  S:    Maintained
  F:    sound/firewire/
 +F:    include/uapi/sound/firewire.h
  
  FIREWIRE MEDIA DRIVERS (firedtv)
  M:    Stefan Richter <[email protected]>
@@@ -6380,7 -6329,7 +6388,7 @@@ FLEXTIMER FTM-QUADDEC DRIVE
  M:    Patrick Havelange <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/ABI/testing/sysfs-bus-counter-ftm-quadddec
 +F:    Documentation/ABI/testing/sysfs-bus-counter-ftm-quaddec
  F:    Documentation/devicetree/bindings/counter/ftm-quaddec.txt
  F:    drivers/counter/ftm-quaddec.c
  
@@@ -6390,11 -6339,20 +6398,11 @@@ S:   Odd Fixe
  L:    [email protected]
  F:    drivers/block/floppy.c
  
 -FMC SUBSYSTEM
 -M:    Alessandro Rubini <[email protected]>
 -W:    http://www.ohwr.org/projects/fmc-bus
 -S:    Supported
 -F:    drivers/fmc/
 -F:    include/linux/fmc*.h
 -F:    include/linux/ipmi-fru.h
 -K:    fmc_d.*register
 -
  FPGA MANAGER FRAMEWORK
  M:    Moritz Fischer <[email protected]>
  L:    [email protected]
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/atull/linux-fpga.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga.git
  Q:    http://patchwork.kernel.org/project/linux-fpga/list/
  F:    Documentation/fpga/
  F:    Documentation/driver-api/fpga/
@@@ -6427,7 -6385,7 +6435,7 @@@ FRAMEBUFFER LAYE
  M:    Bartlomiej Zolnierkiewicz <[email protected]>
  L:    [email protected]
  L:    [email protected]
 -T:    git git://github.com/bzolnier/linux.git
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
  Q:    http://patchwork.kernel.org/project/linux-fbdev/list/
  S:    Maintained
  F:    Documentation/fb/
@@@ -6489,17 -6447,8 +6497,17 @@@ M:    Frank Li <[email protected]
  L:    [email protected]
  S:    Maintained
  F:    drivers/perf/fsl_imx8_ddr_perf.c
 +F:    Documentation/admin-guide/perf/imx-ddr.rst
  F:    Documentation/devicetree/bindings/perf/fsl-imx-ddr.txt
  
 +FREESCALE IMX I2C DRIVER
 +M:    Oleksij Rempel <[email protected]>
 +R:    Pengutronix Kernel Team <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/i2c/busses/i2c-imx.c
 +F:    Documentation/devicetree/bindings/i2c/i2c-imx.txt
 +
  FREESCALE IMX LPI2C DRIVER
  M:    Dong Aisheng <[email protected]>
  L:    [email protected]
@@@ -6662,7 -6611,6 +6670,7 @@@ T:      git git://git.kernel.org/pub/scm/fs/
  S:    Supported
  F:    fs/crypto/
  F:    include/linux/fscrypt*.h
 +F:    include/uapi/linux/fscrypt.h
  F:    Documentation/filesystems/fscrypt.rst
  
  FSI SUBSYSTEM
@@@ -6694,18 -6642,6 +6702,18 @@@ S:    Maintaine
  F:    fs/notify/
  F:    include/linux/fsnotify*.h
  
 +FSVERITY: READ-ONLY FILE-BASED AUTHENTICITY PROTECTION
 +M:    Eric Biggers <[email protected]>
 +M:    Theodore Y. Ts'o <[email protected]>
 +L:    [email protected]
 +Q:    https://patchwork.kernel.org/project/linux-fscrypt/list/
 +T:    git git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git fsverity
 +S:    Supported
 +F:    fs/verity/
 +F:    include/linux/fsverity.h
 +F:    include/uapi/linux/fsverity.h
 +F:    Documentation/filesystems/fsverity.rst
 +
  FUJITSU LAPTOP EXTRAS
  M:    Jonathan Woithe <[email protected]>
  L:    [email protected]
@@@ -6796,13 -6732,6 +6804,13 @@@ W:    https://linuxtv.or
  S:    Maintained
  F:    drivers/media/radio/radio-gemtek*
  
 +GENERIC ARCHITECTURE TOPOLOGY
 +M:    Sudeep Holla <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/base/arch_topology.c
 +F:    include/linux/arch_topology.h
 +
  GENERIC GPIO I2C DRIVER
  M:    Wolfram Sang <[email protected]>
  S:    Supported
@@@ -6815,7 -6744,7 +6823,7 @@@ L:      [email protected]
  S:    Supported
  F:    drivers/i2c/muxes/i2c-mux-gpio.c
  F:    include/linux/platform_data/i2c-mux-gpio.h
 -F:    Documentation/i2c/muxes/i2c-mux-gpio
 +F:    Documentation/i2c/muxes/i2c-mux-gpio.rst
  
  GENERIC HDLC (WAN) DRIVERS
  M:    Krzysztof Halasa <[email protected]>
@@@ -6906,6 -6835,13 +6914,6 @@@ F:     Documentation/filesystems/gfs2*.tx
  F:    fs/gfs2/
  F:    include/uapi/linux/gfs2_ondisk.h
  
 -GIGASET ISDN DRIVERS
 -M:    Paul Bolle <[email protected]>
 -L:    [email protected]
 -W:    http://gigaset307x.sourceforge.net/
 -S:    Odd Fixes
 -F:    drivers/staging/isdn/gigaset/
 -
  GNSS SUBSYSTEM
  M:    Johan Hovold <[email protected]>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git
@@@ -7059,9 -6995,6 +7067,9 @@@ M:      Alex Elder <[email protected]
  M:    Greg Kroah-Hartman <[email protected]>
  S:    Maintained
  F:    drivers/staging/greybus/
 +F:    drivers/greybus/
 +F:    include/linux/greybus.h
 +F:    include/linux/greybus/
  L:    [email protected] (moderated for non-subscribers)
  
  GREYBUS UART PROTOCOLS DRIVERS
@@@ -7387,17 -7320,6 +7395,17 @@@ S:    Supporte
  F:    drivers/scsi/hisi_sas/
  F:    Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
  
 +HISILICON QM AND ZIP Controller DRIVER
 +M:    Zhou Wang <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/crypto/hisilicon/qm.c
 +F:    drivers/crypto/hisilicon/qm.h
 +F:    drivers/crypto/hisilicon/sgl.c
 +F:    drivers/crypto/hisilicon/sgl.h
 +F:    drivers/crypto/hisilicon/zip/
 +F:    Documentation/ABI/testing/debugfs-hisi-zip
 +
  HMM - Heterogeneous Memory Management
  M:    Jérôme Glisse <[email protected]>
  L:    [email protected]
@@@ -7541,12 -7463,11 +7549,12 @@@ F:   drivers/hid/hid-hyperv.
  F:    drivers/hv/
  F:    drivers/input/serio/hyperv-keyboard.c
  F:    drivers/pci/controller/pci-hyperv.c
 +F:    drivers/pci/controller/pci-hyperv-intf.c
  F:    drivers/net/hyperv/
  F:    drivers/scsi/storvsc_drv.c
  F:    drivers/uio/uio_hv_generic.c
  F:    drivers/video/fbdev/hyperv_fb.c
 -F:    drivers/iommu/hyperv_iommu.c
 +F:    drivers/iommu/hyperv-iommu.c
  F:    net/vmw_vsock/hyperv_transport.c
  F:    include/clocksource/hyperv_timer.h
  F:    include/linux/hyperv.h
@@@ -7579,14 -7500,14 +7587,14 @@@ I2C CONTROLLER DRIVER FOR NVIDIA GP
  M:    Ajay Gupta <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-nvidia-gpu
 +F:    Documentation/i2c/busses/i2c-nvidia-gpu.rst
  F:    drivers/i2c/busses/i2c-nvidia-gpu.c
  
  I2C MUXES
  M:    Peter Rosin <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/i2c/i2c-topology
 +F:    Documentation/i2c/i2c-topology.rst
  F:    Documentation/i2c/muxes/
  F:    Documentation/devicetree/bindings/i2c/i2c-mux*
  F:    Documentation/devicetree/bindings/i2c/i2c-arb*
@@@ -7599,15 -7520,15 +7607,15 @@@ I2C MV64XXX MARVELL AND ALLWINNER DRIVE
  M:    Gregory CLEMENT <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
 +F:    Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
  F:    drivers/i2c/busses/i2c-mv64xxx.c
  
  I2C OVER PARALLEL PORT
  M:    Jean Delvare <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-parport
 -F:    Documentation/i2c/busses/i2c-parport-light
 +F:    Documentation/i2c/busses/i2c-parport.rst
 +F:    Documentation/i2c/busses/i2c-parport-light.rst
  F:    drivers/i2c/busses/i2c-parport.c
  F:    drivers/i2c/busses/i2c-parport-light.c
  
@@@ -7641,7 -7562,7 +7649,7 @@@ I2C-TAOS-EVM DRIVE
  M:    Jean Delvare <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-taos-evm
 +F:    Documentation/i2c/busses/i2c-taos-evm.rst
  F:    drivers/i2c/busses/i2c-taos-evm.c
  
  I2C-TINY-USB DRIVER
@@@ -7655,19 -7576,19 +7663,19 @@@ I2C/SMBUS CONTROLLER DRIVERS FOR P
  M:    Jean Delvare <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-ali1535
 -F:    Documentation/i2c/busses/i2c-ali1563
 -F:    Documentation/i2c/busses/i2c-ali15x3
 -F:    Documentation/i2c/busses/i2c-amd756
 -F:    Documentation/i2c/busses/i2c-amd8111
 -F:    Documentation/i2c/busses/i2c-i801
 -F:    Documentation/i2c/busses/i2c-nforce2
 -F:    Documentation/i2c/busses/i2c-piix4
 -F:    Documentation/i2c/busses/i2c-sis5595
 -F:    Documentation/i2c/busses/i2c-sis630
 -F:    Documentation/i2c/busses/i2c-sis96x
 -F:    Documentation/i2c/busses/i2c-via
 -F:    Documentation/i2c/busses/i2c-viapro
 +F:    Documentation/i2c/busses/i2c-ali1535.rst
 +F:    Documentation/i2c/busses/i2c-ali1563.rst
 +F:    Documentation/i2c/busses/i2c-ali15x3.rst
 +F:    Documentation/i2c/busses/i2c-amd756.rst
 +F:    Documentation/i2c/busses/i2c-amd8111.rst
 +F:    Documentation/i2c/busses/i2c-i801.rst
 +F:    Documentation/i2c/busses/i2c-nforce2.rst
 +F:    Documentation/i2c/busses/i2c-piix4.rst
 +F:    Documentation/i2c/busses/i2c-sis5595.rst
 +F:    Documentation/i2c/busses/i2c-sis630.rst
 +F:    Documentation/i2c/busses/i2c-sis96x.rst
 +F:    Documentation/i2c/busses/i2c-via.rst
 +F:    Documentation/i2c/busses/i2c-viapro.rst
  F:    drivers/i2c/busses/i2c-ali1535.c
  F:    drivers/i2c/busses/i2c-ali1563.c
  F:    drivers/i2c/busses/i2c-ali15x3.c
@@@ -7696,7 -7617,7 +7704,7 @@@ M:      Seth Heasley <[email protected]
  M:    Neil Horman <[email protected]>
  L:    [email protected]
  F:    drivers/i2c/busses/i2c-ismt.c
 -F:    Documentation/i2c/busses/i2c-ismt
 +F:    Documentation/i2c/busses/i2c-ismt.rst
  
  I2C/SMBUS STUB DRIVER
  M:    Jean Delvare <[email protected]>
@@@ -7752,7 -7673,7 +7760,7 @@@ F:      drivers/crypto/nx/nx-aes
  F:    drivers/crypto/nx/nx-sha*
  F:    drivers/crypto/nx/nx.*
  F:    drivers/crypto/nx/nx_csbcpb.h
 -F:    drivers/crypto/nx/nx_debugfs.h
 +F:    drivers/crypto/nx/nx_debugfs.c
  
  IBM Power Linux RAID adapter
  M:    Brian King <[email protected]>
@@@ -8136,7 -8057,6 +8144,7 @@@ S:      Maintaine
  F:    drivers/video/fbdev/i810/
  
  INTEL ASoC DRIVERS
 +M:    Cezary Rojewski <[email protected]>
  M:    Pierre-Louis Bossart <[email protected]>
  M:    Liam Girdwood <[email protected]>
  M:    Jie Yang <[email protected]>
@@@ -8158,13 -8078,6 +8166,13 @@@ T:    git git://git.code.sf.net/p/intel-sa
  S:    Supported
  F:    drivers/scsi/isci/
  
 +INTEL CPU family model numbers
 +M:    Tony Luck <[email protected]>
 +M:    [email protected]
 +L:    [email protected]
 +S:    Supported
 +F:    arch/x86/include/asm/intel-family.h
 +
  INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets)
  M:    Jani Nikula <[email protected]>
  M:    Joonas Lahtinen <[email protected]>
@@@ -8409,17 -8322,6 +8417,17 @@@ F:    drivers/platform/x86/intel_speed_sel
  F:    tools/power/x86/intel-speed-select/
  F:    include/uapi/linux/isst_if.h
  
 +INTEL STRATIX10 FIRMWARE DRIVERS
 +M:    Richard Gong <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/firmware/stratix10-rsu.c
 +F:    drivers/firmware/stratix10-svc.c
 +F:    include/linux/firmware/intel/stratix10-smc.h
 +F:    include/linux/firmware/intel/stratix10-svc-client.h
 +F:    Documentation/ABI/testing/sysfs-devices-platform-stratix10-rsu
 +F:    Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt
 +
  INTEL TELEMETRY DRIVER
  M:    Rajneesh Bhardwaj <[email protected]>
  M:    "David E. Box" <[email protected]>
@@@ -8457,7 -8359,7 +8465,7 @@@ M:      [email protected]
  L:    [email protected] (subscribers-only)
  S:    Supported
  W:    http://linuxwimax.org
 -F:    Documentation/wimax/README.i2400m
 +F:    Documentation/admin-guide/wimax/i2400m.rst
  F:    drivers/net/wimax/i2400m/
  F:    include/uapi/linux/wimax/i2400m.h
  
@@@ -8471,7 -8373,6 +8479,7 @@@ M:      Alexander Shishkin <alexander.shishk
  S:    Supported
  F:    Documentation/trace/intel_th.rst
  F:    drivers/hwtracing/intel_th/
 +F:    include/linux/intel_th.h
  
  INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT)
  M:    Ning Sun <[email protected]>
@@@ -8483,6 -8384,12 +8491,6 @@@ F:     Documentation/x86/intel_txt.rs
  F:    include/linux/tboot.h
  F:    arch/x86/kernel/tboot.c
  
 -INTEL-MID GPIO DRIVER
 -M:    David Cohen <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    drivers/gpio/gpio-intel-mid.c
 -
  INTERCONNECT API
  M:    Georgi Djakov <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    drivers/net/ethernet/sgi/ioc3-eth.c
  
 -IOC3 SERIAL DRIVER
 -M:    Pat Gefre <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    drivers/tty/serial/ioc3_serial.c
 -
  IOMAP FILESYSTEM LIBRARY
  M:    Christoph Hellwig <[email protected]>
  M:    Darrick J. Wong <[email protected]>
@@@ -8516,6 -8429,7 +8524,6 @@@ L:      [email protected]
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git
  S:    Supported
 -F:    fs/iomap.c
  F:    fs/iomap/
  F:    include/linux/iomap.h
  
@@@ -8540,6 -8454,11 +8548,6 @@@ S:     Maintaine
  F:    fs/io_uring.c
  F:    include/uapi/linux/io_uring.h
  
 -IP MASQUERADING
 -M:    Juanjo Ciarlante <[email protected]>
 -S:    Maintained
 -F:    net/ipv4/netfilter/ipt_MASQUERADE.c
 -
  IPMI SUBSYSTEM
  M:    Corey Minyard <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -8743,7 -8662,7 +8751,7 @@@ L:      [email protected]
  W:    http://jfs.sourceforge.net/
  T:    git git://github.com/kleikamp/linux-shaggy.git
  S:    Maintained
 -F:    Documentation/filesystems/jfs.txt
 +F:    Documentation/admin-guide/jfs.rst
  F:    fs/jfs/
  
  JME NETWORK DRIVER
@@@ -8913,6 -8832,14 +8921,6 @@@ F:     virt/kvm/
  F:    tools/kvm/
  F:    tools/testing/selftests/kvm/
  
 -KERNEL VIRTUAL MACHINE FOR AMD-V (KVM/amd)
 -M:    Joerg Roedel <[email protected]>
 -L:    [email protected]
 -W:    http://www.linux-kvm.org/
 -S:    Maintained
 -F:    arch/x86/include/asm/svm.h
 -F:    arch/x86/kvm/svm.c
 -
  KERNEL VIRTUAL MACHINE FOR ARM/ARM64 (KVM/arm, KVM/arm64)
  M:    Marc Zyngier <[email protected]>
  R:    James Morse <[email protected]>
@@@ -8955,7 -8882,7 +8963,7 @@@ M:      Christian Borntraeger <borntraeger@d
  M:    Janosch Frank <[email protected]>
  R:    David Hildenbrand <[email protected]>
  R:    Cornelia Huck <[email protected]>
 -L:    linux-s390@vger.kernel.org
 +L:    kvm@vger.kernel.org
  W:    http://www.ibm.com/developerworks/linux/linux390/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git
  S:    Supported
@@@ -8970,11 -8897,6 +8978,11 @@@ F:    tools/testing/selftests/kvm/*/s390x
  KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)
  M:    Paolo Bonzini <[email protected]>
  M:    Radim Krčmář <[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]
  W:    http://www.linux-kvm.org
  T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
@@@ -8982,12 -8904,8 +8990,12 @@@ S:    Supporte
  F:    arch/x86/kvm/
  F:    arch/x86/kvm/*/
  F:    arch/x86/include/uapi/asm/kvm*
 +F:    arch/x86/include/uapi/asm/vmx.h
 +F:    arch/x86/include/uapi/asm/svm.h
  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/kernel/kvm.c
  F:    arch/x86/kernel/kvmclock.c
  
@@@ -9019,7 -8937,7 +9027,7 @@@ F:      security/keys/encrypted-keys
  
  KEYS-TRUSTED
  M:    James Bottomley <[email protected]>
 -M:      Jarkko Sakkinen <[email protected]>
 +M:    Jarkko Sakkinen <[email protected]>
  M:    Mimi Zohar <[email protected]>
  L:    [email protected]
  L:    [email protected]
@@@ -9086,7 -9004,7 +9094,7 @@@ F:      kernel/kprobes.
  KS0108 LCD CONTROLLER DRIVER
  M:    Miguel Ojeda Sandonis <[email protected]>
  S:    Maintained
 -F:    Documentation/auxdisplay/ks0108
 +F:    Documentation/admin-guide/auxdisplay/ks0108.rst
  F:    drivers/auxdisplay/ks0108.c
  F:    include/linux/ks0108.h
  
@@@ -9315,18 -9233,6 +9323,18 @@@ F:    include/linux/nd.
  F:    include/linux/libnvdimm.h
  F:    include/uapi/linux/ndctl.h
  
 +LICENSES and SPDX stuff
 +M:    Thomas Gleixner <[email protected]>
 +M:    Greg Kroah-Hartman <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx.git
 +F:    COPYING
 +F:    Documentation/process/license-rules.rst
 +F:    LICENSES/
 +F:    scripts/spdxcheck-test.sh
 +F:    scripts/spdxcheck.py
 +
  LIGHTNVM PLATFORM SUPPORT
  M:    Matias Bjorling <[email protected]>
  W:    http://github/OpenChannelSSD
@@@ -9433,7 -9339,7 +9441,7 @@@ F:      drivers/misc/lkdtm/
  
  LINUX KERNEL MEMORY CONSISTENCY MODEL (LKMM)
  M:    Alan Stern <[email protected]>
 -M:    Andrea Parri <andrea.parri@amarulasolutions.com>
 +M:    Andrea Parri <parri.andrea@gmail.com>
  M:    Will Deacon <[email protected]>
  M:    Peter Zijlstra <[email protected]>
  M:    Boqun Feng <[email protected]>
@@@ -9441,7 -9347,7 +9449,7 @@@ M:      Nicholas Piggin <[email protected]
  M:    David Howells <[email protected]>
  M:    Jade Alglave <[email protected]>
  M:    Luc Maranget <[email protected]>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  R:    Akira Yokosawa <[email protected]>
  R:    Daniel Lustig <[email protected]>
  L:    [email protected]
@@@ -9675,7 -9581,7 +9683,7 @@@ F:      Documentation/networking/mac80211-in
  F:    include/net/mac80211.h
  F:    net/mac80211/
  F:    drivers/net/wireless/mac80211_hwsim.[ch]
 -F:    Documentation/networking/mac80211_hwsim/README
 +F:    Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst
  
  MAILBOX API
  M:    Jassi Brar <[email protected]>
  L:    [email protected]
  T:    git git://linuxtv.org/media_tree.git
  S:    Supported
 -F:    Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
 -F:    Documentation/devicetree/bindings/media/rcar_vin.txt
 +F:    Documentation/devicetree/bindings/media/renesas,csi2.txt
 +F:    Documentation/devicetree/bindings/media/renesas,vin.txt
  F:    drivers/media/platform/rcar-vin/
  
  MEDIA DRIVERS FOR RENESAS - VSP1
  S:    Supported
  F:    drivers/i2c/busses/i2c-mlxcpld.c
  F:    drivers/i2c/muxes/i2c-mux-mlxcpld.c
 -F:    Documentation/i2c/busses/i2c-mlxcpld
 +F:    Documentation/i2c/busses/i2c-mlxcpld.rst
  
  MELLANOX MLXCPLD LED DRIVER
  M:    Vadim Pasternak <[email protected]>
@@@ -10470,7 -10376,7 +10478,7 @@@ F:   drivers/platform/x86/mlx-platform.
  
  MEMBARRIER SUPPORT
  M:    Mathieu Desnoyers <[email protected]>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  L:    [email protected]
  S:    Supported
  F:    kernel/sched/membarrier.c
@@@ -10722,6 -10628,12 +10730,6 @@@ M:  Nicolas Ferre <nicolas.ferre@microch
  S:    Supported
  F:    drivers/power/reset/at91-sama5d2_shdwc.c
  
 -MICROCHIP SAMA5D2-COMPATIBLE PIOBU GPIO
 -M:    Andrei Stefanescu <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 -L:    [email protected]
 -F:    drivers/gpio/gpio-sama5d2-piobu.c
 -
  MICROCHIP SPI DRIVER
  M:    Nicolas Ferre <[email protected]>
  S:    Supported
@@@ -10734,6 -10646,13 +10742,6 @@@ S:  Supporte
  F:    drivers/misc/atmel-ssc.c
  F:    include/linux/atmel-ssc.h
  
 -MICROCHIP TIMER COUNTER (TC) AND CLOCKSOURCE DRIVERS
 -M:    Nicolas Ferre <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 -S:    Supported
 -F:    drivers/misc/atmel_tclib.c
 -F:    drivers/clocksource/tcb_clksrc.c
 -
  MICROCHIP USBA UDC DRIVER
  M:    Cristian Birsan <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -11166,7 -11085,7 +11174,7 @@@ NET_FAILOVER MODUL
  M:    Sridhar Samudrala <[email protected]>
  L:    [email protected]
  S:    Supported
 -F:    driver/net/net_failover.c
 +F:    drivers/net/net_failover.c
  F:    include/net/net_failover.h
  F:    Documentation/networking/net_failover.rst
  
  S:    Maintained
  W:    https://fedorahosted.org/dropwatch/
  F:    net/core/drop_monitor.c
 +F:    include/uapi/linux/net_dropmon.h
 +F:    include/net/drop_monitor.h
  
  NETWORKING DRIVERS
  M:    "David S. Miller" <[email protected]>
@@@ -11378,7 -11295,6 +11386,7 @@@ M:   Aviad Yehezkel <[email protected]
  M:    Dave Watson <[email protected]>
  M:    John Fastabend <[email protected]>
  M:    Daniel Borkmann <[email protected]>
 +M:    Jakub Kicinski <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    net/tls/*
@@@ -11419,6 -11335,7 +11427,6 @@@ F:   include/net/nfc
  F:    include/uapi/linux/nfc.h
  F:    drivers/nfc/
  F:    include/linux/platform_data/nfcmrvl.h
 -F:    include/linux/platform_data/nxp-nci.h
  F:    Documentation/devicetree/bindings/net/nfc/
  
  NFS, SUNRPC, AND LOCKD CLIENTS
@@@ -11941,21 -11858,6 +11949,21 @@@ T: git git://linuxtv.org/media_tree.gi
  S:    Maintained
  F:    drivers/media/i2c/ov5647.c
  
 +OMNIVISION OV5670 SENSOR DRIVER
 +M:    Chiranjeevi Rapolu <[email protected]>
 +M:    Hyungwoo Yang <[email protected]>
 +L:    [email protected]
 +T:    git git://linuxtv.org/media_tree.git
 +S:    Maintained
 +F:    drivers/media/i2c/ov5670.c
 +
 +OMNIVISION OV5675 SENSOR DRIVER
 +M:    Shawn Tu <[email protected]>
 +L:    [email protected]
 +T:    git git://linuxtv.org/media_tree.git
 +S:    Maintained
 +F:    drivers/media/i2c/ov5675.c
 +
  OMNIVISION OV5695 SENSOR DRIVER
  M:    Shunqian Zheng <[email protected]>
  L:    [email protected]
@@@ -12077,7 -11979,7 +12085,7 @@@ M:   Andrew Lunn <[email protected]
  L:    [email protected]
  S:    Maintained
  F:    Documentation/devicetree/bindings/i2c/i2c-ocores.txt
 -F:    Documentation/i2c/busses/i2c-ocores
 +F:    Documentation/i2c/busses/i2c-ocores.rst
  F:    drivers/i2c/busses/i2c-ocores.c
  F:    include/linux/platform_data/i2c-ocores.h
  
  S:    Supported
  F:    lib/packing.c
  F:    include/linux/packing.h
 -F:    Documentation/packing.txt
 +F:    Documentation/core-api/packing.rst
  
  PADATA PARALLEL EXECUTION MECHANISM
  M:    Steffen Klassert <[email protected]>
  S:    Maintained
  F:    drivers/platform/x86/peaq-wmi.c
  
 +PENSANDO ETHERNET DRIVERS
 +M:    Shannon Nelson <[email protected]>
 +M:    Pensando Drivers <[email protected]>
 +L:    [email protected]
 +S:    Supported
 +F:    Documentation/networking/device_drivers/pensando/ionic.rst
 +F:    drivers/net/ethernet/pensando/
 +
  PER-CPU MEMORY ALLOCATOR
  M:    Dennis Zhou <[email protected]>
  M:    Tejun Heo <[email protected]>
@@@ -12709,7 -12603,6 +12717,7 @@@ PERFORMANCE EVENTS SUBSYSTE
  M:    Peter Zijlstra <[email protected]>
  M:    Ingo Molnar <[email protected]>
  M:    Arnaldo Carvalho de Melo <[email protected]>
 +R:    Mark Rutland <[email protected]>
  R:    Alexander Shishkin <[email protected]>
  R:    Jiri Olsa <[email protected]>
  R:    Namhyung Kim <[email protected]>
@@@ -12742,12 -12635,6 +12750,12 @@@ S: Maintaine
  F:    Documentation/input/devices/pxrc.rst
  F:    drivers/input/joystick/pxrc.c
  
 +FLYSKY FSIA6B RC RECEIVER
 +M:    Markus Koch <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/input/joystick/fsia6b.c
 +
  PHONET PROTOCOL
  M:    Remi Denis-Courmont <[email protected]>
  S:    Supported
  L:    [email protected]
  S:    Supported
  F:    drivers/pinctrl/pinctrl-at91*
 +F:    drivers/gpio/gpio-sama5d2-piobu.c
  
  PIN CONTROLLER - FREESCALE
  M:    Dong Aisheng <[email protected]>
@@@ -12902,12 -12788,6 +12910,12 @@@ F: drivers/i2c/busses/i2c-puv3.
  F:    drivers/video/fbdev/fb-puv3.c
  F:    drivers/rtc/rtc-puv3.c
  
 +PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
 +M:    Tomasz Duszynski <[email protected]>
 +S:    Maintained
 +F:    drivers/iio/chemical/pms7003.c
 +F:    Documentation/devicetree/bindings/iio/chemical/plantower,pms7003.yaml
 +
  PMBUS HARDWARE MONITORING DRIVERS
  M:    Guenter Roeck <[email protected]>
  L:    [email protected]
@@@ -13350,7 -13230,7 +13358,7 @@@ M:   Manish Chopra <[email protected]
  M:    [email protected]
  L:    [email protected]
  S:    Supported
 -F:    drivers/net/ethernet/qlogic/qlge/
 +F:    drivers/staging/qlge/
  
  QM1D1B0004 MEDIA DRIVER
  M:    Akihiro Tsukada <[email protected]>
@@@ -13418,8 -13298,8 +13426,8 @@@ QUALCOMM CPUFREQ DRIVER MSM8996/APQ809
  M:    Ilia Lin <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    Documentation/devicetree/bindings/opp/kryo-cpufreq.txt
 -F:    drivers/cpufreq/qcom-cpufreq-kryo.c
 +F:    Documentation/devicetree/bindings/opp/qcom-nvmem-cpufreq.txt
 +F:    drivers/cpufreq/qcom-cpufreq-nvmem.c
  
  QUALCOMM EMAC GIGABIT ETHERNET DRIVER
  M:    Timur Tabi <[email protected]>
@@@ -13609,7 -13489,7 +13617,7 @@@ S:   Orpha
  F:    drivers/net/wireless/ray*
  
  RCUTORTURE TEST FRAMEWORK
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Josh Triplett <[email protected]>
  R:    Steven Rostedt <[email protected]>
  R:    Mathieu Desnoyers <[email protected]>
@@@ -13656,7 -13536,7 +13664,7 @@@ F:   arch/x86/include/asm/resctrl_sched.
  F:    Documentation/x86/resctrl*
  
  READ-COPY UPDATE (RCU)
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Josh Triplett <[email protected]>
  R:    Steven Rostedt <[email protected]>
  R:    Mathieu Desnoyers <[email protected]>
@@@ -13814,7 -13694,7 +13822,7 @@@ F:   include/linux/reset-controller.
  RESTARTABLE SEQUENCES SUPPORT
  M:    Mathieu Desnoyers <[email protected]>
  M:    Peter Zijlstra <[email protected]>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Boqun Feng <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -13877,8 -13757,7 +13885,8 @@@ F:   include/linux/hid-roccat
  F:    Documentation/ABI/*/sysfs-driver-hid-roccat*
  
  ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
 -M:    Jacob chen <[email protected]>
 +M:    Jacob Chen <[email protected]>
 +M:    Ezequiel Garcia <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    drivers/media/platform/rockchip/rga/
@@@ -13888,7 -13767,7 +13896,7 @@@ HANTRO VPU CODEC DRIVE
  M:    Ezequiel Garcia <[email protected]>
  L:    [email protected]
  S:    Maintained
 -F:    drivers/staging/media/platform/hantro/
 +F:    drivers/staging/media/hantro/
  F:    Documentation/devicetree/bindings/media/rockchip-vpu.txt
  
  ROCKER DRIVER
@@@ -14246,8 -14125,6 +14254,8 @@@ M:   Kamil Konieczny <k.konieczny@partner
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
 +F:    Documentation/devicetree/bindings/crypto/samsung-slimsss.txt
 +F:    Documentation/devicetree/bindings/crypto/samsung-sss.txt
  F:    drivers/crypto/s5p-sss.c
  
  SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS
@@@ -14268,8 -14145,6 +14276,8 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    drivers/clk/samsung/
  F:    include/dt-bindings/clock/exynos*.h
  F:    Documentation/devicetree/bindings/clock/exynos*.txt
 +F:    Documentation/devicetree/bindings/clock/samsung,s3c*
 +F:    Documentation/devicetree/bindings/clock/samsung,s5p*
  
  SAMSUNG SPI DRIVERS
  M:    Kukjin Kim <[email protected]>
@@@ -14320,12 -14195,6 +14328,12 @@@ F: drivers/watchdog/sc1200wdt.
  SCHEDULER
  M:    Ingo Molnar <[email protected]>
  M:    Peter Zijlstra <[email protected]>
 +M:    Juri Lelli <[email protected]> (SCHED_DEADLINE)
 +M:    Vincent Guittot <[email protected]> (SCHED_NORMAL)
 +R:    Dietmar Eggemann <[email protected]> (SCHED_NORMAL)
 +R:    Steven Rostedt <[email protected]> (SCHED_FIFO/SCHED_RR)
 +R:    Ben Segall <[email protected]> (CONFIG_CFS_BANDWIDTH)
 +R:    Mel Gorman <[email protected]> (CONFIG_NUMA_BALANCING)
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
  S:    Maintained
@@@ -14420,7 -14289,7 +14428,7 @@@ F:   net/sctp
  SCx200 CPU SUPPORT
  M:    Jim Cromie <[email protected]>
  S:    Odd Fixes
 -F:    Documentation/i2c/busses/scx200_acb
 +F:    Documentation/i2c/busses/scx200_acb.rst
  F:    arch/x86/platform/scx200/
  F:    drivers/watchdog/scx200_wdt.c
  F:    drivers/i2c/busses/scx200*
@@@ -14606,7 -14475,6 +14614,7 @@@ F:   drivers/net/phy/phylink.
  F:    drivers/net/phy/sfp*
  F:    include/linux/phylink.h
  F:    include/linux/sfp.h
 +K:    phylink
  
  SGI GRU DRIVER
  M:    Dimitri Sivanich <[email protected]>
@@@ -14861,7 -14729,7 +14869,7 @@@ F:   mm/sl?b
  
  SLEEPABLE READ-COPY UPDATE (SRCU)
  M:    Lai Jiangshan <[email protected]>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Josh Triplett <[email protected]>
  R:    Steven Rostedt <[email protected]>
  R:    Mathieu Desnoyers <[email protected]>
@@@ -15012,9 -14880,9 +15020,9 @@@ F:   include/linux/arm_sdei.
  F:    include/uapi/linux/arm_sdei.h
  
  SOFTWARE RAID (Multiple Disks) SUPPORT
 -M:    Shaohua Li <shli@kernel.org>
 +M:    Song Liu <song@kernel.org>
  L:    [email protected]
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/shli/md.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git
  S:    Supported
  F:    drivers/md/Makefile
  F:    drivers/md/Kconfig
@@@ -15345,6 -15213,13 +15353,6 @@@ M:  H Hartley Sweeten <hsweeten@visionen
  S:    Odd Fixes
  F:    drivers/staging/comedi/
  
 -STAGING - EROFS FILE SYSTEM
 -M:    Gao Xiang <[email protected]>
 -M:    Chao Yu <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    drivers/staging/erofs/
 -
  STAGING - FIELDBUS SUBSYSTEM
  M:    Sven Van Asbroeck <[email protected]>
  S:    Maintained
@@@ -15632,7 -15507,7 +15640,7 @@@ F:   Documentation/devicetree/bindings/gp
  SYNOPSYS DESIGNWARE AXI DMAC DRIVER
  M:    Eugeniy Paltsev <[email protected]>
  S:    Maintained
 -F:    drivers/dma/dwi-axi-dmac/
 +F:    drivers/dma/dw-axi-dmac/
  F:    Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.txt
  
  SYNOPSYS DESIGNWARE DMAC DRIVER
@@@ -15689,7 -15564,6 +15697,7 @@@ F:   drivers/clk/clk-sc[mp]i.
  F:    drivers/cpufreq/sc[mp]i-cpufreq.c
  F:    drivers/firmware/arm_scpi.c
  F:    drivers/firmware/arm_scmi/
 +F:    drivers/reset/reset-scmi.c
  F:    include/linux/sc[mp]i_protocol.h
  
  SYSTEM RESET/SHUTDOWN DRIVERS
@@@ -15998,7 -15872,6 +16006,7 @@@ F:   drivers/firmware/ti_sci
  F:    include/linux/soc/ti/ti_sci_protocol.h
  F:    Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt
  F:    drivers/soc/ti/ti_sci_pm_domains.c
 +F:    include/dt-bindings/soc/ti,sci_pm_domain.h
  F:    Documentation/devicetree/bindings/reset/ti,sci-reset.txt
  F:    Documentation/devicetree/bindings/clock/ti,sci-clk.txt
  F:    drivers/clk/keystone/sci-clk.c
@@@ -16052,7 -15925,7 +16060,7 @@@ M:   Viresh Kumar <[email protected]
  M:    Javi Merino <[email protected]>
  L:    [email protected]
  S:    Supported
 -F:    Documentation/thermal/cpu-cooling-api.rst
 +F:    Documentation/driver-api/thermal/cpu-cooling-api.rst
  F:    drivers/thermal/cpu_cooling.c
  F:    include/linux/cpu_cooling.h
  
@@@ -16224,7 -16097,7 +16232,7 @@@ S:   Maintaine
  F:    drivers/net/ethernet/ti/netcp*
  
  TI PCM3060 ASoC CODEC DRIVER
 -M:    Kirill Marinushkin <kmarinushkin@birdec.tech>
 +M:    Kirill Marinushkin <kmarinushkin@birdec.com>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    Documentation/devicetree/bindings/sound/pcm3060.txt
@@@ -16353,7 -16226,7 +16361,7 @@@ F:   drivers/platform/x86/topstar-laptop.
  
  TORTURE-TEST MODULES
  M:    Davidlohr Bueso <[email protected]>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Josh Triplett <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -16575,7 -16448,7 +16583,7 @@@ F:   drivers/hid/hid-udraw-ps3.
  UFS FILESYSTEM
  M:    Evgeniy Dushistov <[email protected]>
  S:    Maintained
 -F:    Documentation/filesystems/ufs.txt
 +F:    Documentation/admin-guide/ufs.rst
  F:    fs/ufs/
  
  UHID USERSPACE HID IO DRIVER:
@@@ -16593,9 -16466,11 +16601,9 @@@ F:  drivers/usb/common/ulpi.
  F:    include/linux/ulpi/
  
  ULTRA-WIDEBAND (UWB) SUBSYSTEM:
 -L:    [email protected]
 -S:    Orphan
 -F:    drivers/uwb/
 -F:    include/linux/uwb.h
 -F:    include/linux/uwb/
 +L:    [email protected]
 +S:    Obsolete
 +F:    drivers/staging/uwb/
  
  UNICODE SUBSYSTEM:
  M:    Gabriel Krisman Bertazi <[email protected]>
@@@ -17328,7 -17203,6 +17336,7 @@@ M:   "VMware, Inc." <[email protected]
  L:    [email protected]
  S:    Supported
  F:    arch/x86/kernel/cpu/vmware.c
 +F:    arch/x86/include/asm/vmware.h
  
  VMWARE PVRDMA DRIVER
  M:    Adit Ranadive <[email protected]>
@@@ -17378,7 -17252,6 +17386,7 @@@ F:   Documentation/power/regulator
  F:    drivers/regulator/
  F:    include/dt-bindings/regulator/
  F:    include/linux/regulator/
 +K:    regulator_get_optional
  
  VRF
  M:    David Ahern <[email protected]>
  L:    [email protected] (subscribers-only)
  S:    Supported
  W:    http://linuxwimax.org
 -F:    Documentation/wimax/README.wimax
 +F:    Documentation/admin-guide/wimax/wimax.rst
  F:    include/linux/wimax/debug.h
  F:    include/net/wimax.h
  F:    include/uapi/linux/wimax.h
@@@ -17647,7 -17520,7 +17655,7 @@@ M:   Darren Hart <[email protected]
  M:    Andy Shevchenko <[email protected]>
  L:    [email protected]
  T:    git git://git.infradead.org/linux-platform-drivers-x86.git
 -S:    Maintained
 +S:    Odd Fixes
  F:    drivers/platform/x86/
  F:    drivers/platform/olpc/
  
@@@ -17700,6 -17573,7 +17708,6 @@@ M:   Jakub Kicinski <jakub.kicinski@netro
  M:    Jesper Dangaard Brouer <[email protected]>
  M:    John Fastabend <[email protected]>
  L:    [email protected]
 -L:    [email protected]
  L:    [email protected]
  S:    Supported
  F:    net/core/xdp.c
@@@ -17762,7 -17636,7 +17770,7 @@@ F:   Documentation/ABI/testing/sysfs-hype
  
  XEN NETWORK BACKEND DRIVER
  M:    Wei Liu <[email protected]>
 -M:    Paul Durrant <paul[email protected]>
 +M:    Paul Durrant <paul@xen.org>
  L:    [email protected] (moderated for non-subscribers)
  L:    [email protected]
  S:    Supported
@@@ -17815,7 -17689,8 +17823,7 @@@ F:   include/uapi/linux/dqblk_xfs.
  F:    include/uapi/linux/fsmap.h
  
  XILINX AXI ETHERNET DRIVER
 -M:    Anirudha Sarangi <[email protected]>
 -M:    John Linn <[email protected]>
 +M:    Radhey Shyam Pandey <[email protected]>
  S:    Maintained
  F:    drivers/net/ethernet/xilinx/xilinx_axienet*
  
@@@ -17835,17 -17710,6 +17843,17 @@@ F: Documentation/devicetree/bindings/me
  F:    drivers/media/platform/xilinx/
  F:    include/uapi/linux/xilinx-v4l2-controls.h
  
 +XILINX SD-FEC IP CORES
 +M:    Derek Kiernan <[email protected]>
 +M:    Dragan Cvetic <[email protected]>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/misc/xlnx,sd-fec.txt
 +F:    Documentation/misc-devices/xilinx_sdfec.rst
 +F:    drivers/misc/xilinx_sdfec.c
 +F:    drivers/misc/Kconfig
 +F:    drivers/misc/Makefile
 +F:    include/uapi/misc/xilinx_sdfec.h
 +
  XILLYBUS DRIVER
  M:    Eli Billauer <[email protected]>
  L:    [email protected]
@@@ -17955,6 -17819,14 +17963,6 @@@ S:  Maintaine
  F:    mm/zpool.c
  F:    include/linux/zpool.h
  
 -ZR36067 VIDEO FOR LINUX DRIVER
 -L:    [email protected]
 -L:    [email protected]
 -W:    http://mjpeg.sourceforge.net/driver-zoran/
 -T:    hg https://linuxtv.org/hg/v4l-dvb
 -S:    Odd Fixes
 -F:    drivers/staging/media/zoran/
 -
  ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER
  M:    Minchan Kim <[email protected]>
  M:    Nitin Gupta <[email protected]>
index a78b2e295895070a8d12940f3e8847ba61fd76e0,320ac20146fd177cb5a307e26f190c7f5e04a2ea..6109815a0401a7c8835e961a0e43f7335d1d490c
@@@ -26,6 -26,7 +26,7 @@@
  #include "kgd_pp_interface.h"
  #include "dm_pp_interface.h"
  #include "dm_pp_smu.h"
+ #include "smu_types.h"
  
  #define SMU_THERMAL_MINIMUM_ALERT_TEMP                0
  #define SMU_THERMAL_MAXIMUM_ALERT_TEMP                255
@@@ -150,124 -151,6 +151,6 @@@ struct smu_power_state 
        struct smu_hw_power_state                     hardware;
  };
  
- enum smu_message_type
- {
-       SMU_MSG_TestMessage = 0,
-       SMU_MSG_GetSmuVersion,
-       SMU_MSG_GetDriverIfVersion,
-       SMU_MSG_SetAllowedFeaturesMaskLow,
-       SMU_MSG_SetAllowedFeaturesMaskHigh,
-       SMU_MSG_EnableAllSmuFeatures,
-       SMU_MSG_DisableAllSmuFeatures,
-       SMU_MSG_EnableSmuFeaturesLow,
-       SMU_MSG_EnableSmuFeaturesHigh,
-       SMU_MSG_DisableSmuFeaturesLow,
-       SMU_MSG_DisableSmuFeaturesHigh,
-       SMU_MSG_GetEnabledSmuFeaturesLow,
-       SMU_MSG_GetEnabledSmuFeaturesHigh,
-       SMU_MSG_SetWorkloadMask,
-       SMU_MSG_SetPptLimit,
-       SMU_MSG_SetDriverDramAddrHigh,
-       SMU_MSG_SetDriverDramAddrLow,
-       SMU_MSG_SetToolsDramAddrHigh,
-       SMU_MSG_SetToolsDramAddrLow,
-       SMU_MSG_TransferTableSmu2Dram,
-       SMU_MSG_TransferTableDram2Smu,
-       SMU_MSG_UseDefaultPPTable,
-       SMU_MSG_UseBackupPPTable,
-       SMU_MSG_RunBtc,
-       SMU_MSG_RequestI2CBus,
-       SMU_MSG_ReleaseI2CBus,
-       SMU_MSG_SetFloorSocVoltage,
-       SMU_MSG_SoftReset,
-       SMU_MSG_StartBacoMonitor,
-       SMU_MSG_CancelBacoMonitor,
-       SMU_MSG_EnterBaco,
-       SMU_MSG_SetSoftMinByFreq,
-       SMU_MSG_SetSoftMaxByFreq,
-       SMU_MSG_SetHardMinByFreq,
-       SMU_MSG_SetHardMaxByFreq,
-       SMU_MSG_GetMinDpmFreq,
-       SMU_MSG_GetMaxDpmFreq,
-       SMU_MSG_GetDpmFreqByIndex,
-       SMU_MSG_GetDpmClockFreq,
-       SMU_MSG_GetSsVoltageByDpm,
-       SMU_MSG_SetMemoryChannelConfig,
-       SMU_MSG_SetGeminiMode,
-       SMU_MSG_SetGeminiApertureHigh,
-       SMU_MSG_SetGeminiApertureLow,
-       SMU_MSG_SetMinLinkDpmByIndex,
-       SMU_MSG_OverridePcieParameters,
-       SMU_MSG_OverDriveSetPercentage,
-       SMU_MSG_SetMinDeepSleepDcefclk,
-       SMU_MSG_ReenableAcDcInterrupt,
-       SMU_MSG_NotifyPowerSource,
-       SMU_MSG_SetUclkFastSwitch,
-       SMU_MSG_SetUclkDownHyst,
-       SMU_MSG_GfxDeviceDriverReset,
-       SMU_MSG_GetCurrentRpm,
-       SMU_MSG_SetVideoFps,
-       SMU_MSG_SetTjMax,
-       SMU_MSG_SetFanTemperatureTarget,
-       SMU_MSG_PrepareMp1ForUnload,
-       SMU_MSG_DramLogSetDramAddrHigh,
-       SMU_MSG_DramLogSetDramAddrLow,
-       SMU_MSG_DramLogSetDramSize,
-       SMU_MSG_SetFanMaxRpm,
-       SMU_MSG_SetFanMinPwm,
-       SMU_MSG_ConfigureGfxDidt,
-       SMU_MSG_NumOfDisplays,
-       SMU_MSG_RemoveMargins,
-       SMU_MSG_ReadSerialNumTop32,
-       SMU_MSG_ReadSerialNumBottom32,
-       SMU_MSG_SetSystemVirtualDramAddrHigh,
-       SMU_MSG_SetSystemVirtualDramAddrLow,
-       SMU_MSG_WaflTest,
-       SMU_MSG_SetFclkGfxClkRatio,
-       SMU_MSG_AllowGfxOff,
-       SMU_MSG_DisallowGfxOff,
-       SMU_MSG_GetPptLimit,
-       SMU_MSG_GetDcModeMaxDpmFreq,
-       SMU_MSG_GetDebugData,
-       SMU_MSG_SetXgmiMode,
-       SMU_MSG_RunAfllBtc,
-       SMU_MSG_ExitBaco,
-       SMU_MSG_PrepareMp1ForReset,
-       SMU_MSG_PrepareMp1ForShutdown,
-       SMU_MSG_SetMGpuFanBoostLimitRpm,
-       SMU_MSG_GetAVFSVoltageByDpm,
-       SMU_MSG_PowerUpVcn,
-       SMU_MSG_PowerDownVcn,
-       SMU_MSG_PowerUpJpeg,
-       SMU_MSG_PowerDownJpeg,
-       SMU_MSG_BacoAudioD3PME,
-       SMU_MSG_ArmD3,
-       SMU_MSG_MAX_COUNT,
- };
- enum smu_clk_type
- {
-       SMU_GFXCLK,
-       SMU_VCLK,
-       SMU_DCLK,
-       SMU_ECLK,
-       SMU_SOCCLK,
-       SMU_UCLK,
-       SMU_DCEFCLK,
-       SMU_DISPCLK,
-       SMU_PIXCLK,
-       SMU_PHYCLK,
-       SMU_FCLK,
-       SMU_SCLK,
-       SMU_MCLK,
-       SMU_PCIE,
-       SMU_OD_SCLK,
-       SMU_OD_MCLK,
-       SMU_OD_VDDC_CURVE,
-       SMU_OD_RANGE,
-       SMU_CLK_COUNT,
- };
  enum smu_power_src_type
  {
        SMU_POWER_SOURCE_AC,
        SMU_POWER_SOURCE_COUNT,
  };
  
- enum smu_feature_mask
- {
-       SMU_FEATURE_DPM_PREFETCHER_BIT,
-       SMU_FEATURE_DPM_GFXCLK_BIT,
-       SMU_FEATURE_DPM_UCLK_BIT,
-       SMU_FEATURE_DPM_SOCCLK_BIT,
-       SMU_FEATURE_DPM_UVD_BIT,
-       SMU_FEATURE_DPM_VCE_BIT,
-       SMU_FEATURE_ULV_BIT,
-       SMU_FEATURE_DPM_MP0CLK_BIT,
-       SMU_FEATURE_DPM_LINK_BIT,
-       SMU_FEATURE_DPM_DCEFCLK_BIT,
-       SMU_FEATURE_DS_GFXCLK_BIT,
-       SMU_FEATURE_DS_SOCCLK_BIT,
-       SMU_FEATURE_DS_LCLK_BIT,
-       SMU_FEATURE_PPT_BIT,
-       SMU_FEATURE_TDC_BIT,
-       SMU_FEATURE_THERMAL_BIT,
-       SMU_FEATURE_GFX_PER_CU_CG_BIT,
-       SMU_FEATURE_RM_BIT,
-       SMU_FEATURE_DS_DCEFCLK_BIT,
-       SMU_FEATURE_ACDC_BIT,
-       SMU_FEATURE_VR0HOT_BIT,
-       SMU_FEATURE_VR1HOT_BIT,
-       SMU_FEATURE_FW_CTF_BIT,
-       SMU_FEATURE_LED_DISPLAY_BIT,
-       SMU_FEATURE_FAN_CONTROL_BIT,
-       SMU_FEATURE_GFX_EDC_BIT,
-       SMU_FEATURE_GFXOFF_BIT,
-       SMU_FEATURE_CG_BIT,
-       SMU_FEATURE_DPM_FCLK_BIT,
-       SMU_FEATURE_DS_FCLK_BIT,
-       SMU_FEATURE_DS_MP1CLK_BIT,
-       SMU_FEATURE_DS_MP0CLK_BIT,
-       SMU_FEATURE_XGMI_BIT,
-       SMU_FEATURE_DPM_GFX_PACE_BIT,
-       SMU_FEATURE_MEM_VDDCI_SCALING_BIT,
-       SMU_FEATURE_MEM_MVDD_SCALING_BIT,
-       SMU_FEATURE_DS_UCLK_BIT,
-       SMU_FEATURE_GFX_ULV_BIT,
-       SMU_FEATURE_FW_DSTATE_BIT,
-       SMU_FEATURE_BACO_BIT,
-       SMU_FEATURE_VCN_PG_BIT,
-       SMU_FEATURE_JPEG_PG_BIT,
-       SMU_FEATURE_USB_PG_BIT,
-       SMU_FEATURE_RSMU_SMN_CG_BIT,
-       SMU_FEATURE_APCC_PLUS_BIT,
-       SMU_FEATURE_GTHR_BIT,
-       SMU_FEATURE_GFX_DCS_BIT,
-       SMU_FEATURE_GFX_SS_BIT,
-       SMU_FEATURE_OUT_OF_BAND_MONITOR_BIT,
-       SMU_FEATURE_TEMP_DEPENDENT_VMIN_BIT,
-       SMU_FEATURE_MMHUB_PG_BIT,
-       SMU_FEATURE_ATHUB_PG_BIT,
-       SMU_FEATURE_COUNT,
- };
  enum smu_memory_pool_size
  {
      SMU_MEMORY_POOL_SIZE_ZERO   = 0,
@@@ -396,12 -222,17 +222,17 @@@ struct smu_bios_boot_up_value
        uint16_t                        vdd_gfx;
        uint8_t                         cooling_id;
        uint32_t                        pp_table_id;
+       uint32_t                        format_revision;
+       uint32_t                        content_revision;
+       uint32_t                        fclk;
  };
  
  enum smu_table_id
  {
        SMU_TABLE_PPTABLE = 0,
        SMU_TABLE_WATERMARKS,
+       SMU_TABLE_CUSTOM_DPM,
+       SMU_TABLE_DPMCLOCKS,
        SMU_TABLE_AVFS,
        SMU_TABLE_AVFS_PSM_DEBUG,
        SMU_TABLE_AVFS_FUSE_OVERRIDE,
@@@ -422,6 -253,7 +253,7 @@@ struct smu_table_contex
        void                            *hardcode_pptable;
        unsigned long                   metrics_time;
        void                            *metrics_table;
+       void                            *clocks_table;
  
        void                            *max_sustainable_clocks;
        struct smu_bios_boot_up_values  boot_values;
@@@ -540,6 -372,8 +372,8 @@@ struct smu_contex
  #define WATERMARKS_EXIST      (1 << 0)
  #define WATERMARKS_LOADED     (1 << 1)
        uint32_t watermarks_bitmap;
+       uint32_t hard_min_uclk_req_from_dal;
+       bool disable_uclk_switch;
  
        uint32_t workload_mask;
        uint32_t workload_prority[WORKLOAD_POLICY_MAX];
@@@ -607,8 -441,6 +441,6 @@@ struct pptable_funcs 
                                      uint32_t *mclk_mask,
                                      uint32_t *soc_mask);
        int (*set_cpu_power_state)(struct smu_context *smu);
-       int (*set_ppfeature_status)(struct smu_context *smu, uint64_t ppfeatures);
-       int (*get_ppfeature_status)(struct smu_context *smu, char *buf);
        bool (*is_dpm_running)(struct smu_context *smu);
        int (*tables_init)(struct smu_context *smu, struct smu_table *tables);
        int (*set_thermal_fan_table)(struct smu_context *smu);
        int (*get_uclk_dpm_states)(struct smu_context *smu, uint32_t *clocks_in_khz, uint32_t *num_states);
        int (*set_default_od_settings)(struct smu_context *smu, bool initialize);
        int (*set_performance_level)(struct smu_context *smu, enum amd_dpm_forced_level level);
+       int (*display_disable_memory_clock_switch)(struct smu_context *smu, bool disable_memory_clock_switch);
+       void (*dump_pptable)(struct smu_context *smu);
+       int (*get_power_limit)(struct smu_context *smu, uint32_t *limit, bool asic_default);
+       int (*get_dpm_uclk_limited)(struct smu_context *smu, uint32_t *clock, bool max);
  };
  
  struct smu_funcs
        int (*get_clk_info_from_vbios)(struct smu_context *smu);
        int (*check_pptable)(struct smu_context *smu);
        int (*parse_pptable)(struct smu_context *smu);
-       int (*populate_smc_pptable)(struct smu_context *smu);
+       int (*populate_smc_tables)(struct smu_context *smu);
        int (*check_fw_version)(struct smu_context *smu);
+       int (*powergate_sdma)(struct smu_context *smu, bool gate);
+       int (*powergate_vcn)(struct smu_context *smu, bool gate);
+       int (*set_gfx_cgpg)(struct smu_context *smu, bool enable);
        int (*write_pptable)(struct smu_context *smu);
        int (*set_min_dcef_deep_sleep)(struct smu_context *smu);
        int (*set_tool_table_location)(struct smu_context *smu);
        int (*init_display_count)(struct smu_context *smu, uint32_t count);
        int (*set_allowed_mask)(struct smu_context *smu);
        int (*get_enabled_mask)(struct smu_context *smu, uint32_t *feature_mask, uint32_t num);
-       int (*update_feature_enable_state)(struct smu_context *smu, uint32_t feature_id, bool enabled);
        int (*notify_display_change)(struct smu_context *smu);
-       int (*get_power_limit)(struct smu_context *smu, uint32_t *limit, bool def);
        int (*set_power_limit)(struct smu_context *smu, uint32_t n);
        int (*get_current_clk_freq)(struct smu_context *smu, enum smu_clk_type clk_id, uint32_t *value);
        int (*init_max_sustainable_clocks)(struct smu_context *smu);
        enum smu_baco_state (*baco_get_state)(struct smu_context *smu);
        int (*baco_set_state)(struct smu_context *smu, enum smu_baco_state state);
        int (*baco_reset)(struct smu_context *smu);
+       int (*get_dpm_ultimate_freq)(struct smu_context *smu, enum smu_clk_type clk_type, uint32_t *min, uint32_t *max);
  };
  
  #define smu_init_microcode(smu) \
        ((smu)->funcs->check_fw_status ? (smu)->funcs->check_fw_status((smu)) : 0)
  #define smu_setup_pptable(smu) \
        ((smu)->funcs->setup_pptable ? (smu)->funcs->setup_pptable((smu)) : 0)
+ #define smu_powergate_sdma(smu, gate) \
+       ((smu)->funcs->powergate_sdma ? (smu)->funcs->powergate_sdma((smu), (gate)) : 0)
+ #define smu_powergate_vcn(smu, gate) \
+       ((smu)->funcs->powergate_vcn ? (smu)->funcs->powergate_vcn((smu), (gate)) : 0)
+ #define smu_set_gfx_cgpg(smu, enabled) \
+       ((smu)->funcs->set_gfx_cgpg ? (smu)->funcs->set_gfx_cgpg((smu), (enabled)) : 0)
  #define smu_get_vbios_bootup_values(smu) \
        ((smu)->funcs->get_vbios_bootup_values ? (smu)->funcs->get_vbios_bootup_values((smu)) : 0)
  #define smu_get_clk_info_from_vbios(smu) \
        ((smu)->funcs->check_pptable ? (smu)->funcs->check_pptable((smu)) : 0)
  #define smu_parse_pptable(smu) \
        ((smu)->funcs->parse_pptable ? (smu)->funcs->parse_pptable((smu)) : 0)
- #define smu_populate_smc_pptable(smu) \
-       ((smu)->funcs->populate_smc_pptable ? (smu)->funcs->populate_smc_pptable((smu)) : 0)
+ #define smu_populate_smc_tables(smu) \
+       ((smu)->funcs->populate_smc_tables ? (smu)->funcs->populate_smc_tables((smu)) : 0)
  #define smu_check_fw_version(smu) \
        ((smu)->funcs->check_fw_version ? (smu)->funcs->check_fw_version((smu)) : 0)
  #define smu_write_pptable(smu) \
        ((smu)->funcs->get_enabled_mask? (smu)->funcs->get_enabled_mask((smu), (mask), (num)) : 0)
  #define smu_is_dpm_running(smu) \
        ((smu)->ppt_funcs->is_dpm_running ? (smu)->ppt_funcs->is_dpm_running((smu)) : 0)
- #define smu_feature_update_enable_state(smu, feature_id, enabled) \
-       ((smu)->funcs->update_feature_enable_state? (smu)->funcs->update_feature_enable_state((smu), (feature_id), (enabled)) : 0)
  #define smu_notify_display_change(smu) \
        ((smu)->funcs->notify_display_change? (smu)->funcs->notify_display_change((smu)) : 0)
  #define smu_store_powerplay_table(smu) \
  #define smu_set_default_od8_settings(smu) \
        ((smu)->ppt_funcs->set_default_od8_settings ? (smu)->ppt_funcs->set_default_od8_settings((smu)) : 0)
  #define smu_get_power_limit(smu, limit, def) \
-       ((smu)->funcs->get_power_limit ? (smu)->funcs->get_power_limit((smu), (limit), (def)) : 0)
+       ((smu)->ppt_funcs->get_power_limit ? (smu)->ppt_funcs->get_power_limit((smu), (limit), (def)) : 0)
  #define smu_set_power_limit(smu, limit) \
        ((smu)->funcs->set_power_limit ? (smu)->funcs->set_power_limit((smu), (limit)) : 0)
  #define smu_get_current_clk_freq(smu, clk_id, value) \
  #define smu_start_thermal_control(smu) \
        ((smu)->funcs->start_thermal_control? (smu)->funcs->start_thermal_control((smu)) : 0)
  #define smu_read_sensor(smu, sensor, data, size) \
-       ((smu)->funcs->read_sensor? (smu)->funcs->read_sensor((smu), (sensor), (data), (size)) : 0)
- #define smu_asic_read_sensor(smu, sensor, data, size) \
        ((smu)->ppt_funcs->read_sensor? (smu)->ppt_funcs->read_sensor((smu), (sensor), (data), (size)) : 0)
+ #define smu_smc_read_sensor(smu, sensor, data, size) \
+       ((smu)->funcs->read_sensor? (smu)->funcs->read_sensor((smu), (sensor), (data), (size)) : -EINVAL)
  #define smu_get_power_profile_mode(smu, buf) \
        ((smu)->ppt_funcs->get_power_profile_mode ? (smu)->ppt_funcs->get_power_profile_mode((smu), buf) : 0)
  #define smu_set_power_profile_mode(smu, param, param_size) \
        ((smu)->ppt_funcs->get_clock_by_type_with_voltage ? (smu)->ppt_funcs->get_clock_by_type_with_voltage((smu), (type), (clocks)) : 0)
  #define smu_display_clock_voltage_request(smu, clock_req) \
        ((smu)->funcs->display_clock_voltage_request ? (smu)->funcs->display_clock_voltage_request((smu), (clock_req)) : 0)
+ #define smu_display_disable_memory_clock_switch(smu, disable_memory_clock_switch) \
+       ((smu)->ppt_funcs->display_disable_memory_clock_switch ? (smu)->ppt_funcs->display_disable_memory_clock_switch((smu), (disable_memory_clock_switch)) : -EINVAL)
  #define smu_get_dal_power_level(smu, clocks) \
        ((smu)->funcs->get_dal_power_level ? (smu)->funcs->get_dal_power_level((smu), (clocks)) : 0)
  #define smu_get_perf_level(smu, designation, level) \
        ((smu)->ppt_funcs->dpm_set_vce_enable ? (smu)->ppt_funcs->dpm_set_vce_enable((smu), (enable)) : 0)
  #define smu_set_xgmi_pstate(smu, pstate) \
                ((smu)->funcs->set_xgmi_pstate ? (smu)->funcs->set_xgmi_pstate((smu), (pstate)) : 0)
- #define smu_set_ppfeature_status(smu, ppfeatures) \
-       ((smu)->ppt_funcs->set_ppfeature_status ? (smu)->ppt_funcs->set_ppfeature_status((smu), (ppfeatures)) : -EINVAL)
- #define smu_get_ppfeature_status(smu, buf) \
-       ((smu)->ppt_funcs->get_ppfeature_status ? (smu)->ppt_funcs->get_ppfeature_status((smu), (buf)) : -EINVAL)
  #define smu_set_watermarks_table(smu, tab, clock_ranges) \
        ((smu)->ppt_funcs->set_watermarks_table ? (smu)->ppt_funcs->set_watermarks_table((smu), (tab), (clock_ranges)) : 0)
  #define smu_get_current_clk_freq_by_table(smu, clk_type, value) \
        ((smu)->funcs->register_irq_handler ? (smu)->funcs->register_irq_handler(smu) : 0)
  #define smu_set_azalia_d3_pme(smu) \
        ((smu)->funcs->set_azalia_d3_pme ? (smu)->funcs->set_azalia_d3_pme((smu)) : 0)
 -#define smu_get_uclk_dpm_states(smu, clocks_in_khz, num_states) \
 -      ((smu)->ppt_funcs->get_uclk_dpm_states ? (smu)->ppt_funcs->get_uclk_dpm_states((smu), (clocks_in_khz), (num_states)) : 0)
+ #define smu_get_dpm_ultimate_freq(smu, param, min, max) \
+               ((smu)->funcs->get_dpm_ultimate_freq ? (smu)->funcs->get_dpm_ultimate_freq((smu), (param), (min), (max)) : 0)
  #define smu_get_max_sustainable_clocks_by_dc(smu, max_clocks) \
        ((smu)->funcs->get_max_sustainable_clocks_by_dc ? (smu)->funcs->get_max_sustainable_clocks_by_dc((smu), (max_clocks)) : 0)
  #define smu_get_uclk_dpm_states(smu, clocks_in_khz, num_states) \
        ((smu)->funcs->baco_reset? (smu)->funcs->baco_reset((smu)) : 0)
  #define smu_asic_set_performance_level(smu, level) \
        ((smu)->ppt_funcs->set_performance_level? (smu)->ppt_funcs->set_performance_level((smu), (level)) : -EINVAL);
+ #define smu_dump_pptable(smu) \
+       ((smu)->ppt_funcs->dump_pptable ? (smu)->ppt_funcs->dump_pptable((smu)) : 0)
+ #define smu_get_dpm_uclk_limited(smu, clock, max) \
+               ((smu)->ppt_funcs->get_dpm_uclk_limited ? (smu)->ppt_funcs->get_dpm_uclk_limited((smu), (clock), (max)) : -EINVAL)
  
  
  extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,
  extern const struct amd_ip_funcs smu_ip_funcs;
  
  extern const struct amdgpu_ip_block_version smu_v11_0_ip_block;
+ extern const struct amdgpu_ip_block_version smu_v12_0_ip_block;
  extern int smu_feature_init_dpm(struct smu_context *smu);
  
  extern int smu_feature_is_enabled(struct smu_context *smu,
@@@ -943,6 -792,7 +790,7 @@@ int smu_update_table(struct smu_contex
                     void *table_data, bool drv2smu);
  
  bool is_support_sw_smu(struct amdgpu_device *adev);
+ bool is_support_sw_smu_xgmi(struct amdgpu_device *adev);
  int smu_reset(struct smu_context *smu);
  int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
                           void *data, uint32_t *size);
@@@ -961,6 -811,9 +809,9 @@@ extern int smu_dpm_set_power_gate(struc
  extern int smu_handle_task(struct smu_context *smu,
                           enum amd_dpm_forced_level level,
                           enum amd_pp_task task_id);
+ int smu_switch_power_profile(struct smu_context *smu,
+                            enum PP_SMC_POWER_PROFILE type,
+                            bool en);
  int smu_get_smc_version(struct smu_context *smu, uint32_t *if_version, uint32_t *smu_version);
  int smu_get_dpm_freq_by_index(struct smu_context *smu, enum smu_clk_type clk_type,
                              uint16_t level, uint32_t *value);
@@@ -976,5 -829,10 +827,10 @@@ enum amd_dpm_forced_level smu_get_perfo
  int smu_force_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level);
  int smu_set_display_count(struct smu_context *smu, uint32_t count);
  bool smu_clk_dpm_is_enabled(struct smu_context *smu, enum smu_clk_type clk_type);
+ int smu_feature_update_enable_state(struct smu_context *smu, uint64_t feature_mask, bool enabled);
+ const char *smu_get_message_name(struct smu_context *smu, enum smu_message_type type);
+ const char *smu_get_feature_name(struct smu_context *smu, enum smu_feature_mask feature);
+ size_t smu_sys_get_pp_feature_mask(struct smu_context *smu, char *buf);
+ int smu_sys_set_pp_feature_mask(struct smu_context *smu, uint64_t new_mask);
  
  #endif
index 9d4d5075cc647ef6686afba1cac57539bd64e7a6,0142ee99195779d5a5f7710d1b21f9232dd23d79..ca64a129c594ecc31f951cbc6ce5b903290501e0
@@@ -122,12 -122,15 +122,15 @@@ static int komeda_parse_pipe_dt(struct 
        pipe->pxlclk = clk;
  
        /* enum ports */
-       pipe->of_output_dev =
+       pipe->of_output_links[0] =
                of_graph_get_remote_node(np, KOMEDA_OF_PORT_OUTPUT, 0);
+       pipe->of_output_links[1] =
+               of_graph_get_remote_node(np, KOMEDA_OF_PORT_OUTPUT, 1);
        pipe->of_output_port =
                of_graph_get_port_by_id(np, KOMEDA_OF_PORT_OUTPUT);
  
 -      pipe->of_node = np;
+       pipe->dual_link = pipe->of_output_links[0] && pipe->of_output_links[1];
 +      pipe->of_node = of_node_get(np);
  
        return 0;
  }
index 69d9e26c60c812769164996f68aa299127371053,89191a555c84dc0e870562586550654b83b0e7fc..8820ce15ce375df111338db44d59821018cfc51c
@@@ -14,7 -14,6 +14,7 @@@
  #include <drm/drm_gem_cma_helper.h>
  #include <drm/drm_gem_framebuffer_helper.h>
  #include <drm/drm_irq.h>
 +#include <drm/drm_probe_helper.h>
  #include <drm/drm_vblank.h>
  
  #include "komeda_dev.h"
@@@ -56,16 -55,13 +56,13 @@@ static irqreturn_t komeda_kms_irq_handl
  }
  
  static struct drm_driver komeda_kms_driver = {
-       .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
-                          DRIVER_PRIME | DRIVER_HAVE_IRQ,
+       .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
        .lastclose                      = drm_fb_helper_lastclose,
        .gem_free_object_unlocked       = drm_gem_cma_free_object,
        .gem_vm_ops                     = &drm_gem_cma_vm_ops,
        .dumb_create                    = komeda_gem_cma_dumb_create,
        .prime_handle_to_fd             = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle             = drm_gem_prime_fd_to_handle,
-       .gem_prime_export               = drm_gem_prime_export,
-       .gem_prime_import               = drm_gem_prime_import,
        .gem_prime_get_sg_table         = drm_gem_cma_prime_get_sg_table,
        .gem_prime_import_sg_table      = drm_gem_cma_prime_import_sg_table,
        .gem_prime_vmap                 = drm_gem_cma_prime_vmap,
@@@ -147,6 -143,7 +144,6 @@@ static int komeda_crtc_normalize_zpos(s
        struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc_st);
        struct komeda_plane_state *kplane_st;
        struct drm_plane_state *plane_st;
 -      struct drm_framebuffer *fb;
        struct drm_plane *plane;
        struct list_head zorder_list;
        int order = 0, err;
  
        list_for_each_entry(kplane_st, &zorder_list, zlist_node) {
                plane_st = &kplane_st->base;
 -              fb = plane_st->fb;
                plane = plane_st->plane;
  
                plane_st->normalized_zpos = order++;
@@@ -204,7 -202,7 +201,7 @@@ static int komeda_kms_check(struct drm_
                            struct drm_atomic_state *state)
  {
        struct drm_crtc *crtc;
 -      struct drm_crtc_state *old_crtc_st, *new_crtc_st;
 +      struct drm_crtc_state *new_crtc_st;
        int i, err;
  
        err = drm_atomic_helper_check_modeset(dev, state);
         * so need to add all affected_planes (even unchanged) to
         * drm_atomic_state.
         */
 -      for_each_oldnew_crtc_in_state(state, crtc, old_crtc_st, new_crtc_st, i) {
 +      for_each_new_crtc_in_state(state, crtc, new_crtc_st, i) {
                err = drm_atomic_add_affected_planes(state, crtc);
                if (err)
                        return err;
@@@ -306,33 -304,24 +303,33 @@@ struct komeda_kms_dev *komeda_kms_attac
                               komeda_kms_irq_handler, IRQF_SHARED,
                               drm->driver->name, drm);
        if (err)
 -              goto cleanup_mode_config;
 +              goto free_component_binding;
  
        err = mdev->funcs->enable_irq(mdev);
        if (err)
 -              goto cleanup_mode_config;
 +              goto free_component_binding;
  
        drm->irq_enabled = true;
  
 +      drm_kms_helper_poll_init(drm);
 +
        err = drm_dev_register(drm, 0);
        if (err)
 -              goto cleanup_mode_config;
 +              goto free_interrupts;
  
        return kms;
  
 -cleanup_mode_config:
 +free_interrupts:
 +      drm_kms_helper_poll_fini(drm);
        drm->irq_enabled = false;
 +      mdev->funcs->disable_irq(mdev);
 +free_component_binding:
 +      component_unbind_all(mdev->dev, drm);
 +cleanup_mode_config:
        drm_mode_config_cleanup(drm);
        komeda_kms_cleanup_private_objs(kms);
 +      drm->dev_private = NULL;
 +      drm_dev_put(drm);
  free_kms:
        kfree(kms);
        return ERR_PTR(err);
@@@ -343,14 -332,12 +340,14 @@@ void komeda_kms_detach(struct komeda_km
        struct drm_device *drm = &kms->base;
        struct komeda_dev *mdev = drm->dev_private;
  
 +      drm_dev_unregister(drm);
 +      drm_kms_helper_poll_fini(drm);
 +      drm_atomic_helper_shutdown(drm);
        drm->irq_enabled = false;
        mdev->funcs->disable_irq(mdev);
 -      drm_dev_unregister(drm);
        component_unbind_all(mdev->dev, drm);
 -      komeda_kms_cleanup_private_objs(kms);
        drm_mode_config_cleanup(drm);
 +      komeda_kms_cleanup_private_objs(kms);
        drm->dev_private = NULL;
        drm_dev_put(drm);
  }
index 14b683164544d8c2ea7d8d272f6f5caadaa4427f,a7a84e66549d6309e9c50c4ea62a8af97383944a..cf5bea578ad924e054bd66a270165b1ecbd09dd7
@@@ -416,8 -416,10 +416,10 @@@ struct komeda_pipeline 
        struct device_node *of_node;
        /** @of_output_port: pipeline output port */
        struct device_node *of_output_port;
-       /** @of_output_dev: output connector device node */
-       struct device_node *of_output_dev;
+       /** @of_output_links: output connector device nodes */
+       struct device_node *of_output_links[2];
+       /** @dual_link: true if of_output_links[0] and [1] are both valid */
+       bool dual_link;
  };
  
  /**
@@@ -480,7 -482,6 +482,7 @@@ void komeda_pipeline_dump_register(stru
                                   struct seq_file *sf);
  
  /* component APIs */
 +extern __printf(10, 11)
  struct komeda_component *
  komeda_component_add(struct komeda_pipeline *pipe,
                     size_t comp_sz, u32 id, u32 hw_id,
index a5d1494a3dc44b853d6b19472305341c18c504fd,dab77b2bc8acecc31bc077ec1e00b4085e52e339..50de8e47659c7f62c272b068adf2d0bad9138956
  /*
   * Authors: Dave Airlie <[email protected]>
   */
- #include <drm/drmP.h>
- #include "ast_drv.h"
  
+ #include <linux/pci.h>
  
- #include <drm/drm_fb_helper.h>
  #include <drm/drm_crtc_helper.h>
+ #include <drm/drm_fb_helper.h>
+ #include <drm/drm_gem.h>
+ #include <drm/drm_gem_framebuffer_helper.h>
+ #include <drm/drm_gem_vram_helper.h>
+ #include <drm/drm_vram_mm_helper.h>
+ #include "ast_drv.h"
  
  void ast_set_index_reg_mask(struct ast_private *ast,
                            uint32_t base, uint8_t index,
@@@ -131,8 -136,8 +136,8 @@@ static int ast_detect_chip(struct drm_d
  
  
        /* Enable extended register access */
 -      ast_enable_mmio(dev);
        ast_open_key(ast);
 +      ast_enable_mmio(dev);
  
        /* Find out whether P2A works or whether to use device-tree */
        ast_detect_config_mode(dev, &scu_rev);
@@@ -383,67 -388,8 +388,8 @@@ static int ast_get_dram_info(struct drm
        return 0;
  }
  
- static void ast_user_framebuffer_destroy(struct drm_framebuffer *fb)
- {
-       struct ast_framebuffer *ast_fb = to_ast_framebuffer(fb);
-       drm_gem_object_put_unlocked(ast_fb->obj);
-       drm_framebuffer_cleanup(fb);
-       kfree(ast_fb);
- }
- static const struct drm_framebuffer_funcs ast_fb_funcs = {
-       .destroy = ast_user_framebuffer_destroy,
- };
- int ast_framebuffer_init(struct drm_device *dev,
-                        struct ast_framebuffer *ast_fb,
-                        const struct drm_mode_fb_cmd2 *mode_cmd,
-                        struct drm_gem_object *obj)
- {
-       int ret;
-       drm_helper_mode_fill_fb_struct(dev, &ast_fb->base, mode_cmd);
-       ast_fb->obj = obj;
-       ret = drm_framebuffer_init(dev, &ast_fb->base, &ast_fb_funcs);
-       if (ret) {
-               DRM_ERROR("framebuffer init failed %d\n", ret);
-               return ret;
-       }
-       return 0;
- }
- static struct drm_framebuffer *
- ast_user_framebuffer_create(struct drm_device *dev,
-              struct drm_file *filp,
-              const struct drm_mode_fb_cmd2 *mode_cmd)
- {
-       struct drm_gem_object *obj;
-       struct ast_framebuffer *ast_fb;
-       int ret;
-       obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
-       if (obj == NULL)
-               return ERR_PTR(-ENOENT);
-       ast_fb = kzalloc(sizeof(*ast_fb), GFP_KERNEL);
-       if (!ast_fb) {
-               drm_gem_object_put_unlocked(obj);
-               return ERR_PTR(-ENOMEM);
-       }
-       ret = ast_framebuffer_init(dev, ast_fb, mode_cmd, obj);
-       if (ret) {
-               drm_gem_object_put_unlocked(obj);
-               kfree(ast_fb);
-               return ERR_PTR(ret);
-       }
-       return &ast_fb->base;
- }
  static const struct drm_mode_config_funcs ast_mode_funcs = {
-       .fb_create = ast_user_framebuffer_create,
+       .fb_create = drm_gem_fb_create
  };
  
  static u32 ast_get_vram_info(struct drm_device *dev)
@@@ -561,7 -507,7 +507,7 @@@ int ast_driver_load(struct drm_device *
        if (ret)
                goto out_free;
  
-       ret = ast_fbdev_init(dev);
+       ret = drm_fbdev_generic_setup(dev, 32);
        if (ret)
                goto out_free;
  
@@@ -576,13 -522,9 +522,12 @@@ void ast_driver_unload(struct drm_devic
  {
        struct ast_private *ast = dev->dev_private;
  
 +      /* enable standard VGA decode */
 +      ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x04);
 +
        ast_release_firmware(dev);
        kfree(ast->dp501_fw_addr);
        ast_mode_fini(dev);
-       ast_fbdev_fini(dev);
        drm_mode_config_cleanup(dev);
  
        ast_mm_fini(ast);
@@@ -612,6 -554,6 +557,6 @@@ int ast_gem_create(struct drm_device *d
                        DRM_ERROR("failed to allocate GEM object\n");
                return ret;
        }
-       *obj = &gbo->gem;
+       *obj = &gbo->bo.base;
        return 0;
  }
index a1cb020e07e502197428bc0fca447c650c381110,1c899a6e87b7319825f397b3e5c9eb1a63c28382..d349c721501c6cb5ee890b5c2906479e0b865daf
  /*
   * Authors: Dave Airlie <[email protected]>
   */
  #include <linux/export.h>
- #include <drm/drmP.h>
+ #include <linux/pci.h>
  #include <drm/drm_crtc.h>
  #include <drm/drm_crtc_helper.h>
+ #include <drm/drm_fourcc.h>
+ #include <drm/drm_gem_vram_helper.h>
  #include <drm/drm_plane_helper.h>
  #include <drm/drm_probe_helper.h>
- #include "ast_drv.h"
  
+ #include "ast_drv.h"
  #include "ast_tables.h"
  
  static struct ast_i2c_chan *ast_i2c_create(struct drm_device *dev);
@@@ -525,28 -529,16 +529,16 @@@ static int ast_crtc_do_set_base(struct 
                                struct drm_framebuffer *fb,
                                int x, int y, int atomic)
  {
-       struct ast_private *ast = crtc->dev->dev_private;
-       struct drm_gem_object *obj;
-       struct ast_framebuffer *ast_fb;
        struct drm_gem_vram_object *gbo;
        int ret;
        s64 gpu_addr;
-       void *base;
  
        if (!atomic && fb) {
-               ast_fb = to_ast_framebuffer(fb);
-               obj = ast_fb->obj;
-               gbo = drm_gem_vram_of_gem(obj);
-               /* unmap if console */
-               if (&ast->fbdev->afb == ast_fb)
-                       drm_gem_vram_kunmap(gbo);
+               gbo = drm_gem_vram_of_gem(fb->obj[0]);
                drm_gem_vram_unpin(gbo);
        }
  
-       ast_fb = to_ast_framebuffer(crtc->primary->fb);
-       obj = ast_fb->obj;
-       gbo = drm_gem_vram_of_gem(obj);
+       gbo = drm_gem_vram_of_gem(crtc->primary->fb->obj[0]);
  
        ret = drm_gem_vram_pin(gbo, DRM_GEM_VRAM_PL_FLAG_VRAM);
        if (ret)
                goto err_drm_gem_vram_unpin;
        }
  
-       if (&ast->fbdev->afb == ast_fb) {
-               /* if pushing console in kmap it */
-               base = drm_gem_vram_kmap(gbo, true, NULL);
-               if (IS_ERR(base)) {
-                       ret = PTR_ERR(base);
-                       DRM_ERROR("failed to kmap fbcon\n");
-               } else {
-                       ast_fbdev_set_base(ast, gpu_addr);
-               }
-       }
        ast_set_offset_reg(crtc);
        ast_set_start_address_crt1(crtc, (u32)gpu_addr);
  
@@@ -604,7 -585,7 +585,7 @@@ static int ast_crtc_mode_set(struct drm
                return -EINVAL;
        ast_open_key(ast);
  
 -      ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
 +      ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
  
        ast_set_std_reg(crtc, adjusted_mode, &vbios_mode);
        ast_set_crtc_reg(crtc, adjusted_mode, &vbios_mode);
@@@ -624,14 -605,10 +605,10 @@@ static void ast_crtc_disable(struct drm
        DRM_DEBUG_KMS("\n");
        ast_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
        if (crtc->primary->fb) {
-               struct ast_private *ast = crtc->dev->dev_private;
-               struct ast_framebuffer *ast_fb = to_ast_framebuffer(crtc->primary->fb);
-               struct drm_gem_object *obj = ast_fb->obj;
-               struct drm_gem_vram_object *gbo = drm_gem_vram_of_gem(obj);
-               /* unmap if console */
-               if (&ast->fbdev->afb == ast_fb)
-                       drm_gem_vram_kunmap(gbo);
+               struct drm_framebuffer *fb = crtc->primary->fb;
+               struct drm_gem_vram_object *gbo =
+                       drm_gem_vram_of_gem(fb->obj[0]);
                drm_gem_vram_unpin(gbo);
        }
        crtc->primary->fb = NULL;
@@@ -890,7 -867,14 +867,14 @@@ static int ast_connector_init(struct dr
                return -ENOMEM;
  
        connector = &ast_connector->base;
-       drm_connector_init(dev, connector, &ast_connector_funcs, DRM_MODE_CONNECTOR_VGA);
+       ast_connector->i2c = ast_i2c_create(dev);
+       if (!ast_connector->i2c)
+               DRM_ERROR("failed to add ddc bus for connector\n");
+       drm_connector_init_with_ddc(dev, connector,
+                                   &ast_connector_funcs,
+                                   DRM_MODE_CONNECTOR_VGA,
+                                   &ast_connector->i2c->adapter);
  
        drm_connector_helper_add(connector, &ast_connector_helper_funcs);
  
        encoder = list_first_entry(&dev->mode_config.encoder_list, struct drm_encoder, head);
        drm_connector_attach_encoder(connector, encoder);
  
-       ast_connector->i2c = ast_i2c_create(dev);
-       if (!ast_connector->i2c)
-               DRM_ERROR("failed to add ddc bus for connector\n");
        return 0;
  }
  
index c1d1ac51d1c207c0cb0b2f08825aa19ca7761bde,e1d9cdf6ec1dcc44987cbcf4a66352f004dc5bb6..2d1b186197432ea42be84d55e0472dde950ef6cf
   * Authors: Dave Airlie <[email protected]>
   */
  
- #include <drm/drmP.h>
- #include "ast_drv.h"
+ #include <linux/delay.h>
+ #include <linux/pci.h>
+ #include <drm/drm_print.h>
  
  #include "ast_dram_tables.h"
+ #include "ast_drv.h"
  
  static void ast_post_chip_2300(struct drm_device *dev);
  static void ast_post_chip_2500(struct drm_device *dev);
@@@ -46,7 -49,7 +49,7 @@@ void ast_enable_mmio(struct drm_device 
  {
        struct ast_private *ast = dev->dev_private;
  
 -      ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
 +      ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
  }
  
  
index c814bcef18a4007d90d5dcb85fd8abb6c69a985b,226a1d0720cf103ad474012230726ac29d05e8c1..88232698d7a00a95b9317465a6f5fe3ae44a05cd
@@@ -1454,7 -1454,6 +1454,7 @@@ static int drm_mode_parse_cmdline_refre
  }
  
  static int drm_mode_parse_cmdline_extra(const char *str, int length,
 +                                      bool freestanding,
                                        const struct drm_connector *connector,
                                        struct drm_cmdline_mode *mode)
  {
        for (i = 0; i < length; i++) {
                switch (str[i]) {
                case 'i':
 +                      if (freestanding)
 +                              return -EINVAL;
 +
                        mode->interlace = true;
                        break;
                case 'm':
 +                      if (freestanding)
 +                              return -EINVAL;
 +
                        mode->margins = true;
                        break;
                case 'D':
@@@ -1549,7 -1542,6 +1549,7 @@@ static int drm_mode_parse_cmdline_res_m
                        if (extras) {
                                int ret = drm_mode_parse_cmdline_extra(end_ptr + i,
                                                                       1,
 +                                                                     false,
                                                                       connector,
                                                                       mode);
                                if (ret)
@@@ -1677,22 -1669,6 +1677,22 @@@ static int drm_mode_parse_cmdline_optio
        return 0;
  }
  
 +static const char * const drm_named_modes_whitelist[] = {
 +      "NTSC",
 +      "PAL",
 +};
 +
 +static bool drm_named_mode_is_in_whitelist(const char *mode, unsigned int size)
 +{
 +      int i;
 +
 +      for (i = 0; i < ARRAY_SIZE(drm_named_modes_whitelist); i++)
 +              if (!strncmp(mode, drm_named_modes_whitelist[i], size))
 +                      return true;
 +
 +      return false;
 +}
 +
  /**
   * drm_mode_parse_command_line_for_connector - parse command line modeline for connector
   * @mode_option: optional per connector mode option
@@@ -1749,30 -1725,16 +1749,30 @@@ bool drm_mode_parse_command_line_for_co
         * bunch of things:
         *   - We need to make sure that the first character (which
         *     would be our resolution in X) is a digit.
 -       *   - However, if the X resolution is missing, then we end up
 -       *     with something like x<yres>, with our first character
 -       *     being an alpha-numerical character, which would be
 -       *     considered a named mode.
 +       *   - If not, then it's either a named mode or a force on/off.
 +       *     To distinguish between the two, we need to run the
 +       *     extra parsing function, and if not, then we consider it
 +       *     a named mode.
         *
         * If this isn't enough, we should add more heuristics here,
         * and matching unit-tests.
         */
 -      if (!isdigit(name[0]) && name[0] != 'x')
 +      if (!isdigit(name[0]) && name[0] != 'x') {
 +              unsigned int namelen = strlen(name);
 +
 +              /*
 +               * Only the force on/off options can be in that case,
 +               * and they all take a single character.
 +               */
 +              if (namelen == 1) {
 +                      ret = drm_mode_parse_cmdline_extra(name, namelen, true,
 +                                                         connector, mode);
 +                      if (!ret)
 +                              return true;
 +              }
 +
                named_mode = true;
 +      }
  
        /* Try to locate the bpp and refresh specifiers, if any */
        bpp_ptr = strchr(name, '-');
        }
  
        if (named_mode) {
 -              strncpy(mode->name, name, mode_end);
 +              if (mode_end + 1 > DRM_DISPLAY_MODE_LEN)
 +                      return false;
 +
 +              if (!drm_named_mode_is_in_whitelist(name, mode_end))
 +                      return false;
 +
 +              strscpy(mode->name, name, mode_end + 1);
        } else {
                ret = drm_mode_parse_cmdline_res_mode(name, mode_end,
                                                      parse_extras,
            extra_ptr != options_ptr) {
                int len = strlen(name) - (extra_ptr - name);
  
 -              ret = drm_mode_parse_cmdline_extra(extra_ptr, len,
 +              ret = drm_mode_parse_cmdline_extra(extra_ptr, len, false,
                                                   connector, mode);
                if (ret)
                        return false;
@@@ -1956,8 -1912,11 +1956,11 @@@ void drm_mode_convert_to_umode(struct d
        case HDMI_PICTURE_ASPECT_256_135:
                out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
                break;
-       case HDMI_PICTURE_ASPECT_RESERVED:
        default:
+               WARN(1, "Invalid aspect ratio (0%x) on mode\n",
+                    in->picture_aspect_ratio);
+               /* fall through */
+       case HDMI_PICTURE_ASPECT_NONE:
                out->flags |= DRM_MODE_FLAG_PIC_AR_NONE;
                break;
        }
@@@ -2016,20 -1975,22 +2019,22 @@@ int drm_mode_convert_umode(struct drm_d
  
        switch (in->flags & DRM_MODE_FLAG_PIC_AR_MASK) {
        case DRM_MODE_FLAG_PIC_AR_4_3:
-               out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_4_3;
+               out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3;
                break;
        case DRM_MODE_FLAG_PIC_AR_16_9:
-               out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
+               out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9;
                break;
        case DRM_MODE_FLAG_PIC_AR_64_27:
-               out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
+               out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27;
                break;
        case DRM_MODE_FLAG_PIC_AR_256_135:
-               out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
+               out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135;
                break;
-       default:
+       case DRM_MODE_FLAG_PIC_AR_NONE:
                out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
                break;
+       default:
+               return -EINVAL;
        }
  
        out->status = drm_mode_validate_driver(dev, out);
index badab94be2d6eaac5bd2b32d5d668df6caf8b9bb,8a03a33c32cb901bfa4d053b7a6cb3908f9fd4ca..ba0f868b2477f667168bc5ff0406d8f84ca64a44
@@@ -8,12 -8,20 +8,20 @@@
   */
  
  #include <linux/component.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/platform_device.h>
  #include <linux/pm_runtime.h>
+ #include <linux/uaccess.h>
  
  #include <drm/drm_atomic.h>
  #include <drm/drm_atomic_helper.h>
+ #include <drm/drm_drv.h>
  #include <drm/drm_fb_helper.h>
+ #include <drm/drm_file.h>
+ #include <drm/drm_fourcc.h>
+ #include <drm/drm_ioctl.h>
  #include <drm/drm_probe_helper.h>
+ #include <drm/drm_vblank.h>
  #include <drm/exynos_drm.h>
  
  #include "exynos_drm_drv.h"
@@@ -75,29 -83,29 +83,29 @@@ static const struct vm_operations_struc
  
  static const struct drm_ioctl_desc exynos_ioctls[] = {
        DRM_IOCTL_DEF_DRV(EXYNOS_GEM_CREATE, exynos_drm_gem_create_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MAP, exynos_drm_gem_map_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_GEM_GET, exynos_drm_gem_get_ioctl,
                        DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_VIDI_CONNECTION, vidi_connection_ioctl,
                        DRM_AUTH),
        DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER, exynos_g2d_get_ver_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST, exynos_g2d_set_cmdlist_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, exynos_g2d_exec_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_RESOURCES,
                        exynos_drm_ipp_get_res_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_CAPS, exynos_drm_ipp_get_caps_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_LIMITS,
                        exynos_drm_ipp_get_limits_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(EXYNOS_IPP_COMMIT, exynos_drm_ipp_commit_ioctl,
-                       DRM_AUTH | DRM_RENDER_ALLOW),
+                       DRM_RENDER_ALLOW),
  };
  
  static const struct file_operations exynos_drm_driver_fops = {
  };
  
  static struct drm_driver exynos_drm_driver = {
-       .driver_features        = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
+       .driver_features        = DRIVER_MODESET | DRIVER_GEM
                                  | DRIVER_ATOMIC | DRIVER_RENDER,
        .open                   = exynos_drm_open,
        .lastclose              = drm_fb_helper_lastclose,
        .dumb_create            = exynos_drm_gem_dumb_create,
        .prime_handle_to_fd     = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle     = drm_gem_prime_fd_to_handle,
-       .gem_prime_export       = drm_gem_prime_export,
        .gem_prime_import       = exynos_drm_gem_prime_import,
        .gem_prime_get_sg_table = exynos_drm_gem_prime_get_sg_table,
        .gem_prime_import_sg_table      = exynos_drm_gem_prime_import_sg_table,
@@@ -242,7 -249,9 +249,7 @@@ static struct component_match *exynos_d
                if (!info->driver || !(info->flags & DRM_COMPONENT_DRIVER))
                        continue;
  
 -              while ((d = bus_find_device(&platform_bus_type, p,
 -                                          &info->driver->driver,
 -                                          (void *)platform_bus_type.match))) {
 +              while ((d = platform_find_device_by_driver(p, &info->driver->driver))) {
                        put_device(p);
  
                        if (!(info->flags & DRM_FIMC_DEVICE) ||
@@@ -410,8 -419,9 +417,8 @@@ static void exynos_drm_unregister_devic
                if (!info->driver || !(info->flags & DRM_VIRTUAL_DEVICE))
                        continue;
  
 -              while ((dev = bus_find_device(&platform_bus_type, NULL,
 -                                          &info->driver->driver,
 -                                          (void *)platform_bus_type.match))) {
 +              while ((dev = platform_find_device_by_driver(NULL,
 +                                              &info->driver->driver))) {
                        put_device(dev);
                        platform_device_unregister(to_platform_device(dev));
                }
index 8aa6a31e8ad07d8e02f4e88142e665ce20997c19,2c5ac3dd647fd5cf697b34d631e00d400019edc6..6df240a01b8c3ba68de001f725a3a6f5446e7bbc
  #include "intel_audio.h"
  #include "intel_connector.h"
  #include "intel_ddi.h"
+ #include "intel_display_types.h"
  #include "intel_dp.h"
  #include "intel_dp_mst.h"
  #include "intel_dpio_phy.h"
- #include "intel_drv.h"
  
  static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,
                                            struct intel_crtc_state *crtc_state,
@@@ -128,15 -128,7 +128,15 @@@ static int intel_dp_mst_compute_config(
        limits.max_lane_count = intel_dp_max_lane_count(intel_dp);
  
        limits.min_bpp = intel_dp_min_bpp(pipe_config);
 -      limits.max_bpp = pipe_config->pipe_bpp;
 +      /*
 +       * FIXME: If all the streams can't fit into the link with
 +       * their current pipe_bpp we should reduce pipe_bpp across
 +       * the board until things start to fit. Until then we
 +       * limit to <= 8bpc since that's what was hardcoded for all
 +       * MST streams previously. This hack should be removed once
 +       * we have the proper retry logic in place.
 +       */
 +      limits.max_bpp = min(pipe_config->pipe_bpp, 24);
  
        intel_dp_adjust_compliance_config(intel_dp, pipe_config, &limits);
  
@@@ -346,11 -338,8 +346,8 @@@ static void intel_mst_enable_dp(struct 
  
        DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
  
-       if (intel_wait_for_register(&dev_priv->uncore,
-                                   DP_TP_STATUS(port),
-                                   DP_TP_STATUS_ACT_SENT,
-                                   DP_TP_STATUS_ACT_SENT,
-                                   1))
+       if (intel_de_wait_for_set(dev_priv, DP_TP_STATUS(port),
+                                 DP_TP_STATUS_ACT_SENT, 1))
                DRM_ERROR("Timed out waiting for ACT sent\n");
  
        drm_dp_check_act_status(&intel_dp->mst_mgr);
@@@ -618,7 -607,7 +615,7 @@@ intel_dp_create_fake_mst_encoder(struc
        intel_encoder->type = INTEL_OUTPUT_DP_MST;
        intel_encoder->power_domain = intel_dig_port->base.power_domain;
        intel_encoder->port = intel_dig_port->base.port;
-       intel_encoder->crtc_mask = 0x7;
+       intel_encoder->crtc_mask = BIT(pipe);
        intel_encoder->cloneable = 0;
  
        intel_encoder->compute_config = intel_dp_mst_compute_config;
@@@ -647,6 -636,12 +644,12 @@@ intel_dp_create_fake_mst_encoders(struc
        return true;
  }
  
+ int
+ intel_dp_mst_encoder_active_links(struct intel_digital_port *intel_dig_port)
+ {
+       return intel_dig_port->dp.active_mst_links;
+ }
  int
  intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_base_id)
  {
index f413904a3e960ffbc1895ee554846a024994761a,598ddb60f9fb5cfb9e45af6cee18dc18ebfbe1ff..d4fb7f16f9f6c9fbff1232d8c621bb56ce1a153a
@@@ -9,7 -9,7 +9,7 @@@
  #include <drm/i915_drm.h>
  
  #include "i915_drv.h"
- #include "intel_drv.h"
+ #include "intel_display_types.h"
  #include "intel_vdsc.h"
  
  enum ROW_INDEX_BPP {
@@@ -459,17 -459,23 +459,23 @@@ int intel_dp_compute_dsc_params(struct 
  enum intel_display_power_domain
  intel_dsc_power_domain(const struct intel_crtc_state *crtc_state)
  {
+       struct drm_i915_private *i915 = to_i915(crtc_state->base.crtc->dev);
        enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
  
        /*
-        * On ICL VDSC/joining for eDP transcoder uses a separate power well PW2
-        * This requires POWER_DOMAIN_TRANSCODER_EDP_VDSC power domain.
+        * On ICL VDSC/joining for eDP transcoder uses a separate power well,
+        * PW2. This requires POWER_DOMAIN_TRANSCODER_VDSC_PW2 power domain.
         * For any other transcoder, VDSC/joining uses the power well associated
         * with the pipe/transcoder in use. Hence another reference on the
         * transcoder power domain will suffice.
+        *
+        * On TGL we have the same mapping, but for transcoder A (the special
+        * TRANSCODER_EDP is gone).
         */
-       if (cpu_transcoder == TRANSCODER_EDP)
-               return POWER_DOMAIN_TRANSCODER_EDP_VDSC;
+       if (INTEL_GEN(i915) >= 12 && cpu_transcoder == TRANSCODER_A)
+               return POWER_DOMAIN_TRANSCODER_VDSC_PW2;
+       else if (cpu_transcoder == TRANSCODER_EDP)
+               return POWER_DOMAIN_TRANSCODER_VDSC_PW2;
        else
                return POWER_DOMAIN_TRANSCODER(cpu_transcoder);
  }
@@@ -541,7 -547,7 +547,7 @@@ static void intel_configure_pps_for_dsc
        pps_val |= DSC_PIC_HEIGHT(vdsc_cfg->pic_height) |
                DSC_PIC_WIDTH(vdsc_cfg->pic_width / num_vdsc_instances);
        DRM_INFO("PPS2 = 0x%08x\n", pps_val);
 -      if (encoder->type == INTEL_OUTPUT_EDP) {
 +      if (cpu_transcoder == TRANSCODER_EDP) {
                I915_WRITE(DSCA_PICTURE_PARAMETER_SET_2, pps_val);
                /*
                 * If 2 VDSC instances are needed, configure PPS for second
index 41dab9ea33cd4e566396550b0d9cc7aa299442ff,f813fcb8ceb6e9eac389a7a46168f68a60180039..b5f6937369eacb8f851eaef540c11db51a713255
@@@ -5,7 -5,7 +5,7 @@@
   */
  
  #include <linux/intel-iommu.h>
- #include <linux/reservation.h>
+ #include <linux/dma-resv.h>
  #include <linux/sync_file.h>
  #include <linux/uaccess.h>
  
  
  #include "gem/i915_gem_ioctls.h"
  #include "gt/intel_context.h"
+ #include "gt/intel_engine_pool.h"
+ #include "gt/intel_gt.h"
  #include "gt/intel_gt_pm.h"
  
- #include "i915_gem_ioctls.h"
+ #include "i915_drv.h"
  #include "i915_gem_clflush.h"
  #include "i915_gem_context.h"
+ #include "i915_gem_ioctls.h"
  #include "i915_trace.h"
- #include "intel_drv.h"
  
  enum {
        FORCE_CPU_RELOC = 1,
@@@ -222,7 -224,6 +224,6 @@@ struct i915_execbuffer 
        struct intel_engine_cs *engine; /** engine to queue the request to */
        struct intel_context *context; /* logical state for the request */
        struct i915_gem_context *gem_context; /** caller's context */
-       struct i915_address_space *vm; /** GTT and vma for the request */
  
        struct i915_request *request; /** our request to build */
        struct i915_vma *batch; /** identity of the batch obj/vma */
@@@ -696,7 -697,7 +697,7 @@@ static int eb_reserve(struct i915_execb
  
                case 1:
                        /* Too fragmented, unbind everything and retry */
-                       err = i915_gem_evict_vm(eb->vm);
+                       err = i915_gem_evict_vm(eb->context->vm);
                        if (err)
                                return err;
                        break;
@@@ -724,12 -725,8 +725,8 @@@ static int eb_select_context(struct i91
                return -ENOENT;
  
        eb->gem_context = ctx;
-       if (ctx->vm) {
-               eb->vm = ctx->vm;
+       if (ctx->vm)
                eb->invalid_flags |= EXEC_OBJECT_NEEDS_GTT;
-       } else {
-               eb->vm = &eb->i915->ggtt.vm;
-       }
  
        eb->context_flags = 0;
        if (test_bit(UCONTEXT_NO_ZEROMAP, &ctx->user_flags))
        return 0;
  }
  
- static struct i915_request *__eb_wait_for_ring(struct intel_ring *ring)
- {
-       struct i915_request *rq;
-       /*
-        * Completely unscientific finger-in-the-air estimates for suitable
-        * maximum user request size (to avoid blocking) and then backoff.
-        */
-       if (intel_ring_update_space(ring) >= PAGE_SIZE)
-               return NULL;
-       /*
-        * Find a request that after waiting upon, there will be at least half
-        * the ring available. The hysteresis allows us to compete for the
-        * shared ring and should mean that we sleep less often prior to
-        * claiming our resources, but not so long that the ring completely
-        * drains before we can submit our next request.
-        */
-       list_for_each_entry(rq, &ring->request_list, ring_link) {
-               if (__intel_ring_space(rq->postfix,
-                                      ring->emit, ring->size) > ring->size / 2)
-                       break;
-       }
-       if (&rq->ring_link == &ring->request_list)
-               return NULL; /* weird, we will check again later for real */
-       return i915_request_get(rq);
- }
- static int eb_wait_for_ring(const struct i915_execbuffer *eb)
- {
-       struct i915_request *rq;
-       int ret = 0;
-       /*
-        * Apply a light amount of backpressure to prevent excessive hogs
-        * from blocking waiting for space whilst holding struct_mutex and
-        * keeping all of their resources pinned.
-        */
-       rq = __eb_wait_for_ring(eb->context->ring);
-       if (rq) {
-               mutex_unlock(&eb->i915->drm.struct_mutex);
-               if (i915_request_wait(rq,
-                                     I915_WAIT_INTERRUPTIBLE,
-                                     MAX_SCHEDULE_TIMEOUT) < 0)
-                       ret = -EINTR;
-               i915_request_put(rq);
-               mutex_lock(&eb->i915->drm.struct_mutex);
-       }
-       return ret;
- }
  static int eb_lookup_vmas(struct i915_execbuffer *eb)
  {
        struct radix_tree_root *handles_vma = &eb->gem_context->handles_vma;
                        goto err_vma;
                }
  
-               vma = i915_vma_instance(obj, eb->vm, NULL);
+               vma = i915_vma_instance(obj, eb->context->vm, NULL);
                if (IS_ERR(vma)) {
                        err = PTR_ERR(vma);
                        goto err_obj;
@@@ -994,7 -934,7 +934,7 @@@ static void reloc_gpu_flush(struct relo
        __i915_gem_object_flush_map(cache->rq->batch->obj, 0, cache->rq_size);
        i915_gem_object_unpin_map(cache->rq->batch->obj);
  
-       i915_gem_chipset_flush(cache->rq->i915);
+       intel_gt_chipset_flush(cache->rq->engine->gt);
  
        i915_request_add(cache->rq);
        cache->rq = NULL;
@@@ -1018,11 -958,12 +958,12 @@@ static void reloc_cache_reset(struct re
                kunmap_atomic(vaddr);
                i915_gem_object_finish_access((struct drm_i915_gem_object *)cache->node.mm);
        } else {
-               wmb();
+               struct i915_ggtt *ggtt = cache_to_ggtt(cache);
+               intel_gt_flush_ggtt_writes(ggtt->vm.gt);
                io_mapping_unmap_atomic((void __iomem *)vaddr);
-               if (cache->node.allocated) {
-                       struct i915_ggtt *ggtt = cache_to_ggtt(cache);
  
+               if (cache->node.allocated) {
                        ggtt->vm.clear_range(&ggtt->vm,
                                             cache->node.start,
                                             cache->node.size);
@@@ -1077,11 -1018,15 +1018,15 @@@ static void *reloc_iomap(struct drm_i91
        void *vaddr;
  
        if (cache->vaddr) {
+               intel_gt_flush_ggtt_writes(ggtt->vm.gt);
                io_mapping_unmap_atomic((void __force __iomem *) unmask_page(cache->vaddr));
        } else {
                struct i915_vma *vma;
                int err;
  
+               if (i915_gem_object_is_tiled(obj))
+                       return ERR_PTR(-EINVAL);
                if (use_cpu_reloc(cache, obj))
                        return NULL;
  
  
                vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0,
                                               PIN_MAPPABLE |
-                                              PIN_NONBLOCK |
-                                              PIN_NONFAULT);
+                                              PIN_NONBLOCK /* NOWARN */ |
+                                              PIN_NOEVICT);
                if (IS_ERR(vma)) {
                        memset(&cache->node, 0, sizeof(cache->node));
                        err = drm_mm_insert_node_in_range
                        if (err) /* no inactive aperture space, use cpu reloc */
                                return NULL;
                } else {
-                       err = i915_vma_put_fence(vma);
-                       if (err) {
-                               i915_vma_unpin(vma);
-                               return ERR_PTR(err);
-                       }
                        cache->node.start = vma->node.start;
                        cache->node.mm = (void *)vma;
                }
  
        offset = cache->node.start;
        if (cache->node.allocated) {
-               wmb();
                ggtt->vm.insert_page(&ggtt->vm,
                                     i915_gem_object_get_dma_address(obj, page),
                                     offset, I915_CACHE_NONE, 0);
@@@ -1201,25 -1139,26 +1139,26 @@@ static int __reloc_gpu_alloc(struct i91
                             unsigned int len)
  {
        struct reloc_cache *cache = &eb->reloc_cache;
-       struct drm_i915_gem_object *obj;
+       struct intel_engine_pool_node *pool;
        struct i915_request *rq;
        struct i915_vma *batch;
        u32 *cmd;
        int err;
  
-       obj = i915_gem_batch_pool_get(&eb->engine->batch_pool, PAGE_SIZE);
-       if (IS_ERR(obj))
-               return PTR_ERR(obj);
+       pool = intel_engine_pool_get(&eb->engine->pool, PAGE_SIZE);
+       if (IS_ERR(pool))
+               return PTR_ERR(pool);
  
-       cmd = i915_gem_object_pin_map(obj,
+       cmd = i915_gem_object_pin_map(pool->obj,
                                      cache->has_llc ?
                                      I915_MAP_FORCE_WB :
                                      I915_MAP_FORCE_WC);
-       i915_gem_object_unpin_pages(obj);
-       if (IS_ERR(cmd))
-               return PTR_ERR(cmd);
+       if (IS_ERR(cmd)) {
+               err = PTR_ERR(cmd);
+               goto out_pool;
+       }
  
-       batch = i915_vma_instance(obj, vma->vm, NULL);
+       batch = i915_vma_instance(pool->obj, vma->vm, NULL);
        if (IS_ERR(batch)) {
                err = PTR_ERR(batch);
                goto err_unmap;
                goto err_unpin;
        }
  
+       err = intel_engine_pool_mark_active(pool, rq);
+       if (err)
+               goto err_request;
        err = reloc_move_to_gpu(rq, vma);
        if (err)
                goto err_request;
                goto skip_request;
  
        i915_vma_lock(batch);
-       GEM_BUG_ON(!reservation_object_test_signaled_rcu(batch->resv, true));
-       err = i915_vma_move_to_active(batch, rq, 0);
+       err = i915_request_await_object(rq, batch->obj, false);
+       if (err == 0)
+               err = i915_vma_move_to_active(batch, rq, 0);
        i915_vma_unlock(batch);
        if (err)
                goto skip_request;
        cache->rq_size = 0;
  
        /* Return with batch mapping (cmd) still pinned */
-       return 0;
+       goto out_pool;
  
  skip_request:
        i915_request_skip(rq, err);
@@@ -1269,7 -1213,9 +1213,9 @@@ err_request
  err_unpin:
        i915_vma_unpin(batch);
  err_unmap:
-       i915_gem_object_unpin_map(obj);
+       i915_gem_object_unpin_map(pool->obj);
+ out_pool:
+       intel_engine_pool_put(pool);
        return err;
  }
  
@@@ -1317,7 -1263,7 +1263,7 @@@ relocate_entry(struct i915_vma *vma
  
        if (!eb->reloc_cache.vaddr &&
            (DBG_FORCE_RELOC == FORCE_GPU_RELOC ||
-            !reservation_object_test_signaled_rcu(vma->resv, true))) {
+            !dma_resv_test_signaled_rcu(vma->resv, true))) {
                const unsigned int gen = eb->reloc_cache.gen;
                unsigned int len;
                u32 *batch;
@@@ -1628,7 -1574,6 +1574,7 @@@ static int check_relocations(const stru
  
  static int eb_copy_relocations(const struct i915_execbuffer *eb)
  {
 +      struct drm_i915_gem_relocation_entry *relocs;
        const unsigned int count = eb->buffer_count;
        unsigned int i;
        int err;
        for (i = 0; i < count; i++) {
                const unsigned int nreloc = eb->exec[i].relocation_count;
                struct drm_i915_gem_relocation_entry __user *urelocs;
 -              struct drm_i915_gem_relocation_entry *relocs;
                unsigned long size;
                unsigned long copied;
  
  
                        if (__copy_from_user((char *)relocs + copied,
                                             (char __user *)urelocs + copied,
 -                                           len)) {
 -end_user:
 -                              user_access_end();
 -end:
 -                              kvfree(relocs);
 -                              err = -EFAULT;
 -                              goto err;
 -                      }
 +                                           len))
 +                              goto end;
  
                        copied += len;
                } while (copied < size);
  
        return 0;
  
 +end_user:
 +      user_access_end();
 +end:
 +      kvfree(relocs);
 +      err = -EFAULT;
  err:
        while (i--) {
 -              struct drm_i915_gem_relocation_entry *relocs =
 -                      u64_to_ptr(typeof(*relocs), eb->exec[i].relocs_ptr);
 +              relocs = u64_to_ptr(typeof(*relocs), eb->exec[i].relocs_ptr);
                if (eb->exec[i].relocation_count)
                        kvfree(relocs);
        }
@@@ -1952,7 -1900,7 +1898,7 @@@ static int eb_move_to_gpu(struct i915_e
        eb->exec = NULL;
  
        /* Unconditionally flush any chipset caches (for streaming writes). */
-       i915_gem_chipset_flush(eb->i915);
+       intel_gt_chipset_flush(eb->engine->gt);
        return 0;
  
  err_skip:
@@@ -2011,18 -1959,17 +1957,17 @@@ static int i915_reset_gen7_sol_offsets(
  
  static struct i915_vma *eb_parse(struct i915_execbuffer *eb, bool is_master)
  {
-       struct drm_i915_gem_object *shadow_batch_obj;
+       struct intel_engine_pool_node *pool;
        struct i915_vma *vma;
        int err;
  
-       shadow_batch_obj = i915_gem_batch_pool_get(&eb->engine->batch_pool,
-                                                  PAGE_ALIGN(eb->batch_len));
-       if (IS_ERR(shadow_batch_obj))
-               return ERR_CAST(shadow_batch_obj);
+       pool = intel_engine_pool_get(&eb->engine->pool, eb->batch_len);
+       if (IS_ERR(pool))
+               return ERR_CAST(pool);
  
        err = intel_engine_cmd_parser(eb->engine,
                                      eb->batch->obj,
-                                     shadow_batch_obj,
+                                     pool->obj,
                                      eb->batch_start_offset,
                                      eb->batch_len,
                                      is_master);
                        vma = NULL;
                else
                        vma = ERR_PTR(err);
-               goto out;
+               goto err;
        }
  
-       vma = i915_gem_object_ggtt_pin(shadow_batch_obj, NULL, 0, 0, 0);
+       vma = i915_gem_object_ggtt_pin(pool->obj, NULL, 0, 0, 0);
        if (IS_ERR(vma))
-               goto out;
+               goto err;
  
        eb->vma[eb->buffer_count] = i915_vma_get(vma);
        eb->flags[eb->buffer_count] =
        vma->exec_flags = &eb->flags[eb->buffer_count];
        eb->buffer_count++;
  
- out:
-       i915_gem_object_unpin_pages(shadow_batch_obj);
+       vma->private = pool;
+       return vma;
+ err:
+       intel_engine_pool_put(pool);
        return vma;
  }
  
  static void
  add_to_client(struct i915_request *rq, struct drm_file *file)
  {
-       rq->file_priv = file->driver_priv;
-       list_add_tail(&rq->client_link, &rq->file_priv->mm.request_list);
+       struct drm_i915_file_private *file_priv = file->driver_priv;
+       rq->file_priv = file_priv;
+       spin_lock(&file_priv->mm.lock);
+       list_add_tail(&rq->client_link, &file_priv->mm.request_list);
+       spin_unlock(&file_priv->mm.lock);
  }
  
  static int eb_submit(struct i915_execbuffer *eb)
        return 0;
  }
  
+ static int num_vcs_engines(const struct drm_i915_private *i915)
+ {
+       return hweight64(INTEL_INFO(i915)->engine_mask &
+                        GENMASK_ULL(VCS0 + I915_MAX_VCS - 1, VCS0));
+ }
  /*
   * Find one BSD ring to dispatch the corresponding BSD command.
   * The engine index is returned.
@@@ -2105,8 -2066,8 +2064,8 @@@ gen8_dispatch_bsd_engine(struct drm_i91
  
        /* Check whether the file_priv has already selected one ring. */
        if ((int)file_priv->bsd_engine < 0)
-               file_priv->bsd_engine = atomic_fetch_xor(1,
-                        &dev_priv->mm.bsd_engine_dispatch_index);
+               file_priv->bsd_engine =
+                       get_random_int() % num_vcs_engines(dev_priv);
  
        return file_priv->bsd_engine;
  }
@@@ -2119,15 -2080,80 +2078,80 @@@ static const enum intel_engine_id user_
        [I915_EXEC_VEBOX]       = VECS0
  };
  
- static int eb_pin_context(struct i915_execbuffer *eb, struct intel_context *ce)
+ static struct i915_request *eb_throttle(struct intel_context *ce)
+ {
+       struct intel_ring *ring = ce->ring;
+       struct intel_timeline *tl = ce->timeline;
+       struct i915_request *rq;
+       /*
+        * Completely unscientific finger-in-the-air estimates for suitable
+        * maximum user request size (to avoid blocking) and then backoff.
+        */
+       if (intel_ring_update_space(ring) >= PAGE_SIZE)
+               return NULL;
+       /*
+        * Find a request that after waiting upon, there will be at least half
+        * the ring available. The hysteresis allows us to compete for the
+        * shared ring and should mean that we sleep less often prior to
+        * claiming our resources, but not so long that the ring completely
+        * drains before we can submit our next request.
+        */
+       list_for_each_entry(rq, &tl->requests, link) {
+               if (rq->ring != ring)
+                       continue;
+               if (__intel_ring_space(rq->postfix,
+                                      ring->emit, ring->size) > ring->size / 2)
+                       break;
+       }
+       if (&rq->link == &tl->requests)
+               return NULL; /* weird, we will check again later for real */
+       return i915_request_get(rq);
+ }
+ static int
+ __eb_pin_context(struct i915_execbuffer *eb, struct intel_context *ce)
  {
        int err;
  
+       if (likely(atomic_inc_not_zero(&ce->pin_count)))
+               return 0;
+       err = mutex_lock_interruptible(&eb->i915->drm.struct_mutex);
+       if (err)
+               return err;
+       err = __intel_context_do_pin(ce);
+       mutex_unlock(&eb->i915->drm.struct_mutex);
+       return err;
+ }
+ static void
+ __eb_unpin_context(struct i915_execbuffer *eb, struct intel_context *ce)
+ {
+       if (likely(atomic_add_unless(&ce->pin_count, -1, 1)))
+               return;
+       mutex_lock(&eb->i915->drm.struct_mutex);
+       intel_context_unpin(ce);
+       mutex_unlock(&eb->i915->drm.struct_mutex);
+ }
+ static int __eb_pin_engine(struct i915_execbuffer *eb, struct intel_context *ce)
+ {
+       struct intel_timeline *tl;
+       struct i915_request *rq;
+       int err;
        /*
         * ABI: Before userspace accesses the GPU (e.g. execbuffer), report
         * EIO if the GPU is already wedged.
         */
-       err = i915_terminally_wedged(eb->i915);
+       err = intel_gt_terminally_wedged(ce->engine->gt);
        if (err)
                return err;
  
         * GGTT space, so do this first before we reserve a seqno for
         * ourselves.
         */
-       err = intel_context_pin(ce);
+       err = __eb_pin_context(eb, ce);
        if (err)
                return err;
  
+       /*
+        * Take a local wakeref for preparing to dispatch the execbuf as
+        * we expect to access the hardware fairly frequently in the
+        * process, and require the engine to be kept awake between accesses.
+        * Upon dispatch, we acquire another prolonged wakeref that we hold
+        * until the timeline is idle, which in turn releases the wakeref
+        * taken on the engine, and the parent device.
+        */
+       tl = intel_context_timeline_lock(ce);
+       if (IS_ERR(tl)) {
+               err = PTR_ERR(tl);
+               goto err_unpin;
+       }
+       intel_context_enter(ce);
+       rq = eb_throttle(ce);
+       intel_context_timeline_unlock(tl);
+       if (rq) {
+               if (i915_request_wait(rq,
+                                     I915_WAIT_INTERRUPTIBLE,
+                                     MAX_SCHEDULE_TIMEOUT) < 0) {
+                       i915_request_put(rq);
+                       err = -EINTR;
+                       goto err_exit;
+               }
+               i915_request_put(rq);
+       }
        eb->engine = ce->engine;
        eb->context = ce;
        return 0;
+ err_exit:
+       mutex_lock(&tl->mutex);
+       intel_context_exit(ce);
+       intel_context_timeline_unlock(tl);
+ err_unpin:
+       __eb_unpin_context(eb, ce);
+       return err;
  }
  
- static void eb_unpin_context(struct i915_execbuffer *eb)
+ static void eb_unpin_engine(struct i915_execbuffer *eb)
  {
-       intel_context_unpin(eb->context);
+       struct intel_context *ce = eb->context;
+       struct intel_timeline *tl = ce->timeline;
+       mutex_lock(&tl->mutex);
+       intel_context_exit(ce);
+       mutex_unlock(&tl->mutex);
+       __eb_unpin_context(eb, ce);
  }
  
  static unsigned int
@@@ -2165,7 -2237,7 +2235,7 @@@ eb_select_legacy_ring(struct i915_execb
                return -1;
        }
  
-       if (user_ring_id == I915_EXEC_BSD && HAS_ENGINE(i915, VCS1)) {
+       if (user_ring_id == I915_EXEC_BSD && num_vcs_engines(i915) > 1) {
                unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
  
                if (bsd_idx == I915_EXEC_BSD_DEFAULT) {
  }
  
  static int
- eb_select_engine(struct i915_execbuffer *eb,
-                struct drm_file *file,
-                struct drm_i915_gem_execbuffer2 *args)
+ eb_pin_engine(struct i915_execbuffer *eb,
+             struct drm_file *file,
+             struct drm_i915_gem_execbuffer2 *args)
  {
        struct intel_context *ce;
        unsigned int idx;
        if (IS_ERR(ce))
                return PTR_ERR(ce);
  
-       err = eb_pin_context(eb, ce);
+       err = __eb_pin_engine(eb, ce);
        intel_context_put(ce);
  
        return err;
@@@ -2427,25 -2499,12 +2497,12 @@@ i915_gem_do_execbuffer(struct drm_devic
        if (unlikely(err))
                goto err_destroy;
  
-       /*
-        * Take a local wakeref for preparing to dispatch the execbuf as
-        * we expect to access the hardware fairly frequently in the
-        * process. Upon first dispatch, we acquire another prolonged
-        * wakeref that we hold until the GPU has been idle for at least
-        * 100ms.
-        */
-       intel_gt_pm_get(eb.i915);
+       err = eb_pin_engine(&eb, file, args);
+       if (unlikely(err))
+               goto err_context;
  
        err = i915_mutex_lock_interruptible(dev);
        if (err)
-               goto err_rpm;
-       err = eb_select_engine(&eb, file, args);
-       if (unlikely(err))
-               goto err_unlock;
-       err = eb_wait_for_ring(&eb); /* may temporarily drop struct_mutex */
-       if (unlikely(err))
                goto err_engine;
  
        err = eb_relocate(&eb);
         * to explicitly hold another reference here.
         */
        eb.request->batch = eb.batch;
+       if (eb.batch->private)
+               intel_engine_pool_mark_active(eb.batch->private, eb.request);
  
        trace_i915_request_queue(eb.request, eb.batch_flags);
        err = eb_submit(&eb);
@@@ -2596,15 -2657,15 +2655,15 @@@ err_request
  err_batch_unpin:
        if (eb.batch_flags & I915_DISPATCH_SECURE)
                i915_vma_unpin(eb.batch);
+       if (eb.batch->private)
+               intel_engine_pool_put(eb.batch->private);
  err_vma:
        if (eb.exec)
                eb_release_vmas(&eb);
- err_engine:
-       eb_unpin_context(&eb);
- err_unlock:
        mutex_unlock(&dev->struct_mutex);
- err_rpm:
-       intel_gt_pm_put(eb.i915);
+ err_engine:
+       eb_unpin_engine(&eb);
+ err_context:
        i915_gem_context_put(eb.gem_context);
  err_destroy:
        eb_destroy(&eb);
index 528b6167833456d9fc6c5a0f8a53197c980a80d1,74da35611d7c010cfc9d1269b4b132f8994f1c3d..11b231c187c500f104e85bc736a0a1f4b36f2f4a
  
  #include <drm/i915_drm.h>
  
+ #include "i915_drv.h"
  #include "i915_gem_ioctls.h"
  #include "i915_gem_object.h"
  #include "i915_scatterlist.h"
- #include "i915_trace.h"
- #include "intel_drv.h"
  
  struct i915_mm_struct {
        struct mm_struct *mm;
@@@ -150,7 -149,8 +149,8 @@@ userptr_mn_invalidate_range_start(struc
                        }
                }
  
-               ret = i915_gem_object_unbind(obj);
+               ret = i915_gem_object_unbind(obj,
+                                            I915_GEM_OBJECT_UNBIND_ACTIVE);
                if (ret == 0)
                        ret = __i915_gem_object_put_pages(obj, I915_MM_SHRINKER);
                i915_gem_object_put(obj);
@@@ -662,9 -662,25 +662,17 @@@ i915_gem_userptr_put_pages(struct drm_i
        __i915_gem_object_release_shmem(obj, pages, true);
        i915_gem_gtt_finish_pages(obj, pages);
  
+       /*
+        * We always mark objects as dirty when they are used by the GPU,
+        * just in case. However, if we set the vma as being read-only we know
+        * that the object will never have been written to.
+        */
+       if (i915_gem_object_is_readonly(obj))
+               obj->mm.dirty = false;
        for_each_sgt_page(page, sgt_iter, pages) {
                if (obj->mm.dirty)
 -                      /*
 -                       * As this may not be anonymous memory (e.g. shmem)
 -                       * but exist on a real mapping, we have to lock
 -                       * the page in order to dirty it -- holding
 -                       * the page reference is not sufficient to
 -                       * prevent the inode from being truncated.
 -                       * Play safe and take the lock.
 -                       */
 -                      set_page_dirty_lock(page);
 +                      set_page_dirty(page);
  
                mark_page_accessed(page);
                put_page(page);
index 99e8242194c00891698ce9659e9960efe0d39b4e,126ab36679196190a05859d2e50783165dfe212d..45481eb1fa3c30ccb0e47d414325746e8f1cb929
@@@ -6,6 -6,7 +6,7 @@@
  
  #include "i915_drv.h"
  #include "intel_context.h"
+ #include "intel_gt.h"
  #include "intel_workarounds.h"
  
  /**
   * - Public functions to init or apply the given workaround type.
   */
  
- static void wa_init_start(struct i915_wa_list *wal, const char *name)
+ static void wa_init_start(struct i915_wa_list *wal, const char *name, const char *engine_name)
  {
        wal->name = name;
+       wal->engine_name = engine_name;
  }
  
  #define WA_LIST_CHUNK (1 << 4)
@@@ -73,8 -75,8 +75,8 @@@ static void wa_init_finish(struct i915_
        if (!wal->count)
                return;
  
-       DRM_DEBUG_DRIVER("Initialized %u %s workarounds\n",
-                        wal->wa_count, wal->name);
+       DRM_DEBUG_DRIVER("Initialized %u %s workarounds on %s\n",
+                        wal->wa_count, wal->name, wal->engine_name);
  }
  
  static void _wa_add(struct i915_wa_list *wal, const struct i915_wa *wa)
@@@ -175,19 -177,6 +177,6 @@@ wa_write_or(struct i915_wa_list *wal, i
        wa_write_masked_or(wal, reg, val, val);
  }
  
- static void
- ignore_wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 mask, u32 val)
- {
-       struct i915_wa wa = {
-               .reg  = reg,
-               .mask = mask,
-               .val  = val,
-               /* Bonkers HW, skip verifying */
-       };
-       _wa_add(wal, &wa);
- }
  #define WA_SET_BIT_MASKED(addr, mask) \
        wa_write_masked_or(wal, (addr), (mask), _MASKED_BIT_ENABLE(mask))
  
@@@ -308,6 -297,11 +297,6 @@@ static void gen9_ctx_workarounds_init(s
                          FLOW_CONTROL_ENABLE |
                          PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE);
  
 -      /* Syncing dependencies between camera and graphics:skl,bxt,kbl */
 -      if (!IS_COFFEELAKE(i915))
 -              WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3,
 -                                GEN9_DISABLE_OCL_OOB_SUPPRESS_LOGIC);
 -
        /* WaEnableYV12BugFixInHalfSliceChicken7:skl,bxt,kbl,glk,cfl */
        /* WaEnableSamplerGPGPUPreemptionSupport:skl,bxt,kbl,cfl */
        WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7,
@@@ -525,12 -519,6 +514,6 @@@ static void icl_ctx_workarounds_init(st
  {
        struct drm_i915_private *i915 = engine->i915;
  
-       /* WaDisableBankHangMode:icl */
-       wa_write(wal,
-                GEN8_L3CNTLREG,
-                intel_uncore_read(engine->uncore, GEN8_L3CNTLREG) |
-                GEN8_ERRDETBCTRL);
        /* WaDisableBankHangMode:icl */
        wa_write(wal,
                 GEN8_L3CNTLREG,
                          GEN11_SAMPLER_ENABLE_HEADLESS_MSG);
  }
  
+ static void tgl_ctx_workarounds_init(struct intel_engine_cs *engine,
+                                    struct i915_wa_list *wal)
+ {
+ }
  static void
  __intel_engine_init_ctx_wa(struct intel_engine_cs *engine,
                           struct i915_wa_list *wal,
        if (engine->class != RENDER_CLASS)
                return;
  
-       wa_init_start(wal, name);
+       wa_init_start(wal, name, engine->name);
  
-       if (IS_GEN(i915, 11))
+       if (IS_GEN(i915, 12))
+               tgl_ctx_workarounds_init(engine, wal);
+       else if (IS_GEN(i915, 11))
                icl_ctx_workarounds_init(engine, wal);
        else if (IS_CANNONLAKE(i915))
                cnl_ctx_workarounds_init(engine, wal);
@@@ -761,7 -756,10 +751,10 @@@ static voi
  wa_init_mcr(struct drm_i915_private *i915, struct i915_wa_list *wal)
  {
        const struct sseu_dev_info *sseu = &RUNTIME_INFO(i915)->sseu;
-       u32 mcr_slice_subslice_mask;
+       unsigned int slice, subslice;
+       u32 l3_en, mcr, mcr_mask;
+       GEM_BUG_ON(INTEL_GEN(i915) < 10);
  
        /*
         * WaProgramMgsrForL3BankSpecificMmioReads: cnl,icl
         * the case, we might need to program MCR select to a valid L3Bank
         * by default, to make sure we correctly read certain registers
         * later on (in the range 0xB100 - 0xB3FF).
-        * This might be incompatible with
-        * WaProgramMgsrForCorrectSliceSpecificMmioReads.
-        * Fortunately, this should not happen in production hardware, so
-        * we only assert that this is the case (instead of implementing
-        * something more complex that requires checking the range of every
-        * MMIO read).
-        */
-       if (INTEL_GEN(i915) >= 10 &&
-           is_power_of_2(sseu->slice_mask)) {
-               /*
-                * read FUSE3 for enabled L3 Bank IDs, if L3 Bank matches
-                * enabled subslice, no need to redirect MCR packet
-                */
-               u32 slice = fls(sseu->slice_mask);
-               u32 fuse3 =
-                       intel_uncore_read(&i915->uncore, GEN10_MIRROR_FUSE3);
-               u8 ss_mask = sseu->subslice_mask[slice];
-               u8 enabled_mask = (ss_mask | ss_mask >>
-                                  GEN10_L3BANK_PAIR_COUNT) & GEN10_L3BANK_MASK;
-               u8 disabled_mask = fuse3 & GEN10_L3BANK_MASK;
-               /*
-                * Production silicon should have matched L3Bank and
-                * subslice enabled
-                */
-               WARN_ON((enabled_mask & disabled_mask) != enabled_mask);
-       }
-       if (INTEL_GEN(i915) >= 11)
-               mcr_slice_subslice_mask = GEN11_MCR_SLICE_MASK |
-                                         GEN11_MCR_SUBSLICE_MASK;
-       else
-               mcr_slice_subslice_mask = GEN8_MCR_SLICE_MASK |
-                                         GEN8_MCR_SUBSLICE_MASK;
-       /*
+        *
         * WaProgramMgsrForCorrectSliceSpecificMmioReads:cnl,icl
         * Before any MMIO read into slice/subslice specific registers, MCR
         * packet control register needs to be programmed to point to any
         * are consistent across s/ss in almost all cases. In the rare
         * occasions, such as INSTDONE, where this value is dependent
         * on s/ss combo, the read should be done with read_subslice_reg.
+        *
+        * Since GEN8_MCR_SELECTOR contains dual-purpose bits which select both
+        * to which subslice, or to which L3 bank, the respective mmio reads
+        * will go, we have to find a common index which works for both
+        * accesses.
+        *
+        * Case where we cannot find a common index fortunately should not
+        * happen in production hardware, so we only emit a warning instead of
+        * implementing something more complex that requires checking the range
+        * of every MMIO read.
         */
-       wa_write_masked_or(wal,
-                          GEN8_MCR_SELECTOR,
-                          mcr_slice_subslice_mask,
-                          intel_calculate_mcr_s_ss_select(i915));
+       if (INTEL_GEN(i915) >= 10 && is_power_of_2(sseu->slice_mask)) {
+               u32 l3_fuse =
+                       intel_uncore_read(&i915->uncore, GEN10_MIRROR_FUSE3) &
+                       GEN10_L3BANK_MASK;
+               DRM_DEBUG_DRIVER("L3 fuse = %x\n", l3_fuse);
+               l3_en = ~(l3_fuse << GEN10_L3BANK_PAIR_COUNT | l3_fuse);
+       } else {
+               l3_en = ~0;
+       }
+       slice = fls(sseu->slice_mask) - 1;
+       GEM_BUG_ON(slice >= ARRAY_SIZE(sseu->subslice_mask));
+       subslice = fls(l3_en & sseu->subslice_mask[slice]);
+       if (!subslice) {
+               DRM_WARN("No common index found between subslice mask %x and L3 bank mask %x!\n",
+                        sseu->subslice_mask[slice], l3_en);
+               subslice = fls(l3_en);
+               WARN_ON(!subslice);
+       }
+       subslice--;
+       if (INTEL_GEN(i915) >= 11) {
+               mcr = GEN11_MCR_SLICE(slice) | GEN11_MCR_SUBSLICE(subslice);
+               mcr_mask = GEN11_MCR_SLICE_MASK | GEN11_MCR_SUBSLICE_MASK;
+       } else {
+               mcr = GEN8_MCR_SLICE(slice) | GEN8_MCR_SUBSLICE(subslice);
+               mcr_mask = GEN8_MCR_SLICE_MASK | GEN8_MCR_SUBSLICE_MASK;
+       }
+       DRM_DEBUG_DRIVER("MCR slice/subslice = %x\n", mcr);
+       wa_write_masked_or(wal, GEN8_MCR_SELECTOR, mcr_mask, mcr);
  }
  
  static void
@@@ -894,10 -897,17 +892,17 @@@ icl_gt_workarounds_init(struct drm_i915
                    GAMT_CHKN_DISABLE_L3_COH_PIPE);
  }
  
+ static void
+ tgl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
+ {
+ }
  static void
  gt_init_workarounds(struct drm_i915_private *i915, struct i915_wa_list *wal)
  {
-       if (IS_GEN(i915, 11))
+       if (IS_GEN(i915, 12))
+               tgl_gt_workarounds_init(i915, wal);
+       else if (IS_GEN(i915, 11))
                icl_gt_workarounds_init(i915, wal);
        else if (IS_CANNONLAKE(i915))
                cnl_gt_workarounds_init(i915, wal);
@@@ -921,7 -931,7 +926,7 @@@ void intel_gt_init_workarounds(struct d
  {
        struct i915_wa_list *wal = &i915->gt_wa_list;
  
-       wa_init_start(wal, "GT");
+       wa_init_start(wal, "GT", "global");
        gt_init_workarounds(i915, wal);
        wa_init_finish(wal);
  }
@@@ -985,9 -995,9 +990,9 @@@ wa_list_apply(struct intel_uncore *unco
        spin_unlock_irqrestore(&uncore->lock, flags);
  }
  
- void intel_gt_apply_workarounds(struct drm_i915_private *i915)
+ void intel_gt_apply_workarounds(struct intel_gt *gt)
  {
-       wa_list_apply(&i915->uncore, &i915->gt_wa_list);
+       wa_list_apply(gt->uncore, &gt->i915->gt_wa_list);
  }
  
  static bool wa_list_verify(struct intel_uncore *uncore,
        return ok;
  }
  
- bool intel_gt_verify_workarounds(struct drm_i915_private *i915,
-                                const char *from)
+ bool intel_gt_verify_workarounds(struct intel_gt *gt, const char *from)
  {
-       return wa_list_verify(&i915->uncore, &i915->gt_wa_list, from);
+       return wa_list_verify(gt->uncore, &gt->i915->gt_wa_list, from);
+ }
+ static inline bool is_nonpriv_flags_valid(u32 flags)
+ {
+       /* Check only valid flag bits are set */
+       if (flags & ~RING_FORCE_TO_NONPRIV_MASK_VALID)
+               return false;
+       /* NB: Only 3 out of 4 enum values are valid for access field */
+       if ((flags & RING_FORCE_TO_NONPRIV_ACCESS_MASK) ==
+           RING_FORCE_TO_NONPRIV_ACCESS_INVALID)
+               return false;
+       return true;
  }
  
  static void
@@@ -1022,6 -1045,9 +1040,9 @@@ whitelist_reg_ext(struct i915_wa_list *
        if (GEM_DEBUG_WARN_ON(wal->count >= RING_MAX_NONPRIV_SLOTS))
                return;
  
+       if (GEM_DEBUG_WARN_ON(!is_nonpriv_flags_valid(flags)))
+               return;
        wa.reg.reg |= flags;
        _wa_add(wal, &wa);
  }
  static void
  whitelist_reg(struct i915_wa_list *wal, i915_reg_t reg)
  {
-       whitelist_reg_ext(wal, reg, RING_FORCE_TO_NONPRIV_RW);
+       whitelist_reg_ext(wal, reg, RING_FORCE_TO_NONPRIV_ACCESS_RW);
  }
  
  static void gen9_whitelist_build(struct i915_wa_list *w)
@@@ -1110,7 -1136,7 +1131,7 @@@ static void cfl_whitelist_build(struct 
         *   - PS_DEPTH_COUNT_UDW
         */
        whitelist_reg_ext(w, PS_INVOCATION_COUNT,
-                         RING_FORCE_TO_NONPRIV_RD |
+                         RING_FORCE_TO_NONPRIV_ACCESS_RD |
                          RING_FORCE_TO_NONPRIV_RANGE_4);
  }
  
@@@ -1150,20 -1176,20 +1171,20 @@@ static void icl_whitelist_build(struct 
                 *   - PS_DEPTH_COUNT_UDW
                 */
                whitelist_reg_ext(w, PS_INVOCATION_COUNT,
-                                 RING_FORCE_TO_NONPRIV_RD |
+                                 RING_FORCE_TO_NONPRIV_ACCESS_RD |
                                  RING_FORCE_TO_NONPRIV_RANGE_4);
                break;
  
        case VIDEO_DECODE_CLASS:
                /* hucStatusRegOffset */
                whitelist_reg_ext(w, _MMIO(0x2000 + engine->mmio_base),
-                                 RING_FORCE_TO_NONPRIV_RD);
+                                 RING_FORCE_TO_NONPRIV_ACCESS_RD);
                /* hucUKernelHdrInfoRegOffset */
                whitelist_reg_ext(w, _MMIO(0x2014 + engine->mmio_base),
-                                 RING_FORCE_TO_NONPRIV_RD);
+                                 RING_FORCE_TO_NONPRIV_ACCESS_RD);
                /* hucStatus2RegOffset */
                whitelist_reg_ext(w, _MMIO(0x23B0 + engine->mmio_base),
-                                 RING_FORCE_TO_NONPRIV_RD);
+                                 RING_FORCE_TO_NONPRIV_ACCESS_RD);
                break;
  
        default:
        }
  }
  
+ static void tgl_whitelist_build(struct intel_engine_cs *engine)
+ {
+ }
  void intel_engine_init_whitelist(struct intel_engine_cs *engine)
  {
        struct drm_i915_private *i915 = engine->i915;
        struct i915_wa_list *w = &engine->whitelist;
  
-       wa_init_start(w, "whitelist");
+       wa_init_start(w, "whitelist", engine->name);
  
-       if (IS_GEN(i915, 11))
+       if (IS_GEN(i915, 12))
+               tgl_whitelist_build(engine);
+       else if (IS_GEN(i915, 11))
                icl_whitelist_build(engine);
        else if (IS_CANNONLAKE(i915))
                cnl_whitelist_build(engine);
@@@ -1235,10 -1267,9 +1262,9 @@@ rcs_engine_wa_init(struct intel_engine_
                             _3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE);
  
                /* WaPipelineFlushCoherentLines:icl */
-               ignore_wa_write_or(wal,
-                                  GEN8_L3SQCREG4,
-                                  GEN8_LQSC_FLUSH_COHERENT_LINES,
-                                  GEN8_LQSC_FLUSH_COHERENT_LINES);
+               wa_write_or(wal,
+                           GEN8_L3SQCREG4,
+                           GEN8_LQSC_FLUSH_COHERENT_LINES);
  
                /*
                 * Wa_1405543622:icl
                 * Wa_1405733216:icl
                 * Formerly known as WaDisableCleanEvicts
                 */
-               ignore_wa_write_or(wal,
-                                  GEN8_L3SQCREG4,
-                                  GEN11_LQSC_CLEAN_EVICT_DISABLE,
-                                  GEN11_LQSC_CLEAN_EVICT_DISABLE);
+               wa_write_or(wal,
+                           GEN8_L3SQCREG4,
+                           GEN11_LQSC_CLEAN_EVICT_DISABLE);
  
                /* WaForwardProgressSoftReset:icl */
                wa_write_or(wal,
                wa_write_or(wal,
                            GEN7_SARCHKMD,
                            GEN7_DISABLE_SAMPLER_PREFETCH);
+               /* Wa_1409178092:icl */
+               wa_write_masked_or(wal,
+                                  GEN11_SCRATCH2,
+                                  GEN11_COHERENT_PARTIAL_WRITE_MERGE_ENABLE,
+                                  0);
        }
  
        if (IS_GEN_RANGE(i915, 9, 11)) {
@@@ -1355,7 -1391,7 +1386,7 @@@ engine_init_workarounds(struct intel_en
        if (I915_SELFTEST_ONLY(INTEL_GEN(engine->i915) < 8))
                return;
  
-       if (engine->id == RCS0)
+       if (engine->class == RENDER_CLASS)
                rcs_engine_wa_init(engine, wal);
        else
                xcs_engine_wa_init(engine, wal);
@@@ -1365,10 -1401,10 +1396,10 @@@ void intel_engine_init_workarounds(stru
  {
        struct i915_wa_list *wal = &engine->wa_list;
  
-       if (GEM_WARN_ON(INTEL_GEN(engine->i915) < 8))
+       if (INTEL_GEN(engine->i915) < 8)
                return;
  
-       wa_init_start(wal, engine->name);
+       wa_init_start(wal, "engine", engine->name);
        engine_init_workarounds(engine, wal);
        wa_init_finish(wal);
  }
@@@ -1411,26 -1447,50 +1442,50 @@@ err_obj
        return ERR_PTR(err);
  }
  
+ static bool mcr_range(struct drm_i915_private *i915, u32 offset)
+ {
+       /*
+        * Registers in this range are affected by the MCR selector
+        * which only controls CPU initiated MMIO. Routing does not
+        * work for CS access so we cannot verify them on this path.
+        */
+       if (INTEL_GEN(i915) >= 8 && (offset >= 0xb100 && offset <= 0xb3ff))
+               return true;
+       return false;
+ }
  static int
  wa_list_srm(struct i915_request *rq,
            const struct i915_wa_list *wal,
            struct i915_vma *vma)
  {
+       struct drm_i915_private *i915 = rq->i915;
+       unsigned int i, count = 0;
        const struct i915_wa *wa;
-       unsigned int i;
        u32 srm, *cs;
  
        srm = MI_STORE_REGISTER_MEM | MI_SRM_LRM_GLOBAL_GTT;
-       if (INTEL_GEN(rq->i915) >= 8)
+       if (INTEL_GEN(i915) >= 8)
                srm++;
  
-       cs = intel_ring_begin(rq, 4 * wal->count);
+       for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
+               if (!mcr_range(i915, i915_mmio_reg_offset(wa->reg)))
+                       count++;
+       }
+       cs = intel_ring_begin(rq, 4 * count);
        if (IS_ERR(cs))
                return PTR_ERR(cs);
  
        for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
+               u32 offset = i915_mmio_reg_offset(wa->reg);
+               if (mcr_range(i915, offset))
+                       continue;
                *cs++ = srm;
-               *cs++ = i915_mmio_reg_offset(wa->reg);
+               *cs++ = offset;
                *cs++ = i915_ggtt_offset(vma) + sizeof(u32) * i;
                *cs++ = 0;
        }
@@@ -1453,7 -1513,7 +1508,7 @@@ static int engine_wa_list_verify(struc
        if (!wal->count)
                return 0;
  
-       vma = create_scratch(&ce->engine->i915->ggtt.vm, wal->count);
+       vma = create_scratch(&ce->engine->gt->ggtt->vm, wal->count);
        if (IS_ERR(vma))
                return PTR_ERR(vma);
  
        }
  
        err = 0;
-       for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
+       for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
+               if (mcr_range(rq->i915, i915_mmio_reg_offset(wa->reg)))
+                       continue;
                if (!wa_verify(wa, results[i], wal->name, from))
                        err = -ENXIO;
+       }
  
        i915_gem_object_unpin_map(vma->obj);
  
index 75baff657e4331f28fc58d938c7a9de7087e0fcc,37f502ca95ad88711e66112db6123bdc73198448..6c79d16b381ea51d73b2cf19051badacc10cb962
@@@ -84,8 -84,8 +84,8 @@@ static void sr_oa_regs(struct intel_vgp
                u32 *reg_state, bool save)
  {
        struct drm_i915_private *dev_priv = workload->vgpu->gvt->dev_priv;
-       u32 ctx_oactxctrl = dev_priv->perf.oa.ctx_oactxctrl_offset;
-       u32 ctx_flexeu0 = dev_priv->perf.oa.ctx_flexeu0_offset;
+       u32 ctx_oactxctrl = dev_priv->perf.ctx_oactxctrl_offset;
+       u32 ctx_flexeu0 = dev_priv->perf.ctx_flexeu0_offset;
        int i = 0;
        u32 flex_mmio[] = {
                i915_mmio_reg_offset(EU_PERF_CNTL0),
@@@ -291,9 -291,6 +291,6 @@@ shadow_context_descriptor_update(struc
         * Update bits 0-11 of the context descriptor which includes flags
         * like GEN8_CTX_* cached in desc_template
         */
-       desc &= U64_MAX << 12;
-       desc |= ce->gem_context->desc_template & ((1ULL << 12) - 1);
        desc &= ~(0x3 << GEN8_CTX_ADDRESSING_MODE_SHIFT);
        desc |= workload->ctx_desc.addressing_mode <<
                GEN8_CTX_ADDRESSING_MODE_SHIFT;
@@@ -571,6 -568,16 +568,16 @@@ static int prepare_shadow_wa_ctx(struc
        return 0;
  }
  
+ static void update_vreg_in_ctx(struct intel_vgpu_workload *workload)
+ {
+       struct intel_vgpu *vgpu = workload->vgpu;
+       struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
+       u32 ring_base;
+       ring_base = dev_priv->engine[workload->ring_id]->mmio_base;
+       vgpu_vreg_t(vgpu, RING_START(ring_base)) = workload->rb_start;
+ }
  static void release_shadow_batch_buffer(struct intel_vgpu_workload *workload)
  {
        struct intel_vgpu *vgpu = workload->vgpu;
@@@ -1019,6 -1026,13 +1026,13 @@@ static int workload_thread(void *priv
                if (need_force_wake)
                        intel_uncore_forcewake_get(&gvt->dev_priv->uncore,
                                        FORCEWAKE_ALL);
+               /*
+                * Update the vReg of the vGPU which submitted this
+                * workload. The vGPU may use these registers for checking
+                * the context state. The value comes from GPU commands
+                * in this workload.
+                */
+               update_vreg_in_ctx(workload);
  
                ret = dispatch_workload(workload);
  
@@@ -1157,7 -1171,7 +1171,7 @@@ void intel_vgpu_clean_submission(struc
  
        intel_vgpu_select_submission_ops(vgpu, ALL_ENGINES, 0);
  
-       i915_context_ppgtt_root_restore(s, i915_vm_to_ppgtt(s->shadow[0]->gem_context->vm));
+       i915_context_ppgtt_root_restore(s, i915_vm_to_ppgtt(s->shadow[0]->vm));
        for_each_engine(engine, vgpu->gvt->dev_priv, id)
                intel_context_unpin(s->shadow[id]);
  
@@@ -1215,30 -1229,43 +1229,43 @@@ i915_context_ppgtt_root_save(struct int
   */
  int intel_vgpu_setup_submission(struct intel_vgpu *vgpu)
  {
+       struct drm_i915_private *i915 = vgpu->gvt->dev_priv;
        struct intel_vgpu_submission *s = &vgpu->submission;
        struct intel_engine_cs *engine;
        struct i915_gem_context *ctx;
        enum intel_engine_id i;
        int ret;
  
-       ctx = i915_gem_context_create_gvt(&vgpu->gvt->dev_priv->drm);
-       if (IS_ERR(ctx))
-               return PTR_ERR(ctx);
+       mutex_lock(&i915->drm.struct_mutex);
+       ctx = i915_gem_context_create_kernel(i915, I915_PRIORITY_MAX);
+       if (IS_ERR(ctx)) {
+               ret = PTR_ERR(ctx);
+               goto out_unlock;
+       }
+       i915_gem_context_set_force_single_submission(ctx);
  
        i915_context_ppgtt_root_save(s, i915_vm_to_ppgtt(ctx->vm));
  
-       for_each_engine(engine, vgpu->gvt->dev_priv, i) {
+       for_each_engine(engine, i915, i) {
                struct intel_context *ce;
  
                INIT_LIST_HEAD(&s->workload_q_head[i]);
                s->shadow[i] = ERR_PTR(-EINVAL);
  
-               ce = i915_gem_context_get_engine(ctx, i);
+               ce = intel_context_create(ctx, engine);
                if (IS_ERR(ce)) {
                        ret = PTR_ERR(ce);
                        goto out_shadow_ctx;
                }
  
+               if (!USES_GUC_SUBMISSION(i915)) { /* Max ring buffer size */
+                       const unsigned int ring_size = 512 * SZ_4K;
+                       ce->ring = __intel_context_ring_size(ring_size);
+               }
                ret = intel_context_pin(ce);
                intel_context_put(ce);
                if (ret)
        bitmap_zero(s->tlb_handle_pending, I915_NUM_ENGINES);
  
        i915_gem_context_put(ctx);
+       mutex_unlock(&i915->drm.struct_mutex);
        return 0;
  
  out_shadow_ctx:
        i915_context_ppgtt_root_restore(s, i915_vm_to_ppgtt(ctx->vm));
-       for_each_engine(engine, vgpu->gvt->dev_priv, i) {
+       for_each_engine(engine, i915, i) {
                if (IS_ERR(s->shadow[i]))
                        break;
  
                intel_context_unpin(s->shadow[i]);
+               intel_context_put(s->shadow[i]);
        }
        i915_gem_context_put(ctx);
+ out_unlock:
+       mutex_unlock(&i915->drm.struct_mutex);
        return ret;
  }
  
@@@ -1424,9 -1455,6 +1455,6 @@@ static int prepare_mm(struct intel_vgpu
  #define same_context(a, b) (((a)->context_id == (b)->context_id) && \
                ((a)->lrca == (b)->lrca))
  
- #define get_last_workload(q) \
-       (list_empty(q) ? NULL : container_of(q->prev, \
-       struct intel_vgpu_workload, list))
  /**
   * intel_vgpu_create_workload - create a vGPU workload
   * @vgpu: a vGPU
@@@ -1446,7 -1474,7 +1474,7 @@@ intel_vgpu_create_workload(struct intel
  {
        struct intel_vgpu_submission *s = &vgpu->submission;
        struct list_head *q = workload_q_head(vgpu, ring_id);
-       struct intel_vgpu_workload *last_workload = get_last_workload(q);
+       struct intel_vgpu_workload *last_workload = NULL;
        struct intel_vgpu_workload *workload = NULL;
        struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
        u64 ring_context_gpa;
        head &= RB_HEAD_OFF_MASK;
        tail &= RB_TAIL_OFF_MASK;
  
-       if (last_workload && same_context(&last_workload->ctx_desc, desc)) {
-               gvt_dbg_el("ring id %d cur workload == last\n", ring_id);
-               gvt_dbg_el("ctx head %x real head %lx\n", head,
-                               last_workload->rb_tail);
-               /*
-                * cannot use guest context head pointer here,
-                * as it might not be updated at this time
-                */
-               head = last_workload->rb_tail;
+       list_for_each_entry_reverse(last_workload, q, list) {
+               if (same_context(&last_workload->ctx_desc, desc)) {
+                       gvt_dbg_el("ring id %d cur workload == last\n",
+                                       ring_id);
+                       gvt_dbg_el("ctx head %x real head %lx\n", head,
+                                       last_workload->rb_tail);
+                       /*
+                        * cannot use guest context head pointer here,
+                        * as it might not be updated at this time
+                        */
+                       head = last_workload->rb_tail;
+                       break;
+               }
        }
  
        gvt_dbg_el("ring id %d begin a new workload\n", ring_id);
                        if (!intel_gvt_ggtt_validate_range(vgpu,
                                workload->wa_ctx.indirect_ctx.guest_gma,
                                workload->wa_ctx.indirect_ctx.size)) {
 -                              kmem_cache_free(s->workloads, workload);
                                gvt_vgpu_err("invalid wa_ctx at: 0x%lx\n",
                                    workload->wa_ctx.indirect_ctx.guest_gma);
 +                              kmem_cache_free(s->workloads, workload);
                                return ERR_PTR(-EINVAL);
                        }
                }
                        if (!intel_gvt_ggtt_validate_range(vgpu,
                                workload->wa_ctx.per_ctx.guest_gma,
                                CACHELINE_BYTES)) {
 -                              kmem_cache_free(s->workloads, workload);
                                gvt_vgpu_err("invalid per_ctx at: 0x%lx\n",
                                        workload->wa_ctx.per_ctx.guest_gma);
 +                              kmem_cache_free(s->workloads, workload);
                                return ERR_PTR(-EINVAL);
                        }
                }
index bac1ee94f63fc0be121cb371cd9e38351494c322,b5b2a64753e6e63d3951b520ad080817f377c551..020696726f9e63703e665b614fb83cf1a8c54a17
@@@ -51,6 -51,7 +51,7 @@@
  #include "display/intel_audio.h"
  #include "display/intel_bw.h"
  #include "display/intel_cdclk.h"
+ #include "display/intel_display_types.h"
  #include "display/intel_dp.h"
  #include "display/intel_fbdev.h"
  #include "display/intel_gmbus.h"
  
  #include "gem/i915_gem_context.h"
  #include "gem/i915_gem_ioctls.h"
+ #include "gt/intel_gt.h"
  #include "gt/intel_gt_pm.h"
- #include "gt/intel_reset.h"
- #include "gt/intel_workarounds.h"
  
  #include "i915_debugfs.h"
  #include "i915_drv.h"
  #include "i915_irq.h"
- #include "i915_pmu.h"
+ #include "i915_memcpy.h"
+ #include "i915_perf.h"
  #include "i915_query.h"
+ #include "i915_suspend.h"
+ #include "i915_sysfs.h"
  #include "i915_trace.h"
  #include "i915_vgpu.h"
  #include "intel_csr.h"
- #include "intel_drv.h"
  #include "intel_pm.h"
- #include "intel_uc.h"
  
  static struct drm_driver driver;
  
- #if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
- static unsigned int i915_load_fail_count;
- bool __i915_inject_load_failure(const char *func, int line)
- {
-       if (i915_load_fail_count >= i915_modparams.inject_load_failure)
-               return false;
-       if (++i915_load_fail_count == i915_modparams.inject_load_failure) {
-               DRM_INFO("Injecting failure at checkpoint %u [%s:%d]\n",
-                        i915_modparams.inject_load_failure, func, line);
-               i915_modparams.inject_load_failure = 0;
-               return true;
-       }
-       return false;
- }
- bool i915_error_injected(void)
- {
-       return i915_load_fail_count && !i915_modparams.inject_load_failure;
- }
- #endif
- #define FDO_BUG_URL "https://bugs.freedesktop.org/enter_bug.cgi?product=DRI"
- #define FDO_BUG_MSG "Please file a bug at " FDO_BUG_URL " against DRM/Intel " \
-                   "providing the dmesg log by booting with drm.debug=0xf"
- void
- __i915_printk(struct drm_i915_private *dev_priv, const char *level,
-             const char *fmt, ...)
- {
-       static bool shown_bug_once;
-       struct device *kdev = dev_priv->drm.dev;
-       bool is_error = level[1] <= KERN_ERR[1];
-       bool is_debug = level[1] == KERN_DEBUG[1];
-       struct va_format vaf;
-       va_list args;
-       if (is_debug && !(drm_debug & DRM_UT_DRIVER))
-               return;
-       va_start(args, fmt);
-       vaf.fmt = fmt;
-       vaf.va = &args;
-       if (is_error)
-               dev_printk(level, kdev, "%pV", &vaf);
-       else
-               dev_printk(level, kdev, "[" DRM_NAME ":%ps] %pV",
-                          __builtin_return_address(0), &vaf);
-       va_end(args);
-       if (is_error && !shown_bug_once) {
-               /*
-                * Ask the user to file a bug report for the error, except
-                * if they may have caused the bug by fiddling with unsafe
-                * module parameters.
-                */
-               if (!test_taint(TAINT_USER))
-                       dev_notice(kdev, "%s", FDO_BUG_MSG);
-               shown_bug_once = true;
-       }
- }
- /* Map PCH device id to PCH type, or PCH_NONE if unknown. */
- static enum intel_pch
- intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
- {
-       switch (id) {
-       case INTEL_PCH_IBX_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
-               WARN_ON(!IS_GEN(dev_priv, 5));
-               return PCH_IBX;
-       case INTEL_PCH_CPT_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found CougarPoint PCH\n");
-               WARN_ON(!IS_GEN(dev_priv, 6) && !IS_IVYBRIDGE(dev_priv));
-               return PCH_CPT;
-       case INTEL_PCH_PPT_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found PantherPoint PCH\n");
-               WARN_ON(!IS_GEN(dev_priv, 6) && !IS_IVYBRIDGE(dev_priv));
-               /* PantherPoint is CPT compatible */
-               return PCH_CPT;
-       case INTEL_PCH_LPT_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found LynxPoint PCH\n");
-               WARN_ON(!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv));
-               WARN_ON(IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv));
-               return PCH_LPT;
-       case INTEL_PCH_LPT_LP_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
-               WARN_ON(!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv));
-               WARN_ON(!IS_HSW_ULT(dev_priv) && !IS_BDW_ULT(dev_priv));
-               return PCH_LPT;
-       case INTEL_PCH_WPT_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found WildcatPoint PCH\n");
-               WARN_ON(!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv));
-               WARN_ON(IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv));
-               /* WildcatPoint is LPT compatible */
-               return PCH_LPT;
-       case INTEL_PCH_WPT_LP_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found WildcatPoint LP PCH\n");
-               WARN_ON(!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv));
-               WARN_ON(!IS_HSW_ULT(dev_priv) && !IS_BDW_ULT(dev_priv));
-               /* WildcatPoint is LPT compatible */
-               return PCH_LPT;
-       case INTEL_PCH_SPT_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found SunrisePoint PCH\n");
-               WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
-               return PCH_SPT;
-       case INTEL_PCH_SPT_LP_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n");
-               WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
-               return PCH_SPT;
-       case INTEL_PCH_KBP_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found Kaby Lake PCH (KBP)\n");
-               WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv) &&
-                       !IS_COFFEELAKE(dev_priv));
-               /* KBP is SPT compatible */
-               return PCH_SPT;
-       case INTEL_PCH_CNP_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found Cannon Lake PCH (CNP)\n");
-               WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
-               return PCH_CNP;
-       case INTEL_PCH_CNP_LP_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found Cannon Lake LP PCH (CNP-LP)\n");
-               WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
-               return PCH_CNP;
-       case INTEL_PCH_CMP_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found Comet Lake PCH (CMP)\n");
-               WARN_ON(!IS_COFFEELAKE(dev_priv));
-               /* CometPoint is CNP Compatible */
-               return PCH_CNP;
-       case INTEL_PCH_ICP_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found Ice Lake PCH\n");
-               WARN_ON(!IS_ICELAKE(dev_priv));
-               return PCH_ICP;
-       case INTEL_PCH_MCC_DEVICE_ID_TYPE:
-               DRM_DEBUG_KMS("Found Mule Creek Canyon PCH\n");
-               WARN_ON(!IS_ELKHARTLAKE(dev_priv));
-               return PCH_MCC;
-       default:
-               return PCH_NONE;
-       }
- }
- static bool intel_is_virt_pch(unsigned short id,
-                             unsigned short svendor, unsigned short sdevice)
- {
-       return (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
-               id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
-               (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
-                svendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
-                sdevice == PCI_SUBDEVICE_ID_QEMU));
- }
- static unsigned short
- intel_virt_detect_pch(const struct drm_i915_private *dev_priv)
- {
-       unsigned short id = 0;
-       /*
-        * In a virtualized passthrough environment we can be in a
-        * setup where the ISA bridge is not able to be passed through.
-        * In this case, a south bridge can be emulated and we have to
-        * make an educated guess as to which PCH is really there.
-        */
-       if (IS_ELKHARTLAKE(dev_priv))
-               id = INTEL_PCH_MCC_DEVICE_ID_TYPE;
-       else if (IS_ICELAKE(dev_priv))
-               id = INTEL_PCH_ICP_DEVICE_ID_TYPE;
-       else if (IS_CANNONLAKE(dev_priv) || IS_COFFEELAKE(dev_priv))
-               id = INTEL_PCH_CNP_DEVICE_ID_TYPE;
-       else if (IS_KABYLAKE(dev_priv) || IS_SKYLAKE(dev_priv))
-               id = INTEL_PCH_SPT_DEVICE_ID_TYPE;
-       else if (IS_HSW_ULT(dev_priv) || IS_BDW_ULT(dev_priv))
-               id = INTEL_PCH_LPT_LP_DEVICE_ID_TYPE;
-       else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
-               id = INTEL_PCH_LPT_DEVICE_ID_TYPE;
-       else if (IS_GEN(dev_priv, 6) || IS_IVYBRIDGE(dev_priv))
-               id = INTEL_PCH_CPT_DEVICE_ID_TYPE;
-       else if (IS_GEN(dev_priv, 5))
-               id = INTEL_PCH_IBX_DEVICE_ID_TYPE;
-       if (id)
-               DRM_DEBUG_KMS("Assuming PCH ID %04x\n", id);
-       else
-               DRM_DEBUG_KMS("Assuming no PCH\n");
-       return id;
- }
- static void intel_detect_pch(struct drm_i915_private *dev_priv)
- {
-       struct pci_dev *pch = NULL;
-       /*
-        * The reason to probe ISA bridge instead of Dev31:Fun0 is to
-        * make graphics device passthrough work easy for VMM, that only
-        * need to expose ISA bridge to let driver know the real hardware
-        * underneath. This is a requirement from virtualization team.
-        *
-        * In some virtualized environments (e.g. XEN), there is irrelevant
-        * ISA bridge in the system. To work reliably, we should scan trhough
-        * all the ISA bridge devices and check for the first match, instead
-        * of only checking the first one.
-        */
-       while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
-               unsigned short id;
-               enum intel_pch pch_type;
-               if (pch->vendor != PCI_VENDOR_ID_INTEL)
-                       continue;
-               id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
-               pch_type = intel_pch_type(dev_priv, id);
-               if (pch_type != PCH_NONE) {
-                       dev_priv->pch_type = pch_type;
-                       dev_priv->pch_id = id;
-                       break;
-               } else if (intel_is_virt_pch(id, pch->subsystem_vendor,
-                                        pch->subsystem_device)) {
-                       id = intel_virt_detect_pch(dev_priv);
-                       pch_type = intel_pch_type(dev_priv, id);
-                       /* Sanity check virtual PCH id */
-                       if (WARN_ON(id && pch_type == PCH_NONE))
-                               id = 0;
-                       dev_priv->pch_type = pch_type;
-                       dev_priv->pch_id = id;
-                       break;
-               }
-       }
-       /*
-        * Use PCH_NOP (PCH but no South Display) for PCH platforms without
-        * display.
-        */
-       if (pch && !HAS_DISPLAY(dev_priv)) {
-               DRM_DEBUG_KMS("Display disabled, reverting to NOP PCH\n");
-               dev_priv->pch_type = PCH_NOP;
-               dev_priv->pch_id = 0;
-       }
-       if (!pch)
-               DRM_DEBUG_KMS("No PCH found.\n");
-       pci_dev_put(pch);
- }
- static int i915_getparam_ioctl(struct drm_device *dev, void *data,
-                              struct drm_file *file_priv)
- {
-       struct drm_i915_private *dev_priv = to_i915(dev);
-       struct pci_dev *pdev = dev_priv->drm.pdev;
-       const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
-       drm_i915_getparam_t *param = data;
-       int value;
-       switch (param->param) {
-       case I915_PARAM_IRQ_ACTIVE:
-       case I915_PARAM_ALLOW_BATCHBUFFER:
-       case I915_PARAM_LAST_DISPATCH:
-       case I915_PARAM_HAS_EXEC_CONSTANTS:
-               /* Reject all old ums/dri params. */
-               return -ENODEV;
-       case I915_PARAM_CHIPSET_ID:
-               value = pdev->device;
-               break;
-       case I915_PARAM_REVISION:
-               value = pdev->revision;
-               break;
-       case I915_PARAM_NUM_FENCES_AVAIL:
-               value = dev_priv->ggtt.num_fences;
-               break;
-       case I915_PARAM_HAS_OVERLAY:
-               value = dev_priv->overlay ? 1 : 0;
-               break;
-       case I915_PARAM_HAS_BSD:
-               value = !!dev_priv->engine[VCS0];
-               break;
-       case I915_PARAM_HAS_BLT:
-               value = !!dev_priv->engine[BCS0];
-               break;
-       case I915_PARAM_HAS_VEBOX:
-               value = !!dev_priv->engine[VECS0];
-               break;
-       case I915_PARAM_HAS_BSD2:
-               value = !!dev_priv->engine[VCS1];
-               break;
-       case I915_PARAM_HAS_LLC:
-               value = HAS_LLC(dev_priv);
-               break;
-       case I915_PARAM_HAS_WT:
-               value = HAS_WT(dev_priv);
-               break;
-       case I915_PARAM_HAS_ALIASING_PPGTT:
-               value = INTEL_PPGTT(dev_priv);
-               break;
-       case I915_PARAM_HAS_SEMAPHORES:
-               value = !!(dev_priv->caps.scheduler & I915_SCHEDULER_CAP_SEMAPHORES);
-               break;
-       case I915_PARAM_HAS_SECURE_BATCHES:
-               value = capable(CAP_SYS_ADMIN);
-               break;
-       case I915_PARAM_CMD_PARSER_VERSION:
-               value = i915_cmd_parser_get_version(dev_priv);
-               break;
-       case I915_PARAM_SUBSLICE_TOTAL:
-               value = intel_sseu_subslice_total(sseu);
-               if (!value)
-                       return -ENODEV;
-               break;
-       case I915_PARAM_EU_TOTAL:
-               value = sseu->eu_total;
-               if (!value)
-                       return -ENODEV;
-               break;
-       case I915_PARAM_HAS_GPU_RESET:
-               value = i915_modparams.enable_hangcheck &&
-                       intel_has_gpu_reset(dev_priv);
-               if (value && intel_has_reset_engine(dev_priv))
-                       value = 2;
-               break;
-       case I915_PARAM_HAS_RESOURCE_STREAMER:
-               value = 0;
-               break;
-       case I915_PARAM_HAS_POOLED_EU:
-               value = HAS_POOLED_EU(dev_priv);
-               break;
-       case I915_PARAM_MIN_EU_IN_POOL:
-               value = sseu->min_eu_in_pool;
-               break;
-       case I915_PARAM_HUC_STATUS:
-               value = intel_huc_check_status(&dev_priv->huc);
-               if (value < 0)
-                       return value;
-               break;
-       case I915_PARAM_MMAP_GTT_VERSION:
-               /* Though we've started our numbering from 1, and so class all
-                * earlier versions as 0, in effect their value is undefined as
-                * the ioctl will report EINVAL for the unknown param!
-                */
-               value = i915_gem_mmap_gtt_version();
-               break;
-       case I915_PARAM_HAS_SCHEDULER:
-               value = dev_priv->caps.scheduler;
-               break;
-       case I915_PARAM_MMAP_VERSION:
-               /* Remember to bump this if the version changes! */
-       case I915_PARAM_HAS_GEM:
-       case I915_PARAM_HAS_PAGEFLIPPING:
-       case I915_PARAM_HAS_EXECBUF2: /* depends on GEM */
-       case I915_PARAM_HAS_RELAXED_FENCING:
-       case I915_PARAM_HAS_COHERENT_RINGS:
-       case I915_PARAM_HAS_RELAXED_DELTA:
-       case I915_PARAM_HAS_GEN7_SOL_RESET:
-       case I915_PARAM_HAS_WAIT_TIMEOUT:
-       case I915_PARAM_HAS_PRIME_VMAP_FLUSH:
-       case I915_PARAM_HAS_PINNED_BATCHES:
-       case I915_PARAM_HAS_EXEC_NO_RELOC:
-       case I915_PARAM_HAS_EXEC_HANDLE_LUT:
-       case I915_PARAM_HAS_COHERENT_PHYS_GTT:
-       case I915_PARAM_HAS_EXEC_SOFTPIN:
-       case I915_PARAM_HAS_EXEC_ASYNC:
-       case I915_PARAM_HAS_EXEC_FENCE:
-       case I915_PARAM_HAS_EXEC_CAPTURE:
-       case I915_PARAM_HAS_EXEC_BATCH_FIRST:
-       case I915_PARAM_HAS_EXEC_FENCE_ARRAY:
-       case I915_PARAM_HAS_EXEC_SUBMIT_FENCE:
-               /* For the time being all of these are always true;
-                * if some supported hardware does not have one of these
-                * features this value needs to be provided from
-                * INTEL_INFO(), a feature macro, or similar.
-                */
-               value = 1;
-               break;
-       case I915_PARAM_HAS_CONTEXT_ISOLATION:
-               value = intel_engines_has_context_isolation(dev_priv);
-               break;
-       case I915_PARAM_SLICE_MASK:
-               value = sseu->slice_mask;
-               if (!value)
-                       return -ENODEV;
-               break;
-       case I915_PARAM_SUBSLICE_MASK:
-               value = sseu->subslice_mask[0];
-               if (!value)
-                       return -ENODEV;
-               break;
-       case I915_PARAM_CS_TIMESTAMP_FREQUENCY:
-               value = 1000 * RUNTIME_INFO(dev_priv)->cs_timestamp_frequency_khz;
-               break;
-       case I915_PARAM_MMAP_GTT_COHERENT:
-               value = INTEL_INFO(dev_priv)->has_coherent_ggtt;
-               break;
-       default:
-               DRM_DEBUG("Unknown parameter %d\n", param->param);
-               return -EINVAL;
-       }
-       if (put_user(value, param->value))
-               return -EFAULT;
-       return 0;
- }
+ struct vlv_s0ix_state {
+       /* GAM */
+       u32 wr_watermark;
+       u32 gfx_prio_ctrl;
+       u32 arb_mode;
+       u32 gfx_pend_tlb0;
+       u32 gfx_pend_tlb1;
+       u32 lra_limits[GEN7_LRA_LIMITS_REG_NUM];
+       u32 media_max_req_count;
+       u32 gfx_max_req_count;
+       u32 render_hwsp;
+       u32 ecochk;
+       u32 bsd_hwsp;
+       u32 blt_hwsp;
+       u32 tlb_rd_addr;
+       /* MBC */
+       u32 g3dctl;
+       u32 gsckgctl;
+       u32 mbctl;
+       /* GCP */
+       u32 ucgctl1;
+       u32 ucgctl3;
+       u32 rcgctl1;
+       u32 rcgctl2;
+       u32 rstctl;
+       u32 misccpctl;
+       /* GPM */
+       u32 gfxpause;
+       u32 rpdeuhwtc;
+       u32 rpdeuc;
+       u32 ecobus;
+       u32 pwrdwnupctl;
+       u32 rp_down_timeout;
+       u32 rp_deucsw;
+       u32 rcubmabdtmr;
+       u32 rcedata;
+       u32 spare2gh;
+       /* Display 1 CZ domain */
+       u32 gt_imr;
+       u32 gt_ier;
+       u32 pm_imr;
+       u32 pm_ier;
+       u32 gt_scratch[GEN7_GT_SCRATCH_REG_NUM];
+       /* GT SA CZ domain */
+       u32 tilectl;
+       u32 gt_fifoctl;
+       u32 gtlc_wake_ctrl;
+       u32 gtlc_survive;
+       u32 pmwgicz;
+       /* Display 2 CZ domain */
+       u32 gu_ctl0;
+       u32 gu_ctl1;
+       u32 pcbr;
+       u32 clock_gate_dis2;
+ };
  
  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
  {
@@@ -632,39 -282,45 +282,45 @@@ static unsigned int i915_vga_set_decode
                return VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM;
  }
  
- static int i915_resume_switcheroo(struct drm_device *dev);
- static int i915_suspend_switcheroo(struct drm_device *dev, pm_message_t state);
+ static int i915_resume_switcheroo(struct drm_i915_private *i915);
+ static int i915_suspend_switcheroo(struct drm_i915_private *i915,
+                                  pm_message_t state);
  
  static void i915_switcheroo_set_state(struct pci_dev *pdev, enum vga_switcheroo_state state)
  {
-       struct drm_device *dev = pci_get_drvdata(pdev);
+       struct drm_i915_private *i915 = pdev_to_i915(pdev);
        pm_message_t pmm = { .event = PM_EVENT_SUSPEND };
  
+       if (!i915) {
+               dev_err(&pdev->dev, "DRM not initialized, aborting switch.\n");
+               return;
+       }
        if (state == VGA_SWITCHEROO_ON) {
                pr_info("switched on\n");
-               dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
+               i915->drm.switch_power_state = DRM_SWITCH_POWER_CHANGING;
                /* i915 resume handler doesn't set to D0 */
                pci_set_power_state(pdev, PCI_D0);
-               i915_resume_switcheroo(dev);
-               dev->switch_power_state = DRM_SWITCH_POWER_ON;
+               i915_resume_switcheroo(i915);
+               i915->drm.switch_power_state = DRM_SWITCH_POWER_ON;
        } else {
                pr_info("switched off\n");
-               dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
-               i915_suspend_switcheroo(dev, pmm);
-               dev->switch_power_state = DRM_SWITCH_POWER_OFF;
+               i915->drm.switch_power_state = DRM_SWITCH_POWER_CHANGING;
+               i915_suspend_switcheroo(i915, pmm);
+               i915->drm.switch_power_state = DRM_SWITCH_POWER_OFF;
        }
  }
  
  static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
  {
-       struct drm_device *dev = pci_get_drvdata(pdev);
+       struct drm_i915_private *i915 = pdev_to_i915(pdev);
  
        /*
         * FIXME: open_count is protected by drm_global_mutex but that would lead to
         * locking inversion with the driver load path. And the access here is
         * completely racy anyway. So don't bother with locking for now.
         */
-       return dev->open_count == 0;
+       return i915 && i915->drm.open_count == 0;
  }
  
  static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
        .can_switch = i915_switcheroo_can_switch,
  };
  
- static int i915_load_modeset_init(struct drm_device *dev)
+ static int i915_driver_modeset_probe(struct drm_device *dev)
  {
        struct drm_i915_private *dev_priv = to_i915(dev);
        struct pci_dev *pdev = dev_priv->drm.pdev;
        int ret;
  
-       if (i915_inject_load_failure())
+       if (i915_inject_probe_failure(dev_priv))
                return -ENODEV;
  
        if (HAS_DISPLAY(dev_priv)) {
  
  cleanup_gem:
        i915_gem_suspend(dev_priv);
-       i915_gem_fini_hw(dev_priv);
-       i915_gem_fini(dev_priv);
+       i915_gem_driver_remove(dev_priv);
+       i915_gem_driver_release(dev_priv);
  cleanup_modeset:
-       intel_modeset_cleanup(dev);
+       intel_modeset_driver_remove(dev);
  cleanup_irq:
-       drm_irq_uninstall(dev);
+       intel_irq_uninstall(dev_priv);
        intel_gmbus_teardown(dev_priv);
  cleanup_csr:
        intel_csr_ucode_fini(dev_priv);
-       intel_power_domains_fini_hw(dev_priv);
+       intel_power_domains_driver_remove(dev_priv);
        vga_switcheroo_unregister_client(pdev);
  cleanup_vga_client:
        vga_client_register(pdev, NULL, NULL, NULL);
@@@ -840,15 -496,6 +496,6 @@@ out_err
        return -ENOMEM;
  }
  
- static void i915_engines_cleanup(struct drm_i915_private *i915)
- {
-       struct intel_engine_cs *engine;
-       enum intel_engine_id id;
-       for_each_engine(engine, i915, id)
-               kfree(engine);
- }
  static void i915_workqueues_cleanup(struct drm_i915_private *dev_priv)
  {
        destroy_workqueue(dev_priv->hotplug.dp_wq);
@@@ -881,8 -528,31 +528,31 @@@ static void intel_detect_preproduction_
        }
  }
  
+ static int vlv_alloc_s0ix_state(struct drm_i915_private *i915)
+ {
+       if (!IS_VALLEYVIEW(i915))
+               return 0;
+       /* we write all the values in the struct, so no need to zero it out */
+       i915->vlv_s0ix_state = kmalloc(sizeof(*i915->vlv_s0ix_state),
+                                      GFP_KERNEL);
+       if (!i915->vlv_s0ix_state)
+               return -ENOMEM;
+       return 0;
+ }
+ static void vlv_free_s0ix_state(struct drm_i915_private *i915)
+ {
+       if (!i915->vlv_s0ix_state)
+               return;
+       kfree(i915->vlv_s0ix_state);
+       i915->vlv_s0ix_state = NULL;
+ }
  /**
-  * i915_driver_init_early - setup state not requiring device access
+  * i915_driver_early_probe - setup state not requiring device access
   * @dev_priv: device private
   *
   * Initialize everything that is a "SW-only" state, that is state not
   * system memory allocation, setting up device specific attributes and
   * function hooks not requiring accessing the device.
   */
- static int i915_driver_init_early(struct drm_i915_private *dev_priv)
+ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
  {
        int ret = 0;
  
-       if (i915_inject_load_failure())
+       if (i915_inject_probe_failure(dev_priv))
                return -ENODEV;
  
        intel_device_info_subplatform_init(dev_priv);
  
-       intel_uncore_init_early(&dev_priv->uncore);
+       intel_uncore_mmio_debug_init_early(&dev_priv->mmio_debug);
+       intel_uncore_init_early(&dev_priv->uncore, dev_priv);
  
        spin_lock_init(&dev_priv->irq_lock);
        spin_lock_init(&dev_priv->gpu_error.lock);
  
        ret = i915_workqueues_init(dev_priv);
        if (ret < 0)
-               goto err_engines;
+               return ret;
  
-       ret = i915_gem_init_early(dev_priv);
+       ret = vlv_alloc_s0ix_state(dev_priv);
        if (ret < 0)
                goto err_workqueues;
  
+       intel_wopcm_init_early(&dev_priv->wopcm);
+       intel_gt_init_early(&dev_priv->gt, dev_priv);
+       ret = i915_gem_init_early(dev_priv);
+       if (ret < 0)
+               goto err_gt;
        /* This must be called before any calls to HAS_PCH_* */
        intel_detect_pch(dev_priv);
  
-       intel_wopcm_init_early(&dev_priv->wopcm);
-       intel_uc_init_early(dev_priv);
        intel_pm_setup(dev_priv);
        intel_init_dpio(dev_priv);
        ret = intel_power_domains_init(dev_priv);
        if (ret < 0)
-               goto err_uc;
+               goto err_gem;
        intel_irq_init(dev_priv);
-       intel_hangcheck_init(dev_priv);
        intel_init_display_hooks(dev_priv);
        intel_init_clock_gating_hooks(dev_priv);
        intel_init_audio_hooks(dev_priv);
  
        return 0;
  
- err_uc:
-       intel_uc_cleanup_early(dev_priv);
+ err_gem:
        i915_gem_cleanup_early(dev_priv);
+ err_gt:
+       intel_gt_driver_late_release(&dev_priv->gt);
+       vlv_free_s0ix_state(dev_priv);
  err_workqueues:
        i915_workqueues_cleanup(dev_priv);
- err_engines:
-       i915_engines_cleanup(dev_priv);
        return ret;
  }
  
  /**
-  * i915_driver_cleanup_early - cleanup the setup done in i915_driver_init_early()
+  * i915_driver_late_release - cleanup the setup done in
+  *                           i915_driver_early_probe()
   * @dev_priv: device private
   */
- static void i915_driver_cleanup_early(struct drm_i915_private *dev_priv)
+ static void i915_driver_late_release(struct drm_i915_private *dev_priv)
  {
        intel_irq_fini(dev_priv);
        intel_power_domains_cleanup(dev_priv);
-       intel_uc_cleanup_early(dev_priv);
        i915_gem_cleanup_early(dev_priv);
+       intel_gt_driver_late_release(&dev_priv->gt);
+       vlv_free_s0ix_state(dev_priv);
        i915_workqueues_cleanup(dev_priv);
-       i915_engines_cleanup(dev_priv);
  
        pm_qos_remove_request(&dev_priv->sb_qos);
        mutex_destroy(&dev_priv->sb_lock);
  }
  
  /**
-  * i915_driver_init_mmio - setup device MMIO
+  * i915_driver_mmio_probe - setup device MMIO
   * @dev_priv: device private
   *
   * Setup minimal device state necessary for MMIO accesses later in the
   * side effects or exposing the driver via kernel internal or user space
   * interfaces.
   */
- static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
+ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv)
  {
        int ret;
  
-       if (i915_inject_load_failure())
+       if (i915_inject_probe_failure(dev_priv))
                return -ENODEV;
  
        if (i915_get_bridge_dev(dev_priv))
  
        intel_uncore_prune_mmio_domains(&dev_priv->uncore);
  
-       intel_uc_init_mmio(dev_priv);
+       intel_uc_init_mmio(&dev_priv->gt.uc);
  
        ret = intel_engines_init_mmio(dev_priv);
        if (ret)
@@@ -1024,11 -701,12 +701,12 @@@ err_bridge
  }
  
  /**
-  * i915_driver_cleanup_mmio - cleanup the setup done in i915_driver_init_mmio()
+  * i915_driver_mmio_release - cleanup the setup done in i915_driver_mmio_probe()
   * @dev_priv: device private
   */
- static void i915_driver_cleanup_mmio(struct drm_i915_private *dev_priv)
+ static void i915_driver_mmio_release(struct drm_i915_private *dev_priv)
  {
+       intel_engines_cleanup(dev_priv);
        intel_teardown_mchbar(dev_priv);
        intel_uncore_fini_mmio(&dev_priv->uncore);
        pci_dev_put(dev_priv->bridge_dev);
@@@ -1516,22 -1194,23 +1194,23 @@@ static void edram_detect(struct drm_i91
                dev_priv->edram_size_mb =
                        gen9_edram_size_mb(dev_priv, edram_cap);
  
-       DRM_INFO("Found %uMB of eDRAM\n", dev_priv->edram_size_mb);
+       dev_info(dev_priv->drm.dev,
+                "Found %uMB of eDRAM\n", dev_priv->edram_size_mb);
  }
  
  /**
-  * i915_driver_init_hw - setup state requiring device access
+  * i915_driver_hw_probe - setup state requiring device access
   * @dev_priv: device private
   *
   * Setup state that requires accessing the device, but doesn't require
   * exposing the driver via kernel internal or userspace interfaces.
   */
- static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
+ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
  {
        struct pci_dev *pdev = dev_priv->drm.pdev;
        int ret;
  
-       if (i915_inject_load_failure())
+       if (i915_inject_probe_failure(dev_priv))
                return -ENODEV;
  
        intel_device_info_runtime_init(dev_priv);
        if (ret)
                goto err_ggtt;
  
+       intel_gt_init_hw(dev_priv);
        ret = i915_ggtt_enable_hw(dev_priv);
        if (ret) {
                DRM_ERROR("failed to enable GGTT\n");
  
        pci_set_master(pdev);
  
 +      /*
 +       * We don't have a max segment size, so set it to the max so sg's
 +       * debugging layer doesn't complain
 +       */
 +      dma_set_max_seg_size(&pdev->dev, UINT_MAX);
 +
        /* overlay on gen2 is broken and can't address above 1G */
        if (IS_GEN(dev_priv, 2)) {
                ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(30));
        pm_qos_add_request(&dev_priv->pm_qos, PM_QOS_CPU_DMA_LATENCY,
                           PM_QOS_DEFAULT_VALUE);
  
-       intel_uncore_sanitize(dev_priv);
+       /* BIOS often leaves RC6 enabled, but disable it for hw init */
+       intel_sanitize_gt_powersave(dev_priv);
  
        intel_gt_init_workarounds(dev_priv);
  
@@@ -1683,17 -1359,17 +1365,17 @@@ err_msi
                pci_disable_msi(pdev);
        pm_qos_remove_request(&dev_priv->pm_qos);
  err_ggtt:
-       i915_ggtt_cleanup_hw(dev_priv);
+       i915_ggtt_driver_release(dev_priv);
  err_perf:
        i915_perf_fini(dev_priv);
        return ret;
  }
  
  /**
-  * i915_driver_cleanup_hw - cleanup the setup done in i915_driver_init_hw()
+  * i915_driver_hw_remove - cleanup the setup done in i915_driver_hw_probe()
   * @dev_priv: device private
   */
- static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)
+ static void i915_driver_hw_remove(struct drm_i915_private *dev_priv)
  {
        struct pci_dev *pdev = dev_priv->drm.pdev;
  
@@@ -1716,7 -1392,7 +1398,7 @@@ static void i915_driver_register(struc
  {
        struct drm_device *dev = &dev_priv->drm;
  
-       i915_gem_shrinker_register(dev_priv);
+       i915_gem_driver_register(dev_priv);
        i915_pmu_register(dev_priv);
  
        /*
@@@ -1796,7 -1472,7 +1478,7 @@@ static void i915_driver_unregister(stru
        i915_teardown_sysfs(dev_priv);
        drm_dev_unplug(&dev_priv->drm);
  
-       i915_gem_shrinker_unregister(dev_priv);
+       i915_gem_driver_unregister(dev_priv);
  }
  
  static void i915_welcome_messages(struct drm_i915_private *dev_priv)
@@@ -1843,9 -1519,10 +1525,10 @@@ i915_driver_create(struct pci_dev *pdev
                return ERR_PTR(err);
        }
  
-       i915->drm.pdev = pdev;
        i915->drm.dev_private = i915;
-       pci_set_drvdata(pdev, &i915->drm);
+       i915->drm.pdev = pdev;
+       pci_set_drvdata(pdev, i915);
  
        /* Setup the write-once "constant" device info */
        device_info = mkwrite_device_info(i915);
@@@ -1869,17 -1546,17 +1552,17 @@@ static void i915_driver_destroy(struct 
  }
  
  /**
-  * i915_driver_load - setup chip and create an initial config
+  * i915_driver_probe - setup chip and create an initial config
   * @pdev: PCI device
   * @ent: matching PCI ID entry
   *
-  * The driver load routine has to do several things:
+  * The driver probe routine has to do several things:
   *   - drive output discovery via intel_modeset_init()
   *   - initialize the memory manager
   *   - allocate initial config memory
   *   - setup the DRM framebuffer with the allocated memory
   */
- int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent)
+ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  {
        const struct intel_device_info *match_info =
                (struct intel_device_info *)ent->driver_data;
        if (ret)
                goto out_fini;
  
-       ret = i915_driver_init_early(dev_priv);
+       ret = i915_driver_early_probe(dev_priv);
        if (ret < 0)
                goto out_pci_disable;
  
        disable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
  
-       ret = i915_driver_init_mmio(dev_priv);
+       i915_detect_vgpu(dev_priv);
+       ret = i915_driver_mmio_probe(dev_priv);
        if (ret < 0)
                goto out_runtime_pm_put;
  
-       ret = i915_driver_init_hw(dev_priv);
+       ret = i915_driver_hw_probe(dev_priv);
        if (ret < 0)
                goto out_cleanup_mmio;
  
-       ret = i915_load_modeset_init(&dev_priv->drm);
+       ret = i915_driver_modeset_probe(&dev_priv->drm);
        if (ret < 0)
                goto out_cleanup_hw;
  
        return 0;
  
  out_cleanup_hw:
-       i915_driver_cleanup_hw(dev_priv);
-       i915_ggtt_cleanup_hw(dev_priv);
+       i915_driver_hw_remove(dev_priv);
+       i915_ggtt_driver_release(dev_priv);
+       /* Paranoia: make sure we have disabled everything before we exit. */
+       intel_sanitize_gt_powersave(dev_priv);
  out_cleanup_mmio:
-       i915_driver_cleanup_mmio(dev_priv);
+       i915_driver_mmio_release(dev_priv);
  out_runtime_pm_put:
        enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
-       i915_driver_cleanup_early(dev_priv);
+       i915_driver_late_release(dev_priv);
  out_pci_disable:
        pci_disable_device(pdev);
  out_fini:
-       i915_load_error(dev_priv, "Device initialization failed (%d)\n", ret);
+       i915_probe_error(dev_priv, "Device initialization failed (%d)\n", ret);
        i915_driver_destroy(dev_priv);
        return ret;
  }
  
- void i915_driver_unload(struct drm_device *dev)
+ void i915_driver_remove(struct drm_i915_private *i915)
  {
-       struct drm_i915_private *dev_priv = to_i915(dev);
-       struct pci_dev *pdev = dev_priv->drm.pdev;
+       struct pci_dev *pdev = i915->drm.pdev;
  
-       disable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
+       disable_rpm_wakeref_asserts(&i915->runtime_pm);
  
-       i915_driver_unregister(dev_priv);
+       i915_driver_unregister(i915);
  
        /*
         * After unregistering the device to prevent any new users, cancel
         * all in-flight requests so that we can quickly unbind the active
         * resources.
         */
-       i915_gem_set_wedged(dev_priv);
+       intel_gt_set_wedged(&i915->gt);
  
        /* Flush any external code that still may be under the RCU lock */
        synchronize_rcu();
  
-       i915_gem_suspend(dev_priv);
+       i915_gem_suspend(i915);
  
-       drm_atomic_helper_shutdown(dev);
+       drm_atomic_helper_shutdown(&i915->drm);
  
-       intel_gvt_cleanup(dev_priv);
+       intel_gvt_driver_remove(i915);
  
-       intel_modeset_cleanup(dev);
+       intel_modeset_driver_remove(&i915->drm);
  
-       intel_bios_cleanup(dev_priv);
+       intel_bios_driver_remove(i915);
  
        vga_switcheroo_unregister_client(pdev);
        vga_client_register(pdev, NULL, NULL, NULL);
  
-       intel_csr_ucode_fini(dev_priv);
+       intel_csr_ucode_fini(i915);
  
        /* Free error state after interrupts are fully disabled. */
-       cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work);
-       i915_reset_error_state(dev_priv);
+       cancel_delayed_work_sync(&i915->gt.hangcheck.work);
+       i915_reset_error_state(i915);
  
-       i915_gem_fini_hw(dev_priv);
+       i915_gem_driver_remove(i915);
  
-       intel_power_domains_fini_hw(dev_priv);
+       intel_power_domains_driver_remove(i915);
  
-       i915_driver_cleanup_hw(dev_priv);
+       i915_driver_hw_remove(i915);
  
-       enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
+       enable_rpm_wakeref_asserts(&i915->runtime_pm);
  }
  
  static void i915_driver_release(struct drm_device *dev)
  
        disable_rpm_wakeref_asserts(rpm);
  
-       i915_gem_fini(dev_priv);
+       i915_gem_driver_release(dev_priv);
+       i915_ggtt_driver_release(dev_priv);
+       /* Paranoia: make sure we have disabled everything before we exit. */
+       intel_sanitize_gt_powersave(dev_priv);
  
-       i915_ggtt_cleanup_hw(dev_priv);
-       i915_driver_cleanup_mmio(dev_priv);
+       i915_driver_mmio_release(dev_priv);
  
        enable_rpm_wakeref_asserts(rpm);
-       intel_runtime_pm_cleanup(rpm);
+       intel_runtime_pm_driver_release(rpm);
  
-       i915_driver_cleanup_early(dev_priv);
+       i915_driver_late_release(dev_priv);
        i915_driver_destroy(dev_priv);
  }
  
@@@ -2046,6 -1731,9 +1737,9 @@@ static void i915_driver_postclose(struc
        mutex_unlock(&dev->struct_mutex);
  
        kfree(file_priv);
+       /* Catch up with all the deferred frees from "this" client */
+       i915_gem_flush_free_objects(to_i915(dev));
  }
  
  static void intel_suspend_encoders(struct drm_i915_private *dev_priv)
@@@ -2150,7 -1838,7 +1844,7 @@@ static int i915_drm_suspend_late(struc
        struct drm_i915_private *dev_priv = to_i915(dev);
        struct pci_dev *pdev = dev_priv->drm.pdev;
        struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
-       int ret;
+       int ret = 0;
  
        disable_rpm_wakeref_asserts(rpm);
  
        intel_power_domains_suspend(dev_priv,
                                    get_suspend_mode(dev_priv, hibernation));
  
-       ret = 0;
-       if (INTEL_GEN(dev_priv) >= 11 || IS_GEN9_LP(dev_priv))
-               bxt_enable_dc9(dev_priv);
-       else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
-               hsw_enable_pc8(dev_priv);
-       else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
+       intel_display_power_suspend_late(dev_priv);
+       if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
                ret = vlv_suspend_complete(dev_priv);
  
        if (ret) {
  
  out:
        enable_rpm_wakeref_asserts(rpm);
-       if (!dev_priv->uncore.user_forcewake.count)
-               intel_runtime_pm_cleanup(rpm);
+       if (!dev_priv->uncore.user_forcewake_count)
+               intel_runtime_pm_driver_release(rpm);
  
        return ret;
  }
  
- static int i915_suspend_switcheroo(struct drm_device *dev, pm_message_t state)
+ static int
+ i915_suspend_switcheroo(struct drm_i915_private *i915, pm_message_t state)
  {
        int error;
  
-       if (!dev) {
-               DRM_ERROR("dev: %p\n", dev);
-               DRM_ERROR("DRM not initialized, aborting suspend.\n");
-               return -ENODEV;
-       }
        if (WARN_ON_ONCE(state.event != PM_EVENT_SUSPEND &&
                         state.event != PM_EVENT_FREEZE))
                return -EINVAL;
  
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
  
-       error = i915_drm_suspend(dev);
+       error = i915_drm_suspend(&i915->drm);
        if (error)
                return error;
  
-       return i915_drm_suspend_late(dev, false);
+       return i915_drm_suspend_late(&i915->drm, false);
  }
  
  static int i915_drm_resume(struct drm_device *dev)
@@@ -2354,75 -2034,68 +2040,68 @@@ static int i915_drm_resume_early(struc
  
        intel_uncore_resume_early(&dev_priv->uncore);
  
-       i915_check_and_clear_faults(dev_priv);
+       intel_gt_check_and_clear_faults(&dev_priv->gt);
  
-       if (INTEL_GEN(dev_priv) >= 11 || IS_GEN9_LP(dev_priv)) {
-               gen9_sanitize_dc_state(dev_priv);
-               bxt_disable_dc9(dev_priv);
-       } else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
-               hsw_disable_pc8(dev_priv);
-       }
+       intel_display_power_resume_early(dev_priv);
  
-       intel_uncore_sanitize(dev_priv);
+       intel_sanitize_gt_powersave(dev_priv);
  
        intel_power_domains_resume(dev_priv);
  
-       intel_gt_sanitize(dev_priv, true);
+       intel_gt_sanitize(&dev_priv->gt, true);
  
        enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
  
        return ret;
  }
  
- static int i915_resume_switcheroo(struct drm_device *dev)
+ static int i915_resume_switcheroo(struct drm_i915_private *i915)
  {
        int ret;
  
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
  
-       ret = i915_drm_resume_early(dev);
+       ret = i915_drm_resume_early(&i915->drm);
        if (ret)
                return ret;
  
-       return i915_drm_resume(dev);
+       return i915_drm_resume(&i915->drm);
  }
  
  static int i915_pm_prepare(struct device *kdev)
  {
-       struct pci_dev *pdev = to_pci_dev(kdev);
-       struct drm_device *dev = pci_get_drvdata(pdev);
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
  
-       if (!dev) {
+       if (!i915) {
                dev_err(kdev, "DRM not initialized, aborting suspend.\n");
                return -ENODEV;
        }
  
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
  
-       return i915_drm_prepare(dev);
+       return i915_drm_prepare(&i915->drm);
  }
  
  static int i915_pm_suspend(struct device *kdev)
  {
-       struct pci_dev *pdev = to_pci_dev(kdev);
-       struct drm_device *dev = pci_get_drvdata(pdev);
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
  
-       if (!dev) {
+       if (!i915) {
                dev_err(kdev, "DRM not initialized, aborting suspend.\n");
                return -ENODEV;
        }
  
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
  
-       return i915_drm_suspend(dev);
+       return i915_drm_suspend(&i915->drm);
  }
  
  static int i915_pm_suspend_late(struct device *kdev)
  {
-       struct drm_device *dev = &kdev_to_i915(kdev)->drm;
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
  
        /*
         * We have a suspend ordering issue with the snd-hda driver also
         * FIXME: This should be solved with a special hdmi sink device or
         * similar so that power domains can be employed.
         */
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
  
-       return i915_drm_suspend_late(dev, false);
+       return i915_drm_suspend_late(&i915->drm, false);
  }
  
  static int i915_pm_poweroff_late(struct device *kdev)
  {
-       struct drm_device *dev = &kdev_to_i915(kdev)->drm;
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
  
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
  
-       return i915_drm_suspend_late(dev, true);
+       return i915_drm_suspend_late(&i915->drm, true);
  }
  
  static int i915_pm_resume_early(struct device *kdev)
  {
-       struct drm_device *dev = &kdev_to_i915(kdev)->drm;
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
  
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
  
-       return i915_drm_resume_early(dev);
+       return i915_drm_resume_early(&i915->drm);
  }
  
  static int i915_pm_resume(struct device *kdev)
  {
-       struct drm_device *dev = &kdev_to_i915(kdev)->drm;
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
  
-       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
+       if (i915->drm.switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
  
-       return i915_drm_resume(dev);
+       return i915_drm_resume(&i915->drm);
  }
  
  /* freeze: before creating the hibernation_image */
  static int i915_pm_freeze(struct device *kdev)
  {
-       struct drm_device *dev = &kdev_to_i915(kdev)->drm;
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
        int ret;
  
-       if (dev->switch_power_state != DRM_SWITCH_POWER_OFF) {
-               ret = i915_drm_suspend(dev);
+       if (i915->drm.switch_power_state != DRM_SWITCH_POWER_OFF) {
+               ret = i915_drm_suspend(&i915->drm);
                if (ret)
                        return ret;
        }
  
-       ret = i915_gem_freeze(kdev_to_i915(kdev));
+       ret = i915_gem_freeze(i915);
        if (ret)
                return ret;
  
  
  static int i915_pm_freeze_late(struct device *kdev)
  {
-       struct drm_device *dev = &kdev_to_i915(kdev)->drm;
+       struct drm_i915_private *i915 = kdev_to_i915(kdev);
        int ret;
  
-       if (dev->switch_power_state != DRM_SWITCH_POWER_OFF) {
-               ret = i915_drm_suspend_late(dev, true);
+       if (i915->drm.switch_power_state != DRM_SWITCH_POWER_OFF) {
+               ret = i915_drm_suspend_late(&i915->drm, true);
                if (ret)
                        return ret;
        }
  
-       ret = i915_gem_freeze_late(kdev_to_i915(kdev));
+       ret = i915_gem_freeze_late(i915);
        if (ret)
                return ret;
  
@@@ -2556,9 -2229,12 +2235,12 @@@ static int i915_pm_restore(struct devic
   */
  static void vlv_save_gunit_s0ix_state(struct drm_i915_private *dev_priv)
  {
-       struct vlv_s0ix_state *s = &dev_priv->vlv_s0ix_state;
+       struct vlv_s0ix_state *s = dev_priv->vlv_s0ix_state;
        int i;
  
+       if (!s)
+               return;
        /* GAM 0x4000-0x4770 */
        s->wr_watermark         = I915_READ(GEN7_WR_WATERMARK);
        s->gfx_prio_ctrl        = I915_READ(GEN7_GFX_PRIO_CTRL);
  
  static void vlv_restore_gunit_s0ix_state(struct drm_i915_private *dev_priv)
  {
-       struct vlv_s0ix_state *s = &dev_priv->vlv_s0ix_state;
+       struct vlv_s0ix_state *s = dev_priv->vlv_s0ix_state;
        u32 val;
        int i;
  
+       if (!s)
+               return;
        /* GAM 0x4000-0x4770 */
        I915_WRITE(GEN7_WR_WATERMARK,   s->wr_watermark);
        I915_WRITE(GEN7_GFX_PRIO_CTRL,  s->gfx_prio_ctrl);
@@@ -2849,8 -2528,7 +2534,7 @@@ static int vlv_suspend_complete(struct 
        if (err)
                goto err2;
  
-       if (!IS_CHERRYVIEW(dev_priv))
-               vlv_save_gunit_s0ix_state(dev_priv);
+       vlv_save_gunit_s0ix_state(dev_priv);
  
        err = vlv_force_gfx_clock(dev_priv, false);
        if (err)
@@@ -2880,8 -2558,7 +2564,7 @@@ static int vlv_resume_prepare(struct dr
         */
        ret = vlv_force_gfx_clock(dev_priv, true);
  
-       if (!IS_CHERRYVIEW(dev_priv))
-               vlv_restore_gunit_s0ix_state(dev_priv);
+       vlv_restore_gunit_s0ix_state(dev_priv);
  
        err = vlv_allow_gt_wake(dev_priv, true);
        if (!ret)
  
  static int intel_runtime_suspend(struct device *kdev)
  {
-       struct pci_dev *pdev = to_pci_dev(kdev);
-       struct drm_device *dev = pci_get_drvdata(pdev);
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
        struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
-       int ret;
+       int ret = 0;
  
        if (WARN_ON_ONCE(!(dev_priv->gt_pm.rc6.enabled && HAS_RC6(dev_priv))))
                return -ENODEV;
         */
        i915_gem_runtime_suspend(dev_priv);
  
-       intel_uc_runtime_suspend(dev_priv);
+       intel_gt_runtime_suspend(&dev_priv->gt);
  
        intel_runtime_pm_disable_interrupts(dev_priv);
  
        intel_uncore_suspend(&dev_priv->uncore);
  
-       ret = 0;
-       if (INTEL_GEN(dev_priv) >= 11) {
-               icl_display_core_uninit(dev_priv);
-               bxt_enable_dc9(dev_priv);
-       } else if (IS_GEN9_LP(dev_priv)) {
-               bxt_display_core_uninit(dev_priv);
-               bxt_enable_dc9(dev_priv);
-       } else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
-               hsw_enable_pc8(dev_priv);
-       } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
+       intel_display_power_suspend(dev_priv);
+       if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
                ret = vlv_suspend_complete(dev_priv);
-       }
  
        if (ret) {
                DRM_ERROR("Runtime suspend failed, disabling it (%d)\n", ret);
  
                intel_runtime_pm_enable_interrupts(dev_priv);
  
-               intel_uc_resume(dev_priv);
+               intel_gt_runtime_resume(&dev_priv->gt);
  
-               i915_gem_init_swizzling(dev_priv);
                i915_gem_restore_fences(dev_priv);
  
                enable_rpm_wakeref_asserts(rpm);
        }
  
        enable_rpm_wakeref_asserts(rpm);
-       intel_runtime_pm_cleanup(rpm);
+       intel_runtime_pm_driver_release(rpm);
  
        if (intel_uncore_arm_unclaimed_mmio_detection(&dev_priv->uncore))
                DRM_ERROR("Unclaimed access detected prior to suspending\n");
  
  static int intel_runtime_resume(struct device *kdev)
  {
-       struct pci_dev *pdev = to_pci_dev(kdev);
-       struct drm_device *dev = pci_get_drvdata(pdev);
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
        struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
        int ret = 0;
  
        if (intel_uncore_unclaimed_mmio(&dev_priv->uncore))
                DRM_DEBUG_DRIVER("Unclaimed access during suspend, bios?\n");
  
-       if (INTEL_GEN(dev_priv) >= 11) {
-               bxt_disable_dc9(dev_priv);
-               icl_display_core_init(dev_priv, true);
-               if (dev_priv->csr.dmc_payload) {
-                       if (dev_priv->csr.allowed_dc_mask &
-                           DC_STATE_EN_UPTO_DC6)
-                               skl_enable_dc6(dev_priv);
-                       else if (dev_priv->csr.allowed_dc_mask &
-                                DC_STATE_EN_UPTO_DC5)
-                               gen9_enable_dc5(dev_priv);
-               }
-       } else if (IS_GEN9_LP(dev_priv)) {
-               bxt_disable_dc9(dev_priv);
-               bxt_display_core_init(dev_priv, true);
-               if (dev_priv->csr.dmc_payload &&
-                   (dev_priv->csr.allowed_dc_mask & DC_STATE_EN_UPTO_DC5))
-                       gen9_enable_dc5(dev_priv);
-       } else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
-               hsw_disable_pc8(dev_priv);
-       } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
+       intel_display_power_resume(dev_priv);
+       if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
                ret = vlv_resume_prepare(dev_priv, true);
-       }
  
        intel_uncore_runtime_resume(&dev_priv->uncore);
  
        intel_runtime_pm_enable_interrupts(dev_priv);
  
-       intel_uc_resume(dev_priv);
        /*
         * No point of rolling back things in case of an error, as the best
         * we can do is to hope that things will still work (and disable RPM).
         */
-       i915_gem_init_swizzling(dev_priv);
+       intel_gt_runtime_resume(&dev_priv->gt);
        i915_gem_restore_fences(dev_priv);
  
        /*
@@@ -3194,9 -2838,9 +2844,9 @@@ static const struct drm_ioctl_desc i915
        DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_GETPARAM, i915_gem_context_getparam_ioctl, DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_SETPARAM, i915_gem_context_setparam_ioctl, DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(I915_PERF_OPEN, i915_perf_open_ioctl, DRM_RENDER_ALLOW),
-       DRM_IOCTL_DEF_DRV(I915_PERF_ADD_CONFIG, i915_perf_add_config_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
-       DRM_IOCTL_DEF_DRV(I915_PERF_REMOVE_CONFIG, i915_perf_remove_config_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
-       DRM_IOCTL_DEF_DRV(I915_QUERY, i915_query_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(I915_PERF_ADD_CONFIG, i915_perf_add_config_ioctl, DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(I915_PERF_REMOVE_CONFIG, i915_perf_remove_config_ioctl, DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(I915_QUERY, i915_query_ioctl, DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(I915_GEM_VM_CREATE, i915_gem_vm_create_ioctl, DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(I915_GEM_VM_DESTROY, i915_gem_vm_destroy_ioctl, DRM_RENDER_ALLOW),
  };
@@@ -3206,7 -2850,7 +2856,7 @@@ static struct drm_driver driver = 
         * deal with them for Intel hardware.
         */
        .driver_features =
-           DRIVER_GEM | DRIVER_PRIME |
+           DRIVER_GEM |
            DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_SYNCOBJ,
        .release = i915_driver_release,
        .open = i915_driver_open,
        .gem_prime_export = i915_gem_prime_export,
        .gem_prime_import = i915_gem_prime_import,
  
+       .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
+       .get_scanout_position = i915_get_crtc_scanoutpos,
        .dumb_create = i915_gem_dumb_create,
        .dumb_map_offset = i915_gem_mmap_gtt,
        .ioctls = i915_ioctls,
index 6381652a8829127800300e16a118400c3535029b,ce1fae3a78a9c2d9a456207b8b7d525336f65f30..2e2ed653e9c6b452e281ea4625fe56863ee7f7d1
@@@ -166,6 -166,8 +166,8 @@@ struct ingenic_drm 
  
        struct ingenic_dma_hwdesc *dma_hwdesc;
        dma_addr_t dma_hwdesc_phys;
+       bool panel_is_sharp;
  };
  
  static const u32 ingenic_drm_primary_formats[] = {
@@@ -283,6 -285,13 +285,13 @@@ static void ingenic_drm_crtc_update_tim
        regmap_write(priv->map, JZ_REG_LCD_DAV,
                     vds << JZ_LCD_DAV_VDS_OFFSET |
                     vde << JZ_LCD_DAV_VDE_OFFSET);
+       if (priv->panel_is_sharp) {
+               regmap_write(priv->map, JZ_REG_LCD_PS, hde << 16 | (hde + 1));
+               regmap_write(priv->map, JZ_REG_LCD_CLS, hde << 16 | (hde + 1));
+               regmap_write(priv->map, JZ_REG_LCD_SPL, hpe << 16 | (hpe + 1));
+               regmap_write(priv->map, JZ_REG_LCD_REV, mode->htotal << 16);
+       }
  }
  
  static void ingenic_drm_crtc_update_ctrl(struct ingenic_drm *priv,
@@@ -378,11 -387,18 +387,18 @@@ static void ingenic_drm_encoder_atomic_
  {
        struct ingenic_drm *priv = drm_encoder_get_priv(encoder);
        struct drm_display_mode *mode = &crtc_state->adjusted_mode;
-       struct drm_display_info *info = &conn_state->connector->display_info;
-       unsigned int cfg = JZ_LCD_CFG_PS_DISABLE
-                        | JZ_LCD_CFG_CLS_DISABLE
-                        | JZ_LCD_CFG_SPL_DISABLE
-                        | JZ_LCD_CFG_REV_DISABLE;
+       struct drm_connector *conn = conn_state->connector;
+       struct drm_display_info *info = &conn->display_info;
+       unsigned int cfg;
+       priv->panel_is_sharp = info->bus_flags & DRM_BUS_FLAG_SHARP_SIGNALS;
+       if (priv->panel_is_sharp) {
+               cfg = JZ_LCD_CFG_MODE_SPECIAL_TFT_1 | JZ_LCD_CFG_REV_POLARITY;
+       } else {
+               cfg = JZ_LCD_CFG_PS_DISABLE | JZ_LCD_CFG_CLS_DISABLE
+                   | JZ_LCD_CFG_SPL_DISABLE | JZ_LCD_CFG_REV_DISABLE;
+       }
  
        if (mode->flags & DRM_MODE_FLAG_NHSYNC)
                cfg |= JZ_LCD_CFG_HSYNC_ACTIVE_LOW;
        if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
                cfg |= JZ_LCD_CFG_PCLK_FALLING_EDGE;
  
-       if (conn_state->connector->connector_type == DRM_MODE_CONNECTOR_TV) {
-               if (mode->flags & DRM_MODE_FLAG_INTERLACE)
-                       cfg |= JZ_LCD_CFG_MODE_TV_OUT_I;
-               else
-                       cfg |= JZ_LCD_CFG_MODE_TV_OUT_P;
-       } else {
-               switch (*info->bus_formats) {
-               case MEDIA_BUS_FMT_RGB565_1X16:
-                       cfg |= JZ_LCD_CFG_MODE_GENERIC_16BIT;
-                       break;
-               case MEDIA_BUS_FMT_RGB666_1X18:
-                       cfg |= JZ_LCD_CFG_MODE_GENERIC_18BIT;
-                       break;
-               case MEDIA_BUS_FMT_RGB888_1X24:
-                       cfg |= JZ_LCD_CFG_MODE_GENERIC_24BIT;
-                       break;
-               default:
-                       break;
+       if (!priv->panel_is_sharp) {
+               if (conn->connector_type == DRM_MODE_CONNECTOR_TV) {
+                       if (mode->flags & DRM_MODE_FLAG_INTERLACE)
+                               cfg |= JZ_LCD_CFG_MODE_TV_OUT_I;
+                       else
+                               cfg |= JZ_LCD_CFG_MODE_TV_OUT_P;
+               } else {
+                       switch (*info->bus_formats) {
+                       case MEDIA_BUS_FMT_RGB565_1X16:
+                               cfg |= JZ_LCD_CFG_MODE_GENERIC_16BIT;
+                               break;
+                       case MEDIA_BUS_FMT_RGB666_1X18:
+                               cfg |= JZ_LCD_CFG_MODE_GENERIC_18BIT;
+                               break;
+                       case MEDIA_BUS_FMT_RGB888_1X24:
+                               cfg |= JZ_LCD_CFG_MODE_GENERIC_24BIT;
+                               break;
+                       case MEDIA_BUS_FMT_RGB888_3X8:
+                               cfg |= JZ_LCD_CFG_MODE_8BIT_SERIAL;
+                               break;
+                       default:
+                               break;
+                       }
                }
        }
  
@@@ -433,6 -454,7 +454,7 @@@ static int ingenic_drm_encoder_atomic_c
        case MEDIA_BUS_FMT_RGB565_1X16:
        case MEDIA_BUS_FMT_RGB666_1X18:
        case MEDIA_BUS_FMT_RGB888_1X24:
+       case MEDIA_BUS_FMT_RGB888_3X8:
                return 0;
        default:
                return -EINVAL;
@@@ -484,8 -506,7 +506,7 @@@ static void ingenic_drm_disable_vblank(
  DEFINE_DRM_GEM_CMA_FOPS(ingenic_drm_fops);
  
  static struct drm_driver ingenic_drm_driver_data = {
-       .driver_features        = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
-                               | DRIVER_ATOMIC,
+       .driver_features        = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
        .name                   = "ingenic-drm",
        .desc                   = "DRM module for Ingenic SoCs",
        .date                   = "20190422",
@@@ -581,7 -602,6 +602,6 @@@ static int ingenic_drm_probe(struct pla
        struct drm_bridge *bridge;
        struct drm_panel *panel;
        struct drm_device *drm;
-       struct resource *mem;
        void __iomem *base;
        long parent_rate;
        int ret, irq;
        drm->mode_config.max_height = 600;
        drm->mode_config.funcs = &ingenic_drm_mode_config_funcs;
  
-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(dev, mem);
+       base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base)) {
                dev_err(dev, "Failed to get memory resource");
                return PTR_ERR(base);
                return ret;
        }
  
 -      if (panel) {
 +      if (panel)
                bridge = devm_drm_panel_bridge_add(dev, panel,
 -                                                 DRM_MODE_CONNECTOR_Unknown);
 -      }
 +                                                 DRM_MODE_CONNECTOR_DPI);
  
        priv->dma_hwdesc = dma_alloc_coherent(dev, sizeof(*priv->dma_hwdesc),
                                              &priv->dma_hwdesc_phys,
index b609dc030d6ca906f61ffd8bba47dce8bf1e644d,ff3d9acc24fcf145d35621e620afefda9a30f98b..4da21353c3a20b5379a6e4ef74915538b5f351fe
@@@ -24,7 -24,7 +24,7 @@@ int lima_gem_create_handle(struct drm_d
        struct lima_bo *bo;
        struct lima_device *ldev = to_lima_dev(dev);
  
-       bo = lima_bo_create(ldev, size, flags, NULL, NULL);
+       bo = lima_bo_create(ldev, size, flags, NULL);
        if (IS_ERR(bo))
                return PTR_ERR(bo);
  
@@@ -136,7 -136,7 +136,7 @@@ static int lima_gem_sync_bo(struct lima
        int err = 0;
  
        if (!write) {
-               err = reservation_object_reserve_shared(bo->gem.resv, 1);
+               err = dma_resv_reserve_shared(bo->gem.resv, 1);
                if (err)
                        return err;
        }
@@@ -296,9 -296,9 +296,9 @@@ int lima_gem_submit(struct drm_file *fi
  
        for (i = 0; i < submit->nr_bos; i++) {
                if (submit->bos[i].flags & LIMA_SUBMIT_BO_WRITE)
-                       reservation_object_add_excl_fence(bos[i]->gem.resv, fence);
+                       dma_resv_add_excl_fence(bos[i]->gem.resv, fence);
                else
-                       reservation_object_add_shared_fence(bos[i]->gem.resv, fence);
+                       dma_resv_add_shared_fence(bos[i]->gem.resv, fence);
        }
  
        lima_gem_unlock_bos(bos, submit->nr_bos, &ctx);
@@@ -341,8 -341,8 +341,8 @@@ int lima_gem_wait(struct drm_file *file
  
        timeout = drm_timeout_abs_to_jiffies(timeout_ns);
  
-       ret = drm_gem_reservation_object_wait(file, handle, write, timeout);
+       ret = drm_gem_dma_resv_wait(file, handle, write, timeout);
 -      if (ret == 0)
 +      if (ret == -ETIME)
                ret = timeout ? -ETIMEDOUT : -EBUSY;
  
        return ret;
index c07abf9e201c13f9d0cbde32cac402997e03e722,982fe8485a617ad4bb4cd66c39c34f61ed07c83e..9a09eba5318273611fb7a6f0f63bd5b0ae190f66
@@@ -237,7 -237,7 +237,7 @@@ DEFINE_DRM_GEM_CMA_FOPS(drm_fops)
  
  static struct drm_driver mcde_drm_driver = {
        .driver_features =
-               DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_ATOMIC,
+               DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
        .release = mcde_release,
        .lastclose = drm_fb_helper_lastclose,
        .ioctls = NULL,
  
        .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-       .gem_prime_import = drm_gem_prime_import,
-       .gem_prime_export = drm_gem_prime_export,
        .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
        .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
        .gem_prime_vmap = drm_gem_cma_prime_vmap,
@@@ -319,7 -317,7 +317,7 @@@ static int mcde_probe(struct platform_d
        struct device *dev = &pdev->dev;
        struct drm_device *drm;
        struct mcde *mcde;
-       struct component_match *match;
+       struct component_match *match = NULL;
        struct resource *res;
        u32 pid;
        u32 val;
                struct device_driver *drv = &mcde_component_drivers[i]->driver;
                struct device *p = NULL, *d;
  
 -              while ((d = bus_find_device(&platform_bus_type, p, drv,
 -                                          (void *)platform_bus_type.match))) {
 +              while ((d = platform_find_device_by_driver(p, drv))) {
                        put_device(p);
                        component_match_add(dev, &match, mcde_compare_dev, d);
                        p = d;
                }
                put_device(p);
        }
+       if (!match) {
+               dev_err(dev, "no matching components\n");
+               return -ENODEV;
+       }
        if (IS_ERR(match)) {
                dev_err(dev, "could not create component match\n");
                ret = PTR_ERR(match);
index 945bc20f1d33f0d5aada0a7d9d7c0e52fb15c28a,2ee809a6f3dc12f0fa984b2e4030e59b87fefaaa..352b81a7a67020b87465d47ddbe516df04fb91d0
@@@ -4,23 -4,26 +4,27 @@@
   * Author: YT SHEN <[email protected]>
   */
  
- #include <drm/drmP.h>
+ #include <linux/component.h>
+ #include <linux/iommu.h>
+ #include <linux/module.h>
+ #include <linux/of_address.h>
+ #include <linux/of_platform.h>
+ #include <linux/pm_runtime.h>
++#include <linux/dma-mapping.h>
  #include <drm/drm_atomic.h>
  #include <drm/drm_atomic_helper.h>
+ #include <drm/drm_drv.h>
  #include <drm/drm_fb_helper.h>
  #include <drm/drm_gem.h>
  #include <drm/drm_gem_cma_helper.h>
  #include <drm/drm_of.h>
  #include <drm/drm_probe_helper.h>
- #include <linux/component.h>
- #include <linux/iommu.h>
- #include <linux/of_address.h>
- #include <linux/of_platform.h>
- #include <linux/pm_runtime.h>
- #include <linux/dma-mapping.h>
+ #include <drm/drm_vblank.h>
  
  #include "mtk_drm_crtc.h"
  #include "mtk_drm_ddp.h"
+ #include "mtk_drm_ddp.h"
  #include "mtk_drm_ddp_comp.h"
  #include "mtk_drm_drv.h"
  #include "mtk_drm_fb.h"
@@@ -39,22 -42,12 +43,12 @@@ static void mtk_atomic_schedule(struct 
        schedule_work(&private->commit.work);
  }
  
- static void mtk_atomic_wait_for_fences(struct drm_atomic_state *state)
- {
-       struct drm_plane *plane;
-       struct drm_plane_state *new_plane_state;
-       int i;
-       for_each_new_plane_in_state(state, plane, new_plane_state, i)
-               mtk_fb_wait(new_plane_state->fb);
- }
  static void mtk_atomic_complete(struct mtk_drm_private *private,
                                struct drm_atomic_state *state)
  {
        struct drm_device *drm = private->drm;
  
-       mtk_atomic_wait_for_fences(state);
+       drm_atomic_helper_wait_for_fences(drm, state, false);
  
        /*
         * Mediatek drm supports runtime PM, so plane registers cannot be
@@@ -214,7 -207,6 +208,7 @@@ static int mtk_drm_kms_init(struct drm_
        struct mtk_drm_private *private = drm->dev_private;
        struct platform_device *pdev;
        struct device_node *np;
 +      struct device *dma_dev;
        int ret;
  
        if (!iommu_present(&platform_bus_type))
                goto err_component_unbind;
        }
  
 -      private->dma_dev = &pdev->dev;
 +      dma_dev = &pdev->dev;
 +      private->dma_dev = dma_dev;
 +
 +      /*
 +       * Configure the DMA segment size to make sure we get contiguous IOVA
 +       * when importing PRIME buffers.
 +       */
 +      if (!dma_dev->dma_parms) {
 +              private->dma_parms_allocated = true;
 +              dma_dev->dma_parms =
 +                      devm_kzalloc(drm->dev, sizeof(*dma_dev->dma_parms),
 +                                   GFP_KERNEL);
 +      }
 +      if (!dma_dev->dma_parms) {
 +              ret = -ENOMEM;
 +              goto err_component_unbind;
 +      }
 +
 +      ret = dma_set_max_seg_size(dma_dev, (unsigned int)DMA_BIT_MASK(32));
 +      if (ret) {
 +              dev_err(dma_dev, "Failed to set DMA segment size\n");
 +              goto err_unset_dma_parms;
 +      }
  
        /*
         * We don't use the drm_irq_install() helpers provided by the DRM
        drm->irq_enabled = true;
        ret = drm_vblank_init(drm, MAX_CRTC);
        if (ret < 0)
 -              goto err_component_unbind;
 +              goto err_unset_dma_parms;
  
        drm_kms_helper_poll_init(drm);
        drm_mode_config_reset(drm);
  
        return 0;
  
 +err_unset_dma_parms:
 +      if (private->dma_parms_allocated)
 +              dma_dev->dma_parms = NULL;
  err_component_unbind:
        component_unbind_all(drm->dev, drm);
  err_config_cleanup:
  
  static void mtk_drm_kms_deinit(struct drm_device *drm)
  {
 +      struct mtk_drm_private *private = drm->dev_private;
 +
        drm_kms_helper_poll_fini(drm);
        drm_atomic_helper_shutdown(drm);
  
 +      if (private->dma_parms_allocated)
 +              private->dma_dev->dma_parms = NULL;
 +
        component_unbind_all(drm->dev, drm);
        drm_mode_config_cleanup(drm);
  }
@@@ -352,21 -314,8 +346,20 @@@ static const struct file_operations mtk
        .compat_ioctl = drm_compat_ioctl,
  };
  
 +/*
 + * We need to override this because the device used to import the memory is
 + * not dev->dev, as drm_gem_prime_import() expects.
 + */
 +struct drm_gem_object *mtk_drm_gem_prime_import(struct drm_device *dev,
 +                                              struct dma_buf *dma_buf)
 +{
 +      struct mtk_drm_private *private = dev->dev_private;
 +
 +      return drm_gem_prime_import_dev(dev, dma_buf, private->dma_dev);
 +}
 +
  static struct drm_driver mtk_drm_driver = {
-       .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
-                          DRIVER_ATOMIC,
+       .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
  
        .gem_free_object_unlocked = mtk_drm_gem_free_object,
        .gem_vm_ops = &drm_gem_cma_vm_ops,
  
        .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-       .gem_prime_export = drm_gem_prime_export,
 +      .gem_prime_import = mtk_drm_gem_prime_import,
        .gem_prime_get_sg_table = mtk_gem_prime_get_sg_table,
        .gem_prime_import_sg_table = mtk_gem_prime_import_sg_table,
        .gem_prime_mmap = mtk_drm_gem_mmap_buf,
@@@ -568,15 -515,12 +560,15 @@@ static int mtk_drm_probe(struct platfor
                        comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL);
                        if (!comp) {
                                ret = -ENOMEM;
 +                              of_node_put(node);
                                goto err_node;
                        }
  
                        ret = mtk_ddp_comp_init(dev, node, comp, comp_id, NULL);
 -                      if (ret)
 +                      if (ret) {
 +                              of_node_put(node);
                                goto err_node;
 +                      }
  
                        private->ddp_comp[comp_id] = comp;
                }
index 5c36c75232e6d0364f4d90419b7a7010da8985e9,064a69d161e3d2a855d20de5914a204bb20c0908..b46be8a091e99cfc77009bc850bea8ecceaa993c
  #include <linux/dma-mapping.h>
  #include <linux/hdmi.h>
  
- #include <drm/drmP.h>
  #include <drm/drm_atomic_helper.h>
  #include <drm/drm_dp_helper.h>
+ #include <drm/drm_edid.h>
  #include <drm/drm_fb_helper.h>
  #include <drm/drm_plane_helper.h>
  #include <drm/drm_probe_helper.h>
  #include <drm/drm_scdc_helper.h>
- #include <drm/drm_edid.h>
+ #include <drm/drm_vblank.h>
  
  #include <nvif/class.h>
  #include <nvif/cl0002.h>
@@@ -771,20 -771,16 +771,20 @@@ nv50_msto_atomic_check(struct drm_encod
        struct nv50_head_atom *asyh = nv50_head_atom(crtc_state);
        int slots;
  
 -      /* When restoring duplicated states, we need to make sure that the
 -       * bw remains the same and avoid recalculating it, as the connector's
 -       * bpc may have changed after the state was duplicated
 -       */
 -      if (!state->duplicated)
 -              asyh->dp.pbn =
 -                      drm_dp_calc_pbn_mode(crtc_state->adjusted_mode.clock,
 -                                           connector->display_info.bpc * 3);
 +      if (crtc_state->mode_changed || crtc_state->connectors_changed) {
 +              /*
 +               * When restoring duplicated states, we need to make sure that
 +               * the bw remains the same and avoid recalculating it, as the
 +               * connector's bpc may have changed after the state was
 +               * duplicated
 +               */
 +              if (!state->duplicated) {
 +                      const int bpp = connector->display_info.bpc * 3;
 +                      const int clock = crtc_state->adjusted_mode.clock;
 +
 +                      asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, bpp);
 +              }
  
 -      if (crtc_state->mode_changed) {
                slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr,
                                                      mstc->port,
                                                      asyh->dp.pbn);
@@@ -1603,7 -1599,8 +1603,8 @@@ nv50_sor_create(struct drm_connector *c
                        nv_encoder->aux = aux;
                }
  
-               if ((data = nvbios_dp_table(bios, &ver, &hdr, &cnt, &len)) &&
+               if (nv_connector->type != DCB_CONNECTOR_eDP &&
+                   (data = nvbios_dp_table(bios, &ver, &hdr, &cnt, &len)) &&
                    ver >= 0x40 && (nvbios_rd08(bios, data + 0x08) & 0x04)) {
                        ret = nv50_mstm_new(nv_encoder, &nv_connector->aux, 16,
                                            nv_connector->base.base.id,
@@@ -1830,8 -1827,11 +1831,11 @@@ nv50_disp_atomic_commit_tail(struct drm
  
                NV_ATOMIC(drm, "%s: clr %04x (set %04x)\n", crtc->name,
                          asyh->clr.mask, asyh->set.mask);
-               if (old_crtc_state->active && !new_crtc_state->active)
+               if (old_crtc_state->active && !new_crtc_state->active) {
+                       pm_runtime_put_noidle(dev->dev);
                        drm_crtc_vblank_off(crtc);
+               }
  
                if (asyh->clr.mask) {
                        nv50_head_flush_clr(head, asyh, atom->flush_disable);
                }
  
                if (new_crtc_state->active) {
-                       if (!old_crtc_state->active)
+                       if (!old_crtc_state->active) {
                                drm_crtc_vblank_on(crtc);
+                               pm_runtime_get_noresume(dev->dev);
+                       }
                        if (new_crtc_state->event)
                                drm_crtc_vblank_get(crtc);
                }
        drm_atomic_helper_cleanup_planes(dev, state);
        drm_atomic_helper_commit_cleanup_done(state);
        drm_atomic_state_put(state);
+       /* Drop the RPM ref we got from nv50_disp_atomic_commit() */
+       pm_runtime_mark_last_busy(dev->dev);
+       pm_runtime_put_autosuspend(dev->dev);
  }
  
  static void
@@@ -1997,11 -2003,8 +2007,8 @@@ static in
  nv50_disp_atomic_commit(struct drm_device *dev,
                        struct drm_atomic_state *state, bool nonblock)
  {
-       struct nouveau_drm *drm = nouveau_drm(dev);
        struct drm_plane_state *new_plane_state;
        struct drm_plane *plane;
-       struct drm_crtc *crtc;
-       bool active = false;
        int ret, i;
  
        ret = pm_runtime_get_sync(dev->dev);
  
        drm_atomic_state_get(state);
  
+       /*
+        * Grab another RPM ref for the commit tail, which will release the
+        * ref when it's finished
+        */
+       pm_runtime_get_noresume(dev->dev);
        if (nonblock)
                queue_work(system_unbound_wq, &state->commit_work);
        else
                nv50_disp_atomic_commit_tail(state);
  
-       drm_for_each_crtc(crtc, dev) {
-               if (crtc->state->active) {
-                       if (!drm->have_disp_power_ref) {
-                               drm->have_disp_power_ref = true;
-                               return 0;
-                       }
-                       active = true;
-                       break;
-               }
-       }
-       if (!active && drm->have_disp_power_ref) {
-               pm_runtime_put_autosuspend(dev->dev);
-               drm->have_disp_power_ref = false;
-       }
  err_cleanup:
        if (ret)
                drm_atomic_helper_cleanup_planes(dev, state);
@@@ -2320,6 -2313,7 +2317,7 @@@ nv50_display_create(struct drm_device *
        disp->disp = &nouveau_display(dev)->disp;
        dev->mode_config.funcs = &nv50_disp_func;
        dev->mode_config.quirk_addfb_prefer_xbgr_30bpp = true;
+       dev->mode_config.normalize_zpos = true;
  
        /* small shared memory area we use for notifiers and semaphores */
        ret = nouveau_bo_new(&drm->client, 4096, 0x1000, TTM_PL_FLAG_VRAM,
index 1bad0a2cc5c6362045c29439bc2a3e2cf9d9ccc1,9f652d2e7af1d0637a481a0bb9e6bbedc5689957..2983c003698ec9b59d6fb772ad2264b21c55b951
@@@ -4,15 -4,21 +4,21 @@@
   * Author: Rob Clark <[email protected]>
   */
  
- #include <linux/of.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/platform_device.h>
  #include <linux/sort.h>
  #include <linux/sys_soc.h>
  
  #include <drm/drm_atomic.h>
  #include <drm/drm_atomic_helper.h>
+ #include <drm/drm_drv.h>
  #include <drm/drm_fb_helper.h>
- #include <drm/drm_probe_helper.h>
+ #include <drm/drm_file.h>
+ #include <drm/drm_ioctl.h>
  #include <drm/drm_panel.h>
+ #include <drm/drm_prime.h>
+ #include <drm/drm_probe_helper.h>
+ #include <drm/drm_vblank.h>
  
  #include "omap_dmm_tiler.h"
  #include "omap_drv.h"
@@@ -466,19 -472,19 +472,19 @@@ static int ioctl_gem_info(struct drm_de
  
  static const struct drm_ioctl_desc ioctls[DRM_COMMAND_END - DRM_COMMAND_BASE] = {
        DRM_IOCTL_DEF_DRV(OMAP_GET_PARAM, ioctl_get_param,
-                         DRM_AUTH | DRM_RENDER_ALLOW),
+                         DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(OMAP_SET_PARAM, drm_invalid_op,
                          DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY),
        DRM_IOCTL_DEF_DRV(OMAP_GEM_NEW, ioctl_gem_new,
-                         DRM_AUTH | DRM_RENDER_ALLOW),
+                         DRM_RENDER_ALLOW),
        /* Deprecated, to be removed. */
        DRM_IOCTL_DEF_DRV(OMAP_GEM_CPU_PREP, drm_noop,
-                         DRM_AUTH | DRM_RENDER_ALLOW),
+                         DRM_RENDER_ALLOW),
        /* Deprecated, to be removed. */
        DRM_IOCTL_DEF_DRV(OMAP_GEM_CPU_FINI, drm_noop,
-                         DRM_AUTH | DRM_RENDER_ALLOW),
+                         DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(OMAP_GEM_INFO, ioctl_gem_info,
-                         DRM_AUTH | DRM_RENDER_ALLOW),
+                         DRM_RENDER_ALLOW),
  };
  
  /*
@@@ -513,7 -519,7 +519,7 @@@ static const struct file_operations oma
  };
  
  static struct drm_driver omap_drm_driver = {
-       .driver_features = DRIVER_MODESET | DRIVER_GEM  | DRIVER_PRIME |
+       .driver_features = DRIVER_MODESET | DRIVER_GEM  |
                DRIVER_ATOMIC | DRIVER_RENDER,
        .open = dev_open,
        .lastclose = drm_fb_helper_lastclose,
@@@ -669,7 -675,7 +675,7 @@@ static int pdev_probe(struct platform_d
        if (omapdss_is_initialized() == false)
                return -EPROBE_DEFER;
  
 -      ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
 +      ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
        if (ret) {
                dev_err(&pdev->dev, "Failed to set the DMA mask\n");
                return ret;
index 6e8145c36e933fc97dbf01214c8c93d9a4f10576,387d830cb7cf83b1d5c047dea1b62183b955bef9..6010f9ee7c1fd95487c74561d2d52501bae9c8ae
@@@ -1,7 -1,9 +1,9 @@@
  // SPDX-License-Identifier:   GPL-2.0
  /* Copyright 2019 Linaro, Ltd, Rob Herring <[email protected]> */
+ #include <linux/atomic.h>
  #include <linux/bitfield.h>
  #include <linux/delay.h>
+ #include <linux/dma-mapping.h>
  #include <linux/interrupt.h>
  #include <linux/io.h>
  #include <linux/iopoll.h>
@@@ -9,6 -11,7 +11,7 @@@
  #include <linux/iommu.h>
  #include <linux/platform_device.h>
  #include <linux/pm_runtime.h>
+ #include <linux/shmem_fs.h>
  #include <linux/sizes.h>
  
  #include "panfrost_device.h"
  #define mmu_write(dev, reg, data) writel(data, dev->iomem + reg)
  #define mmu_read(dev, reg) readl(dev->iomem + reg)
  
- struct panfrost_mmu {
-       struct io_pgtable_cfg pgtbl_cfg;
-       struct io_pgtable_ops *pgtbl_ops;
-       struct mutex lock;
- };
  static int wait_ready(struct panfrost_device *pfdev, u32 as_nr)
  {
        int ret;
@@@ -83,13 -80,11 +80,11 @@@ static void lock_region(struct panfrost
  }
  
  
- static int mmu_hw_do_operation(struct panfrost_device *pfdev, u32 as_nr,
-               u64 iova, size_t size, u32 op)
+ static int mmu_hw_do_operation_locked(struct panfrost_device *pfdev, int as_nr,
+                                     u64 iova, size_t size, u32 op)
  {
-       unsigned long flags;
-       int ret;
-       spin_lock_irqsave(&pfdev->hwaccess_lock, flags);
+       if (as_nr < 0)
+               return 0;
  
        if (op != AS_COMMAND_UNLOCK)
                lock_region(pfdev, as_nr, iova, size);
        write_cmd(pfdev, as_nr, op);
  
        /* Wait for the flush to complete */
-       ret = wait_ready(pfdev, as_nr);
+       return wait_ready(pfdev, as_nr);
+ }
  
-       spin_unlock_irqrestore(&pfdev->hwaccess_lock, flags);
+ static int mmu_hw_do_operation(struct panfrost_device *pfdev,
+                              struct panfrost_mmu *mmu,
+                              u64 iova, size_t size, u32 op)
+ {
+       int ret;
  
+       spin_lock(&pfdev->as_lock);
+       ret = mmu_hw_do_operation_locked(pfdev, mmu->as, iova, size, op);
+       spin_unlock(&pfdev->as_lock);
        return ret;
  }
  
void panfrost_mmu_enable(struct panfrost_device *pfdev, u32 as_nr)
static void panfrost_mmu_enable(struct panfrost_device *pfdev, struct panfrost_mmu *mmu)
  {
-       struct io_pgtable_cfg *cfg = &pfdev->mmu->pgtbl_cfg;
+       int as_nr = mmu->as;
+       struct io_pgtable_cfg *cfg = &mmu->pgtbl_cfg;
        u64 transtab = cfg->arm_mali_lpae_cfg.transtab;
        u64 memattr = cfg->arm_mali_lpae_cfg.memattr;
  
-       mmu_write(pfdev, MMU_INT_CLEAR, ~0);
-       mmu_write(pfdev, MMU_INT_MASK, ~0);
+       mmu_hw_do_operation_locked(pfdev, as_nr, 0, ~0UL, AS_COMMAND_FLUSH_MEM);
  
        mmu_write(pfdev, AS_TRANSTAB_LO(as_nr), transtab & 0xffffffffUL);
        mmu_write(pfdev, AS_TRANSTAB_HI(as_nr), transtab >> 32);
        write_cmd(pfdev, as_nr, AS_COMMAND_UPDATE);
  }
  
- static void mmu_disable(struct panfrost_device *pfdev, u32 as_nr)
+ static void panfrost_mmu_disable(struct panfrost_device *pfdev, u32 as_nr)
  {
+       mmu_hw_do_operation_locked(pfdev, as_nr, 0, ~0UL, AS_COMMAND_FLUSH_MEM);
        mmu_write(pfdev, AS_TRANSTAB_LO(as_nr), 0);
        mmu_write(pfdev, AS_TRANSTAB_HI(as_nr), 0);
  
        write_cmd(pfdev, as_nr, AS_COMMAND_UPDATE);
  }
  
+ u32 panfrost_mmu_as_get(struct panfrost_device *pfdev, struct panfrost_mmu *mmu)
+ {
+       int as;
+       spin_lock(&pfdev->as_lock);
+       as = mmu->as;
+       if (as >= 0) {
+               int en = atomic_inc_return(&mmu->as_count);
+               WARN_ON(en >= NUM_JOB_SLOTS);
+               list_move(&mmu->list, &pfdev->as_lru_list);
+               goto out;
+       }
+       /* Check for a free AS */
+       as = ffz(pfdev->as_alloc_mask);
+       if (!(BIT(as) & pfdev->features.as_present)) {
+               struct panfrost_mmu *lru_mmu;
+               list_for_each_entry_reverse(lru_mmu, &pfdev->as_lru_list, list) {
+                       if (!atomic_read(&lru_mmu->as_count))
+                               break;
+               }
+               WARN_ON(&lru_mmu->list == &pfdev->as_lru_list);
+               list_del_init(&lru_mmu->list);
+               as = lru_mmu->as;
+               WARN_ON(as < 0);
+               lru_mmu->as = -1;
+       }
+       /* Assign the free or reclaimed AS to the FD */
+       mmu->as = as;
+       set_bit(as, &pfdev->as_alloc_mask);
+       atomic_set(&mmu->as_count, 1);
+       list_add(&mmu->list, &pfdev->as_lru_list);
+       dev_dbg(pfdev->dev, "Assigned AS%d to mmu %p, alloc_mask=%lx", as, mmu, pfdev->as_alloc_mask);
+       panfrost_mmu_enable(pfdev, mmu);
+ out:
+       spin_unlock(&pfdev->as_lock);
+       return as;
+ }
+ void panfrost_mmu_as_put(struct panfrost_device *pfdev, struct panfrost_mmu *mmu)
+ {
+       atomic_dec(&mmu->as_count);
+       WARN_ON(atomic_read(&mmu->as_count) < 0);
+ }
+ void panfrost_mmu_reset(struct panfrost_device *pfdev)
+ {
+       struct panfrost_mmu *mmu, *mmu_tmp;
+       spin_lock(&pfdev->as_lock);
+       pfdev->as_alloc_mask = 0;
+       list_for_each_entry_safe(mmu, mmu_tmp, &pfdev->as_lru_list, list) {
+               mmu->as = -1;
+               atomic_set(&mmu->as_count, 0);
+               list_del_init(&mmu->list);
+       }
+       spin_unlock(&pfdev->as_lock);
+       mmu_write(pfdev, MMU_INT_CLEAR, ~0);
+       mmu_write(pfdev, MMU_INT_MASK, ~0);
+ }
  static size_t get_pgsize(u64 addr, size_t size)
  {
        if (addr & (SZ_2M - 1) || size < SZ_2M)
        return SZ_2M;
  }
  
- int panfrost_mmu_map(struct panfrost_gem_object *bo)
+ void panfrost_mmu_flush_range(struct panfrost_device *pfdev,
+                             struct panfrost_mmu *mmu,
+                             u64 iova, size_t size)
  {
-       struct drm_gem_object *obj = &bo->base.base;
-       struct panfrost_device *pfdev = to_panfrost_device(obj->dev);
-       struct io_pgtable_ops *ops = pfdev->mmu->pgtbl_ops;
-       u64 iova = bo->node.start << PAGE_SHIFT;
-       unsigned int count;
-       struct scatterlist *sgl;
-       struct sg_table *sgt;
-       int ret;
+       if (mmu->as < 0)
+               return;
  
-       if (WARN_ON(bo->is_mapped))
-               return 0;
+       pm_runtime_get_noresume(pfdev->dev);
  
-       sgt = drm_gem_shmem_get_pages_sgt(obj);
-       if (WARN_ON(IS_ERR(sgt)))
-               return PTR_ERR(sgt);
+       /* Flush the PTs only if we're already awake */
+       if (pm_runtime_active(pfdev->dev))
+               mmu_hw_do_operation(pfdev, mmu, iova, size, AS_COMMAND_FLUSH_PT);
  
-       ret = pm_runtime_get_sync(pfdev->dev);
-       if (ret < 0)
-               return ret;
+       pm_runtime_put_sync_autosuspend(pfdev->dev);
+ }
  
-       mutex_lock(&pfdev->mmu->lock);
+ static int mmu_map_sg(struct panfrost_device *pfdev, struct panfrost_mmu *mmu,
+                     u64 iova, int prot, struct sg_table *sgt)
+ {
+       unsigned int count;
+       struct scatterlist *sgl;
+       struct io_pgtable_ops *ops = mmu->pgtbl_ops;
+       u64 start_iova = iova;
  
        for_each_sg(sgt->sgl, sgl, sgt->nents, count) {
                unsigned long paddr = sg_dma_address(sgl);
                size_t len = sg_dma_len(sgl);
  
-               dev_dbg(pfdev->dev, "map: iova=%llx, paddr=%lx, len=%zx", iova, paddr, len);
+               dev_dbg(pfdev->dev, "map: as=%d, iova=%llx, paddr=%lx, len=%zx", mmu->as, iova, paddr, len);
  
                while (len) {
                        size_t pgsize = get_pgsize(iova | paddr, len);
  
-                       ops->map(ops, iova, paddr, pgsize, IOMMU_WRITE | IOMMU_READ);
+                       ops->map(ops, iova, paddr, pgsize, prot);
                        iova += pgsize;
                        paddr += pgsize;
                        len -= pgsize;
                }
        }
  
-       mmu_hw_do_operation(pfdev, 0, bo->node.start << PAGE_SHIFT,
-                           bo->node.size << PAGE_SHIFT, AS_COMMAND_FLUSH_PT);
+       panfrost_mmu_flush_range(pfdev, mmu, start_iova, iova - start_iova);
+       return 0;
+ }
+ int panfrost_mmu_map(struct panfrost_gem_object *bo)
+ {
+       struct drm_gem_object *obj = &bo->base.base;
+       struct panfrost_device *pfdev = to_panfrost_device(obj->dev);
+       struct sg_table *sgt;
+       int prot = IOMMU_READ | IOMMU_WRITE;
  
-       mutex_unlock(&pfdev->mmu->lock);
+       if (WARN_ON(bo->is_mapped))
+               return 0;
+       if (bo->noexec)
+               prot |= IOMMU_NOEXEC;
  
-       pm_runtime_mark_last_busy(pfdev->dev);
-       pm_runtime_put_autosuspend(pfdev->dev);
+       sgt = drm_gem_shmem_get_pages_sgt(obj);
+       if (WARN_ON(IS_ERR(sgt)))
+               return PTR_ERR(sgt);
+       mmu_map_sg(pfdev, bo->mmu, bo->node.start << PAGE_SHIFT, prot, sgt);
        bo->is_mapped = true;
  
        return 0;
@@@ -201,76 -296,212 +296,220 @@@ void panfrost_mmu_unmap(struct panfrost
  {
        struct drm_gem_object *obj = &bo->base.base;
        struct panfrost_device *pfdev = to_panfrost_device(obj->dev);
-       struct io_pgtable_ops *ops = pfdev->mmu->pgtbl_ops;
+       struct io_pgtable_ops *ops = bo->mmu->pgtbl_ops;
        u64 iova = bo->node.start << PAGE_SHIFT;
        size_t len = bo->node.size << PAGE_SHIFT;
        size_t unmapped_len = 0;
-       int ret;
  
        if (WARN_ON(!bo->is_mapped))
                return;
  
-       dev_dbg(pfdev->dev, "unmap: iova=%llx, len=%zx", iova, len);
-       ret = pm_runtime_get_sync(pfdev->dev);
-       if (ret < 0)
-               return;
-       mutex_lock(&pfdev->mmu->lock);
+       dev_dbg(pfdev->dev, "unmap: as=%d, iova=%llx, len=%zx", bo->mmu->as, iova, len);
  
        while (unmapped_len < len) {
                size_t unmapped_page;
                size_t pgsize = get_pgsize(iova, len - unmapped_len);
  
-               unmapped_page = ops->unmap(ops, iova, pgsize, NULL);
-               if (!unmapped_page)
-                       break;
-               iova += unmapped_page;
-               unmapped_len += unmapped_page;
+               if (ops->iova_to_phys(ops, iova)) {
 -                      unmapped_page = ops->unmap(ops, iova, pgsize);
++                      unmapped_page = ops->unmap(ops, iova, pgsize, NULL);
+                       WARN_ON(unmapped_page != pgsize);
+               }
+               iova += pgsize;
+               unmapped_len += pgsize;
        }
  
-       mmu_hw_do_operation(pfdev, 0, bo->node.start << PAGE_SHIFT,
-                           bo->node.size << PAGE_SHIFT, AS_COMMAND_FLUSH_PT);
-       mutex_unlock(&pfdev->mmu->lock);
-       pm_runtime_mark_last_busy(pfdev->dev);
-       pm_runtime_put_autosuspend(pfdev->dev);
+       panfrost_mmu_flush_range(pfdev, bo->mmu, bo->node.start << PAGE_SHIFT, len);
        bo->is_mapped = false;
  }
  
  static void mmu_tlb_inv_context_s1(void *cookie)
- {
-       struct panfrost_device *pfdev = cookie;
-       mmu_hw_do_operation(pfdev, 0, 0, ~0UL, AS_COMMAND_FLUSH_MEM);
- }
+ {}
  
 -static void mmu_tlb_inv_range_nosync(unsigned long iova, size_t size,
 -                                   size_t granule, bool leaf, void *cookie)
 -{}
 -
  static void mmu_tlb_sync_context(void *cookie)
  {
        //struct panfrost_device *pfdev = cookie;
        // TODO: Wait 1000 GPU cycles for HW_ISSUE_6367/T60X
  }
  
 -static const struct iommu_gather_ops mmu_tlb_ops = {
 +static void mmu_tlb_flush_walk(unsigned long iova, size_t size, size_t granule,
 +                             void *cookie)
 +{
 +      mmu_tlb_sync_context(cookie);
 +}
 +
 +static void mmu_tlb_flush_leaf(unsigned long iova, size_t size, size_t granule,
 +                             void *cookie)
 +{
 +      mmu_tlb_sync_context(cookie);
 +}
 +
 +static const struct iommu_flush_ops mmu_tlb_ops = {
        .tlb_flush_all  = mmu_tlb_inv_context_s1,
 -      .tlb_add_flush  = mmu_tlb_inv_range_nosync,
 -      .tlb_sync       = mmu_tlb_sync_context,
 +      .tlb_flush_walk = mmu_tlb_flush_walk,
 +      .tlb_flush_leaf = mmu_tlb_flush_leaf,
  };
  
+ int panfrost_mmu_pgtable_alloc(struct panfrost_file_priv *priv)
+ {
+       struct panfrost_mmu *mmu = &priv->mmu;
+       struct panfrost_device *pfdev = priv->pfdev;
+       INIT_LIST_HEAD(&mmu->list);
+       mmu->as = -1;
+       mmu->pgtbl_cfg = (struct io_pgtable_cfg) {
+               .pgsize_bitmap  = SZ_4K | SZ_2M,
+               .ias            = FIELD_GET(0xff, pfdev->features.mmu_features),
+               .oas            = FIELD_GET(0xff00, pfdev->features.mmu_features),
+               .tlb            = &mmu_tlb_ops,
+               .iommu_dev      = pfdev->dev,
+       };
+       mmu->pgtbl_ops = alloc_io_pgtable_ops(ARM_MALI_LPAE, &mmu->pgtbl_cfg,
+                                             priv);
+       if (!mmu->pgtbl_ops)
+               return -EINVAL;
+       return 0;
+ }
+ void panfrost_mmu_pgtable_free(struct panfrost_file_priv *priv)
+ {
+       struct panfrost_device *pfdev = priv->pfdev;
+       struct panfrost_mmu *mmu = &priv->mmu;
+       spin_lock(&pfdev->as_lock);
+       if (mmu->as >= 0) {
+               pm_runtime_get_noresume(pfdev->dev);
+               if (pm_runtime_active(pfdev->dev))
+                       panfrost_mmu_disable(pfdev, mmu->as);
+               pm_runtime_put_autosuspend(pfdev->dev);
+               clear_bit(mmu->as, &pfdev->as_alloc_mask);
+               clear_bit(mmu->as, &pfdev->as_in_use_mask);
+               list_del(&mmu->list);
+       }
+       spin_unlock(&pfdev->as_lock);
+       free_io_pgtable_ops(mmu->pgtbl_ops);
+ }
+ static struct drm_mm_node *addr_to_drm_mm_node(struct panfrost_device *pfdev, int as, u64 addr)
+ {
+       struct drm_mm_node *node = NULL;
+       u64 offset = addr >> PAGE_SHIFT;
+       struct panfrost_mmu *mmu;
+       spin_lock(&pfdev->as_lock);
+       list_for_each_entry(mmu, &pfdev->as_lru_list, list) {
+               struct panfrost_file_priv *priv;
+               if (as != mmu->as)
+                       continue;
+               priv = container_of(mmu, struct panfrost_file_priv, mmu);
+               drm_mm_for_each_node(node, &priv->mm) {
+                       if (offset >= node->start && offset < (node->start + node->size))
+                               goto out;
+               }
+       }
+ out:
+       spin_unlock(&pfdev->as_lock);
+       return node;
+ }
+ #define NUM_FAULT_PAGES (SZ_2M / PAGE_SIZE)
+ int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, u64 addr)
+ {
+       int ret, i;
+       struct drm_mm_node *node;
+       struct panfrost_gem_object *bo;
+       struct address_space *mapping;
+       pgoff_t page_offset;
+       struct sg_table *sgt;
+       struct page **pages;
+       node = addr_to_drm_mm_node(pfdev, as, addr);
+       if (!node)
+               return -ENOENT;
+       bo = drm_mm_node_to_panfrost_bo(node);
+       if (!bo->is_heap) {
+               dev_WARN(pfdev->dev, "matching BO is not heap type (GPU VA = %llx)",
+                        node->start << PAGE_SHIFT);
+               return -EINVAL;
+       }
+       WARN_ON(bo->mmu->as != as);
+       /* Assume 2MB alignment and size multiple */
+       addr &= ~((u64)SZ_2M - 1);
+       page_offset = addr >> PAGE_SHIFT;
+       page_offset -= node->start;
+       mutex_lock(&bo->base.pages_lock);
+       if (!bo->base.pages) {
+               bo->sgts = kvmalloc_array(bo->base.base.size / SZ_2M,
+                                    sizeof(struct sg_table), GFP_KERNEL | __GFP_ZERO);
+               if (!bo->sgts) {
+                       mutex_unlock(&bo->base.pages_lock);
+                       return -ENOMEM;
+               }
+               pages = kvmalloc_array(bo->base.base.size >> PAGE_SHIFT,
+                                      sizeof(struct page *), GFP_KERNEL | __GFP_ZERO);
+               if (!pages) {
+                       kfree(bo->sgts);
+                       bo->sgts = NULL;
+                       mutex_unlock(&bo->base.pages_lock);
+                       return -ENOMEM;
+               }
+               bo->base.pages = pages;
+               bo->base.pages_use_count = 1;
+       } else
+               pages = bo->base.pages;
+       mapping = bo->base.base.filp->f_mapping;
+       mapping_set_unevictable(mapping);
+       for (i = page_offset; i < page_offset + NUM_FAULT_PAGES; i++) {
+               pages[i] = shmem_read_mapping_page(mapping, i);
+               if (IS_ERR(pages[i])) {
+                       mutex_unlock(&bo->base.pages_lock);
+                       ret = PTR_ERR(pages[i]);
+                       goto err_pages;
+               }
+       }
+       mutex_unlock(&bo->base.pages_lock);
+       sgt = &bo->sgts[page_offset / (SZ_2M / PAGE_SIZE)];
+       ret = sg_alloc_table_from_pages(sgt, pages + page_offset,
+                                       NUM_FAULT_PAGES, 0, SZ_2M, GFP_KERNEL);
+       if (ret)
+               goto err_pages;
+       if (!dma_map_sg(pfdev->dev, sgt->sgl, sgt->nents, DMA_BIDIRECTIONAL)) {
+               ret = -EINVAL;
+               goto err_map;
+       }
+       mmu_map_sg(pfdev, bo->mmu, addr, IOMMU_WRITE | IOMMU_READ | IOMMU_NOEXEC, sgt);
+       bo->is_mapped = true;
+       dev_dbg(pfdev->dev, "mapped page fault @ AS%d %llx", as, addr);
+       return 0;
+ err_map:
+       sg_free_table(sgt);
+ err_pages:
+       drm_gem_shmem_put_pages(&bo->base);
+       return ret;
+ }
  static const char *access_type_name(struct panfrost_device *pfdev,
                u32 fault_status)
  {
  static irqreturn_t panfrost_mmu_irq_handler(int irq, void *data)
  {
        struct panfrost_device *pfdev = data;
-       u32 status = mmu_read(pfdev, MMU_INT_STAT);
-       int i;
  
-       if (!status)
+       if (!mmu_read(pfdev, MMU_INT_STAT))
                return IRQ_NONE;
  
-       dev_err(pfdev->dev, "mmu irq status=%x\n", status);
+       mmu_write(pfdev, MMU_INT_MASK, 0);
+       return IRQ_WAKE_THREAD;
+ }
+ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
+ {
+       struct panfrost_device *pfdev = data;
+       u32 status = mmu_read(pfdev, MMU_INT_RAWSTAT);
+       int i, ret;
  
        for (i = 0; status; i++) {
                u32 mask = BIT(i) | BIT(i + 16);
                access_type = (fault_status >> 8) & 0x3;
                source_id = (fault_status >> 16);
  
+               /* Page fault only */
+               if ((status & mask) == BIT(i)) {
+                       WARN_ON(exception_type < 0xC1 || exception_type > 0xC4);
+                       ret = panfrost_mmu_map_fault_addr(pfdev, i, addr);
+                       if (!ret) {
+                               mmu_write(pfdev, MMU_INT_CLEAR, BIT(i));
+                               status &= ~mask;
+                               continue;
+                       }
+               }
                /* terminal fault, print info about the fault */
                dev_err(pfdev->dev,
                        "Unhandled Page fault in AS%d at VA 0x%016llX\n"
                status &= ~mask;
        }
  
+       mmu_write(pfdev, MMU_INT_MASK, ~0);
        return IRQ_HANDLED;
  };
  
  int panfrost_mmu_init(struct panfrost_device *pfdev)
  {
-       struct io_pgtable_ops *pgtbl_ops;
        int err, irq;
  
-       pfdev->mmu = devm_kzalloc(pfdev->dev, sizeof(*pfdev->mmu), GFP_KERNEL);
-       if (!pfdev->mmu)
-               return -ENOMEM;
-       mutex_init(&pfdev->mmu->lock);
        irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "mmu");
        if (irq <= 0)
                return -ENODEV;
  
-       err = devm_request_irq(pfdev->dev, irq, panfrost_mmu_irq_handler,
-                              IRQF_SHARED, "mmu", pfdev);
+       err = devm_request_threaded_irq(pfdev->dev, irq, panfrost_mmu_irq_handler,
+                                       panfrost_mmu_irq_handler_thread,
+                                       IRQF_SHARED, "mmu", pfdev);
  
        if (err) {
                dev_err(pfdev->dev, "failed to request mmu irq");
                return err;
        }
-       mmu_write(pfdev, MMU_INT_CLEAR, ~0);
-       mmu_write(pfdev, MMU_INT_MASK, ~0);
-       pfdev->mmu->pgtbl_cfg = (struct io_pgtable_cfg) {
-               .pgsize_bitmap  = SZ_4K | SZ_2M,
-               .ias            = FIELD_GET(0xff, pfdev->features.mmu_features),
-               .oas            = FIELD_GET(0xff00, pfdev->features.mmu_features),
-               .tlb            = &mmu_tlb_ops,
-               .iommu_dev      = pfdev->dev,
-       };
-       pgtbl_ops = alloc_io_pgtable_ops(ARM_MALI_LPAE, &pfdev->mmu->pgtbl_cfg,
-                                        pfdev);
-       if (!pgtbl_ops)
-               return -ENOMEM;
-       pfdev->mmu->pgtbl_ops = pgtbl_ops;
-       panfrost_mmu_enable(pfdev, 0);
  
        return 0;
  }
  void panfrost_mmu_fini(struct panfrost_device *pfdev)
  {
        mmu_write(pfdev, MMU_INT_MASK, 0);
-       mmu_disable(pfdev, 0);
-       free_io_pgtable_ops(pfdev->mmu->pgtbl_ops);
  }
index 952201c6d821d719f6520c83462923918ebf31f4,c1802e01d9f6e3eeb922b058075a9bc1cb73b9da..265bfe9f8016f78d1ac928d1ec9081f135306d7e
   *    Alon Levy <[email protected]>
   */
  
- #include <linux/module.h>
+ #include "qxl_drv.h"
  #include <linux/console.h>
+ #include <linux/module.h>
+ #include <linux/pci.h>
  
- #include <drm/drmP.h>
  #include <drm/drm.h>
+ #include <drm/drm_drv.h>
+ #include <drm/drm_file.h>
  #include <drm/drm_modeset_helper.h>
+ #include <drm/drm_prime.h>
  #include <drm/drm_probe_helper.h>
- #include "qxl_drv.h"
  #include "qxl_object.h"
  
  static const struct pci_device_id pciidlist[] = {
@@@ -59,11 -63,6 +63,11 @@@ module_param_named(num_heads, qxl_num_c
  static struct drm_driver qxl_driver;
  static struct pci_driver qxl_pci_driver;
  
 +static bool is_vga(struct pci_dev *pdev)
 +{
 +      return pdev->class == PCI_CLASS_DISPLAY_VGA << 8;
 +}
 +
  static int
  qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  {
        if (ret)
                goto disable_pci;
  
 +      if (is_vga(pdev)) {
 +              ret = vga_get_interruptible(pdev, VGA_RSRC_LEGACY_IO);
 +              if (ret) {
 +                      DRM_ERROR("can't get legacy vga ioports\n");
 +                      goto disable_pci;
 +              }
 +      }
 +
        ret = qxl_device_init(qdev, &qxl_driver, pdev);
        if (ret)
 -              goto disable_pci;
 +              goto put_vga;
  
        ret = qxl_modeset_init(qdev);
        if (ret)
@@@ -118,9 -109,6 +122,9 @@@ modeset_cleanup
        qxl_modeset_fini(qdev);
  unload:
        qxl_device_fini(qdev);
 +put_vga:
 +      if (is_vga(pdev))
 +              vga_put(pdev, VGA_RSRC_LEGACY_IO);
  disable_pci:
        pci_disable_device(pdev);
  free_dev:
@@@ -138,8 -126,6 +142,8 @@@ qxl_pci_remove(struct pci_dev *pdev
  
        qxl_modeset_fini(qdev);
        qxl_device_fini(qdev);
 +      if (is_vga(pdev))
 +              vga_put(pdev, VGA_RSRC_LEGACY_IO);
  
        dev->dev_private = NULL;
        kfree(qdev);
@@@ -224,16 -210,14 +228,14 @@@ static int qxl_pm_resume(struct device 
  
  static int qxl_pm_thaw(struct device *dev)
  {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct drm_device *drm_dev = pci_get_drvdata(pdev);
+       struct drm_device *drm_dev = dev_get_drvdata(dev);
  
        return qxl_drm_resume(drm_dev, true);
  }
  
  static int qxl_pm_freeze(struct device *dev)
  {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct drm_device *drm_dev = pci_get_drvdata(pdev);
+       struct drm_device *drm_dev = dev_get_drvdata(dev);
  
        return qxl_drm_freeze(drm_dev);
  }
@@@ -265,8 -249,7 +267,7 @@@ static struct pci_driver qxl_pci_drive
  };
  
  static struct drm_driver qxl_driver = {
-       .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
-                          DRIVER_ATOMIC,
+       .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
  
        .dumb_create = qxl_mode_dumb_create,
        .dumb_map_offset = qxl_mode_dumb_mmap,
  #endif
        .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-       .gem_prime_export = drm_gem_prime_export,
-       .gem_prime_import = drm_gem_prime_import,
        .gem_prime_pin = qxl_gem_prime_pin,
        .gem_prime_unpin = qxl_gem_prime_unpin,
        .gem_prime_get_sg_table = qxl_gem_prime_get_sg_table,
index 082d02c840249c49e79de11465feb44e3fe28950,52c5f1ab8277ebb31821433577aafaf5c1fd2447..3fc7e6899cab5843e42b0e1647526ef3330d9ded
@@@ -71,11 -71,11 +71,11 @@@ struct rcar_lvds 
        bool dual_link;
  };
  
- #define bridge_to_rcar_lvds(bridge) \
-       container_of(bridge, struct rcar_lvds, bridge)
+ #define bridge_to_rcar_lvds(b) \
+       container_of(b, struct rcar_lvds, bridge)
  
- #define connector_to_rcar_lvds(connector) \
-       container_of(connector, struct rcar_lvds, connector)
+ #define connector_to_rcar_lvds(c) \
+       container_of(c, struct rcar_lvds, connector)
  
  static void rcar_lvds_write(struct rcar_lvds *lvds, u32 reg, u32 data)
  {
@@@ -673,8 -673,10 +673,8 @@@ static int rcar_lvds_parse_dt_companion
  
        /* Locate the companion LVDS encoder for dual-link operation, if any. */
        companion = of_parse_phandle(dev->of_node, "renesas,companion", 0);
 -      if (!companion) {
 -              dev_err(dev, "Companion LVDS encoder not found\n");
 -              return -ENXIO;
 -      }
 +      if (!companion)
 +              return 0;
  
        /*
         * Sanity check: the companion encoder must have the same compatible
index 9aae3d8e99ef426743d21533f3b1168449a56fe5,7d7cb57410fc083f98d0752b1f68686c14e2ca46..f38f5e113c6b319a65472dcee0b0c7e38b64c6ca
  #include <linux/reset.h>
  #include <linux/clk.h>
  
- #include <drm/drmP.h>
- #include <drm/drm_dp_helper.h>
- #include <drm/drm_of.h>
- #include <drm/drm_panel.h>
- #include <drm/drm_probe_helper.h>
  #include <video/of_videomode.h>
  #include <video/videomode.h>
  
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_atomic_helper.h>
  #include <drm/bridge/analogix_dp.h>
+ #include <drm/drm_dp_helper.h>
+ #include <drm/drm_of.h>
+ #include <drm/drm_panel.h>
+ #include <drm/drm_probe_helper.h>
  
  #include "rockchip_drm_drv.h"
- #include "rockchip_drm_psr.h"
  #include "rockchip_drm_vop.h"
  
  #define RK3288_GRF_SOC_CON6           0x25c
@@@ -73,29 -72,6 +72,6 @@@ struct rockchip_dp_device 
        struct analogix_dp_plat_data plat_data;
  };
  
- static int analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled)
- {
-       struct rockchip_dp_device *dp = to_dp(encoder);
-       int ret;
-       if (!analogix_dp_psr_enabled(dp->adp))
-               return 0;
-       DRM_DEV_DEBUG(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit");
-       ret = rockchip_drm_wait_vact_end(dp->encoder.crtc,
-                                        PSR_WAIT_LINE_FLAG_TIMEOUT_MS);
-       if (ret) {
-               DRM_DEV_ERROR(dp->dev, "line flag interrupt did not arrive\n");
-               return -ETIMEDOUT;
-       }
-       if (enabled)
-               return analogix_dp_enable_psr(dp->adp);
-       else
-               return analogix_dp_disable_psr(dp->adp);
- }
  static int rockchip_dp_pre_init(struct rockchip_dp_device *dp)
  {
        reset_control_assert(dp->rst);
@@@ -126,21 -102,9 +102,9 @@@ static int rockchip_dp_poweron_start(st
        return ret;
  }
  
- static int rockchip_dp_poweron_end(struct analogix_dp_plat_data *plat_data)
- {
-       struct rockchip_dp_device *dp = to_dp(plat_data);
-       return rockchip_drm_psr_inhibit_put(&dp->encoder);
- }
  static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
  {
        struct rockchip_dp_device *dp = to_dp(plat_data);
-       int ret;
-       ret = rockchip_drm_psr_inhibit_get(&dp->encoder);
-       if (ret != 0)
-               return ret;
  
        clk_disable_unprepare(dp->pclk);
  
@@@ -180,12 -144,42 +144,42 @@@ static void rockchip_dp_drm_encoder_mod
        /* do nothing */
  }
  
- static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder)
+ static
+ struct drm_crtc *rockchip_dp_drm_get_new_crtc(struct drm_encoder *encoder,
+                                             struct drm_atomic_state *state)
+ {
+       struct drm_connector *connector;
+       struct drm_connector_state *conn_state;
+       connector = drm_atomic_get_new_connector_for_encoder(state, encoder);
+       if (!connector)
+               return NULL;
+       conn_state = drm_atomic_get_new_connector_state(state, connector);
+       if (!conn_state)
+               return NULL;
+       return conn_state->crtc;
+ }
+ static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder,
+                                          struct drm_atomic_state *state)
  {
        struct rockchip_dp_device *dp = to_dp(encoder);
+       struct drm_crtc *crtc;
+       struct drm_crtc_state *old_crtc_state;
        int ret;
        u32 val;
  
+       crtc = rockchip_dp_drm_get_new_crtc(encoder, state);
+       if (!crtc)
+               return;
+       old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
+       /* Coming back from self refresh, nothing to do */
+       if (old_crtc_state && old_crtc_state->self_refresh_active)
+               return;
        ret = drm_of_encoder_active_endpoint_id(dp->dev->of_node, encoder);
        if (ret < 0)
                return;
        clk_disable_unprepare(dp->grfclk);
  }
  
- static void rockchip_dp_drm_encoder_nop(struct drm_encoder *encoder)
+ static void rockchip_dp_drm_encoder_disable(struct drm_encoder *encoder,
+                                           struct drm_atomic_state *state)
  {
-       /* do nothing */
+       struct rockchip_dp_device *dp = to_dp(encoder);
+       struct drm_crtc *crtc;
+       struct drm_crtc_state *new_crtc_state = NULL;
+       int ret;
+       crtc = rockchip_dp_drm_get_new_crtc(encoder, state);
+       /* No crtc means we're doing a full shutdown */
+       if (!crtc)
+               return;
+       new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+       /* If we're not entering self-refresh, no need to wait for vact */
+       if (!new_crtc_state || !new_crtc_state->self_refresh_active)
+               return;
+       ret = rockchip_drm_wait_vact_end(crtc, PSR_WAIT_LINE_FLAG_TIMEOUT_MS);
+       if (ret)
+               DRM_DEV_ERROR(dp->dev, "line flag irq timed out\n");
  }
  
  static int
@@@ -241,8 -253,8 +253,8 @@@ rockchip_dp_drm_encoder_atomic_check(st
  static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
        .mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
        .mode_set = rockchip_dp_drm_encoder_mode_set,
-       .enable = rockchip_dp_drm_encoder_enable,
-       .disable = rockchip_dp_drm_encoder_nop,
+       .atomic_enable = rockchip_dp_drm_encoder_enable,
+       .atomic_disable = rockchip_dp_drm_encoder_disable,
        .atomic_check = rockchip_dp_drm_encoder_atomic_check,
  };
  
@@@ -334,23 -346,16 +346,16 @@@ static int rockchip_dp_bind(struct devi
  
        dp->plat_data.dev_type = dp->data->chip_type;
        dp->plat_data.power_on_start = rockchip_dp_poweron_start;
-       dp->plat_data.power_on_end = rockchip_dp_poweron_end;
        dp->plat_data.power_off = rockchip_dp_powerdown;
        dp->plat_data.get_modes = rockchip_dp_get_modes;
  
-       ret = rockchip_drm_psr_register(&dp->encoder, analogix_dp_psr_set);
-       if (ret < 0)
-               goto err_cleanup_encoder;
        dp->adp = analogix_dp_bind(dev, dp->drm_dev, &dp->plat_data);
        if (IS_ERR(dp->adp)) {
                ret = PTR_ERR(dp->adp);
-               goto err_unreg_psr;
+               goto err_cleanup_encoder;
        }
  
        return 0;
- err_unreg_psr:
-       rockchip_drm_psr_unregister(&dp->encoder);
  err_cleanup_encoder:
        dp->encoder.funcs->destroy(&dp->encoder);
        return ret;
@@@ -362,7 -367,6 +367,6 @@@ static void rockchip_dp_unbind(struct d
        struct rockchip_dp_device *dp = dev_get_drvdata(dev);
  
        analogix_dp_unbind(dp->adp);
-       rockchip_drm_psr_unregister(&dp->encoder);
        dp->encoder.funcs->destroy(&dp->encoder);
  
        dp->adp = ERR_PTR(-ENODEV);
@@@ -432,7 -436,7 +436,7 @@@ static int rockchip_dp_resume(struct de
  
  static const struct dev_pm_ops rockchip_dp_pm_ops = {
  #ifdef CONFIG_PM_SLEEP
 -      .suspend = rockchip_dp_suspend,
 +      .suspend_late = rockchip_dp_suspend,
        .resume_early = rockchip_dp_resume,
  #endif
  };
index 38dc263769615c70e2b56f21fc885e6ca8a75c8b,30c177eb3022a57b55f139811325d9738c4f43a1..20ecb1508a2247992143fda3a8be830da110de17
@@@ -6,11 -6,6 +6,6 @@@
   * based on exynos_drm_drv.c
   */
  
- #include <drm/drmP.h>
- #include <drm/drm_fb_helper.h>
- #include <drm/drm_gem_cma_helper.h>
- #include <drm/drm_of.h>
- #include <drm/drm_probe_helper.h>
  #include <linux/dma-mapping.h>
  #include <linux/dma-iommu.h>
  #include <linux/pm_runtime.h>
  #include <linux/console.h>
  #include <linux/iommu.h>
  
+ #include <drm/drm_drv.h>
+ #include <drm/drm_fb_helper.h>
+ #include <drm/drm_gem_cma_helper.h>
+ #include <drm/drm_of.h>
+ #include <drm/drm_probe_helper.h>
+ #include <drm/drm_vblank.h>
  #include "rockchip_drm_drv.h"
  #include "rockchip_drm_fb.h"
  #include "rockchip_drm_fbdev.h"
@@@ -212,16 -214,13 +214,13 @@@ static const struct file_operations roc
  };
  
  static struct drm_driver rockchip_drm_driver = {
-       .driver_features        = DRIVER_MODESET | DRIVER_GEM |
-                                 DRIVER_PRIME | DRIVER_ATOMIC,
+       .driver_features        = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
        .lastclose              = drm_fb_helper_lastclose,
        .gem_vm_ops             = &drm_gem_cma_vm_ops,
        .gem_free_object_unlocked = rockchip_gem_free_object,
        .dumb_create            = rockchip_gem_dumb_create,
        .prime_handle_to_fd     = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle     = drm_gem_prime_fd_to_handle,
-       .gem_prime_import       = drm_gem_prime_import,
-       .gem_prime_export       = drm_gem_prime_export,
        .gem_prime_get_sg_table = rockchip_gem_prime_get_sg_table,
        .gem_prime_import_sg_table      = rockchip_gem_prime_import_sg_table,
        .gem_prime_vmap         = rockchip_gem_prime_vmap,
@@@ -330,7 -329,8 +329,7 @@@ static struct component_match *rockchip
                struct device *p = NULL, *d;
  
                do {
 -                      d = bus_find_device(&platform_bus_type, p, &drv->driver,
 -                                          (void *)platform_bus_type.match);
 +                      d = platform_find_device_by_driver(p, &drv->driver);
                        put_device(p);
                        p = d;
  
index df0cc8f46d7bdcc63578b30e0f97cb2f1e36f409,690aeb8227041b79295abbfe61ef635e158c70cf..04c721d0d3b981964145b3bc9cf80e17545008a5
@@@ -6,7 -6,15 +6,15 @@@
   * Maxime Ripard <[email protected]>
   */
  
- #include <drm/drmP.h>
+ #include <linux/component.h>
+ #include <linux/ioport.h>
+ #include <linux/module.h>
+ #include <linux/of_address.h>
+ #include <linux/of_device.h>
+ #include <linux/of_irq.h>
+ #include <linux/regmap.h>
+ #include <linux/reset.h>
  #include <drm/drm_atomic_helper.h>
  #include <drm/drm_connector.h>
  #include <drm/drm_crtc.h>
  #include <drm/drm_modes.h>
  #include <drm/drm_of.h>
  #include <drm/drm_panel.h>
+ #include <drm/drm_print.h>
  #include <drm/drm_probe_helper.h>
+ #include <drm/drm_vblank.h>
  
  #include <uapi/drm/drm_mode.h>
  
- #include <linux/component.h>
- #include <linux/ioport.h>
- #include <linux/of_address.h>
- #include <linux/of_device.h>
- #include <linux/of_irq.h>
- #include <linux/regmap.h>
- #include <linux/reset.h>
  #include "sun4i_crtc.h"
  #include "sun4i_dotclock.h"
  #include "sun4i_drv.h"
@@@ -314,7 -316,6 +316,7 @@@ static void sun4i_tcon0_mode_set_dither
                /* R and B components are only 5 bits deep */
                val |= SUN4I_TCON0_FRM_CTL_MODE_R;
                val |= SUN4I_TCON0_FRM_CTL_MODE_B;
 +              /* Fall through */
        case MEDIA_BUS_FMT_RGB666_1X18:
        case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
                /* Fall through: enable dithering */
@@@ -479,7 -480,7 +481,7 @@@ static void sun4i_tcon0_mode_set_rgb(st
                                     const struct drm_display_mode *mode)
  {
        struct drm_connector *connector = sun4i_tcon_get_connector(encoder);
-       struct drm_display_info display_info = connector->display_info;
+       const struct drm_display_info *info = &connector->display_info;
        unsigned int bp, hsync, vsync;
        u8 clk_delay;
        u32 val = 0;
        if (mode->flags & DRM_MODE_FLAG_PVSYNC)
                val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
  
-       if (display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
+       if (info->bus_flags & DRM_BUS_FLAG_DE_LOW)
                val |= SUN4I_TCON0_IO_POL_DE_NEGATIVE;
  
        /*
         * Following code is a way to avoid quirks all around TCON
         * and DOTCLOCK drivers.
         */
-       if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
+       if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
                clk_set_phase(tcon->dclk, 240);
  
-       if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)
+       if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)
                clk_set_phase(tcon->dclk, 0);
  
        regmap_update_bits(tcon->regs, SUN4I_TCON0_IO_POL_REG,
index b889ad3e86e179fa8b3f404aaaa28855d97be21b,472f73985deb8c0543805a711414cfd2eed71459..1636344ba9ec2ecebe44aa38a382fb81f29fe007
@@@ -9,19 -9,20 +9,20 @@@
  #include <linux/clk.h>
  #include <linux/component.h>
  #include <linux/crc-ccitt.h>
+ #include <linux/module.h>
  #include <linux/of_address.h>
+ #include <linux/phy/phy-mipi-dphy.h>
+ #include <linux/phy/phy.h>
+ #include <linux/platform_device.h>
  #include <linux/pm_runtime.h>
  #include <linux/regmap.h>
  #include <linux/reset.h>
  #include <linux/slab.h>
  
- #include <linux/phy/phy.h>
- #include <linux/phy/phy-mipi-dphy.h>
- #include <drm/drmP.h>
  #include <drm/drm_atomic_helper.h>
  #include <drm/drm_mipi_dsi.h>
  #include <drm/drm_panel.h>
+ #include <drm/drm_print.h>
  #include <drm/drm_probe_helper.h>
  
  #include "sun4i_crtc.h"
@@@ -993,7 -994,6 +994,7 @@@ static ssize_t sun6i_dsi_transfer(struc
                        ret = sun6i_dsi_dcs_read(dsi, msg);
                        break;
                }
 +              /* Else, fall through */
  
        default:
                ret = -EINVAL;
index 1551c8253bec0e62b5f0ca7c16128f8ac93c58fc,048c70a7b59273cbf7ddfaa71b5114618fbaf22d..5e6fb6c2307f0d59cd51c6841c20ec5beac25c29
  #include <linux/clk.h>
  #include <linux/component.h>
  #include <linux/device.h>
+ #include <linux/dma-mapping.h>
  #include <linux/io.h>
  #include <linux/module.h>
  #include <linux/of_platform.h>
  #include <linux/platform_device.h>
  #include <linux/pm_runtime.h>
+ #include <drm/drm_atomic_helper.h>
+ #include <drm/drm_drv.h>
  #include <drm/drm_fb_cma_helper.h>
  #include <drm/drm_fb_helper.h>
- #include <drm/drm_atomic_helper.h>
+ #include <drm/drm_vblank.h>
  
  #include "uapi/drm/vc4_drm.h"
  #include "vc4_drv.h"
  #include "vc4_regs.h"
  
@@@ -177,7 -182,6 +182,6 @@@ static struct drm_driver vc4_drm_drive
                            DRIVER_ATOMIC |
                            DRIVER_GEM |
                            DRIVER_RENDER |
-                           DRIVER_PRIME |
                            DRIVER_SYNCOBJ),
        .open = vc4_open,
        .postclose = vc4_close,
  
        .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-       .gem_prime_import = drm_gem_prime_import,
        .gem_prime_export = vc4_prime_export,
        .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
        .gem_prime_import_sg_table = vc4_prime_import_sg_table,
@@@ -237,7 -240,8 +240,7 @@@ static void vc4_match_add_drivers(struc
                struct device_driver *drv = &drivers[i]->driver;
                struct device *p = NULL, *d;
  
 -              while ((d = bus_find_device(&platform_bus_type, p, drv,
 -                                          (void *)platform_bus_type.match))) {
 +              while ((d = platform_find_device_by_driver(p, drv))) {
                        put_device(p);
                        component_match_add(dev, match, compare_dev, d);
                        p = d;
index 0c647be81ab01b697db78e84e2e481d1152c16b6,81a86c3b77bc12a832fd8284522bd62bb7910172..b6c5e4c2ac3c0d3050ae37883db2d5eaa786015e
   *
   */
  
- #include <linux/slab.h>
- #include <linux/module.h>
- #include <linux/kernel.h>
  #include <linux/frame.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/slab.h>
  #include <asm/hypervisor.h>
- #include <drm/drmP.h>
  #include "vmwgfx_drv.h"
  #include "vmwgfx_msg.h"
  
  #define MESSAGE_STATUS_SUCCESS  0x0001
  #define MESSAGE_STATUS_DORECV   0x0002
  #define MESSAGE_STATUS_CPT      0x0010
@@@ -46,6 -45,8 +45,6 @@@
  #define RETRIES                 3
  
  #define VMW_HYPERVISOR_MAGIC    0x564D5868
 -#define VMW_HYPERVISOR_PORT     0x5658
 -#define VMW_HYPERVISOR_HB_PORT  0x5659
  
  #define VMW_PORT_CMD_MSG        30
  #define VMW_PORT_CMD_HB_MSG     0
@@@ -91,7 -92,7 +90,7 @@@ static int vmw_open_channel(struct rpc_
  
        VMW_PORT(VMW_PORT_CMD_OPEN_CHANNEL,
                (protocol | GUESTMSG_FLAG_COOKIE), si, di,
 -              VMW_HYPERVISOR_PORT,
 +              0,
                VMW_HYPERVISOR_MAGIC,
                eax, ebx, ecx, edx, si, di);
  
@@@ -124,7 -125,7 +123,7 @@@ static int vmw_close_channel(struct rpc
  
        VMW_PORT(VMW_PORT_CMD_CLOSE_CHANNEL,
                0, si, di,
 -              (VMW_HYPERVISOR_PORT | (channel->channel_id << 16)),
 +              channel->channel_id << 16,
                VMW_HYPERVISOR_MAGIC,
                eax, ebx, ecx, edx, si, di);
  
@@@ -158,8 -159,7 +157,8 @@@ static unsigned long vmw_port_hb_out(st
                VMW_PORT_HB_OUT(
                        (MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG,
                        msg_len, si, di,
 -                      VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16),
 +                      VMWARE_HYPERVISOR_HB | (channel->channel_id << 16) |
 +                      VMWARE_HYPERVISOR_OUT,
                        VMW_HYPERVISOR_MAGIC, bp,
                        eax, ebx, ecx, edx, si, di);
  
  
                VMW_PORT(VMW_PORT_CMD_MSG | (MSG_TYPE_SENDPAYLOAD << 16),
                         word, si, di,
 -                       VMW_HYPERVISOR_PORT | (channel->channel_id << 16),
 +                       channel->channel_id << 16,
                         VMW_HYPERVISOR_MAGIC,
                         eax, ebx, ecx, edx, si, di);
        }
@@@ -212,7 -212,7 +211,7 @@@ static unsigned long vmw_port_hb_in(str
                VMW_PORT_HB_IN(
                        (MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG,
                        reply_len, si, di,
 -                      VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16),
 +                      VMWARE_HYPERVISOR_HB | (channel->channel_id << 16),
                        VMW_HYPERVISOR_MAGIC, bp,
                        eax, ebx, ecx, edx, si, di);
  
  
                VMW_PORT(VMW_PORT_CMD_MSG | (MSG_TYPE_RECVPAYLOAD << 16),
                         MESSAGE_STATUS_SUCCESS, si, di,
 -                       VMW_HYPERVISOR_PORT | (channel->channel_id << 16),
 +                       channel->channel_id << 16,
                         VMW_HYPERVISOR_MAGIC,
                         eax, ebx, ecx, edx, si, di);
  
@@@ -268,7 -268,7 +267,7 @@@ static int vmw_send_msg(struct rpc_chan
  
                VMW_PORT(VMW_PORT_CMD_SENDSIZE,
                        msg_len, si, di,
 -                      VMW_HYPERVISOR_PORT | (channel->channel_id << 16),
 +                      channel->channel_id << 16,
                        VMW_HYPERVISOR_MAGIC,
                        eax, ebx, ecx, edx, si, di);
  
@@@ -326,7 -326,7 +325,7 @@@ static int vmw_recv_msg(struct rpc_chan
  
                VMW_PORT(VMW_PORT_CMD_RECVSIZE,
                        0, si, di,
 -                      (VMW_HYPERVISOR_PORT | (channel->channel_id << 16)),
 +                      channel->channel_id << 16,
                        VMW_HYPERVISOR_MAGIC,
                        eax, ebx, ecx, edx, si, di);
  
                                     !!(HIGH_WORD(ecx) & MESSAGE_STATUS_HB));
                if ((HIGH_WORD(ebx) & MESSAGE_STATUS_SUCCESS) == 0) {
                        kfree(reply);
 -
 +                      reply = NULL;
                        if ((HIGH_WORD(ebx) & MESSAGE_STATUS_CPT) != 0) {
                                /* A checkpoint occurred. Retry. */
                                continue;
  
                VMW_PORT(VMW_PORT_CMD_RECVSTATUS,
                        MESSAGE_STATUS_SUCCESS, si, di,
 -                      (VMW_HYPERVISOR_PORT | (channel->channel_id << 16)),
 +                      channel->channel_id << 16,
                        VMW_HYPERVISOR_MAGIC,
                        eax, ebx, ecx, edx, si, di);
  
                if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0) {
                        kfree(reply);
 -
 +                      reply = NULL;
                        if ((HIGH_WORD(ecx) & MESSAGE_STATUS_CPT) != 0) {
                                /* A checkpoint occurred. Retry. */
                                continue;
                break;
        }
  
 -      if (retries == RETRIES)
 +      if (!reply)
                return -EINVAL;
  
        *msg_len = reply_len;
This page took 0.421277 seconds and 4 git commands to generate.