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

Commits on Nov 18, 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>
    Thomas Hellström authored and intel-lab-lkp committed Nov 18, 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
    
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Thomas Hellström authored and intel-lab-lkp committed Nov 18, 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>
    Thomas Hellström authored and intel-lab-lkp committed Nov 18, 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.
    
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Thomas Hellström authored and intel-lab-lkp committed Nov 18, 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 18, 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.
    
    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>
    mlankhorst authored and intel-lab-lkp committed Nov 18, 2021
  7. Merge remote-tracking branch 'drm-intel/drm-intel-gt-next' into drm-tip

    # Conflicts:
    #	drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
    jwrdegoede committed Nov 18, 2021
  8. 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
    jwrdegoede committed Nov 18, 2021
  9. Merge remote-tracking branch 'drm-misc/drm-misc-next' into drm-tip

    # Conflicts:
    #	drivers/gpu/drm/scheduler/sched_main.c
    jwrdegoede committed Nov 18, 2021
  10. drm/i915/vlv_dsi: Double pixelclock on read-back for dual-link panels

    In intel_dsi_get_config() double the pclk returned by foo_dsi_get_pclk()
    for dual-link panels. This fixes the following WARN triggering:
    
     i915 0000:00:02.0: [drm] *ERROR* [CRTC:51:pipe A] mismatch in pixel_rate (expected 235710, found 118056)
     i915 0000:00:02.0: [drm] *ERROR* [CRTC:51:pipe A] mismatch in hw.pipe_mode.crtc_clock (expected 235710, found 118056)
     i915 0000:00:02.0: [drm] *ERROR* [CRTC:51:pipe A] mismatch in hw.adjusted_mode.crtc_clock (expected 235710, found 118056)
     i915 0000:00:02.0: [drm] *ERROR* [CRTC:51:pipe A] mismatch in port_clock (expected 235710, found 118056)
     ------------[ cut here ]------------
     pipe state doesn't match!
     WARNING: CPU: 3 PID: 136 at drivers/gpu/drm/i915/display/intel_display.c:9125 intel_display_finish_reset+0x1bd3/0x2050 [i915]
     ...
    
    This has been tested on a Xiaomi Mi Pad 2 (with CHT x5-Z8500 SoC) tablet,
    with a 1536x2048 dual-link DSI panel.
    
    Note this fix was taken from icl_dsi.c which does the same in
    its get_config().
    
    Cc: Tsuchiya Yuto <kitakar@gmail.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Acked-by: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211024155020.126328-1-hdegoede@redhat.com
    jwrdegoede committed Nov 18, 2021
  11. drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Book X91F/L

    The Lenovo Yoga Book X91F/L uses a panel which has been mounted
    90 degrees rotated. Add a quirk for this.
    
    Cc: Yauhen Kharuzhy <jekhor@gmail.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Acked-by: Simon Ser <contact@emersion.fr>
    Tested-by: Yauhen Kharuzhy <jekhor@gmail.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211106130227.11927-1-hdegoede@redhat.com
    jwrdegoede committed Nov 18, 2021
  12. Merge drm/drm-next into drm-misc-next

    Backmerging from drm/drm-next for v5.16-rc1.
    
    Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
    Thomas Zimmermann committed Nov 18, 2021

