1. 16 6月, 2017 3 次提交
  2. 13 6月, 2017 2 次提交
    • C
      drm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path · d0b1d259
      Christophe JAILLET 提交于
      If one 'drm_gem_handle_create()' fails, we leak somes handles and some
      memory.
      
      In order to fix it:
        - move the 'free(bo_state)' at the end of the function so that it is also
          called in the eror handling path. This has the side effect to also try
          to free it if the first 'kcalloc' fails. This is harmless.
        - add a new label, err_delete_handle, in order to delete already
          allocated handles in error handling path
        - remove the now useless 'err' label
      
      The way the code is now written will also delete the handles if the
      'copy_to_user()' call fails.
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170512123803.1886-1-christophe.jaillet@wanadoo.fr
      d0b1d259
    • H
      drm/vc4/vc4_bo.c: always set bo->resv · 24bb206f
      Hans Verkuil 提交于
      The bo->resv pointer could be NULL, leading to kernel oopses
      like the one below.
      
      This patch ensures that bo->resv is always set in vc4_create_object
      ensuring that it is never NULL.
      
      Thanks to Eric Anholt for pointing to the correct solution.
      
      [   19.738487] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [   19.746805] pgd = ffff8000275fc000
      [   19.750319] [00000000] *pgd=0000000000000000
      [   19.754715] Internal error: Oops: 96000004 [#1] PREEMPT SMP
      [   19.760369] Modules linked in: smsc95xx usbnet vc4 drm_kms_helper drm pwm_bcm2835 i2c_bcm2835 bcm2835_rng rng_core bcm2835_dma virt_dma
      [   19.772767] CPU: 0 PID: 1297 Comm: Xorg Not tainted 4.12.0-rc1-rpi3 #58
      [   19.779476] Hardware name: Raspberry Pi 3 Model B (DT)
      [   19.784688] task: ffff800028268000 task.stack: ffff800026c08000
      [   19.790705] PC is at ww_mutex_lock_interruptible+0x14/0xc0
      [   19.796329] LR is at vc4_submit_cl_ioctl+0x4fc/0x998 [vc4]
      ...
      [   20.240855] [<ffff0000088975f4>] ww_mutex_lock_interruptible+0x14/0xc0
      [   20.247528] [<ffff0000009b3ea4>] vc4_submit_cl_ioctl+0x4fc/0x998 [vc4]
      [   20.254372] [<ffff0000008f75f8>] drm_ioctl+0x180/0x438 [drm]
      [   20.260120] [<ffff00000821383c>] do_vfs_ioctl+0xa4/0x7d0
      [   20.265510] [<ffff000008213fe4>] SyS_ioctl+0x7c/0x98
      [   20.270550] [<ffff000008082f30>] el0_svc_naked+0x24/0x28
      [   20.275941] Code: d2800002 d5384103 910003fd f9800011 (c85ffc04)
      [   20.282527] ---[ end trace 1f6bd640ff32ae12 ]---
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Link: http://patchwork.freedesktop.org/patch/msgid/14e68768-6c92-2d74-92fd-196dbc50d8f7@xs4all.nl
      24bb206f
  3. 05 6月, 2017 2 次提交
  4. 03 6月, 2017 1 次提交
  5. 01 6月, 2017 1 次提交
  6. 26 5月, 2017 1 次提交
  7. 22 5月, 2017 1 次提交
  8. 18 5月, 2017 1 次提交
  9. 17 5月, 2017 3 次提交
  10. 10 5月, 2017 3 次提交
    • D
      drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos · 1bf6ad62
      Daniel Vetter 提交于
      If we restrict this helper to only kms drivers (which is the case) we
      can look up the correct mode easily ourselves. But it's a bit tricky:
      
      - All legacy drivers look at crtc->hwmode. But that is updated already
        at the beginning of the modeset helper, which means when we disable
        a pipe. Hence the final timestamps might be a bit off. But since
        this is an existing bug I'm not going to change it, but just try to
        be bug-for-bug compatible with the current code. This only applies
        to radeon&amdgpu.
      
      - i915 tries to get it perfect by updating crtc->hwmode when the pipe
        is off (i.e. vblank->enabled = false).
      
      - All other atomic drivers look at crtc->state->adjusted_mode. Those
        that look at state->requested_mode simply don't adjust their mode,
        so it's the same. That has two problems: Accessing crtc->state from
        interrupt handling code is unsafe, and it's updated before we shut
        down the pipe. For nonblocking modesets it's even worse.
      
      For atomic drivers try to implement what i915 does. To do that we add
      a new hwmode field to the vblank structure, and update it from
      drm_calc_timestamping_constants(). For atomic drivers that's called
      from the right spot by the helper library already, so all fine. But
      for safety let's enforce that.
      
      For legacy driver this function is only called at the end (oh the
      fun), which is broken, so again let's not bother and just stay
      bug-for-bug compatible.
      
      The  benefit is that we can use drm_calc_vbltimestamp_from_scanoutpos
      directly to implement ->get_vblank_timestamp in every driver, deleting
      a lot of code.
      
      v2: Completely new approach, trying to mimick the i915 solution.
      
      v3: Fixup kerneldoc.
      
      v4: Drop the WARN_ON to check that the vblank is off, atomic helpers
      currently unconditionally call this. Recomputing the same stuff should
      be harmless.
      
      v5: Fix typos and move misplaced hunks to the right patches (Neil).
      
      v6: Undo hunk movement (kbuild).
      
      Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: linux-arm-msm@vger.kernel.org
      Cc: freedreno@lists.freedesktop.org
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-4-daniel.vetter@ffwll.ch
      1bf6ad62
    • D
      drm/vblank: Switch to bool in_vblank_irq in get_vblank_timestamp · 3fcdcb27
      Daniel Vetter 提交于
      It's overkill to have a flag parameter which is essentially used just
      as a boolean. This takes care of core + adjusting drivers.
      
      Adjusting the scanout position callback is a bit harder, since radeon
      also supplies it's own driver-private flags in there.
      
      v2: Fixup misplaced hunks (Neil).
      
      v3: kbuild says v1 was better ...
      
      Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: linux-arm-msm@vger.kernel.org
      Cc: freedreno@lists.freedesktop.org
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-2-daniel.vetter@ffwll.ch
      3fcdcb27
    • D
      drm/vblank: Switch drm_driver->get_vblank_timestamp to return a bool · d673c02c
      Daniel Vetter 提交于
      There's really no reason for anything more:
      - Calling this while the crtc vblank stuff isn't set up is a driver
        bug. Those places alrready DRM_ERROR.
      - Calling this when the crtc is off is either a driver bug (calling
        drm_crtc_handle_vblank at the wrong time) or a core bug (for
        anything else). Again, we DRM_ERROR.
      - EINVAL is checked at higher levels already, and if we'd use struct
        drm_crtc * instead of (dev, pipe) it would be real obvious that
        those are again core bugs.
      
      The only valid failure mode is crap hardware that couldn't sample a
      useful timestamp, to ask the core to just grab a not-so-accurate
      timestamp. Bool is perfectly fine for that.
      
      v2: Also fix up the one caller, I lost that in the shuffling (Jani).
      
      v3: Fixup commit message (Neil).
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: linux-arm-msm@vger.kernel.org
      Cc: freedreno@lists.freedesktop.org
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-1-daniel.vetter@ffwll.ch
      d673c02c
  11. 09 5月, 2017 3 次提交
  12. 19 4月, 2017 3 次提交
  13. 14 4月, 2017 1 次提交
  14. 07 4月, 2017 1 次提交
  15. 06 4月, 2017 1 次提交
  16. 30 3月, 2017 1 次提交
  17. 29 3月, 2017 2 次提交
  18. 18 3月, 2017 2 次提交
  19. 17 3月, 2017 1 次提交
    • E
      drm/vc4: Add HDMI audio support · bb7d7856
      Eric Anholt 提交于
      The HDMI encoder IP embeds all needed blocks to output audio, with a
      custom DAI called MAI moving audio between the two parts of the HDMI
      core.  This driver now exposes a sound card to let users stream audio
      to their display.
      
      Using the hdmi-codec driver has been considered here, but MAI meant
      having to significantly rework hdmi-codec, and it would have left
      little shared code with the I2S mode anyway.
      
      The encoder requires that the audio be SPDIF-formatted frames only,
      which alsalib will format-convert for us.
      
      This patch is the combined work of Eric Anholt (initial register setup
      with a separate dmaengine driver and using simple-audio-card) and
      Boris Brezillon (moving it all into HDMI, massive debug to get it
      actually working), and which Eric has the permission to release.
      
      v2: Drop "-audio" from sound card name, since that's already implied
          (suggestion by Boris)
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170227202803.12855-2-eric@anholt.net
      bb7d7856
  20. 03 3月, 2017 2 次提交
  21. 02 3月, 2017 1 次提交
  22. 01 3月, 2017 4 次提交