1. 07 10月, 2016 1 次提交
  2. 20 8月, 2016 1 次提交
    • E
      drm/vc4: Fix overflow mem unreferencing when the binner runs dry. · 9326e6f2
      Eric Anholt 提交于
      Overflow memory handling is tricky: While it's still referenced by the
      BPO registers, we want to keep it from being freed.  When we are
      putting a new set of overflow memory in the registers, we need to
      assign the old one to the last rendering job using it.
      
      We were looking at "what's currently running in the binner", but since
      the bin/render submission split, we may end up with the binner
      completing and having no new job while the renderer is still
      processing.  So, if we don't find a bin job at all, look at the
      highest-seqno (last) render job to attach our overflow to.
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Fixes: ca26d28b ("drm/vc4: improve throughput by pipelining binning and rendering jobs")
      Cc: stable@vger.kernel.org
      9326e6f2
  3. 16 7月, 2016 1 次提交
    • E
      drm/vc4: Add support for branching in shader validation. · 6d45c81d
      Eric Anholt 提交于
      We're already checking that branch instructions are between the start
      of the shader and the proper PROG_END sequence.  The other thing we
      need to make branching safe is to verify that the shader doesn't read
      past the end of the uniforms stream.
      
      To do that, we require that at any basic block reading uniforms have
      the following instructions:
      
      load_imm temp, <next offset within uniform stream>
      add unif_addr, temp, unif
      
      The instructions are generated by userspace, and the kernel verifies
      that the load_imm is of the expected offset, and that the add adds it
      to a uniform.  We track which uniform in the stream that is, and at
      draw call time fix up the uniform stream to have the address of the
      start of the shader's uniforms at that location.
      Signed-off-by: NEric Anholt <eric@anholt.net>
      6d45c81d
  4. 12 7月, 2016 1 次提交
    • M
      drm/vc4: Implement precise vblank timestamping. · 1bf59f1d
      Mario Kleiner 提交于
      Precise vblank timestamping is implemented via the
      usual scanout position based method. On VC4 the
      pixelvalves PV do not have a scanout position
      register. Only the hardware video scaler HVS has a
      similar register which describes which scanline for
      the output is currently composited and stored in the
      HVS fifo for later consumption by the PV.
      
      This causes a problem in that the HVS runs at a much
      faster clock (system clock / audio gate) than the PV
      which runs at video mode dot clock, so the unless the
      fifo between HVS and PV is full, the HVS will progress
      faster in its observable read line position than video
      scan rate, so the HVS position reading can't be directly
      translated into a scanout position for timestamp correction.
      
      Additionally when the PV is in vblank, it doesn't consume
      from the fifo, so the fifo gets full very quickly and then
      the HVS stops compositing until the PV enters active scanout
      and starts consuming scanlines from the fifo again, making
      new space for the HVS to composite.
      
      Therefore a simple translation of HVS read position into
      elapsed time since (or to) start of active scanout does
      not work, but for the most interesting cases we can still
      get useful and sufficiently accurate results:
      
      1. The PV enters active scanout of a new frame with the
         fifo of the HVS completely full, and the HVS can refill
         any fifo line which gets consumed and thereby freed up by
         the PV during active scanout very quickly. Therefore the
         PV and HVS work effectively in lock-step during active
         scanout with the fifo never having more than 1 scanline
         freed up by the PV before it gets refilled. The PV's
         real scanout position is therefore trailing the HVS
         compositing position as scanoutpos = hvspos - fifosize
         and we can get the true scanoutpos as HVS readpos minus
         fifo size, so precise timestamping works while in active
         scanout, except for the last few scanlines of the frame,
         when the HVS reaches end of frame, stops compositing and
         the PV catches up and drains the fifo. This special case
         would only introduce minor errors though.
      
      2. If we are in vblank, then we can only guess something
         reasonable. If called from vblank irq, we assume the irq is
         usually dispatched with minimum delay, so we can take a
         timestamp taken at entry into the vblank irq handler as a
         baseline and then add a full vblank duration until the
         guessed start of active scanout. As irq dispatch is usually
         pretty low latency this works with relatively low jitter and
         good results.
      
         If we aren't called from vblank then we could be anywhere
         within the vblank interval, so we return a neutral result,
         simply the current system timestamp, and hope for the best.
      
      Measurement shows the generated timestamps to be rather precise,
      and at least never off more than 1 vblank duration worst-case.
      
      Limitations: Doesn't work well yet for interlaced video modes,
                   therefore disabled in interlaced mode for now.
      
      v2: Use the DISPBASE registers to determine the FIFO size (changes
          by anholt)
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de@gmail.com> (v2)
      1bf59f1d
  5. 02 6月, 2016 1 次提交
  6. 15 4月, 2016 1 次提交
    • E
      drm/vc4: Add DPI driver · 08302c35
      Eric Anholt 提交于
      The DPI interface involves taking a ton of our GPIOs to be used as
      outputs, and routing display signals over them in parallel.
      
      v2: Use display_info.bus_formats[] to replace our custom DT
          properties.
      v3: Rebase on V3D documentation changes.
      v4: Fix rebase detritus from V3D documentation changes.
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Acked-by: NRob Herring <robh@kernel.org>
      08302c35
  7. 14 3月, 2016 1 次提交
  8. 17 2月, 2016 5 次提交
  9. 08 2月, 2016 1 次提交
  10. 08 12月, 2015 7 次提交
  11. 21 10月, 2015 2 次提交
    • D
      drm/vc4: Use the fbdev_cma helpers · 48666d56
      Derek Foreman 提交于
      Keep the fbdev_cma pointer around so we can use it on hotplog and close
      to ensure the frame buffer console is in a useful state.
      Signed-off-by: NDerek Foreman <derekf@osg.samsung.com>
      Signed-off-by: NEric Anholt <eric@anholt.net>
      48666d56
    • E
      drm/vc4: Add KMS support for Raspberry Pi. · c8b75bca
      Eric Anholt 提交于
      This is enough for fbcon and bringing up X using
      xf86-video-modesetting.  It doesn't support the 3D accelerator or
      power management yet.
      
      v2: Drop FB_HELPER select thanks to Archit's patches.  Do manual init
          ordering instead of using the .load hook.  Structure registration
          more like tegra's, but still using the typical "component" code.
          Drop no-op hooks for atomic_begin and mode_fixup() now that
          they're optional.  Drop sentinel in Makefile.  Fix minor style
          nits I noticed on another reread.
      
      v3: Use the new bcm2835 clk driver to manage pixel/HSM clocks instead
          of having a fixed video mode.  Use exynos-style component driver
          matching instead of devicetree nodes to list the component driver
          instances.  Rename compatibility strings to say bcm2835, and
          distinguish pv0/1/2.  Clean up some h/vsync code, and add in
          interlaced mode setup.  Fix up probe/bind error paths.  Use
          bitops.h macros for vc4_regs.h
      
      v4: Include i2c.h, allow building under COMPILE_TEST, drop msleep now
          that other bugs have been fixed, add timeouts to cpu_relax()
          loops, rename hpd-gpio to hpd-gpios.
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c8b75bca