1. 18 Dec, 2015 6 commits
    • Mario Kleiner's avatar
      drm/radeon: Fixup hw vblank counter/ts for new drm_update_vblank_count() (v2) · c55d21ea
      Mario Kleiner authored
      commit 4dfd6486 "drm: Use vblank timestamps to guesstimate how many
      vblanks were missed" introduced in Linux 4.4-rc1 makes the drm core
      more fragile to drivers which don't update hw vblank counters and
      vblank timestamps in sync with firing of the vblank irq and
      essentially at leading edge of vblank.
      
      This exposed a problem with radeon-kms/amdgpu-kms which do not
      satisfy above requirements:
      
      The vblank irq fires a few scanlines before start of vblank, but
      programmed pageflips complete at start of vblank and
      vblank timestamps update at start of vblank, whereas the
      hw vblank counter increments only later, at start of vsync.
      
      This leads to problems like off by one errors for vblank counter
      updates, vblank counters apparently going backwards or vblank
      timestamps apparently having time going backwards. The net result
      is stuttering of graphics in games, or little hangs, as well as
      total failure of timing sensitive applications.
      
      See bug #93147 for an example of the regression on Linux 4.4-rc:
      
      https://bugs.freedesktop.org/show_bug.cgi?id=93147
      
      This patch tries to align all above events better from the
      viewpoint of the drm core / of external callers to fix the problem:
      
      1. The apparent start of vblank is shifted a few scanlines earlier,
      so the vblank irq now always happens after start of this extended
      vblank interval and thereby drm_update_vblank_count() always samples
      the updated vblank count and timestamp of the new vblank interval.
      
      To achieve this, the reporting of scanout positions by
      radeon_get_crtc_scanoutpos() now operates as if the vblank starts
      radeon_crtc->lb_vblank_lead_lines before the real start of the hw
      vblank interval. This means that the vblank timestamps which are based
      on these scanout positions will now update at this earlier start of
      vblank.
      
      2. The driver->get_vblank_counter() function will bump the returned
      vblank count as read from the hw by +1 if the query happens after
      the shifted earlier start of the vblank, but before the real hw increment
      at start of vsync, so the counter appears to increment at start of vblank
      in sync with the timestamp update.
      
      3. Calls from vblank irq-context and regular non-irq calls are now
      treated identical, always simulating the shifted vblank start, to
      avoid inconsistent results for queries happening from vblank irq vs.
      happening from drm_vblank_enable() or vblank_disable_fn().
      
      4. The radeon_flip_work_func will delay mmio programming a pageflip until
      the start of the real vblank iff it happens to execute inside the shifted
      earlier start of the vblank, so pageflips now also appear to execute at
      start of the shifted vblank, in sync with vblank counter and timestamp
      updates. This to avoid some races between updates of vblank count and
      timestamps that are used for swap scheduling and pageflip execution which
      could cause pageflips to execute before the scheduled target vblank.
      
      The lb_vblank_lead_lines "fudge" value is calculated as the size of
      the display controllers line buffer in scanlines for the given video
      mode: Vblank irq's are triggered by the line buffer logic when the line
      buffer refill for a video frame ends, ie. when the line buffer source read
      position enters the hw vblank. This means that a vblank irq could fire at
      most as many scanlines before the current reported scanout position of the
      crtc timing generator as the number of scanlines the line buffer can
      maximally hold for a given video mode.
      
      This patch has been successfully tested on a RV730 card with DCE-3 display
      engine and on a evergreen card with DCE-4 display engine, in single-display
      and dual-display configuration, with different video modes.
      
      A similar patch is needed for amdgpu-kms to fix the same problem.
      
      Limitations:
      
      - Line buffer sizes in pixels are hard-coded on < DCE-4 to a value
        i just guessed to be high enough to work ok, lacking info on the true
        sizes atm.
      
      Fixes: fdo#93147
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Cc: Harry Wentland <Harry.Wentland@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      
      (v1) Tested-by: Dave Witbrodt <dawitbro@sbcglobal.net>
      
      (v2) Refine radeon_flip_work_func() for better efficiency:
      
           In radeon_flip_work_func, replace the busy waiting udelay(5)
           with event lock held by a more performance and energy efficient
           usleep_range() until at least predicted true start of hw vblank,
           with some slack for scheduler happiness. Release the event lock
           during waits to not delay other outputs in doing their stuff, as
           the waiting can last up to 200 usecs in some cases.
      
           Retested on DCE-3 and DCE-4 to verify it still works nicely.
      
      (v2) Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      c55d21ea
    • Slava Grigorev's avatar
      drm/radeon: Fix "slow" audio over DP on DCE8+ · ac4a9350
      Slava Grigorev authored
      DP audio is derived from the dfs clock.
      Signed-off-by: default avatarSlava Grigorev <slava.grigorev@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      ac4a9350
    • Christian König's avatar
      drm/amdgpu: keep the PTs validation list in the VM v2 · ee1782c3
      Christian König authored
      This avoids allocating it on the fly.
      
      v2: fix grammar in comment
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
      ee1782c3
    • Christian König's avatar
      drm/amdgpu: split VM PD and PT handling during CS · 56467ebf
      Christian König authored
      This way we avoid the extra allocation for the page directory entry.
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
      56467ebf
    • Christian König's avatar
      drm/amdgpu: put VM page tables directly into duplicates list · 3c0eea6c
      Christian König authored
      They share the reservation object with the page directory anyway.
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
      3c0eea6c
    • Chunming Zhou's avatar
      drm/amdgpu: restrict the sched jobs number to power of two · 5b011235
      Chunming Zhou authored
      Signed-off-by: default avatarChunming Zhou <David1.Zhou@amd.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      CC: stable@vger.kernel.org
      5b011235
  2. 17 Dec, 2015 1 commit
  3. 15 Dec, 2015 4 commits
  4. 11 Dec, 2015 4 commits
  5. 04 Dec, 2015 7 commits
  6. 02 Dec, 2015 15 commits
  7. 30 Nov, 2015 3 commits
    • Dave Airlie's avatar
      Merge tag 'drm-intel-next-2015-11-20-merged' of... · 80d69009
      Dave Airlie authored
      Merge tag 'drm-intel-next-2015-11-20-merged' of git://anongit.freedesktop.org/drm-intel into drm-next
      
      drm-intel-next-2015-11-20-rebased:
      4 weeks because of my vacation, so a bit more:
      - final bits of the typesafe register mmio functions (Ville)
      - power domain fix for hdmi detection (Imre)
      - tons of fixes and improvements to the psr code (Rodrigo)
      - refactoring of the dp detection code (Ander)
      - complete rework of the dmc loader and dc5/dc6 handling (Imre, Patrik and
        others)
      - dp compliance improvements from Shubhangi Shrivastava
      - stop_machine hack from Chris to fix corruptions when updating GTT ptes on bsw
      - lots of fifo underrun fixes from Ville
      - big pile of fbc fixes and improvements from Paulo
      - fix fbdev failures paths (Tvrtko and Lukas Wunner)
      - dp link training refactoring (Ander)
      - interruptible prepare_plane for atomic (Maarten)
      - basic kabylake support (Deepak&Rodrigo)
      - don't leak ringspace on resets (Chris)
      drm-intel-next-2015-10-23:
      - 2nd attempt at atomic watermarks from Matt, but just prep for now
      - fixes all over
      
      * tag 'drm-intel-next-2015-11-20-merged' of git://anongit.freedesktop.org/drm-intel: (209 commits)
        drm/i915: Update DRIVER_DATE to 20151120
        drm/i915: take a power domain reference while checking the HDMI live status
        drm/i915: take a power domain ref only when needed during HDMI detect
        drm/i915: Tear down fbdev if initialization fails
        async: export current_is_async()
        Revert "drm/i915: Initialize HWS page address after GPU reset"
        drm/i915: Fix oops caused by fbdev initialization failure
        drm/i915: Fix i915_ggtt_view_equal to handle rotation correctly
        drm/i915: Stuff rotation params into view union
        drm/i915: Drop return value from intel_fill_fb_ggtt_view
        drm/i915 : Fix to remove unnecsessary checks in postclose function.
        drm/i915: add MISSING_CASE to a few port/aux power domain helpers
        drm/i915/ddi: fix intel_display_port_aux_power_domain() after HDMI detect
        drm/i915: Remove platform specific *_dp_detect() functions
        drm/i915: Don't do edp panel detection in g4x_dp_detect()
        drm/i915: Send TP1 TP2/3 even when panel claims no NO_TRAIN_ON_EXIT.
        drm/i915: PSR: Don't Skip aux handshake on DP_PSR_NO_TRAIN_ON_EXIT.
        drm/i915: Reduce PSR re-activation time for VLV/CHV.
        drm/i915: Delay first PSR activation.
        drm/i915: Type safe register read/write
        ...
      80d69009
    • Dave Airlie's avatar
      Merge tag 'topic/drm-misc-2015-11-26' of git://anongit.freedesktop.org/drm-intel into drm-next · aeb745e9
      Dave Airlie authored
      Here's the first drm-misc pull, with really mostly misc stuff all over.
      Somewhat invasive is only Ville's change to mark the arg struct for
      fb_create const - that might conflict with a new driver pull. So better to
      get in fast.
      
      * tag 'topic/drm-misc-2015-11-26' of git://anongit.freedesktop.org/drm-intel:
        drm/mm: use list_next_entry
        drm/i915: fix potential dangling else problems in for_each_ macros
        drm: fix potential dangling else problems in for_each_ macros
        drm/sysfs: Send out uevent when connector->force changes
        drm/atomic: Small documentation fix.
        drm/mm: rewrite drm_mm_for_each_hole
        drm/sysfs: Grab lock for edid/modes_show
        drm: Print the src/dst/clip rectangles in error in drm_plane_helper
        drm: Add "prefix" parameter to drm_rect_debug_print()
        drm: Keep coordinates in the typical x, y, w, h order instead of x, y, h, w
        drm: Pass the user drm_mode_fb_cmd2 as const to .fb_create()
        drm: modes: replace simple_strtoul by kstrtouint
        drm: Describe the Rotation property bits.
        drm: Remove unused fbdev_list members
        GPU-DRM: Delete unnecessary checks before drm_property_unreference_blob()
        drm/dp: add eDP DPCD backlight control bit definitions
        drm/tegra: Remove local fbdev emulation Kconfig option
        drm/imx: Remove local fbdev emulation Kconfig option
        drm/gem: Update/Polish docs
        drm: Update GEM refcounting docs
      aeb745e9
    • Linus Torvalds's avatar
      Linux 4.4-rc3 · 31ade3b8
      Linus Torvalds authored
      31ade3b8