Skip to content
  1. Jun 04, 2021
  2. Jun 02, 2021
    • Thomas Hellström's avatar
      drm/i915/ttm: Embed a ttm buffer object in the i915 gem object · f4db23f2
      Thomas Hellström authored
      
      
      Embed a struct ttm_buffer_object into the i915 gem object, making sure
      we alias the gem object part. It's a bit unfortunate that the
      struct ttm_buffer_ojbect embeds a gem object since we otherwise could
      make the TTM part private to the TTM backend, and use the usual
      i915 gem object for the other backends.
      To make this a bit more storage efficient for the other backends,
      we'd have to use a pointer for the gem object which would require
      a lot of changes in the driver. We postpone that for later.
      
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Acked-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210602083818.241793-3-thomas.hellstrom@linux.intel.com
      f4db23f2
    • Thomas Hellström's avatar
      drm/i915/ttm Initialize the ttm device and memory managers · d1487389
      Thomas Hellström authored
      
      
      Temporarily remove the buddy allocator and related selftests
      and hook up the TTM range manager for i915 regions.
      
      Also modify the mock region selftests somewhat to account for a
      fragmenting manager.
      
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210602083818.241793-2-thomas.hellstrom@linux.intel.com
      d1487389
    • Matthew Auld's avatar
      Revert "i915: use io_mapping_map_user" · 0e4fe0c9
      Matthew Auld authored
      This reverts commit b739f125.
      
      We are unfortunately seeing more issues like we did in 293837b9
      
      
      ("Revert "i915: fix remap_io_sg to verify the pgprot""), except this is
      now for the vm_fault_gtt path, where we are now hitting the same
      BUG_ON(!pte_none(*pte)):
      
      [10887.466150] kernel BUG at mm/memory.c:2183!
      [10887.466162] invalid opcode: 0000 [#1] PREEMPT SMP PTI
      [10887.466168] CPU: 0 PID: 7775 Comm: ffmpeg Tainted: G     U            5.13.0-rc3-CI-Nightly #1
      [10887.466174] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
      [10887.466177] RIP: 0010:remap_pfn_range_notrack+0x30f/0x440
      [10887.466188] Code: e8 96 d7 e0 ff 84 c0 0f 84 27 01 00 00 48 ba 00 f0 ff ff ff ff 0f 00 4c 89 e0 48 c1 e0 0c 4d 85 ed 75 96 48 21 d0 31 f6 eb a9 <0f> 0b 48 39 37 0f 85 0e 01 00 00 48 8b 0c 24 48 39 4f 08 0f 85 00
      [10887.466193] RSP: 0018:ffffc90006e33c50 EFLAGS: 00010286
      [10887.466198] RAX: 800000000000002f RBX: 00007f5e01800000 RCX: 0000000000000028
      [10887.466201] RDX: 0000000000000001 RSI: ffffea0000000000 RDI: 0000000000000000
      [10887.466204] RBP: ffffea000033fea8 R08: 800000000000002f R09: ffff8881072256e0
      [10887.466207] R10: ffffc9000b84fff8 R11: 0000000017dab000 R12: 0000000000089f9f
      [10887.466210] R13: 800000000000002f R14: 00007f5e017e4000 R15: ffff88800cffaf20
      [10887.466213] FS:  00007f5e04849640(0000) GS:ffff888278000000(0000) knlGS:0000000000000000
      [10887.466216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [10887.466220] CR2: 00007fd9b191a2ac CR3: 00000001829ac000 CR4: 00000000003506f0
      [10887.466223] Call Trace:
      [10887.466233]  vm_fault_gtt+0x1ca/0x5d0 [i915]
      [10887.466381]  ? ktime_get+0x38/0x90
      [10887.466389]  __do_fault+0x37/0x90
      [10887.466395]  __handle_mm_fault+0xc46/0x1200
      [10887.466402]  handle_mm_fault+0xce/0x2a0
      [10887.466407]  do_user_addr_fault+0x1c5/0x660
      
      Reverting this commit is reported to fix the issue.
      
      Reported-by: default avatarEero Tamminen <eero.t.tamminen@intel.com>
      References: https://gitlab.freedesktop.org/drm/intel/-/issues/3519
      Fixes: b739f125
      
       ("i915: use io_mapping_map_user")
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210527185145.458021-1-matthew.auld@intel.com
      0e4fe0c9
    • Zhihao Cheng's avatar
      drm/i915/selftests: Fix return value check in live_breadcrumbs_smoketest() · 8f4caef8
      Zhihao Cheng authored
      In case of error, the function live_context() returns ERR_PTR() and never
      returns NULL. The NULL test in the return value check should be replaced
      with IS_ERR().
      
      Fixes: 52c0fdb2
      
       ("drm/i915: Replace global breadcrumbs with per-context interrupt tracking")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/33c46ef24cd547d0ad21dc106441491a@intel.com
      [tursulin: Wrap commit text, fix Fixes: tag.]
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      8f4caef8
    • YueHaibing's avatar
      drm/i915: use DEVICE_ATTR_RO macro · 177f30c6
      YueHaibing authored
      
      
      Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(),
      which makes the code a bit shorter and easier to read.
      
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210528100403.21548-1-yuehaibing@huawei.com
      177f30c6
    • Joonas Lahtinen's avatar
      Merge drm/drm-next into drm-intel-gt-next · 942baad2
      Joonas Lahtinen authored
      
      
      Pulling in -rc2 fixes and TTM changes that next upcoming patches depend
      on.
      
      Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      942baad2
    • Dave Airlie's avatar
      Merge tag 'drm-intel-gt-next-2021-05-28' of... · ccd1950c
      Dave Airlie authored
      
      Merge tag 'drm-intel-gt-next-2021-05-28' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
      
      UAPI Changes:
      - Add reworked uAPI for DG1 behind CONFIG_BROKEN (Matt A, Abdiel)
      
      Driver Changes:
      
      - Fix for Gitlab issues #3293 and #3450:
        Avoid kernel crash on older L-shape memory machines
      
      - Add Wa_14010733141 (VDBox SFC reset) for Gen11+ (Aditya)
      - Fix crash in auto_retire active retire callback due to
        misalignment (Stephane)
      - Fix overlay active retire callback alignment (Tvrtko)
      - Eliminate need to align active retire callbacks (Matt A, Ville,
        Daniel)
      - Program FF_MODE2 tuning value for all Gen12 platforms (Caz)
      - Add Wa_14011060649 for TGL,RKL,DG1 and ADLS (Swathi)
      - Create stolen memory region from local memory on DG1 (CQ)
      - Place PD in LMEM on dGFX (Matt A)
      - Use WC when default state object is allocated in LMEM (Venkata)
      - Determine the coherent map type based on object location (Venkata)
      - Use lmem physical addresses for fb_mmap() on discrete (Mohammed)
      - Bypass aperture on fbdev when LMEM is available (Anusha)
      - Return error value when displayable BO not in LMEM for dGFX (Mohammed)
      - Do release kernel context if breadcrumb measure fails (Janusz)
      - Hide modparams for compiled-out features (Tvrtko)
      - Apply Wa_22010271021 for all Gen11 platforms (Caz)
      - Fix unlikely ref count race in arming the watchdog timer (Tvrtko)
      - Check actual RC6 enable status in PMU (Tvrtko)
      - Fix a double free in gen8_preallocate_top_level_pdp (Lv)
      - Use trylock in shrinker for GGTT on BSW VT-d and BXT (Maarten)
      - Remove erroneous i915_is_ggtt check for
        I915_GEM_OBJECT_UNBIND_VM_TRYLOCK (Maarten)
      
      - Convert uAPI headers to real kerneldoc (Matt A)
      - Clean up kerneldoc warnings headers (Matt A, Maarten)
      - Fail driver if LMEM training failed (Matt R)
      - Avoid div-by-zero on Gen2 (Ville)
      - Read C0DRB3/C1DRB3 as 16 bits again and add _BW suffix (Ville)
      - Remove reference to struct drm_device.pdev (Thomas)
      - Increase separation between GuC and execlists code (Chris, Matt B)
      
      - Use might_alloc() (Bernard)
      - Split DGFX_FEATURES from GEN12_FEATURES (Lucas)
      - Deduplicate Wa_22010271021 programming on (Jose)
      - Drop duplicate WaDisable4x2SubspanOptimization:hsw (Tvrtko)
      - Selftest improvements (Chris, Hsin-Yi, Tvrtko)
      - Shuffle around init_memory_region for stolen (Matt)
      - Typo fixes (wengjianfeng)
      
      [airlied: fix conflict with fixes in i915_active.c]
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/YLCbBR22BsQ/dpJB@jlahtine-mobl.ger.corp.intel.com
      ccd1950c
    • Dave Airlie's avatar
      Merge tag 'drm-misc-next-2021-06-01' of git://anongit.freedesktop.org/drm/drm-misc into drm-next · 43ed3c6c
      Dave Airlie authored
      
      
      drm-misc-next for 5.14:
      
      UAPI Changes:
      
       * Use DRM driver names for fbdev
      
      Cross-subsystem Changes:
      
      Core Changes:
      
       * Fix leaked DMA handles
      
       * Improve documentation around DRM_CLIENT_CAP_*
      
       * Cleanups
      
       * dp_mst: Use kHz as link-rate unit during init
      
       * fourcc: Remove drm_gem_format_name() and drm_format_name_buf
      
       * gem-cma: Fix mmap for buffers with write combining
      
       * ttm: Don't override pre-set vm_ops; ttm_bo_mmap() removal and cleanups
      
      Driver Changes:
      
       * drm/amdgpu: Fix hot unplug during suspend; Implement mmap as GEM object
         function; Use %p4cc format-string modifier; Cleanups
      
       * drm/bridge: Cdns: Fix PM reference leak, Cleanups; Lt8912b: Fix Coccinelle
         warnings; Fix Kconfig dependencies; Fixes and cleanups
      
       * drm/hisilicon/kirin: Cleanups
      
       * drm/nouveau: Implement mmap as GEM object function
      
       * drm/radeon: Implement mmap as GEM object function
      
       * drm/rockchip: Remove generic drivers during init; Add scaling for RK3036
         win1; Fix missing registers for RK3066 and 3188; Add alpha support for
         RK3036, RK3066, RK3126 and RK3188; Fixes and cleanups
      
       * drm/simpledrm: Use %p4cc: format-string modifier
      
       * drm/vmwgfx: Cleanups
      
       * fbdev/matrox: Use modern module_init()
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/YLZOKiYE6XFmE/MH@linux-uq9g.fritz.box
      43ed3c6c
  3. Jun 01, 2021
  4. May 31, 2021
  5. May 29, 2021
    • Johan Jonker's avatar
      drm/rockchip: vop: add PX30 version info · 872b68e9
      Johan Jonker authored
      
      
      To reduce memory various Rockchip VOP versions share
      common reg structures. However more recent added SoCs not
      always have to same futures as the old ones.
      Add PX30 missing version info, so all VOP version checks
      work correct if needed in the future.
      
      Signed-off-by: default avatarJohan Jonker <jbx6244@gmail.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210131125016.10837-1-jbx6244@gmail.com
      872b68e9
    • Colin Ian King's avatar
      drm/rockchip: cdn-dp: fix sign extension on an int multiply for a u64 result · ce0cb93a
      Colin Ian King authored
      The variable bit_per_pix is a u8 and is promoted in the multiplication
      to an int type and then sign extended to a u64. If the result of the
      int multiplication is greater than 0x7fffffff then the upper 32 bits will
      be set to 1 as a result of the sign extension. Avoid this by casting
      tu_size_reg to u64 to avoid sign extension and also a potential overflow.
      
      Fixes: 1a0f7ed3
      
       ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200915162049.36434-1-colin.king@canonical.com
      ce0cb93a
    • Christophe JAILLET's avatar
      drm/rockchip: lvds: Fix an error handling path · 3dfa159f
      Christophe JAILLET authored
      'ret' is know to be 0 a this point. Checking the return value of
      'phy_init()' and 'phy_set_mode()' was intended instead.
      
      So add the missing assignments.
      
      Fixes: cca1705c
      
       ("drm/rockchip: lvds: Add PX30 support")
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/248220d4815dc8c8088cebfab7d6df5f70518438.1619881852.git.christophe.jaillet@wanadoo.fr
      3dfa159f
    • Jiapeng Chong's avatar
      drm/rockchip: remove unused function · 7455cedf
      Jiapeng Chong authored
      
      
      Fix the following clang warning:
      
      drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:320:20: warning: unused
      function 'dsi_set' [-Wunused-function].
      
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/1618476421-114429-1-git-send-email-jiapeng.chong@linux.alibaba.com
      7455cedf
    • Thomas Hebb's avatar
      drm/rockchip: dsi: remove extra component_del() call · b354498b
      Thomas Hebb authored
      commit cf6d100d ("drm/rockchip: dsi: add dual mipi support") added
      this devcnt field and call to component_del(). However, these both
      appear to be erroneous changes left over from an earlier version of the
      patch. In the version merged, nothing ever modifies devcnt, meaning
      component_del() runs unconditionally and in addition to the
      component_del() calls in dw_mipi_dsi_rockchip_host_detach(). The second
      call fails to delete anything and produces a warning in dmesg.
      
      If we look at the previous version of the patch[1], however, we see that
      it had logic to calculate devcnt and call component_add() in certain
      situations. This was removed in v6, and the fact that the deletion code
      was not appears to have been an oversight.
      
      [1] https://patchwork.kernel.org/project/dri-devel/patch/20180821140515.22246-8-heiko@sntech.de/
      
      Fixes: cf6d100d
      
       ("drm/rockchip: dsi: add dual mipi support")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/201385acb0eeb5dfb037afdc6a94bfbcdab97f99.1618797778.git.tommyhebb@gmail.com
      b354498b
    • Thomas Hebb's avatar
      drm/rockchip: dsi: move all lane config except LCDC mux to bind() · 43c2de10
      Thomas Hebb authored
      When we first enable the DSI encoder, we currently program some per-chip
      configuration that we look up in rk3399_chip_data based on the device
      tree compatible we match. This data configures various parameters of the
      MIPI lanes, including on RK3399 whether DSI1 is slaved to DSI0 in a
      dual-mode configuration. It also selects which LCDC (i.e. VOP) to scan
      out from.
      
      This causes a problem in RK3399 dual-mode configurations, though: panel
      prepare() callbacks run before the encoder gets enabled and expect to be
      able to write commands to the DSI bus, but the bus isn't fully
      functional until the lane and master/slave configuration have been
      programmed. As a result, dual-mode panels (and possibly others too) fail
      to turn on when the rockchipdrm driver is initially loaded.
      
      Because the LCDC mux is the only thing we don't know until enable time
      (and is the only thing that can ever change), we can actually move most
      of the initialization to bind() and get it out of the way early. That's
      what this change does. (Rockchip's 4.4 BSP kernel does it in mode_set(),
      which also avoids the issue, but bind() seems like the more correct
      place to me.)
      
      Tested on a Google Scarlet board (Acer Chromebook Tab 10), which has a
      Kingdisplay KD097D04 dual-mode panel. Prior to this change, the panel's
      backlight would turn on but no image would appear when initially loading
      rockchipdrm. If I kept rockchipdrm loaded and reloaded the panel driver,
      it would come on. With this change, the panel successfully turns on
      during initial rockchipdrm load as expected.
      
      Fixes: 2d4f7bda
      
       ("drm/rockchip: dsi: migrate to use dw-mipi-dsi bridge driver")
      Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
      Tested-by: default avatarJonathan Liu <net147@gmail.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com
      43c2de10