1. 01 Mar, 2021 3 commits
    • Bhaskar Chowdhury's avatar
    • Colin Xu's avatar
      drm/i915/gvt: Refactor GVT vblank emulator for vGPU virtual display · b01739fb
      Colin Xu authored
      Current vblank emulator uses single hrtimer at 16ms period for all vGPUs,
      which introduces three major issues:
      
      - 16ms matches the refresh rate at 62.5Hz (instead of 60Hz) which
        doesn't follow standard timing. This leads to some frame drop or glitch
        issue during video playback. SW expects a vsync interval of 16.667ms or
        higher precision for an accurate 60Hz refresh rate. However current
        vblank emulator only works at 16ms.
      
      - Doesn't respect the fact that with current virtual EDID timing set,
        not all resolutions are running at 60Hz. For example, current virtual
        EDID also supports refresh rate at 56Hz, 59.97Hz, 60Hz, 75Hz, etc.
      
      - Current vblank emulator use single hrtimer for all vGPUs. Regardsless
        the possibility that different guests could run in different
        resolutions, all vsync interrupts are injected at 16ms interval with
        same hrtimer.
      
      Based on previous patch which decode guest expected refresh rate from
      vreg, the vblank emulator refactor patch makes following changes:
      - Change the vblank emulator hrtimer from gvt global to per-vGPU.
        By doing this, each vGPU display can operates at different refresh
        rates. Currently only one dislay is supported for each vGPU so per-vGPU
        hrtimer is enough. If multiple displays are supported per-vGPU in
        future, we can expand to per-PIPE further.
      - Change the fixed hrtimer period from 16ms to dynamic based on vreg.
        GVT is expected to emulate the HW as close as possible. So reflacting
        the accurate vsync interrupt interval is more correct than fixed 16ms.
      - Change the vblank timer period and start the timer on PIPECONF change.
        The initial period is updated to 16666667 based on 60Hz refresh rate.
        According to PRM, PIPECONF controls the timing generator of the
        connected display on this pipe, so it's safe to stop hrtimer on
        PIPECONF disabling, and re-start hrtimer at new period on enabling.
      
      Other changes including:
      - Move vblank_timer_fn from irq.c into display.c.
      - Clean per-vGPU vblank timer at clean_display instead of clean_irq.
      
      To run quick test, launch a web browser and goto URL: www.displayhz.com
      
      The actual refresh rate from guest can now always match guest settings.
      
      V2:
      Rebase to 5.11.
      Remove unused intel_gvt_clean_irq().
      Simplify enable logic in update_vblank_emulation(). (zhenyu)
      Loop all vGPU by idr when check all vblank timer. (zhenyu)
      Signed-off-by: default avatarColin Xu <colin.xu@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20210226044630.284269-1-colin.xu@intel.comReviewed-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      b01739fb
    • Colin Xu's avatar
      drm/i915/gvt: Get accurate vGPU virtual display refresh rate from vreg · 6a4500c7
      Colin Xu authored
      Guest OS builds up its timing mode list based on the virtual EDID as
      simulated by GVT. However since there are several timings supported in
      the virtual EDID, and each timing can also support several modes
      (resolution and refresh rate), current emulated vblank period (16ms)
      may not always be correct and could lead to miss-sync behavior in guest.
      
      Guest driver will setup new resolution and program vregs accordingly and
      it should always follows GEN PRM. Based on the simulated display regs by
      GVT, it's safe to decode the actual refresh rate using by guest from
      vreg only.
      
      Current implementation only enables PIPE_A and PIPE_A is always tied to
      TRANSCODER_A in HW. GVT may simulate DP monitor on PORT_B or PORT_D
      based on the caller. So we can find out which DPLL is used by PORT_x
      which connected to TRANSCODER_A and calculate the DP bit rate from the
      DPLL frequency. Then DP stream clock (pixel clock) can be calculated
      from DP link M/N and DP bit rate. Finally, get the refresh rate from
      pixel clock, H total and V total.
      
      The per-vGPU accurate refresh rate is not used yet but only stored,
      until per-vGPU vblank timer is enabled. Then each vGPU can have
      different and accurate refresh rate per-guest driver configuration.
      
      Refer to PRM for GEN display and VESA timing standard for more details.
      
      V2:
      Rebase to 5.11.
      Correctly calculate DP link rate for BDW and BXT.
      Use GVT_DEFAULT_REFRESH_RATE instead of hardcoded to 60 as init refresh.
      Typo fix. (zhenyu)
      Signed-off-by: default avatarColin Xu <colin.xu@intel.com>
      Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20210226044559.283622-1-colin.xu@intel.comReviewed-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
      6a4500c7
  2. 24 Feb, 2021 1 commit
  3. 23 Feb, 2021 1 commit
  4. 22 Feb, 2021 10 commits
  5. 20 Feb, 2021 1 commit
    • Lee Shawn C's avatar
      drm/i915/vbt: update DP max link rate table · b60e320b
      Lee Shawn C authored
      According to Bspec #20124, max link rate table for DP was updated
      at BDB version 230. Max link rate can support upto UHBR.
      
      After migrate to BDB v230, the definition for LBR, HBR2 and HBR3
      were changed. For backward compatibility. If BDB version was
      from 216 to 229. Driver have to follow original rule to configure
      DP max link rate value from VBT.
      
      v2: split the mapping table to two for old and new BDB definition.
      v3: return link rate instead of assigning it.
      v4: remove the useless variable.
      
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Cooper Chiou <cooper.chiou@intel.com>
      Cc: William Tseng <william.tseng@intel.com>
      Signed-off-by: default avatarLee Shawn C <shawn.c.lee@intel.com>
      [vsyrjala: Try to retain the comment that VBT version 216 added some of this]
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210218052333.16109-1-shawn.c.lee@intel.com
      b60e320b
  6. 18 Feb, 2021 2 commits
  7. 17 Feb, 2021 2 commits
  8. 16 Feb, 2021 15 commits
  9. 13 Feb, 2021 5 commits