1. 10 4月, 2021 1 次提交
  2. 17 2月, 2021 1 次提交
  3. 21 1月, 2021 1 次提交
  4. 16 12月, 2020 1 次提交
    • B
      drm: atomic: use krealloc_array() · 32ce2553
      Bartosz Golaszewski 提交于
      Use the helper that checks for overflows internally instead of manually
      calculating the size of the new array.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-8-brgl@bgdev.plSigned-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      32ce2553
  5. 08 10月, 2020 1 次提交
    • D
      drm/atomic: document and enforce rules around "spurious" EBUSY · fb6473a4
      Daniel Vetter 提交于
      When doing an atomic modeset with ALLOW_MODESET drivers are allowed to
      pull in arbitrary other resources, including CRTCs (e.g. when
      reconfiguring global resources).
      
      But in nonblocking mode userspace has then no idea this happened,
      which can lead to spurious EBUSY calls, both:
      - when that other CRTC is currently busy doing a page_flip the
        ALLOW_MODESET commit can fail with an EBUSY
      - on the other CRTC a normal atomic flip can fail with EBUSY because
        of the additional commit inserted by the kernel without userspace's
        knowledge
      
      For blocking commits this isn't a problem, because everyone else will
      just block until all the CRTC are reconfigured. Only thing userspace
      can notice is the dropped frames without any reason for why frames got
      dropped.
      
      Consensus is that we need new uapi to handle this properly, but no one
      has any idea what exactly the new uapi should look like. Since this
      has been shipping for years already compositors need to deal no matter
      what, so as a first step just try to enforce this across drivers
      better with some checks.
      
      v2: Add comments and a WARN_ON to enforce this only when allowed - we
      don't want to silently convert page flips into blocking plane updates
      just because the driver is buggy.
      
      v3: Fix inverted WARN_ON (Pekka).
      
      v4: Drop the uapi changes, only add a WARN_ON for now to enforce some
      rules for drivers.
      
      v5: Make the WARNING more informative (Daniel)
      
      v6: Add unconditional debug output for compositor hackers to figure
      out what's going on when they get an EBUSY (Daniel)
      
      v7: Fix up old/new_crtc_state confusion for real (Pekka/Ville)
      Acked-by: NPekka Paalanen <pekka.paalanen@collabora.com>
      Reviewed-by: NDaniel Stone <daniels@collabora.com>
      References: https://lists.freedesktop.org/archives/dri-devel/2018-July/182281.html
      Bugzilla: https://gitlab.freedesktop.org/wayland/weston/issues/24#note_9568
      Cc: Daniel Stone <daniel@fooishbar.org>
      Cc: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
      Cc: Simon Ser <contact@emersion.fr>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200925084651.3250104-1-daniel.vetter@ffwll.ch
      fb6473a4
  6. 02 10月, 2020 1 次提交
  7. 02 7月, 2020 1 次提交
  8. 19 3月, 2020 1 次提交
  9. 18 3月, 2020 1 次提交
  10. 18 2月, 2020 1 次提交
  11. 31 1月, 2020 1 次提交
    • B
      drm/bridge: Add a drm_bridge_state object · 75146591
      Boris Brezillon 提交于
      One of the last remaining objects to not have its atomic state.
      
      This is being motivated by our attempt to support runtime bus-format
      negotiation between elements of the bridge chain.
      This patch just paves the road for such a feature by adding a new
      drm_bridge_state object inheriting from drm_private_obj so we can
      re-use some of the existing state initialization/tracking logic.
      
      v10:
      * Add changelog to the commit message
      
      v9:
      * Clarify the fact that the bridge->atomic_reset() and
        {connector,plane,crtc,...}->reset() semantics are different
      * Move the drm_atomic_private_obj_init() call back to
        drm_bridge_attach()
      * Check the presence of ->atomic_duplicate_state instead of
        ->atomic_reset in drm_atomic_add_encoder_bridges()
      * Fix copy&paste errors in the atomic bridge state helpers doc
      * Add A-b/R-b tags
      
      v8:
      * Move bridge state helpers out of the CONFIG_DEBUGFS section
      
      v7:
      * Move helpers, struct-defs, ... to atomic helper files to avoid the
        drm -> drm_kms_helper -> drm circular dep
      * Stop providing default implementation for atomic state reset,
        duplicate and destroy hooks (has to do with the helper/core split)
      * Drop all R-b/T-b as helpers have now be moved to other places
      
      v6:
      * Made helpers private, removed doc and moved them to satisfy dependencies
      * Renamed helpers to _default_
      
      v5:
      * Re-introduced the helpers from v4
      
      v4:
      * Fix the doc
      * Kill default helpers (inlined)
      * Fix drm_atomic_get_bridge_state() to check for an ERR_PTR()
      * Add Neil's R-b
      
      v3:
      * No changes
      
      v2:
      * Use drm_for_each_bridge_in_chain()
      * Rename helpers to be more consistent with the rest of the DRM API
      * Improve/fix the doc
      Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200128135514.108171-2-boris.brezillon@collabora.com
      75146591
  12. 08 1月, 2020 1 次提交
  13. 07 1月, 2020 1 次提交
  14. 22 12月, 2019 1 次提交
  15. 11 12月, 2019 1 次提交
  16. 23 9月, 2019 1 次提交
  17. 14 6月, 2019 2 次提交
  18. 08 6月, 2019 1 次提交
  19. 28 5月, 2019 1 次提交
  20. 29 4月, 2019 1 次提交
  21. 11 12月, 2018 1 次提交
  22. 05 12月, 2018 1 次提交
  23. 08 11月, 2018 3 次提交
  24. 03 11月, 2018 1 次提交
    • R
      drm: Add connector property to limit max bpc · 47e22ff1
      Radhakrishna Sripada 提交于
      At times 12bpc HDMI cannot be driven due to faulty cables, dongles
      level shifters etc. To workaround them we may need to drive the output
      at a lower bpc. Currently the user space does not have a way to limit
      the bpc. The default bpc to be programmed is decided by the driver and
      is run against connector limitations.
      
      Creating a new connector property "max bpc" in order to limit the bpc.
      xrandr can make use of this connector property to make sure that bpc does
      not exceed the configured value. This property can be used by userspace to
      set the bpc.
      
      V2: Initialize max_bpc to satisfy kms_properties
      V3: Move the property to drm_connector
      V4: Split drm and i915 components(Ville)
      V5: Make the property per connector(Ville)
      V6: Compare the requested bpc to connector bpc(Daniel)
          Move the attach_property function to core(Ville)
      V7: Fix checkpatch warnings
      V8: Simplify the connector check code(Ville)
      V9: Const display_info(Ville)
      V10,V11: Fix CI issues.
      V12: Add the Kernel documentation(Daniel)
      V14: Crossreference the function name in the doc(Daniel)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Kishore Kadiyala <kishore.kadiyala@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Cc: Sunpeng Li <sunpeng.li@amd.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NRadhakrishna Sripada <radhakrishna.sripada@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181012184233.29250-1-radhakrishna.sripada@intel.com
      47e22ff1
  25. 19 10月, 2018 1 次提交
    • L
      drm: Get ref on CRTC commit object when waiting for flip_done · 4364bcb2
      Leo Li 提交于
      This fixes a general protection fault, caused by accessing the contents
      of a flip_done completion object that has already been freed. It occurs
      due to the preemption of a non-blocking commit worker thread W by
      another commit thread X. X continues to clear its atomic state at the
      end, destroying the CRTC commit object that W still needs. Switching
      back to W and accessing the commit objects then leads to bad results.
      
      Worker W becomes preemptable when waiting for flip_done to complete. At
      this point, a frequently occurring commit thread X can take over. Here's
      an example where W is a worker thread that flips on both CRTCs, and X
      does a legacy cursor update on both CRTCs:
      
              ...
           1. W does flip work
           2. W runs commit_hw_done()
           3. W waits for flip_done on CRTC 1
           4. > flip_done for CRTC 1 completes
           5. W finishes waiting for CRTC 1
           6. W waits for flip_done on CRTC 2
      
           7. > Preempted by X
           8. > flip_done for CRTC 2 completes
           9. X atomic_check: hw_done and flip_done are complete on all CRTCs
          10. X updates cursor on both CRTCs
          11. X destroys atomic state
          12. X done
      
          13. > Switch back to W
          14. W waits for flip_done on CRTC 2
          15. W raises general protection fault
      
      The error looks like so:
      
          general protection fault: 0000 [#1] PREEMPT SMP PTI
          **snip**
          Call Trace:
           lock_acquire+0xa2/0x1b0
           _raw_spin_lock_irq+0x39/0x70
           wait_for_completion_timeout+0x31/0x130
           drm_atomic_helper_wait_for_flip_done+0x64/0x90 [drm_kms_helper]
           amdgpu_dm_atomic_commit_tail+0xcae/0xdd0 [amdgpu]
           commit_tail+0x3d/0x70 [drm_kms_helper]
           process_one_work+0x212/0x650
           worker_thread+0x49/0x420
           kthread+0xfb/0x130
           ret_from_fork+0x3a/0x50
          Modules linked in: x86_pkg_temp_thermal amdgpu(O) chash(O)
          gpu_sched(O) drm_kms_helper(O) syscopyarea sysfillrect sysimgblt
          fb_sys_fops ttm(O) drm(O)
      
      Note that i915 has this issue masked, since hw_done is signaled after
      waiting for flip_done. Doing so will block the cursor update from
      happening until hw_done is signaled, preventing the cursor commit from
      destroying the state.
      
      v2: The reference on the commit object needs to be obtained before
          hw_done() is signaled, since that's the point where another commit
          is allowed to modify the state. Assuming that the
          new_crtc_state->commit object still exists within flip_done() is
          incorrect.
      
          Fix by getting a reference in setup_commit(), and releasing it
          during default_clear().
      Signed-off-by: NLeo Li <sunpeng.li@amd.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NHarry Wentland <harry.wentland@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1539611200-6184-1-git-send-email-sunpeng.li@amd.com
      4364bcb2
  26. 18 9月, 2018 1 次提交
  27. 09 9月, 2018 2 次提交
  28. 25 8月, 2018 1 次提交
    • L
      drm: Add per-plane pixel blend mode property · a5ec8332
      Lowry Li 提交于
      Pixel blend modes represent the alpha blending equation
      selection, describing how the pixels from the current
      plane are composited with the background.
      
      Adds a pixel_blend_mode to drm_plane_state and a
      blend_mode_property to drm_plane, and related support
      functions.
      
      Defines three blend modes in drm_blend.h.
      
      Changes since v1:
       - Moves the blending equation into the DOC comment
       - Refines the comments of drm_plane_create_blend_mode_property to not
         enumerate the #defines, but instead the string values
       - Uses fg.* instead of pixel.* and plane_alpha instead of plane.alpha
      Changes since v2:
       - Refines the comments of drm_plane_create_blend_mode_property:
            1) Puts the descriptions (after the ":") on a new line
            2) Adds explaining why @supported_modes need PREMUL as default
      Changes since v3:
       - Refines drm_plane_create_blend_mode_property(). drm_property_add_enum()
         can calculate the index itself just fine, so no point in having the
         caller pass it in.
       - Since the current DRM assumption is that alpha is premultiplied
         as default, define DRM_MODE_BLEND_PREMULTI as 0 will be better.
       - Refines some comments.
      Changes since v4:
       - Adds comments in drm_blend.h.
       - Removes setting default value in drm_plane_create_blend_mode_property()
         as it is already in __drm_atomic_helper_plane_reset().
       - Fixes to use state->pixel_blend_mode instead of using
         plane->state->pixel_blend_mode in reset function.
       - Rebases on drm-misc-next.
      Reviewed-by: NLiviu Dudau <liviu.dudau@arm.com>
      Signed-off-by: NLowry Li <lowry.li@arm.com>
      Signed-off-by: NAyan Kumar Halder <ayan.halder@arm.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/245734/
      a5ec8332
  29. 07 7月, 2018 1 次提交
  30. 06 7月, 2018 1 次提交
  31. 05 7月, 2018 1 次提交
    • B
      drm: mali-dp: Add writeback connector · 8cbc5caf
      Brian Starkey 提交于
      Mali-DP has a memory writeback engine which can be used to write the
      composition result to a memory buffer. Expose this functionality as a
      DRM writeback connector on supported hardware.
      
      Changes since v1:
       Daniel Vetter:
       - Don't require a modeset when writeback routing changes
       - Make writeback connector always disconnected
      
      Changes since v2:
       - Rebase onto new drm_writeback_connector
       - Add reset callback, allocating subclassed state
       Daniel Vetter:
       - Squash out-fence support into this commit
       Gustavo Padovan:
       - Don't signal fence directly from driver (and drop malidp_mw_job)
      
      Changes since v3:
       - Modifications to fit with Mali-DP commit tail changes
      Signed-off-by: NBrian Starkey <brian.starkey@arm.com>
      [rebased and fixed conflicts]
      Signed-off-by: NMihail Atanassov <mihail.atanassov@arm.com>
      Signed-off-by: NLiviu Dudau <liviu.dudau@arm.com>
      8cbc5caf
  32. 02 7月, 2018 2 次提交
  33. 20 6月, 2018 2 次提交
    • B
      drm: writeback: Add out-fences for writeback connectors · b13cc8dd
      Brian Starkey 提交于
      Add the WRITEBACK_OUT_FENCE_PTR property to writeback connectors, to
      enable userspace to get a fence which will signal once the writeback is
      complete. It is not allowed to request an out-fence without a
      framebuffer attached to the connector.
      
      A timeline is added to drm_writeback_connector for use by the writeback
      out-fences.
      
      In the case of a commit failure or DRM_MODE_ATOMIC_TEST_ONLY, the fence
      is set to -1.
      
      Changes from v2:
       - Rebase onto Gustavo Padovan's v9 explicit sync series
       - Change out_fence_ptr type to s32 __user *
       - Set *out_fence_ptr to -1 in drm_atomic_connector_set_property
       - Store fence in drm_writeback_job
       Gustavo Padovan:
       - Move out_fence_ptr out of connector_state
       - Signal fence from drm_writeback_signal_completion instead of
         in driver directly
      
      Changes from v3:
       - Rebase onto commit 7e9081c5 ("drm/fence: fix memory overwrite
         when setting out_fence fd") (change out_fence_ptr to s32 __user *,
         for real this time.)
       - Update documentation around WRITEBACK_OUT_FENCE_PTR
      Signed-off-by: NBrian Starkey <brian.starkey@arm.com>
      [rebased and fixed conflicts]
      Signed-off-by: NMihail Atanassov <mihail.atanassov@arm.com>
      Signed-off-by: NLiviu Dudau <liviu.dudau@arm.com>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/229036/
      b13cc8dd
    • B
      drm: Add writeback connector type · 935774cd
      Brian Starkey 提交于
      Writeback connectors represent writeback engines which can write the
      CRTC output to a memory framebuffer. Add a writeback connector type and
      related support functions.
      
      Drivers should initialize a writeback connector with
      drm_writeback_connector_init() which takes care of setting up all the
      writeback-specific details on top of the normal functionality of
      drm_connector_init().
      
      Writeback connectors have a WRITEBACK_FB_ID property, used to set the
      output framebuffer, and a WRITEBACK_PIXEL_FORMATS blob used to expose the
      supported writeback formats to userspace.
      
      When a framebuffer is attached to a writeback connector with the
      WRITEBACK_FB_ID property, it is used only once (for the commit in which
      it was included), and userspace can never read back the value of
      WRITEBACK_FB_ID. WRITEBACK_FB_ID can only be set if the connector is
      attached to a CRTC.
      
      Changes since v1:
       - Added drm_writeback.c + documentation
       - Added helper to initialize writeback connector in one go
       - Added core checks
       - Squashed into a single commit
       - Dropped the client cap
       - Writeback framebuffers are no longer persistent
      
      Changes since v2:
       Daniel Vetter:
       - Subclass drm_connector to drm_writeback_connector
       - Relax check to allow CRTC to be set without an FB
       - Add some writeback_ prefixes
       - Drop PIXEL_FORMATS_SIZE property, as it was unnecessary
       Gustavo Padovan:
       - Add drm_writeback_job to handle writeback signalling centrally
      
      Changes since v3:
       - Rebased
       - Rename PIXEL_FORMATS -> WRITEBACK_PIXEL_FORMATS
      
      Chances since v4:
       - Embed a drm_encoder inside the drm_writeback_connector to
         reduce the amount of boilerplate code required from the drivers
         that are using it.
      
      Changes since v5:
       - Added Rob Clark's atomic_commit() vfunc to connector helper
         funcs, so that writeback jobs are committed from atomic helpers
       - Updated create_writeback_properties() signature to return an
         error code rather than a boolean false for failure.
       - Free writeback job with the connector state rather than when
         doing the cleanup_work()
      
      Changes since v7:
       - fix extraneous use of out_fence that is only introduced in a
         subsequent patch.
      
      Changes since v8:
       - whitespace changes pull from subsequent patch
      
      Changes since v9:
       - Revert the v6 changes that free the writeback job in the connector
         state cleanup and return to doing it in the cleanup_work() function
      Signed-off-by: NBrian Starkey <brian.starkey@arm.com>
      [rebased and fixed conflicts]
      Signed-off-by: NMihail Atanassov <mihail.atanassov@arm.com>
      [rebased and added atomic_commit() vfunc for writeback jobs]
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NLiviu Dudau <liviu.dudau@arm.com>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Link: https://patchwork.freedesktop.org/patch/229037/
      935774cd
  34. 16 6月, 2018 1 次提交