1. 26 Aug, 2021 7 commits
  2. 23 Aug, 2021 7 commits
  3. 20 Aug, 2021 6 commits
  4. 18 Aug, 2021 3 commits
  5. 17 Aug, 2021 4 commits
  6. 16 Aug, 2021 6 commits
  7. 13 Aug, 2021 3 commits
  8. 12 Aug, 2021 4 commits
    • Daniel Vetter's avatar
      drm/vgem: use shmem helpers · 45d9c8dd
      Daniel Vetter authored
      Aside from deleting lots of code the real motivation here is to switch
      the mmap over to VM_PFNMAP, to be more consistent with what real gpu
      drivers do. They're all VM_PFNMAP, which means get_user_pages doesn't
      work, and even if you try and there's a struct page behind that,
      touching it and mucking around with its refcount can upset drivers
      real bad.
      
      v2: Review from Thomas:
      - sort #include
      - drop more dead code that I didn't spot somehow
      
      v3: select DRM_GEM_SHMEM_HELPER to make it build (intel-gfx-ci)
      
      v4: I got tricked by 0cf2ef46 ("drm/shmem-helper: Use cached
      mappings by default"), and we need WC in vgem because vgem doesn't
      have explicit begin/end cpu access ioctls.
      
      Also add a comment why exactly vgem has to use wc.
      
      v5: Don't set obj->base.funcs, it will default to drm_gem_shmem_funcs
      (Thomas)
      
      v6: vgem also needs an MMU for remapping
      
      v7: I absolutely butchered the rebases over the vgem mmap change and
      revert and broke the patch. Actually go back to v6 from before the
      vgem mmap changes.
      
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: "Christian König" <christian.koenig@amd.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Melissa Wen <melissa.srw@gmail.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210812131412.2487363-4-daniel.vetter@ffwll.ch
      45d9c8dd
    • Daniel Vetter's avatar
      drm/shmem-helpers: Allocate wc pages on x86 · 804b6e5e
      Daniel Vetter authored
      intel-gfx-ci realized that something is not quite coherent anymore on
      some platforms for our i915+vgem tests, when I tried to switch vgem
      over to shmem helpers.
      
      After lots of head-scratching I realized that I've removed calls to
      drm_clflush. And we need those. To make this a bit cleaner use the
      same page allocation tooling as ttm, which does internally clflush
      (and more, as neeeded on any platform instead of just the intel x86
      cpus i915 can be combined with).
      
      Unfortunately this doesn't exist on arm, or as a generic feature. For
      that I think only the dma-api can get at wc memory reliably, so maybe
      we'd need some kind of GFP_WC flag to do this properly.
      
      v2: Add a TODO comment about what should be done to support this in
      other places (Thomas)
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210812131412.2487363-3-daniel.vetter@ffwll.ch
      804b6e5e
    • Daniel Vetter's avatar
      drm/shmem-helper: Switch to vmf_insert_pfn · 8b93d1d7
      Daniel Vetter authored
      We want to stop gup, which isn't the case if we use vmf_insert_page
      and VM_MIXEDMAP, because that does not set pte_special.
      
      The motivation here is to stop get_user_pages from working on buffer
      object mmaps in general. Quoting some discussion with Thomas:
      
      On Thu, Jul 22, 2021 at 08:22:43PM +0200, Thomas Zimmermann wrote:
      > Am 13.07.21 um 22:51 schrieb Daniel Vetter:
      > > We want to stop gup, which isn't the case if we use vmf_insert_page
      >
      > What is gup?
      
      get_user_pages. It pins memory wherever it is, which badly wreaks at least
      ttm and could also cause trouble with cma allocations. In both cases
      becaue we can't move/reuse these pages anymore.
      
      Now get_user_pages fails when the memory isn't considered "normal", like
      with VM_PFNMAP and using vm_insert_pfn. For consistency across all dma-buf
      I'm trying (together with Christian König) to roll this out everywhere,
      for fewer surprises.
      
      E.g. for 5.14 iirc we merged a patch to do the same for ttm, where it
      closes an actual bug (ttm gets really badly confused when there's suddenly
      pinned pages where it thought it can move them).
      
      cma allcoations already use VM_PFNMAP (because that's what dma_mmap is
      using underneath), as is anything that's using remap_pfn_range. Worst case
      we have to revert this patch for shmem helpers if it breaks something, but
      I hope that's not the case. On the ttm side we've also had some fallout
      that we needed to paper over with clever tricks.
      v2: With this shmem gem helpers now definitely need CONFIG_MMU (0day)
      
      v3: add more depends on MMU. For usb drivers this is a bit awkward,
      but really it's correct: To be able to provide a contig mapping of
      buffers to userspace on !MMU platforms we'd need to use the cma
      helpers for these drivers on those platforms. As-is this wont work.
      
      Also not exactly sure why vm_insert_page doesn't go boom, because that
      definitely wont fly in practice since the pages are non-contig to
      begin with.
      
      v4: Explain the entire motivation a lot more (Thomas)
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210812131412.2487363-2-daniel.vetter@ffwll.ch
      8b93d1d7
    • Rob Clark's avatar
      drm/bridge: ti-sn65dsi86: Avoid creating multiple connectors · c7782443
      Rob Clark authored
      If we created our own connector because the driver does not support the
      NO_CONNECTOR flag, we don't want the downstream bridge to *also* create
      a connector.  And if this driver did pass the NO_CONNECTOR flag (and we
      supported that mode) this would change nothing.
      
      Fixes: 4e5763f0 ("drm/bridge: ti-sn65dsi86: Wrap panel with panel-bridge")
      Reported-by: default avatarStephen Boyd <swboyd@chromium.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Tested-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Tested-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210811235253.924867-2-robdclark@gmail.com
      c7782443