Commits on Nov 17, 2021

  1. drm/i915: Clarify probing order in intel_dp_aux_init_backlight_funcs()

    Hooray! We've managed to hit enough bugs upstream that I've been able to
    come up with a pretty solid explanation for how backlight controls are
    actually supposed to be detected and used these days. As well, having the
    rest of the PWM bits in VESA's backlight interface implemented seems to
    have fixed all of the problematic brightness controls laptop panels that
    we've hit so far.
    
    So, let's actually document this instead of just calling the laptop panels
    liars. As well, I would like to formally apologize to all of the laptop
    panels I called liars. I'm sorry laptop panels, hopefully you can all
    forgive me and we can move past this~
    
    Signed-off-by: Lyude Paul <lyude@redhat.com>
    Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-6-lyude@redhat.com
    Lyude committed Nov 17, 2021
  2. drm/dp, drm/i915: Add support for VESA backlights using PWM for brigh…

    …tness control
    
    Now that we've added support to i915 for controlling panel backlights that
    need PWM to be enabled/disabled, let's finalize this and add support for
    controlling brightness levels via PWM as well. This should hopefully put us
    towards the path of supporting _ALL_ backlights via VESA's DPCD interface
    which would allow us to finally start trusting the DPCD again.
    
    Note however that we still don't enable using this by default on i915 when
    it's not needed, primarily because I haven't yet had a chance to confirm if
    it's safe to do this on the one machine in Intel's CI that had an issue
    with this: samus-fi-bdw. I have done basic testing of this on other
    machines though, by manually patching i915 to force it into PWM-only mode
    on some of my laptops.
    
    v2:
    * Correct documentation (thanks Doug!)
    * Get rid of backlight caps
    
    Signed-off-by: Lyude Paul <lyude@redhat.com>
    Reviewed-by: Doug Anderson <dianders@chromium.org>
    Cc: Rajeev Nandan <rajeevny@codeaurora.org>
    Cc: Satadru Pramanik <satadru@gmail.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-5-lyude@redhat.com
    Lyude committed Nov 17, 2021
  3. drm/dp: Don't read back backlight mode in drm_edp_backlight_enable()

    As it turns out, apparently some machines will actually leave additional
    backlight functionality like dynamic backlight control on before the OS
    loads. Currently we don't take care to disable unsupported features when
    writing back the backlight mode, which can lead to some rather strange
    looking behavior when adjusting the backlight.
    
    So, let's fix this by just not reading back the current backlight mode on
    initial enable. I don't think there should really be any downsides to this,
    and this will ensure we don't leave any unsupported functionality enabled.
    
    This should fix at least one (but not all) of the issues seen with DPCD
    backlight support on fi-bdw-samus
    
    v5:
    * Just avoid reading back DPCD register - Doug Anderson
    
    Signed-off-by: Lyude Paul <lyude@redhat.com>
    Fixes: 867cf9c ("drm/dp: Extract i915's eDP backlight code into DRM helpers")
    Reviewed-by: Douglas Anderson <dianders@chromium.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-4-lyude@redhat.com
    Lyude committed Nov 17, 2021
  4. drm/nouveau/kms/nv50-: Explicitly check DPCD backlights for aux enabl…

    …e/brightness
    
    Since we don't support hybrid AUX/PWM backlights in nouveau right now,
    let's add some explicit checks so that we don't break nouveau once we
    enable support for these backlights in other drivers.
    
    Reviewed-by: Karol Herbst <kherbst@redhat.com>
    Signed-off-by: Lyude Paul <lyude@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-3-lyude@redhat.com
    Lyude committed Nov 17, 2021
  5. drm/i915: Add support for panels with VESA backlights with PWM enable…

    …/disable
    
    This simply adds proper support for panel backlights that can be controlled
    via VESA's backlight control protocol, but which also require that we
    enable and disable the backlight via PWM instead of via the DPCD interface.
    We also enable this by default, in order to fix some people's backlights
    that were broken by not having this enabled.
    
    For reference, backlights that require this and use VESA's backlight
    interface tend to be laptops with hybrid GPUs, but this very well may
    change in the future.
    
    v4:
    * Make sure that we call intel_backlight_level_to_pwm() in
      intel_dp_aux_vesa_enable_backlight() - vsyrjala
    
    Signed-off-by: Lyude Paul <lyude@redhat.com>
    Link: https://gitlab.freedesktop.org/drm/intel/-/issues/3680
    Fixes: fe7d52b ("drm/i915/dp: Don't use DPCD backlights that need PWM enable/disable")
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: <stable@vger.kernel.org> # v5.12+
    Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-2-lyude@redhat.com
    Lyude committed Nov 17, 2021
  6. drm/i915: Fix fastsets on TypeC ports following a non-blocking modeset

    After a non-blocking modeset on a TypeC port's CRTC - possibly blocked
    later in drm_atomic_helper_wait_for_dependencies() - a fastset on the
    same CRTC may copy the state of CRTC before this gets updated to reflect
    the up-to-date DP-alt vs. TBT-alt TypeC mode DPLL used for the CRTC. In
    this case after the first (non-blocking) commit completes enabling the
    DPLL required for the up-to-date TypeC mode the following fastset will
    update the CRTC state pointing to the wrong DPLL. A subsequent disabling
    modeset will try to disable the wrong PLL, triggering a state checker
    WARN (and leaving the DPLL which is actually used active for good).
    
    Fix the above race by copying the DPLL state for fastset CRTCs from the
    old CRTC state at the point where it's guaranteed to be up-to-date
    already. This could be handled in the encoder's update_prepare() hook as
    well, but that's a bigger change, which is better done as a follow-up.
    
    v2: Copy dpll_hw_state as well. (Ville)
    
    Testcase: igt/kms_busy/extended-modeset-hang-newfb-with-reset
    Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4308
    Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Reviewed-by: Mika Kahola <mika.kahola@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211115181121.156197-1-imre.deak@intel.com
    ideak committed Nov 17, 2021
  7. gpu: drm: panel-edp: Fix edp_panel_entry documentation

    The edp_panel_entry members 'delay' and 'name' are documented, but
    without the correct syntax for kernel doc.
    
    This generates the following warnings:
    
    drivers/gpu/drm/panel/panel-edp.c:204: warning: Function parameter or member 'delay' not described in 'edp_panel_entry'
    drivers/gpu/drm/panel/panel-edp.c:204: warning: Function parameter or member 'name' not described in 'edp_panel_entry'
    
    Fix them accordingly.
    
    Fixes: 5540cf8 ("drm/panel-edp: Implement generic "edp-panel"s probed by EDID")
    Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211117163239.529781-1-kieran.bingham+renesas@ideasonboard.com
    kbingham authored and dianders committed Nov 17, 2021
  8. drm/bridge: parade-ps8640: Fix additional suspend/resume at bootup

    Through log and waveform, we can see that there will be additional
    suspend/resume when booting. This timing does not meet the ps8640 spec.
    It seems that the delay of 500ms does not satisfied drm_panel_get_modes.
    I increased it to 900ms and it seems that this problem can be solved.
    To be safe, I'd just round up to a full 1000.
    
    Signed-off-by: yangcong <yangcong5@huaqin.corp-partner.google.com>
    Reviewed-by: Stephen Boyd <swboyd@chromium.org>
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211112084302.2447931-1-yangcong5@huaqin.corp-partner.google.com
    yangcong authored and dianders committed Nov 17, 2021
  9. drm/i915/guc: fix NULL vs IS_ERR() checking

    The intel_engine_create_virtual() function does not return NULL.  It
    returns error pointers.
    
    Fixes: e5e3217 ("drm/i915/guc: Connect UAPI to GuC multi-lrc interface")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116114916.GB11936@kili
    error27 authored and rodrigovivi committed Nov 17, 2021
  10. drm/i915/guc: fix NULL vs IS_ERR() checking

    The intel_engine_create_virtual() function does not return NULL.  It
    returns error pointers.
    
    Fixes: e5e3217 ("drm/i915/guc: Connect UAPI to GuC multi-lrc interface")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116114916.GB11936@kili
    (cherry picked from commit fc12b70)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    error27 authored and rodrigovivi committed Nov 17, 2021
  11. drm/i915/dsi/xelpd: Fix the bit mask for wakeup GB

    v2: Fix the typo, move out the hardcoding from
        macro(Jani, Ville)
    
    Fixes: f87c46c ("drm/i915/dsi/xelpd: Add WA to program LP to HS wakeup guardband")
    Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
    Reviewed-by: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211019151435.20477-2-vandita.kulkarni@intel.com
    (cherry picked from commit 6f07707)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Vanditakulkarni authored and rodrigovivi committed Nov 17, 2021
  12. Revert "drm/i915/tgl/dsi: Gate the ddi clocks after pll mapping"

    This reverts commit 991d955 ("drm/i915/tgl/dsi: Gate the ddi clocks
    after pll mapping"). The Bspec was updated recently with the pll ungate
    sequence similar to that of icl dsi enable sequence. Hence reverting.
    
    Bspec: 49187
    Fixes: 991d955 ("drm/i915/tgl/dsi: Gate the ddi clocks after pll mapping")
    Cc: <stable@vger.kernel.org> # v5.4+
    Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211109120428.15211-1-vandita.kulkarni@intel.com
    (cherry picked from commit 4579509)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Vanditakulkarni authored and rodrigovivi committed Nov 17, 2021
  13. dma-buf: nuke dma_resv_get_excl_unlocked

    Heureka, that's finally not used any more.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210917123513.1106-27-christian.koenig@amd.com
    ChristianKoenigAMD committed Nov 17, 2021
  14. drm/amdgpu: stop getting excl fence separately

    Just grab all fences for the display flip in one go.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211028132630.2330-2-christian.koenig@amd.com
    ChristianKoenigAMD committed Nov 17, 2021
  15. drm/i915: use new iterator in i915_gem_object_wait_reservation

    Simplifying the code a bit.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    [mlankhorst: Handle timeout = 0 correctly, use new i915_request_wait_timeout.]
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Acked-by: Daniel Vetter <daniel@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-7-christian.koenig@amd.com
    ChristianKoenigAMD committed Nov 17, 2021
  16. drm/i915: Fix i915_request fence wait semantics

    The i915_request fence wait behaves differently for timeout = 0
    compared to expected dma-fence behavior.
    
    i915 behavior:
    - Unsignaled: -ETIME
    - Signaled: 0 (= timeout)
    
    Expected:
    - Unsignaled: 0
    - Signaled: 1
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Acked-by: Daniel Vetter <daniel@ffwll.ch>
    Acked-by: Christian König <christian.koenig@amd.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-6-christian.koenig@amd.com
    Signed-off-by: Christian König <christian.koenig@amd.com>
    mlankhorst authored and ChristianKoenigAMD committed Nov 17, 2021
  17. drm/i915: use new cursor in intel_prepare_plane_fb v2

    Simplifying the code a bit.
    
    v2: rebased
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Acked-by: Daniel Vetter <daniel@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-5-christian.koenig@amd.com
    ChristianKoenigAMD committed Nov 17, 2021
  18. drm/i915: use the new iterator in i915_sw_fence_await_reservation v3

    Simplifying the code a bit.
    
    v2: use dma_resv_for_each_fence instead, according to Tvrtko the lock is
        held here anyway.
    v3: back to using dma_resv_for_each_fence_unlocked.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Acked-by: Daniel Vetter <daniel@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-4-christian.koenig@amd.com
    ChristianKoenigAMD committed Nov 17, 2021
  19. drm/i915: use new iterator in i915_gem_object_wait_priority

    Simplifying the code a bit.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Acked-by: Daniel Vetter <daniel@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-3-christian.koenig@amd.com
    ChristianKoenigAMD committed Nov 17, 2021
  20. drm/i915: use the new iterator in i915_gem_busy_ioctl v2

    This makes the function much simpler since the complex
    retry logic is now handled else where.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Acked-by: Daniel Vetter <daniel@ffwll.ch>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-2-christian.koenig@amd.com
    ChristianKoenigAMD committed Nov 17, 2021
Older