Skip to content
Permalink
Thomas-Hellstr…
Switch branches/tags

Commits on Nov 22, 2021

  1. drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

    Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for
    future users and update the only current user to sync the objects
    as needed after this function.
    
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Thomas Hellström authored and intel-lab-lkp committed Nov 22, 2021
  2. drm/i915/ttm: Implement asynchronous TTM moves

    Don't wait sync while migrating, but rather make the GPU blit await the
    dependencies and add a moving fence to the object.
    
    This also enables asynchronous VRAM management in that on eviction,
    rather than waiting for the moving fence to expire before freeing VRAM,
    it is freed immediately and the fence is stored with the VRAM manager and
    handed out to newly allocated objects to await before clears and swapins,
    or for kernel objects before setting up gpu vmas or mapping.
    
    To collect dependencies before migrating, add a set of utilities that
    coalesce these to a single dma_fence.
    
    What is still missing for fully asynchronous operation is asynchronous vma
    unbinding, which is still to be implemented.
    
    This commit substantially reduces execution time in the gem_lmem_swapping
    test.
    
    v2:
    - Make a couple of functions static.
    v4:
    - Fix some style issues (Matthew Auld)
    - Audit and add more checks for ghost objects (Matthew Auld)
    - Add more documentation for the i915_deps utility (Mattew Auld)
    - Simplify the i915_deps_sync() function
    v6:
    - Re-check for fence signaled before returning -EBUSY (Matthew Auld)
    - Use dma_resv_iter_is_exclusive() (Matthew Auld)
    - Await all dma-resv fences before a migration blit (Matthew Auld)
    
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Thomas Hellström authored and intel-lab-lkp committed Nov 22, 2021
  3. drm/i915/ttm: Correctly handle waiting for gpu when shrinking

    With async migration, the shrinker may end up wanting to release the
    pages of an object while the migration blit is still running, since
    the GT migration code doesn't set up VMAs and the shrinker is thus
    oblivious to the fact that the GPU is still using the pages.
    
    Add waiting for gpu in the shrinker_release_pages() op and an
    argument to that function indicating whether the shrinker expects it
    to not wait for gpu. In the latter case the shrinker_release_pages()
    op will return -EBUSY if the object is not idle.
    
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Thomas Hellström authored and intel-lab-lkp committed Nov 22, 2021
  4. drm/i915/ttm: Drop region reference counting

    There is an interesting refcounting loop:
    struct intel_memory_region has a struct ttm_resource_manager,
    ttm_resource_manager->move may hold a reference to i915_request,
    i915_request may hold a reference to intel_context,
    intel_context may hold a reference to drm_i915_gem_object,
    drm_i915_gem_object may hold a reference to intel_memory_region.
    
    Break this loop by dropping region reference counting.
    
    In addition, Have regions with a manager moving fence make sure
    that all region objects are released before freeing the region.
    
    v6:
    - Fix a code comment.
    
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Thomas Hellström authored and intel-lab-lkp committed Nov 22, 2021
  5. drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function

    Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h.
    This will help keep a number of functions static when introducing
    async moves.
    
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Thomas Hellström authored and intel-lab-lkp committed Nov 22, 2021
  6. drm/i915: Add support for moving fence waiting

    For now, we will only allow async migration when TTM is used,
    so the paths we care about are related to TTM.
    
    The mmap path is handled by having the fence in ttm_bo->moving,
    when pinning, the binding only becomes available after the moving
    fence is signaled, and pinning a cpu map will only work after
    the moving fence signals.
    
    This should close all holes where userspace can read a buffer
    before it's fully migrated.
    
    v2:
    - Fix a couple of SPARSE warnings
    v3:
    - Fix a NULL pointer dereference
    v4:
    - Ditch the moving fence waiting for i915_vma_pin_iomap() and
      replace with a verification that the vma is already bound.
      (Matthew Auld)
    - Squash with a previous patch introducing moving fence waiting and
      accessing interfaces (Matthew Auld)
    - Rename to indicated that we also add support for sync waiting.
    v5:
    - Fix check for NULL and unreferencing i915_vma_verify_bind_complete()
      (Matthew Auld)
    - Fix compilation failure if !CONFIG_DRM_I915_DEBUG_GEM
    - Fix include ordering. (Matthew Auld)
    
    Co-developed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    mlankhorst authored and intel-lab-lkp committed Nov 22, 2021

