This adds modifier support to radeonsi.
It has been tested on
- VEGA10, RAVEN, NAVI14
- weston, sway, X with xf86-video-amdgpu (i.e. legacy path still works)
and includes some basic testing of the layout code.
The main goal is to keep it somewhat simple and regression free, so
on the display side this series only exposes what the current GPU
can render to. While we could expose more I think that is more
suitable for follow-up work as the benefit would be minimal and
there are some more …
[View More]design discussion there to discuss that are
orthogonal from the initial implementation.
Similarly this series only exposes 32-bpp displayable DCC in the cases
that radeonsi would use it and any extra capabilities here should be
future work.
I believe these are by far the most complicated modifiers we've seen
up till now, mostly related to
- GPU identification for cases where it matters wrt tiling.
- Every generation having tiling layout changes
- Compression settings.
I believe the complexity is necessary as every layout should be different
and all layouts should be the best in some situation (though not all
combinations of GPU parameters will actually have an existing GPU).
That said, on the render side the number of modifiers actually listed for
a given GPU is ~10, and in the current implementation that is the same
for the display side. (we could expose more actually differing layouts
on the display side for cross-GPU compatibility, but I consider that
out of scope for this initial work).
This series can be found on
https://github.com/BNieuwenhuizen/linux/tree/modifiers
An userspace implementation in radeonsi can be found on
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6176
v2:
Per suggestion from Daniel Vetter I added logic to get the tiling_flags at
addfb2 time and convert them into modifiers for GFX9+. Furthermore, the DCC
constant econding modifers only get exposed on RAVEN2 and newer.
Bas Nieuwenhuizen (11):
drm/amd/display: Do not silently accept DCC for multiplane formats.
drm/amd: Init modifier field of helper fb.
drm/amd/display: Honor the offset for plane 0.
drm/fourcc: Add AMD DRM modifiers.
drm/amd/display: Store tiling_flags in the framebuffer.
drm/amd/display: Convert tiling_flags to modifiers.
drm/amd/display: Refactor surface tiling setup.
drm/amd/display: Set DC options from modifiers.
drm/amd/display: Add formats for DCC with 2/3 planes.
drm/amd/display: Expose modifiers.
drm/amd/display: Clean up GFX9 tiling_flags path.
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 169 +++-
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 3 +
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 754 ++++++++++++++----
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 -
include/uapi/drm/drm_fourcc.h | 115 +++
6 files changed, 880 insertions(+), 165 deletions(-)
--
2.28.0
[View Less]
Even for legacy userspace, since otherwise GETFB2 is broken and if you
switch between modifier-less and modifier-aware compositors, smooth
transitions break.
Also it's just best practice to make sure modifiers are invariant for
a given drm_fb, and that a modifier-aware kms drivers only has one
place to store them, ignoring any old implicit bo flags or whatever
else might float around.
Motivated by some irc discussion with Bas about amdgpu modifier
support.
Fixes: 455e00f1412f ("drm: Add …
[View More]getfb2 ioctl")
Cc: Daniel Stone <daniels(a)collabora.com>
Cc: Juston Li <juston.li(a)intel.com>
Cc: Daniel Vetter <daniel.vetter(a)ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala(a)linux.intel.com>
Cc: Bas Nieuwenhuizen <bas(a)basnieuwenhuizen.nl>
Cc: Marek Olšák <maraeo(a)gmail.com>
Cc: "Wentland, Harry" <harry.wentland(a)amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter(a)intel.com>
---
include/drm/drm_mode_config.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index a18f73eb3cf6..5ffbb4ed5b35 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -58,6 +58,12 @@ struct drm_mode_config_funcs {
* actual modifier used if the request doesn't have it specified,
* ie. when (@mode_cmd->flags & DRM_MODE_FB_MODIFIERS) == 0.
*
+ * IMPORTANT: These implied modifiers for legacy userspace must be
+ * stored in struct &drm_framebuffer, including all relevant metadata
+ * like &drm_framebuffer.pitches and &drm_framebuffer.offsets if the
+ * modifier enables additional planes beyond the fourcc pixel format
+ * code. This is required by the GETFB2 ioctl.
+ *
* If the parameters are deemed valid and the backing storage objects in
* the underlying memory manager all exist, then the driver allocates
* a new &drm_framebuffer structure, subclassed to contain
@@ -915,6 +921,13 @@ struct drm_mode_config {
* @allow_fb_modifiers:
*
* Whether the driver supports fb modifiers in the ADDFB2.1 ioctl call.
+ *
+ * IMPORTANT:
+ *
+ * If this is set the driver must fill out the full implicit modifier
+ * information in their &drm_mode_config_funcs.fb_create hook for legacy
+ * userspace which does not set modifiers. Otherwise the GETFB2 ioctl is
+ * broken for modifier aware userspace.
*/
bool allow_fb_modifiers;
--
2.28.0
[View Less]
Hi Dave & Daniel,
Exactly same content as previous PR:
https://lists.freedesktop.org/archives/intel-gfx/2020-September/247626.html
Just rebased adding the missing S-o-b:s and updated "Fixes:" tags accordingly
as requested.
Regards, Joonas
***
drm-intel-gt-next-2020-09-07:
(Same content as drm-intel-gt-next-2020-09-04-3, S-o-b's added)
UAPI Changes:
(- Potential implicit changes from WW locking refactoring)
Cross-subsystem Changes:
(- WW locking changes should align the i915 locking …
[View More]more with others)
Driver Changes:
- MAJOR: Apply WW locking across the driver (Maarten)
- Reverts for 5 commits to make applying WW locking faster (Maarten)
- Disable preparser around invalidations on Tigerlake for non-RCS engines (Chris)
- Add missing dma_fence_put() for error case of syncobj timeline (Chris)
- Parse command buffer earlier in eb_relocate(slow) to facilitate backoff (Maarten)
- Pin engine before pinning all objects (Maarten)
- Rework intel_context pinning to do everything outside of pin_mutex (Maarten)
- Avoid tracking GEM context until registered (Cc: stable, Chris)
- Provide a fastpath for waiting on vma bindings (Chris)
- Fixes to preempt-to-busy mechanism (Chris)
- Distinguish the virtual breadcrumbs from the irq breadcrumbs (Chris)
- Switch to object allocations for page directories (Chris)
- Hold context/request reference while breadcrumbs are active (Chris)
- Make sure execbuffer always passes ww state to i915_vma_pin (Maarten)
- Code refactoring to facilitate use of WW locking (Maarten)
- Locking refactoring to use more granular locking (Maarten, Chris)
- Support for multiple pinned timelines per engine (Chris)
- Move complication of I915_GEM_THROTTLE to the ioctl from general code (Chris)
- Make active tracking/vma page-directory stash work preallocated (Chris)
- Avoid flushing submission tasklet too often (Chris)
- Reduce context termination list iteration guard to RCU (Chris)
- Reductions to locking contention (Chris)
- Fixes for issues found by CI (Chris)
The following changes since commit 3393649977f9a8847c659e282ea290d4b703295c:
Merge tag 'drm-intel-next-2020-08-24-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next (2020-08-28 14:09:31 +1000)
are available in the Git repository at:
git://anongit.freedesktop.org/drm/drm-intel tags/drm-intel-gt-next-2020-09-07
for you to fetch changes up to e0ee152fce25dc9269c7ea5280c98aa4b3682759:
drm/i915: Unlock the shared hwsp_gtt object after pinning (2020-09-07 15:08:11 +0300)
----------------------------------------------------------------
(Same content as drm-intel-gt-next-2020-09-04-3, S-o-b's added)
UAPI Changes:
(- Potential implicit changes from WW locking refactoring)
Cross-subsystem Changes:
(- WW locking changes should align the i915 locking more with others)
Driver Changes:
- MAJOR: Apply WW locking across the driver (Maarten)
- Reverts for 5 commits to make applying WW locking faster (Maarten)
- Disable preparser around invalidations on Tigerlake for non-RCS engines (Chris)
- Add missing dma_fence_put() for error case of syncobj timeline (Chris)
- Parse command buffer earlier in eb_relocate(slow) to facilitate backoff (Maarten)
- Pin engine before pinning all objects (Maarten)
- Rework intel_context pinning to do everything outside of pin_mutex (Maarten)
- Avoid tracking GEM context until registered (Cc: stable, Chris)
- Provide a fastpath for waiting on vma bindings (Chris)
- Fixes to preempt-to-busy mechanism (Chris)
- Distinguish the virtual breadcrumbs from the irq breadcrumbs (Chris)
- Switch to object allocations for page directories (Chris)
- Hold context/request reference while breadcrumbs are active (Chris)
- Make sure execbuffer always passes ww state to i915_vma_pin (Maarten)
- Code refactoring to facilitate use of WW locking (Maarten)
- Locking refactoring to use more granular locking (Maarten, Chris)
- Support for multiple pinned timelines per engine (Chris)
- Move complication of I915_GEM_THROTTLE to the ioctl from general code (Chris)
- Make active tracking/vma page-directory stash work preallocated (Chris)
- Avoid flushing submission tasklet too often (Chris)
- Reduce context termination list iteration guard to RCU (Chris)
- Reductions to locking contention (Chris)
- Fixes for issues found by CI (Chris)
----------------------------------------------------------------
Chris Wilson (33):
drm/i915: Reduce i915_request.lock contention for i915_request_wait
drm/i915/selftests: Mock the status_page.vma for the kernel_context
drm/i915: Soften the tasklet flush frequency before waits
drm/i915/gem: Remove disordered per-file request list for throttling
drm/i915/gt: Disable preparser around xcs invalidations on tgl
drm/i915/gt: Delay taking the spinlock for grabbing from the buffer pool
drm/i915/selftests: Flush the active barriers before asserting
drm/i915/gt: Fix termination condition for freeing all buffer objects
drm/i915/gem: Delay tracking the GEM context until it is registered
drm/i915/gt: Support multiple pinned timelines
drm/i915/gt: Pull release of node->age under the spinlock
drm/i915/selftests: Drop stale timeline constructor assert
drm/i915: Skip taking acquire mutex for no ref->active callback
drm/i915: Export a preallocate variant of i915_active_acquire()
drm/i915: Keep the most recently used active-fence upon discard
drm/i915: Make the stale cached active node available for any timeline
drm/i915: Reduce locking around i915_active_acquire_preallocate_barrier()
drm/i915: Provide a fastpath for waiting on vma bindings
drm/i915: Remove requirement for holding i915_request.lock for breadcrumbs
drm/i915/gt: Replace intel_engine_transfer_stale_breadcrumbs
drm/i915/gt: Only transfer the virtual context to the new engine if active
drm/i915/gt: Distinguish the virtual breadcrumbs from the irq breadcrumbs
drm/i915: Preallocate stashes for vma page-directories
drm/i915/gt: Switch to object allocations for page directories
drm/i915/gt: Shrink i915_page_directory's slab bucket
drm/i915/gt: Move intel_breadcrumbs_arm_irq earlier
drm/i915/gt: Hold context/request reference while breadcrumbs are active
drm/i915/selftests: Prevent selecting 0 for our random width/align
drm/i915/gem: Reduce context termination list iteration guard to RCU
drm/i915/gem: Free the fence after a fence-chain lookup failure
drm/i915: Be wary of data races when reading the active execlists
drm/i915: Remove i915_request.lock requirement for execution callbacks
drm/i915: Filter wake_flags passed to default_wake_function
Maarten Lankhorst (23):
Revert "drm/i915/gem: Async GPU relocations only"
drm/i915: Revert relocation chaining commits.
Revert "drm/i915/gem: Drop relocation slowpath".
Revert "drm/i915/gem: Split eb_vma into its own allocation"
drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.
drm/i915: Remove locking from i915_gem_object_prepare_read/write
drm/i915: Parse command buffer earlier in eb_relocate(slow)
drm/i915: Use per object locking in execbuf, v12.
drm/i915: Use ww locking in intel_renderstate.
drm/i915: Add ww context handling to context_barrier_task
drm/i915: Nuke arguments to eb_pin_engine
drm/i915: Pin engine before pinning all objects, v5.
drm/i915: Rework intel_context pinning to do everything outside of pin_mutex
drm/i915: Make sure execbuffer always passes ww state to i915_vma_pin.
drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2.
drm/i915: Kill last user of intel_context_create_request outside of selftests
drm/i915: Convert i915_perf to ww locking as well
drm/i915: Dirty hack to fix selftests locking inversion
drm/i915/selftests: Fix locking inversion in lrc selftest.
drm/i915: Use ww pinning for intel_context_create_request()
drm/i915: Move i915_vma_lock in the selftests to avoid lock inversion, v3.
drm/i915: Add ww locking to vm_fault_gtt
drm/i915: Add ww locking to pin_to_display_plane, v2.
Thomas Hellström (1):
drm/i915: Unlock the shared hwsp_gtt object after pinning
drivers/gpu/drm/i915/display/intel_display.c | 6 +-
drivers/gpu/drm/i915/gem/i915_gem_client_blt.c | 89 +-
drivers/gpu/drm/i915/gem/i915_gem_context.c | 105 +-
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 4 +-
drivers/gpu/drm/i915/gem/i915_gem_domain.c | 80 +-
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1601 +++++++++++++-------
drivers/gpu/drm/i915/gem/i915_gem_mman.c | 51 +-
drivers/gpu/drm/i915/gem/i915_gem_object.h | 40 +-
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 152 +-
drivers/gpu/drm/i915/gem/i915_gem_object_blt.h | 3 +
drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 10 +
drivers/gpu/drm/i915/gem/i915_gem_pm.c | 2 +-
drivers/gpu/drm/i915/gem/i915_gem_throttle.c | 67 +-
drivers/gpu/drm/i915/gem/i915_gem_tiling.c | 2 +-
drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 9 +-
.../drm/i915/gem/selftests/i915_gem_client_blt.c | 2 +-
.../drm/i915/gem/selftests/i915_gem_coherency.c | 50 +-
.../gpu/drm/i915/gem/selftests/i915_gem_context.c | 144 +-
.../drm/i915/gem/selftests/i915_gem_execbuffer.c | 60 +-
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 45 +-
drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c | 2 +-
drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 106 +-
drivers/gpu/drm/i915/gt/gen6_ppgtt.h | 5 +-
drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 181 +--
drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 305 ++--
drivers/gpu/drm/i915/gt/intel_breadcrumbs.h | 36 +
drivers/gpu/drm/i915/gt/intel_breadcrumbs_types.h | 47 +
drivers/gpu/drm/i915/gt/intel_context.c | 318 ++--
drivers/gpu/drm/i915/gt/intel_context.h | 13 +
drivers/gpu/drm/i915/gt/intel_context_types.h | 5 +-
drivers/gpu/drm/i915/gt/intel_engine.h | 20 -
drivers/gpu/drm/i915/gt/intel_engine_cs.c | 34 +-
drivers/gpu/drm/i915/gt/intel_engine_pm.c | 3 +-
drivers/gpu/drm/i915/gt/intel_engine_types.h | 31 +-
drivers/gpu/drm/i915/gt/intel_ggtt.c | 97 +-
drivers/gpu/drm/i915/gt/intel_gt.c | 23 +-
drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 103 +-
.../gpu/drm/i915/gt/intel_gt_buffer_pool_types.h | 6 +-
drivers/gpu/drm/i915/gt/intel_gt_irq.c | 1 +
drivers/gpu/drm/i915/gt/intel_gtt.c | 300 +---
drivers/gpu/drm/i915/gt/intel_gtt.h | 142 +-
drivers/gpu/drm/i915/gt/intel_lrc.c | 182 ++-
drivers/gpu/drm/i915/gt/intel_ppgtt.c | 150 +-
drivers/gpu/drm/i915/gt/intel_renderstate.c | 73 +-
drivers/gpu/drm/i915/gt/intel_renderstate.h | 9 +-
drivers/gpu/drm/i915/gt/intel_reset.c | 1 +
drivers/gpu/drm/i915/gt/intel_ring.c | 10 +-
drivers/gpu/drm/i915/gt/intel_ring.h | 3 +-
drivers/gpu/drm/i915/gt/intel_ring_submission.c | 42 +-
drivers/gpu/drm/i915/gt/intel_rps.c | 1 +
drivers/gpu/drm/i915/gt/intel_timeline.c | 28 +-
drivers/gpu/drm/i915/gt/intel_timeline.h | 24 +-
drivers/gpu/drm/i915/gt/intel_workarounds.c | 43 +-
drivers/gpu/drm/i915/gt/mock_engine.c | 30 +-
drivers/gpu/drm/i915/gt/selftest_context.c | 2 +
drivers/gpu/drm/i915/gt/selftest_lrc.c | 22 +-
drivers/gpu/drm/i915/gt/selftest_rps.c | 30 +-
drivers/gpu/drm/i915/gt/selftest_timeline.c | 10 +-
drivers/gpu/drm/i915/gt/selftest_workarounds.c | 2 +-
drivers/gpu/drm/i915/gt/uc/intel_guc.c | 2 +-
drivers/gpu/drm/i915/gvt/cmd_parser.c | 3 +-
drivers/gpu/drm/i915/gvt/scheduler.c | 17 +-
drivers/gpu/drm/i915/i915_active.c | 237 ++-
drivers/gpu/drm/i915/i915_active.h | 31 +-
drivers/gpu/drm/i915/i915_drv.c | 2 +-
drivers/gpu/drm/i915/i915_drv.h | 24 +-
drivers/gpu/drm/i915/i915_gem.c | 107 +-
drivers/gpu/drm/i915/i915_gem.h | 12 +
drivers/gpu/drm/i915/i915_irq.c | 1 +
drivers/gpu/drm/i915/i915_perf.c | 57 +-
drivers/gpu/drm/i915/i915_request.c | 224 +--
drivers/gpu/drm/i915/i915_request.h | 8 -
drivers/gpu/drm/i915/i915_sw_fence.c | 10 +-
drivers/gpu/drm/i915/i915_vma.c | 65 +-
drivers/gpu/drm/i915/i915_vma.h | 13 +-
drivers/gpu/drm/i915/selftests/i915_gem.c | 41 +
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 75 +-
drivers/gpu/drm/i915/selftests/i915_perf.c | 4 +-
drivers/gpu/drm/i915/selftests/i915_request.c | 18 +-
drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
.../gpu/drm/i915/selftests/intel_memory_region.c | 8 +-
drivers/gpu/drm/i915/selftests/mock_gtt.c | 26 +-
82 files changed, 3743 insertions(+), 2206 deletions(-)
create mode 100644 drivers/gpu/drm/i915/gt/intel_breadcrumbs.h
create mode 100644 drivers/gpu/drm/i915/gt/intel_breadcrumbs_types.h
[View Less]
Store DMA mapping data in geni_i2c_dev struct.
Implement Shutdown callback for geni i2c driver.
Changes in V2:
- Changed commit text.
- As per Stephen's comments added separate function for stop transfer.
Roja Rani Yarubandi (2):
i2c: i2c-qcom-geni: Store DMA mapping data in geni_i2c_dev struct
i2c: i2c-qcom-geni: Add shutdown callback for i2c
drivers/i2c/busses/i2c-qcom-geni.c | 50 ++++++++++++++++++++++++++++++
include/linux/qcom-geni-se.h | 5 +++
2 files changed, 55 …
[View More]insertions(+)
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
[View Less]
This adds support bindings and support for the TDO TL070WSH30 TFT-LCD panel
module shipped with the Amlogic S400 Development Kit.
The panel has a 1024×600 resolution and uses 24 bit RGB per pixel.
It provides a MIPI DSI interface to the host, a built-in LED backlight
and touch controller.
Neil Armstrong (2):
dt-bindings: display: panel: add TDO tl070wsh30 DSI panel bindings
drm: panel: add TDO tl070wsh30 panel driver
.../display/panel/tdo,tl070wsh30.yaml | 58 ++++
drivers/gpu/…
[View More]drm/panel/Kconfig | 11 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 263 ++++++++++++++++++
4 files changed, 333 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/panel/tdo,tl070wsh30.yaml
create mode 100644 drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
--
2.22.0
[View Less]
From: Antonio Borneo <antonio.borneo(a)st.com>
Current code enables the HS clock when video mode is started or to
send out a HS command, and disables the HS clock to send out a LP
command. This is not what DSI spec specify.
Enable HS clock either in command and in video mode.
Set automatic HS clock management for panels and devices that
support non-continuous HS clock.
Signed-off-by: Antonio Borneo <antonio.borneo(a)st.com>
---
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 9 ++…
[View More]+++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index d580b2aa4ce9..979acaa90d00 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -365,7 +365,6 @@ static void dw_mipi_message_config(struct dw_mipi_dsi *dsi,
if (lpm)
val |= CMD_MODE_ALL_LP;
- dsi_write(dsi, DSI_LPCLK_CTRL, lpm ? 0 : PHY_TXREQUESTCLKHS);
dsi_write(dsi, DSI_CMD_MODE_CFG, val);
}
@@ -541,16 +540,22 @@ static void dw_mipi_dsi_video_mode_config(struct dw_mipi_dsi *dsi)
static void dw_mipi_dsi_set_mode(struct dw_mipi_dsi *dsi,
unsigned long mode_flags)
{
+ u32 val;
+
dsi_write(dsi, DSI_PWR_UP, RESET);
if (mode_flags & MIPI_DSI_MODE_VIDEO) {
dsi_write(dsi, DSI_MODE_CFG, ENABLE_VIDEO_MODE);
dw_mipi_dsi_video_mode_config(dsi);
- dsi_write(dsi, DSI_LPCLK_CTRL, PHY_TXREQUESTCLKHS);
} else {
dsi_write(dsi, DSI_MODE_CFG, ENABLE_CMD_MODE);
}
+ val = PHY_TXREQUESTCLKHS;
+ if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)
+ val |= AUTO_CLKLANE_CTRL;
+ dsi_write(dsi, DSI_LPCLK_CTRL, val);
+
dsi_write(dsi, DSI_PWR_UP, POWERUP);
}
--
2.17.1
[View Less]