Commits on Nov 19, 2021

  1. Merge remote-tracking branch 'drm-intel/drm-intel-gt-next' into drm-tip

    # Conflicts:
    #	drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
    matt-auld committed Nov 19, 2021
  2. Merge remote-tracking branch 'drm-intel/drm-intel-next' into drm-tip

    # Conflicts:
    #	drivers/gpu/drm/i915/display/intel_display.c
    #	drivers/gpu/drm/i915/display/intel_dp.c
    #	drivers/gpu/drm/i915/gt/intel_ggtt.c
    matt-auld committed Nov 19, 2021
  3. Merge remote-tracking branch 'drm-misc/drm-misc-next' into drm-tip

    # Conflicts:
    #	drivers/gpu/drm/scheduler/sched_main.c
    matt-auld committed Nov 19, 2021
  4. drm/i915: Drain the ttm delayed workqueue too

    Lets be thorough here. Users of the TTM backend would likely expect this
    behaviour.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-6-matthew.auld@intel.com
    mlankhorst authored and matt-auld committed Nov 19, 2021
  5. drm/i915: Remove resv from i915_vma

    It's just an alias to vma->obj->base.resv, no need to duplicate it.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-5-matthew.auld@intel.com
    mlankhorst authored and matt-auld committed Nov 19, 2021
  6. drm/i915: vma is always backed by an object.

    vma->obj and vma->resv are now never NULL, and some checks can be removed.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-4-matthew.auld@intel.com
    mlankhorst authored and matt-auld committed Nov 19, 2021
  7. drm/i915: Create a full object for mock_ring, v2.

    This allows us to finally get rid of all the assumptions that vma->obj
    is NULL.
    
    Changes since v1:
    - Ensure the mock_ring vma is pinned to prevent a fault.
    - Pin it high to avoid failure in evict_for_vma selftest.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-3-matthew.auld@intel.com
    mlankhorst authored and matt-auld committed Nov 19, 2021
  8. drm/i915: Create a dummy object for gen6 ppgtt

    We currently have to special case vma->obj being NULL because
    of gen6 ppgtt and mock_engine. Fix gen6 ppgtt, so we may soon
    be able to remove a few checks. As the object only exists as
    a fake object pointing to ggtt, we have no backing storage,
    so no real object is created. It just has to look real enough.
    
    Also kill pin_mutex, it's not compatible with ww locking,
    and we can use the vm lock instead.
    
    v2:
      - Drop IS_SHRINKABLE and shorten overly long line
    v3:
      - Checkpatch fix for alignment
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-2-matthew.auld@intel.com
    mlankhorst authored and matt-auld committed Nov 19, 2021
  9. drm/i915: move the pre_pin earlier

    In intel_context_do_pin_ww, when calling into the pre_pin hook(which is
    passed the ww context) it could in theory return -EDEADLK(which is very
    likely with debug kernels), once we start adding more ww locking in there,
    like in the next patch. If so then we need to be mindful of having to
    restart the do_pin at this point.
    
    If this is the kernel_context, or some other early in-kernel context
    where we have yet to setup the default_state, then we always inhibit the
    context restore, and instead rely on the delayed active_release to set
    the CONTEXT_VALID_BIT for us(if we even care), which should indicate
    that we have context switched away, and that our newly saved context
    state should now be valid. However, since we currently grab the active
    reference before the potential ww dance, we can end up setting the
    CONTEXT_VALID_BIT much too early, if we need to backoff, and then upon
    re-trying the do_pin, we could potentially cause the hardware to
    incorrectly load some garbage context state when later context switching
    to that context, but at the very least this will trigger the
    GEM_BUG_ON() in __engine_unpark. For now let's just move any ww dance
    stuff prior to arming the active reference.
    
    For normal user contexts this shouldn't be a concern, since we should
    already have the default_state ready when initialising the lrc state,
    and so there should be no concern with active_release somehow
    prematurely setting the CONTEXT_VALID_BIT.
    
    v2(Thomas):
      - Also re-order the onion unwind
    
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-1-matthew.auld@intel.com
    matt-auld committed Nov 19, 2021
  10. drm/i915/dg2: Implement WM0 cursor WA for DG2

    Bug in the register unit which results in WM1 register
    used when only WM0 is enabled on cursor.
    Software workaround is when only WM0 enabled on cursor,
    copy contents of CUR_WM_0[30:0] (exclude the enable bit)
    into CUR_WM_1[30:0].
    
    v2:  - s/dev_priv/i915/ (Ville Syrjälä)
         - Removed unneeded brackets (Ville Syrjälä)
    
    HSDES: 14012656716
    
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211118093907.18510-1-stanislav.lisovskiy@intel.com
    StanFox1984 committed Nov 19, 2021
  11. drm/i915/pxp: fix includes for headers in include/drm

    Use <> not "" for including headers from include/drm.
    
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116135813.19806-1-jani.nikula@intel.com
    jnikula committed Nov 19, 2021
  12. drm/i915: drop intel_display.h include from intel_display_power.h

    Use forward declarations instead.
    
    Cc: Imre Deak <imre.deak@intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: Imre Deak <imre.deak@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-5-jani.nikula@intel.com
    jnikula committed Nov 19, 2021
  13. drm/i915: move structs from intel_display_power.h to .c

    Anything internal to the implementation should be hidden away. Move the
    intel_display_power structs to the .c file.
    
    Cc: Imre Deak <imre.deak@intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: Imre Deak <imre.deak@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-4-jani.nikula@intel.com
    jnikula committed Nov 19, 2021
  14. drm/i915/debugfs: move debug printing to intel_display_power.c

    The debugfs should have no special privileges to look into the
    implementation guts. Move the actual debug printing of power domains to
    intel_display_power.c.
    
    Cc: Imre Deak <imre.deak@intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: Imre Deak <imre.deak@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-3-jani.nikula@intel.com
    jnikula committed Nov 19, 2021
  15. drm/i915: drop intel_display.h include from intel_dpll_mgr.h

    Use forward declarations instead.
    
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: Imre Deak <imre.deak@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-2-jani.nikula@intel.com
    jnikula committed Nov 19, 2021
  16. drm/i915: drop intel_display.h include from intel_ddi.h

    Use forward declarations instead.
    
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: Imre Deak <imre.deak@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-1-jani.nikula@intel.com
    jnikula committed Nov 19, 2021
  17. drm/aspeed: Fix vga_pw sysfs output

    Before the drm driver had support for this file there was a driver that
    exposed the contents of the vga password register to userspace. It would
    present the entire register instead of interpreting it.
    
    The drm implementation chose to mask of the lower bit, without explaining
    why. This breaks the existing userspace, which is looking for 0xa8 in
    the lower byte.
    
    Change our implementation to expose the entire register.
    
    Fixes: 696029e ("drm/aspeed: Add sysfs for output settings")
    Reported-by: Oskar Senft <osk@google.com>
    Signed-off-by: Joel Stanley <joel@jms.id.au>
    Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
    Tested-by: Oskar Senft <osk@google.com>
    Signed-off-by: Maxime Ripard <maxime@cerno.tech>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211117010145.297253-1-joel@jms.id.au
    shenki authored and mripard committed Nov 19, 2021
  18. drm/vc4: fix error code in vc4_create_object()

    The ->gem_create_object() functions are supposed to return NULL if there
    is an error.  None of the callers expect error pointers so returing one
    will lead to an Oops.  See drm_gem_vram_create(), for example.
    
    Fixes: c826a6e ("drm/vc4: Add a BO cache.")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Maxime Ripard <maxime@cerno.tech>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211118111416.GC1147@kili
    error27 authored and mripard committed Nov 19, 2021
  19. drm/i915: Clean up CRC register defines

    Use REG_BIT() & co. for the CRC registers.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211112193813.8224-8-ville.syrjala@linux.intel.com
    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    vsyrjala committed Nov 19, 2021
  20. drm/i915: Clean up DPINVGTT/VLV_DPFLIPSTAT bits

    Use REG_BIT() & co. for DPINVTT/VLV_DPFLIPSTAT bits.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211112193813.8224-9-ville.syrjala@linux.intel.com
    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    vsyrjala committed Nov 19, 2021
  21. drm/i915: Clean up FPGA_DBG/CLAIM_ER bits

    Use REG_BIT() & co. for FPGA_DBG/CLAIM_ER bits.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211112193813.8224-10-ville.syrjala@linux.intel.com
    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    vsyrjala committed Nov 19, 2021
  22. Merge tag 'amd-drm-fixes-5.16-2021-11-17' of https://gitlab.freedeskt…

    …op.org/agd5f/linux into drm-fixes
    
    amd-drm-fixes-5.16-2021-11-17:
    
    amdgpu:
    - Better debugging info for SMU msgs
    - Better error reporting when adding IP blocks
    - Fix UVD powergating regression on CZ
    - Clock reporting fix for navi1x
    - OLED panel backlight fix
    - Fix scaling on VGA/DVI for non-DC display code
    - Fix GLFCLK handling for RGP on some APUs
    - fix potential memory leak
    
    amdkfd:
    - GPU reset fix
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    From: Alex Deucher <alexander.deucher@amd.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211118041638.20831-1-alexander.deucher@amd.com
    airlied committed Nov 19, 2021
  23. Merge tag 'drm-intel-fixes-2021-11-18' of git://anongit.freedesktop.o…

    …rg/drm/drm-intel into drm-fixes
    
    One quick fix for return error handling, one fix for ADL-P display
    and one revert targeting stable 5.4, for TGL's DSI display clocks
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    
    From: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/YZbUPIHpR1S3JZ2b@intel.com
    airlied committed Nov 19, 2021
  24. Merge tag 'drm-misc-fixes-2021-11-18' of git://anongit.freedesktop.or…

    …g/drm/drm-misc into drm-fixes
    
    A infoframe corruption fix for nouveau, a wrong free function usage fix
    for GEM CMA helpers, a Kconfig dependency fix for sun4i, two fixes for
    drm/scheduler refcounting and a probing fix for efifb.
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    
    From: Maxime Ripard <maxime@cerno.tech>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211118075447.5rn6zaulnrequqnm@gilmour
    airlied committed Nov 19, 2021

Commits on Nov 18, 2021

  1. drm/i915/: Extend VRR platform support to Gen 11

    VRR is supported on Gen 11 HW , hence extend the support
    in the driver to enable this for Gen 11.
    
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116231209.28621-1-manasi.d.navare@intel.com
    mdnavare committed Nov 18, 2021
  2. drm/nouveau/acr: fix a couple NULL vs IS_ERR() checks

    The nvkm_acr_lsfw_add() function never returns NULL.  It returns error
    pointers on error.
    
    Fixes: 22dcda4 ("drm/nouveau/acr: implement new subdev to replace "secure boot"")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Karol Herbst <kherbst@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211118111314.GB1147@kili
    error27 authored and karolherbst committed Nov 18, 2021
Older