drm/amdgpu: Comply with implicit fencing rules
Subsystems (39)
PATCH 11/11 drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default
In reply to Daniel VetterGoes through all the drivers and deletes the default hook since it's the default now.
--- drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 1 - drivers/gpu/drm/gud/gud_drv.c | 1 - drivers/gpu/drm/mcde/mcde_display.c | 1 - drivers/gpu/drm/pl111/pl111_display.c | 1 - drivers/gpu/drm/tiny/hx8357d.c | 1 - drivers/gpu/drm/tiny/ili9225.c | 1 - drivers/gpu/drm/tiny/ili9341.c | 1 - drivers/gpu/drm/tiny/ili9486.c | 1 - drivers/gpu/drm/tiny/mi0283qt.c | 1 - drivers/gpu/drm/tiny/repaper.c | 1 - drivers/gpu/drm/tiny/st7586.c | 1 - drivers/gpu/drm/tiny/st7735r.c | 1 - drivers/gpu/drm/tve200/tve200_display.c | 1 - drivers/gpu/drm/xen/xen_drm_front_kms.c | 1 - 14 files changed, 14 deletions(-)
drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c +0 -1
@@ -220,7 +220,6 @@ static const struct drm_simple_display_pipe_funcs aspeed_gfx_funcs = { .enable = aspeed_gfx_pipe_enable, .disable = aspeed_gfx_pipe_disable, .update = aspeed_gfx_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, .enable_vblank = aspeed_gfx_enable_vblank, .disable_vblank = aspeed_gfx_disable_vblank, };
drivers/gpu/drm/gud/gud_drv.c +0 -1
@@ -364,7 +364,6 @@ static void gud_debugfs_init(struct drm_minor *minor)static const struct drm_simple_display_pipe_funcs gud_pipe_funcs = { .check = gud_pipe_check, .update = gud_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static const struct drm_mode_config_funcs gud_mode_config_funcs = {
drivers/gpu/drm/mcde/mcde_display.c +0 -1
@@ -1479,7 +1479,6 @@ static struct drm_simple_display_pipe_funcs mcde_display_funcs = { .update = mcde_display_update, .enable_vblank = mcde_display_enable_vblank, .disable_vblank = mcde_display_disable_vblank, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };int mcde_display_init (struct drm_device *drm)
drivers/gpu/drm/pl111/pl111_display.c +0 -1
@@ -440,7 +440,6 @@ static struct drm_simple_display_pipe_funcs pl111_display_funcs = { .enable = pl111_display_enable, .disable = pl111_display_disable, .update = pl111_display_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, }; static int pl111_clk_div_choose_div(struct clk_hw *hw, unsigned long rate,
drivers/gpu/drm/tiny/hx8357d.c +0 -1
@@ -184,7 +184,6 @@ static const struct drm_simple_display_pipe_funcs hx8357d_pipe_funcs = { .enable = yx240qv29_enable, .disable = mipi_dbi_pipe_disable, .update = mipi_dbi_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static const struct drm_display_mode yx350hv15_mode = {
drivers/gpu/drm/tiny/ili9225.c +0 -1
@@ -328,7 +328,6 @@ static const struct drm_simple_display_pipe_funcs ili9225_pipe_funcs = { .enable = ili9225_pipe_enable, .disable = ili9225_pipe_disable, .update = ili9225_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static const struct drm_display_mode ili9225_mode = {
drivers/gpu/drm/tiny/ili9341.c +0 -1
@@ -140,7 +140,6 @@ static const struct drm_simple_display_pipe_funcs ili9341_pipe_funcs = { .enable = yx240qv29_enable, .disable = mipi_dbi_pipe_disable, .update = mipi_dbi_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static const struct drm_display_mode yx240qv29_mode = {
drivers/gpu/drm/tiny/ili9486.c +0 -1
@@ -153,7 +153,6 @@ static const struct drm_simple_display_pipe_funcs waveshare_pipe_funcs = { .enable = waveshare_enable, .disable = mipi_dbi_pipe_disable, .update = mipi_dbi_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static const struct drm_display_mode waveshare_mode = {
drivers/gpu/drm/tiny/mi0283qt.c +0 -1
@@ -144,7 +144,6 @@ static const struct drm_simple_display_pipe_funcs mi0283qt_pipe_funcs = { .enable = mi0283qt_enable, .disable = mipi_dbi_pipe_disable, .update = mipi_dbi_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static const struct drm_display_mode mi0283qt_mode = {
drivers/gpu/drm/tiny/repaper.c +0 -1
@@ -861,7 +861,6 @@ static const struct drm_simple_display_pipe_funcs repaper_pipe_funcs = { .enable = repaper_pipe_enable, .disable = repaper_pipe_disable, .update = repaper_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static int repaper_connector_get_modes (struct drm_connector *connector)
drivers/gpu/drm/tiny/st7586.c +0 -1
@@ -268,7 +268,6 @@ static const struct drm_simple_display_pipe_funcs st7586_pipe_funcs = { .enable = st7586_pipe_enable, .disable = st7586_pipe_disable, .update = st7586_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static const struct drm_display_mode st7586_mode = {
drivers/gpu/drm/tiny/st7735r.c +0 -1
@@ -136,7 +136,6 @@ static const struct drm_simple_display_pipe_funcs st7735r_pipe_funcs = { .enable = st7735r_pipe_enable, .disable = mipi_dbi_pipe_disable, .update = mipi_dbi_pipe_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, };static const struct st7735r_cfg jd_t18003_t01_cfg = {
drivers/gpu/drm/tve200/tve200_display.c +0 -1
@@ -316,7 +316,6 @@ static const struct drm_simple_display_pipe_funcs tve200_display_funcs = { .enable = tve200_display_enable, .disable = tve200_display_disable, .update = tve200_display_update, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, .enable_vblank = tve200_display_enable_vblank, .disable_vblank = tve200_display_disable_vblank, };
drivers/gpu/drm/xen/xen_drm_front_kms.c +0 -1
@@ -302,7 +302,6 @@ static const struct drm_simple_display_pipe_funcs display_funcs = { .mode_valid = display_mode_valid, .enable = display_enable, .disable = display_disable, - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, .check = display_check, .update = display_update, };
Signature · 1 line
2.31.0
PATCH 2/11 drm/panfrost: Remove sched_lock
In reply to Daniel VetterScheduler takes care of its own locking, dont worry. For everything else there's reservation locking on each bo.
So seems to be entirely redundnant and just a bit in the way.
--- drivers/gpu/drm/panfrost/panfrost_device.c | 1 - drivers/gpu/drm/panfrost/panfrost_device.h | 2 -- drivers/gpu/drm/panfrost/panfrost_job.c | 13 ++----------- 3 files changed, 2 insertions(+), 14 deletions(-)
drivers/gpu/drm/panfrost/panfrost_device.c +0 -1
@@ -199,7 +199,6 @@ int panfrost_device_init(struct panfrost_device *pfdev)int err;struct resource *res; -mutex_init (&pfdev->sched_lock);INIT_LIST_HEAD (&pfdev->scheduled_jobs);INIT_LIST_HEAD (&pfdev->as_lru_list);
drivers/gpu/drm/panfrost/panfrost_device.h +0 -2
@@ -105,8 +105,6 @@ struct panfrost_device {struct panfrost_perfcnt *perfcnt; -struct mutex sched_lock; -struct {struct work_struct work;atomic_t pending;
drivers/gpu/drm/panfrost/panfrost_job.c +2 -11
@@ -218,26 +218,19 @@ static void panfrost_attach_object_fences(struct drm_gem_object **bos,int panfrost_job_push (struct panfrost_job *job) { -struct panfrost_device *pfdev = job->pfdev;int slot =panfrost_job_get_slot (job);struct drm_sched_entity *entity = &job->file_priv->sched_entity[slot];struct ww_acquire_ctx acquire_ctx;int ret =0 ; -mutex_lock (&pfdev->sched_lock); - ret =drm_gem_lock_reservations (job->bos, job->bo_count, &acquire_ctx); -if (ret) { -mutex_unlock (&pfdev->sched_lock); +if (ret)return ret; - } ret =drm_sched_job_init (&job->base, entity,NULL ); -if (ret) { -mutex_unlock (&pfdev->sched_lock); +if (ret) goto unlock; - } job->render_done_fence =dma_fence_get (&job->base.s_fence->finished);
@@ -248,8 +241,6 @@ int panfrost_job_push(struct panfrost_job *job)drm_sched_entity_push_job (&job->base, entity); -mutex_unlock (&pfdev->sched_lock); -panfrost_attach_object_fences (job->bos, job->bo_count, job->render_done_fence);
Signature · 6 lines
2.31.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/11 drm/panfrost: Use xarray and helpers for depedency tracking
In reply to Daniel VetterMore consistency and prep work for the next patch.
Aside: I wonder whether we shouldn't just move this entire xarray business into the scheduler so that not everyone has to reinvent the same wheels. Cc'ing some scheduler people for this too.
--- drivers/gpu/drm/panfrost/panfrost_drv.c | 41 ++++++++--------- drivers/gpu/drm/panfrost/panfrost_job.c | 61 ++++++++++--------------- drivers/gpu/drm/panfrost/panfrost_job.h | 8 ++-- 3 files changed, 46 insertions(+), 64 deletions(-)
drivers/gpu/drm/panfrost/panfrost_drv.c +18 -23
@@ -137,12 +137,6 @@ panfrost_lookup_bos(struct drm_device *dev,if (!job->bo_count)return 0 ; - job->implicit_fences =kvmalloc_array (job->bo_count, -sizeof (struct dma_fence *), -GFP_KERNEL | __GFP_ZERO); -if (!job->implicit_fences) -return -ENOMEM ; - ret =drm_gem_objects_lookup (file_priv, (void __user *)(uintptr_t )args->bo_handles, job->bo_count, &job->bos);
@@ -173,7 +167,7 @@ panfrost_lookup_bos(struct drm_device *dev, }/** -* panfrost_copy_in_sync() - Sets up job->in_fences[] with the sync objects +* panfrost_copy_in_sync() - Sets up job->deps with the sync objects * referenced by the job. * @dev: DRM device * @file_priv: DRM file for this fd
@@ -193,22 +187,14 @@ panfrost_copy_in_sync(struct drm_device *dev, {u32 *handles;int ret =0 ; -int i; +int i, in_fence_count; - job->in_fence_count = args->in_sync_count; + in_fence_count = args->in_sync_count; -if (!job->in_fence_count) +if (!in_fence_count)return 0 ; - job->in_fences =kvmalloc_array (job->in_fence_count, -sizeof (struct dma_fence *), -GFP_KERNEL | __GFP_ZERO); -if (!job->in_fences) { -DRM_DEBUG ("Failed to allocate job in fences\n" ); -return -ENOMEM ; - } - - handles =kvmalloc_array (job->in_fence_count,sizeof (u32),GFP_KERNEL ); + handles =kvmalloc_array (in_fence_count,sizeof (u32),GFP_KERNEL );if (!handles) { ret = -ENOMEM ;DRM_DEBUG ("Failed to allocate incoming syncobj handles\n" );
@@ -217,16 +203,23 @@ panfrost_copy_in_sync(struct drm_device *dev,if (copy_from_user (handles, (void __user *)(uintptr_t )args->in_syncs, - job->in_fence_count *sizeof (u32))) { + in_fence_count *sizeof (u32))) { ret = -EFAULT ;DRM_DEBUG ("Failed to copy in syncobj handles\n" ); goto fail; } -for (i =0 ; i < job->in_fence_count; i++) { +for (i =0 ; i < in_fence_count; i++) { +struct dma_fence *fence; + ret =drm_syncobj_find_fence (file_priv, handles[i],0 ,0 , - &job->in_fences[i]); -if (ret == -EINVAL ) + &fence); +if (ret) + goto fail; + + ret =drm_gem_fence_array_add (&job->deps, fence); + +if (ret) goto fail; }
@@ -264,6 +257,8 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,kref_init (&job->refcount); +xa_init_flags (&job->deps,XA_FLAGS_ALLOC ); + job->pfdev = pfdev; job->jc = args->jc; job->requirements = args->requirements;
drivers/gpu/drm/panfrost/panfrost_job.c +25 -36
91 lines not on this page · raw message
drivers/gpu/drm/panfrost/panfrost_job.h +3 -5
@@ -19,9 +19,9 @@ struct panfrost_job {struct panfrost_device *pfdev;struct panfrost_file_priv *file_priv; -/* Optional fences userspace can pass in for the job to depend on. */ -struct dma_fence **in_fences; -u32 in_fence_count; +/* Contains both explicit and implicit fences */ +struct xarray deps; +unsigned long last_dep;/* Fence to be signaled by IRQ handler when the job is complete. */ struct dma_fence *done_fence;
@@ -30,8 +30,6 @@ struct panfrost_job {__u32 requirements;__u32 flush_id; -/* Exclusive fences we have taken from the BOs to wait for */ -struct dma_fence **implicit_fences;struct panfrost_gem_mapping **mappings;struct drm_gem_object **bos;u32 bo_count;
Signature · 1 line
2.31.0
PATCH 4/11 drm/panfrost: Fix implicit sync
In reply to Daniel VetterCurrently this has no practial relevance I think because there's not many who can pull off a setup with panfrost and another gpu in the same system. But the rules are that if you're setting an exclusive fence, indicating a gpu write access in the implicit fencing system, then you need to wait for all fences, not just the previous exclusive fence.
panfrost against itself has no problem, because it always sets the exclusive fence (but that's probably something that will need to be fixed for vulkan and/or multi-engine gpus, or you'll suffer badly). Also no problem with that against display.
With the prep work done to switch over to the dependency helpers this is now a oneliner.
--- drivers/gpu/drm/panfrost/panfrost_job.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/panfrost/panfrost_job.c +2 -3
@@ -203,9 +203,8 @@ static int panfrost_acquire_object_fences(struct drm_gem_object **bos,int i, ret;for (i =0 ; i < bo_count; i++) { -struct dma_fence *fence =dma_resv_get_excl_rcu (bos[i]->resv); - - ret =drm_gem_fence_array_add (deps, fence); +/* panfrost always uses write mode in its current uapi */ + ret =drm_gem_fence_array_add_implicit (deps, bos[i], true);if (ret)return ret; }
Signature · 1 line
2.31.0
PATCH 6/11 drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterNo need to set it explicitly.
--- drivers/gpu/drm/imx/dcss/dcss-plane.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 - drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 - drivers/gpu/drm/stm/ltdc.c | 1 - drivers/gpu/drm/sun4i/sun4i_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 1 - drivers/gpu/drm/tidss/tidss_plane.c | 1 - 14 files changed, 15 deletions(-)
drivers/gpu/drm/imx/dcss/dcss-plane.c +0 -1
@@ -361,7 +361,6 @@ static void dcss_plane_atomic_disable(struct drm_plane *plane, }static const struct drm_plane_helper_funcs dcss_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = dcss_plane_atomic_check, .atomic_update = dcss_plane_atomic_update, .atomic_disable = dcss_plane_atomic_disable,
drivers/gpu/drm/imx/ipuv3-plane.c +0 -1
@@ -772,7 +772,6 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = ipu_plane_atomic_check, .atomic_disable = ipu_plane_atomic_disable, .atomic_update = ipu_plane_atomic_update,
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0 -1
@@ -786,7 +786,6 @@ static const struct drm_plane_helper_funcs ingenic_drm_plane_helper_funcs = { .atomic_update = ingenic_drm_plane_atomic_update, .atomic_check = ingenic_drm_plane_atomic_check, .atomic_disable = ingenic_drm_plane_atomic_disable, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static const struct drm_crtc_helper_funcs ingenic_drm_crtc_helper_funcs = {
drivers/gpu/drm/ingenic/ingenic-ipu.c +0 -1
@@ -615,7 +615,6 @@ static const struct drm_plane_helper_funcs ingenic_ipu_plane_helper_funcs = { .atomic_update = ingenic_ipu_plane_atomic_update, .atomic_check = ingenic_ipu_plane_atomic_check, .atomic_disable = ingenic_ipu_plane_atomic_disable, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static int
drivers/gpu/drm/mediatek/mtk_drm_plane.c +0 -1
@@ -227,7 +227,6 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mtk_plane_atomic_check, .atomic_update = mtk_plane_atomic_update, .atomic_disable = mtk_plane_atomic_disable,
drivers/gpu/drm/meson/meson_overlay.c +0 -1
@@ -747,7 +747,6 @@ static const struct drm_plane_helper_funcs meson_overlay_helper_funcs = { .atomic_check = meson_overlay_atomic_check, .atomic_disable = meson_overlay_atomic_disable, .atomic_update = meson_overlay_atomic_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static bool meson_overlay_format_mod_supported(struct drm_plane *plane,
drivers/gpu/drm/meson/meson_plane.c +0 -1
@@ -422,7 +422,6 @@ static const struct drm_plane_helper_funcs meson_plane_helper_funcs = { .atomic_check = meson_plane_atomic_check, .atomic_disable = meson_plane_atomic_disable, .atomic_update = meson_plane_atomic_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static bool meson_plane_format_mod_supported(struct drm_plane *plane,
drivers/gpu/drm/mxsfb/mxsfb_kms.c +0 -2
@@ -500,13 +500,11 @@ static bool mxsfb_format_mod_supported(struct drm_plane *plane, }static const struct drm_plane_helper_funcs mxsfb_plane_primary_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_primary_atomic_update, };static const struct drm_plane_helper_funcs mxsfb_plane_overlay_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_overlay_atomic_update, };
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0 -1
@@ -1109,7 +1109,6 @@ static const struct drm_plane_helper_funcs plane_helper_funcs = { .atomic_disable = vop_plane_atomic_disable, .atomic_async_check = vop_plane_atomic_async_check, .atomic_async_update = vop_plane_atomic_async_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static const struct drm_plane_funcs vop_plane_funcs = {
drivers/gpu/drm/stm/ltdc.c +0 -1
@@ -946,7 +946,6 @@ static const struct drm_plane_funcs ltdc_plane_funcs = { };static const struct drm_plane_helper_funcs ltdc_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = ltdc_plane_atomic_check, .atomic_update = ltdc_plane_atomic_update, .atomic_disable = ltdc_plane_atomic_disable,
drivers/gpu/drm/sun4i/sun4i_layer.c +0 -1
@@ -127,7 +127,6 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_disable = sun4i_backend_layer_atomic_disable, .atomic_update = sun4i_backend_layer_atomic_update, };
drivers/gpu/drm/sun4i/sun8i_ui_layer.c +0 -1
@@ -332,7 +332,6 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = sun8i_ui_layer_atomic_check, .atomic_disable = sun8i_ui_layer_atomic_disable, .atomic_update = sun8i_ui_layer_atomic_update,
drivers/gpu/drm/sun4i/sun8i_vi_layer.c +0 -1
@@ -436,7 +436,6 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = sun8i_vi_layer_atomic_check, .atomic_disable = sun8i_vi_layer_atomic_disable, .atomic_update = sun8i_vi_layer_atomic_update,
drivers/gpu/drm/tidss/tidss_plane.c +0 -1
@@ -158,7 +158,6 @@ static void drm_plane_destroy(struct drm_plane *plane) }static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = tidss_plane_atomic_check, .atomic_update = tidss_plane_atomic_update, .atomic_disable = tidss_plane_atomic_disable,
Signature · 1 line
2.31.0
PATCH 1/11 drm/amdgpu: Comply with implicit fencing rules
Docs for struct dma_resv are fairly clear:
"A reservation object can have attached one exclusive fence (normally associated with write operations) or N shared fences (read operations)."
https://dri.freedesktop.org/docs/drm/driver-api/dma-buf.html#reservation-objects
Furthermore a review across all of upstream.
First of render drivers and how they set implicit fences:
- nouveau follows this contract, see in validate_fini_no_ticket()
nouveau_bo_fence(nvbo, fence, !!b->write_domains);
and that last boolean controls whether the exclusive or shared fence slot is used.
- radeon follows this contract by setting
p->relocs[i].tv.num_shared = !r->write_domain;
in radeon_cs_parser_relocs(), which ensures that the call to ttm_eu_fence_buffer_objects() in radeon_cs_parser_fini() will do the right thing.
- vmwgfx seems to follow this contract with the shotgun approach of always setting ttm_val_buf->num_shared = 0, which means ttm_eu_fence_buffer_objects() will only use the exclusive slot.
- etnaviv follows this contract, as can be trivially seen by looking at submit_attach_object_fences()
- i915 is a bit a convoluted maze with multiple paths leading to i915_vma_move_to_active(). Which sets the exclusive flag if EXEC_OBJECT_WRITE is set. This can either come as a buffer flag for softpin mode, or through the write_domain when using relocations. It follows this contract.
- lima follows this contract, see lima_gem_submit() which sets the exclusive fence when the LIMA_SUBMIT_BO_WRITE flag is set for that bo
- msm follows this contract, see msm_gpu_submit() which sets the exclusive flag when the MSM_SUBMIT_BO_WRITE is set for that buffer
- panfrost follows this contract with the shotgun approach of just always setting the exclusive fence, see panfrost_attach_object_fences(). Benefits of a single engine I guess
- v3d follows this contract with the same shotgun approach in v3d_attach_fences_and_unlock_reservation(), but it has at least an XXX comment that maybe this should be improved
- v4c uses the same shotgun approach of always setting an exclusive fence, see vc4_update_bo_seqnos()
- vgem also follows this contract, see vgem_fence_attach_ioctl() and the VGEM_FENCE_WRITE. This is used in some igts to validate prime sharing with i915.ko without the need of a 2nd gpu
- vritio follows this contract again with the shotgun approach of always setting an exclusive fence, see virtio_gpu_array_add_fence()
This covers the setting of the exclusive fences when writing.
Synchronizing against the exclusive fence is a lot more tricky, and I only spot checked a few:
- i915 does it, with the optional EXEC_OBJECT_ASYNC to skip all implicit dependencies (which is used by vulkan)
- etnaviv does this. Implicit dependencies are collected in submit_fence_sync(), again with an opt-out flag ETNA_SUBMIT_NO_IMPLICIT. These are then picked up in etnaviv_sched_dependency which is the drm_sched_backend_ops->dependency callback.
- v4c seems to not do much here, maybe gets away with it by not having a scheduler and only a single engine. Since all newer broadcom chips than the OG vc4 use v3d for rendering, which follows this contract, the impact of this issue is fairly small.
- v3d does this using the drm_gem_fence_array_add_implicit() helper, which then it's drm_sched_backend_ops->dependency callback v3d_job_dependency() picks up.
- panfrost is nice here and tracks the implicit fences in panfrost_job->implicit_fences, which again the drm_sched_backend_ops->dependency callback panfrost_job_dependency() picks up. It is mildly questionable though since it only picks up exclusive fences in panfrost_acquire_object_fences(), but not buggy in practice because it also always sets the exclusive fence. It should pick up both sets of fences, just in case there's ever going to be a 2nd gpu in a SoC with a mali gpu. Or maybe a mali SoC with a pcie port and a real gpu, which might actually happen eventually. A bug, but easy to fix. Should probably use the drm_gem_fence_array_add_implicit() helper.
- lima is nice an easy, uses drm_gem_fence_array_add_implicit() and the same schema as v3d.
- msm is mildly entertaining. It also supports MSM_SUBMIT_NO_IMPLICIT, but because it doesn't use the drm/scheduler it handles fences from the wrong context with a synchronous dma_fence_wait. See submit_fence_sync() leading to msm_gem_sync_object(). Investing into a scheduler might be a good idea.
- all the remaining drivers are ttm based, where I hope they do appropriately obey implicit fences already. I didn't do the full audit there because a) not follow the contract would confuse ttm quite well and b) reading non-standard scheduler and submit code which isn't based on drm/scheduler is a pain.
Onwards to the display side.
- Any driver using the drm_gem_plane_helper_prepare_fb() helper will correctly. Overwhelmingly most drivers get this right, except a few totally dont. I'll follow up with a patch to make this the default and avoid a bunch of bugs.
- I didn't audit the ttm drivers, but given that dma_resv started there I hope they get this right.
In conclusion this IS the contract, both as documented and overwhelmingly implemented, specically as implemented by all render drivers except amdgpu.
Amdgpu tried to fix this already in
commit 049aca4363d8af87cab8d53de5401602db3b9999
Author: Christian König <[email protected]> Date: Wed Sep 19 16:54:35 2018 +0200
drm/amdgpu: fix using shared fence for exported BOs v2
but this fix falls short on a number of areas:
- It's racy, by the time the buffer is shared it might be too late. To make sure there's definitely never a problem we need to set the fences correctly for any buffer that's potentially exportable.
- It's breaking uapi, dma-buf fds support poll() and differentitiate between, which was introduced in
commit 9b495a5887994a6d74d5c261d012083a92b94738 Author: Maarten Lankhorst <[email protected]> Date: Tue Jul 1 12:57:43 2014 +0200 dma-buf: add poll support, v3
- Christian König wants to nack new uapi building further on this dma_resv contract because it breaks amdgpu, quoting
"Yeah, and that is exactly the reason why I will NAK this uAPI change.
"This doesn't works for amdgpu at all for the reasons outlined above."
https://lore.kernel.org/dri-devel/[email protected]/
Rejecting new development because your own driver is broken and violates established cross driver contracts and uapi is really not how upstream works.
Now this patch will have a severe performance impact on anything that runs on multiple engines. So we can't just merge it outright, but need a bit a plan:
- amdgpu needs a proper uapi for handling implicit fencing. The funny thing is that to do it correctly, implicit fencing must be treated as a very strange IPC mechanism for transporting fences, where both setting the fence and dependency intercepts must be handled explicitly. Current best practices is a per-bo flag to indicate writes, and a per-bo flag to to skip implicit fencing in the CS ioctl as a new chunk.
- Since amdgpu has been shipping with broken behaviour we need an opt-out flag from the butchered implicit fencing model to enable the proper explicit implicit fencing model.
- for kernel memory fences due to bo moves at least the i915 idea is to use ttm_bo->moving. amdgpu probably needs the same.
- since the current p2p dma-buf interface assumes the kernel memory fence is in the exclusive dma_resv fence slot we need to add a new fence slot for kernel fences, which must never be ignored. Since currently only amdgpu supports this there's no real problem here yet, until amdgpu gains a NO_IMPLICIT CS flag.
- New userspace needs to ship in enough desktop distros so that users wont notice the perf impact. I think we can ignore LTS distros who upgrade their kernels but not their mesa3d snapshot.
- Then when this is all in place we can merge this patch here.
What is not a solution to this problem here is trying to make the dma_resv rules in the kernel more clever. The fundamental issue here is that the amdgpu CS uapi is the least expressive one across all drivers (only equalled by panfrost, which has an actual excuse) by not allowing any userspace control over how implicit sync is conducted.
Until this is fixed it's completely pointless to make the kernel more clever to improve amdgpu, because all we're doing is papering over this uapi design issue. amdgpu needs to attain the status quo established by other drivers first, once that's achieved we can tackle the remaining issues in a consistent way across drivers.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 -2
@@ -617,8 +617,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,amdgpu_bo_list_for_each_entry (e, p->bo_list) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (e->tv.bo); -/* Make sure we use the exclusive slot for shared BOs */ -if (bo->prime_shared_count) +/* Make sure we use the exclusive slot for all potentially shared BOs */ +if (!(bo->flags &AMDGPU_GEM_CREATE_VM_ALWAYS_VALID )) e->tv.num_shared =0 ; e->bo_va =amdgpu_vm_bo_find (vm, bo); }
Signature · 6 lines
2.31.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/11 drm/armada: Remove prepare/cleanup_fb hooks
All they do is refcount the fb, which the atomic helpers already do.
This is was necessary with the legacy helpers and I guess just carry over in the conversion. drm_plane_state always has a full reference for its ->fb pointer during its entire lifetime,
see __drm_atomic_helper_plane_destroy_state()
--- drivers/gpu/drm/armada/armada_overlay.c | 2 -- drivers/gpu/drm/armada/armada_plane.c | 29 ------------------------- drivers/gpu/drm/armada/armada_plane.h | 2 -- 3 files changed, 33 deletions(-)
drivers/gpu/drm/armada/armada_overlay.c +0 -2
@@ -247,8 +247,6 @@ static void armada_drm_overlay_plane_atomic_disable(struct drm_plane *plane, }static const struct drm_plane_helper_funcs armada_overlay_plane_helper_funcs = { - .prepare_fb = armada_drm_plane_prepare_fb, - .cleanup_fb = armada_drm_plane_cleanup_fb, .atomic_check = armada_drm_plane_atomic_check, .atomic_update = armada_drm_overlay_plane_atomic_update, .atomic_disable = armada_drm_overlay_plane_atomic_disable,
drivers/gpu/drm/armada/armada_plane.c +0 -29
@@ -78,33 +78,6 @@ void armada_drm_plane_calc(struct drm_plane_state *state, u32 addrs[2][3], } } -int armada_drm_plane_prepare_fb (struct drm_plane *plane, -struct drm_plane_state *state) -{ -DRM_DEBUG_KMS ("[PLANE:%d:%s] [FB:%d]\n" , - plane->base.id, plane->name, - state->fb ? state->fb->base.id :0 ); - -/* -* Take a reference on the new framebuffer - we want to -* hold on to it while the hardware is displaying it. -*/ -if (state->fb) -drm_framebuffer_get (state->fb); -return 0 ; -} - -void armada_drm_plane_cleanup_fb (struct drm_plane *plane, -struct drm_plane_state *old_state) -{ -DRM_DEBUG_KMS ("[PLANE:%d:%s] [FB:%d]\n" , - plane->base.id, plane->name, - old_state->fb ? old_state->fb->base.id :0 ); - -if (old_state->fb) -drm_framebuffer_put (old_state->fb); -} -int armada_drm_plane_atomic_check (struct drm_plane *plane,struct drm_atomic_state *state) {
@@ -282,8 +255,6 @@ static void armada_drm_primary_plane_atomic_disable(struct drm_plane *plane, }static const struct drm_plane_helper_funcs armada_primary_plane_helper_funcs = { - .prepare_fb = armada_drm_plane_prepare_fb, - .cleanup_fb = armada_drm_plane_cleanup_fb, .atomic_check = armada_drm_plane_atomic_check, .atomic_update = armada_drm_primary_plane_atomic_update, .atomic_disable = armada_drm_primary_plane_atomic_disable,
drivers/gpu/drm/armada/armada_plane.h +0 -2
@@ -21,8 +21,6 @@ struct armada_plane_state {void armada_drm_plane_calc (struct drm_plane_state *state,u32 addrs[2 ][3 ],u16 pitches[3 ],bool interlaced); -int armada_drm_plane_prepare_fb (struct drm_plane *plane, -struct drm_plane_state *state);void armada_drm_plane_cleanup_fb (struct drm_plane *plane,struct drm_plane_state *old_state); int armada_drm_plane_atomic_check(struct drm_plane *plane,
Signature · 6 lines
2.31.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/11 drm/omap: Follow implicit fencing in prepare_fb
In reply to Daniel VetterI guess no one ever tried running omap together with lima or panfrost, not even sure that's possible. Anyway for consistency, fix this.
--- drivers/gpu/drm/omapdrm/omap_plane.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/omapdrm/omap_plane.c +3 -0
@@ -6,6 +6,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_plane_helper.h> #include "omap_dmm_tiler.h"
@@ -29,6 +30,8 @@ static int omap_plane_prepare_fb(struct drm_plane *plane,if (!new_state->fb)return 0 ; +drm_gem_plane_helper_prepare_fb (plane, new_state); +return omap_framebuffer_pin (new_state->fb); }
Signature · 6 lines
2.31.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/11 drm/atomic-helper: make drm_gem_plane_helper_prepare_fb the default
In reply to Daniel VetterThere's a bunch of atomic drivers who don't do this quite correctly, luckily most of them aren't in wide use or people would have noticed the tearing.
By making this the default we avoid the constant audit pain and can additionally remove a ton of lines from vfuncs for a bit more clarity in smaller drivers.
While at it complain if there's a cleanup_fb hook but no prepare_fb hook, because that makes no sense. I haven't found any driver which violates this, but better safe than sorry.
Subsequent patches will reap the benefits.
--- drivers/gpu/drm/drm_atomic_helper.c | 10 ++++++++++ drivers/gpu/drm/drm_gem_atomic_helper.c | 3 +++ include/drm/drm_modeset_helper_vtables.h | 7 +++++-- 3 files changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +10 -0
@@ -35,6 +35,7 @@#include <drm/drm_damage_helper.h> #include <drm/drm_device.h> #include <drm/drm_drv.h> +#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_plane_helper.h> #include <drm/drm_print.h> #include <drm/drm_self_refresh_helper.h>
@@ -2408,6 +2409,15 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev, ret = funcs->prepare_fb (plane, new_plane_state);if (ret) goto fail; + }else { +WARN_ON_ONCE (funcs->cleanup_fb); + +if (!drm_core_check_feature (dev,DRIVER_GEM )) +continue ; + + ret =drm_gem_plane_helper_prepare_fb (plane, new_plane_state); +if (ret) + goto fail; } }
drivers/gpu/drm/drm_gem_atomic_helper.c +3 -0
@@ -135,6 +135,9 @@* GEM based framebuffer drivers which have their buffers always pinned in * memory. * +* This function is the default implementation for GEM drivers of +* &drm_plane_helper_funcs.prepare_fb if no callback is provided. +* * See drm_atomic_set_fence_for_plane() for a discussion of implicit and * explicit fencing in atomic modeset updates. */
include/drm/drm_modeset_helper_vtables.h +5 -2
@@ -1178,8 +1178,11 @@ struct drm_plane_helper_funcs {* equivalent functionality should be implemented through private * members in the plane structure. * -* Drivers which always have their buffers pinned should use -* drm_gem_plane_helper_prepare_fb() for this hook. +* For GEM drivers who neither have a @prepare_fb not @cleanup_fb hook +* set drm_gem_plane_helper_prepare_fb() is called automatically to +* implement this. Other drivers which need additional plane processing +* can call drm_gem_plane_helper_prepare_fb() from their @prepare_fb +* hook. * * The helpers will call @cleanup_fb with matching arguments for every * successful call to this hook.
Signature · 1 line
2.31.0
PATCH 8/11 drm/vram-helpers: Create DRM_GEM_VRAM_PLANE_HELPER_FUNCS
In reply to Daniel VetterLike we have for the shadow helpers too, and roll it out to drivers.
--- drivers/gpu/drm/ast/ast_mode.c | 3 +-- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 3 +-- drivers/gpu/drm/vboxvideo/vbox_mode.c | 3 +-- include/drm/drm_gem_vram_helper.h | 12 ++++++++++++ 4 files changed, 15 insertions(+), 6 deletions(-)
drivers/gpu/drm/ast/ast_mode.c +1 -2
@@ -612,8 +612,7 @@ ast_primary_plane_helper_atomic_disable(struct drm_plane *plane, }static const struct drm_plane_helper_funcs ast_primary_plane_helper_funcs = { - .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, - .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb, +DRM_GEM_VRAM_PLANE_HELPER_FUNCS , .atomic_check = ast_primary_plane_helper_atomic_check, .atomic_update = ast_primary_plane_helper_atomic_update, .atomic_disable = ast_primary_plane_helper_atomic_disable,
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +1 -2
@@ -158,8 +158,7 @@ static const struct drm_plane_funcs hibmc_plane_funcs = { };static const struct drm_plane_helper_funcs hibmc_plane_helper_funcs = { - .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, - .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb, +DRM_GEM_VRAM_PLANE_HELPER_FUNCS , .atomic_check = hibmc_plane_atomic_check, .atomic_update = hibmc_plane_atomic_update, };
drivers/gpu/drm/vboxvideo/vbox_mode.c +1 -2
@@ -488,8 +488,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = { .atomic_check = vbox_primary_atomic_check, .atomic_update = vbox_primary_atomic_update, .atomic_disable = vbox_primary_atomic_disable, - .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, - .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb, + DRM_GEM_VRAM_PLANE_HELPER_FUNCS, };static const struct drm_plane_funcs vbox_primary_plane_funcs = {
include/drm/drm_gem_vram_helper.h +12 -0
@@ -124,6 +124,18 @@ void drm_gem_vram_plane_helper_cleanup_fb(struct drm_plane *plane, struct drm_plane_state *old_state); +/** +* DRM_GEM_VRAM_PLANE_HELPER_FUNCS - +* Initializes struct drm_plane_helper_funcs for VRAM handling +* +* Drivers may use GEM BOs as VRAM helpers for the framebuffer memory. This +* macro initializes struct drm_plane_helper_funcs to use the respective helper +* functions. +*/ +#define DRM_GEM_VRAM_PLANE_HELPER_FUNCS \ + .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, \ + .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb +/* * Helpers for struct drm_simple_display_pipe_funcs */
Signature · 1 line
2.31.0
PATCH 10/11 drm/simple-helper: drm_gem_simple_display_pipe_prepare_fb as default
In reply to Daniel VetterIt's tedious to review this all the time, and my audit showed that arcpgu actually forgot to set this.
Make this the default and stop worrying.
Again I sprinkled WARN_ON_ONCE on top to make sure we don't have strange combinations of hooks: cleanup_fb without prepare_fb doesn't make sense, and since simpler drivers are all new they better be GEM based drivers.
--- drivers/gpu/drm/drm_simple_kms_helper.c | 12 ++++++++++-- include/drm/drm_simple_kms_helper.h | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_simple_kms_helper.c +10 -2
@@ -9,6 +9,8 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> +#include <drm/drm_drv.h> +#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_managed.h> #include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h>
@@ -225,8 +227,14 @@ static int drm_simple_kms_plane_prepare_fb(struct drm_plane *plane,struct drm_simple_display_pipe *pipe; pipe = container_of(plane, struct drm_simple_display_pipe, plane); -if (!pipe->funcs || !pipe->funcs->prepare_fb) -return 0 ; +if (!pipe->funcs || !pipe->funcs->prepare_fb) { +if (WARN_ON_ONCE (drm_core_check_feature (plane->dev,DRIVER_GEM ))) +return 0 ; + +WARN_ON_ONCE (pipe->funcs && pipe->funcs->cleanup_fb); + +return drm_gem_simple_display_pipe_prepare_fb (pipe, state); + }return pipe->funcs->prepare_fb (pipe, state); }
include/drm/drm_simple_kms_helper.h +5 -2
@@ -116,8 +116,11 @@ struct drm_simple_display_pipe_funcs {* the documentation for the &drm_plane_helper_funcs.prepare_fb hook for * more details. * -* Drivers which always have their buffers pinned should use -* drm_gem_simple_display_pipe_prepare_fb() for this hook. +* For GEM drivers who neither have a @prepare_fb not @cleanup_fb hook +* set drm_gem_simple_display_pipe_prepare_fb() is called automatically +* to implement this. Other drivers which need additional plane +* processing can call drm_gem_simple_display_pipe_prepare_fb() from +* their @prepare_fb hook. */ int (*prepare_fb)(struct drm_simple_display_pipe *pipe,struct drm_plane_state *plane_state);
Signature · 1 line
2.31.0
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] drm/amdgpu: Comply with implicit fencing rules
In reply to Daniel Vetter== Series Details ==
== Series Details ==
Series: series starting with [01/11] drm/amdgpu: Comply with implicit fencing rules
URL : https://patchwork.freedesktop.org/series/90401/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 6771ddb74407 drm/amdgpu: Comply with implicit fencing rules -:15: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #15: https://dri.freedesktop.org/docs/drm/driver-api/dma-buf.html#reservation-objects
-:140: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 049aca4363d8 ("drm/amdgpu: fix using shared fence for exported BOs v2")' #140:
commit 049aca4363d8af87cab8d53de5401602db3b9999
-:155: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 9b495a588799 ("dma-buf: add poll support, v3")' #155:
commit 9b495a5887994a6d74d5c261d012083a92b94738
-:183: WARNING:REPEATED_WORD: Possible repeated word: 'to' #183:
writes, and a per-bo flag to to skip implicit fencing in the CS
-:200: WARNING:TYPO_SPELLING: 'wont' may be misspelled - perhaps 'won't'? #200:
wont notice the perf impact. I think we can ignore LTS distros who ^^^^
-:250: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 2 errors, 4 warnings, 0 checks, 10 lines checked624f38550c70 drm/panfrost: Remove sched_lock
-:83: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 51 lines checked2edd25e5fe08 drm/panfrost: Use xarray and helpers for depedency tracking
-:242: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 192 lines checked953b17b9a69e drm/panfrost: Fix implicit sync
-:49: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 11 lines checked611ea094f310 drm/atomic-helper: make drm_gem_plane_helper_prepare_fb the default
-:87: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 44 lines checkedb88bbf562ada drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
-:223: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 104 lines checkedc6de563ba9b7 drm/armada: Remove prepare/cleanup_fb hooks
-:88: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 57 lines checked808bc32c760a drm/vram-helpers: Create DRM_GEM_VRAM_PLANE_HELPER_FUNCS
-:83: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 45 lines checkedbdd282fc50b5 drm/omap: Follow implicit fencing in prepare_fb
-:32: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 15 lines checkedf13bd70bbd81 drm/simple-helper: drm_gem_simple_display_pipe_prepare_fb as default
-:71: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 37 lines checked8e1fe156d455 drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default
-:199: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'
total: 0 errors, 1 warnings, 0 checks, 98 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [01/11] drm/amdgpu: Comply with implicit fencing rules
In reply to Daniel Vetter== Series Details ==
== Series Details ==
Series: series starting with [01/11] drm/amdgpu: Comply with implicit fencing rules
URL : https://patchwork.freedesktop.org/series/90401/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. - +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1345:25: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1345:25: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1345:25: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1346:17: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1346:17: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1346:17: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1405:17: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1405:17: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1405:17: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:293:16: error: incompatible types in comparison expression (different type sizes): +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:293:16: unsigned long * +drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:293:16: unsigned long long * +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:275:25: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:275:25: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:275:25: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:276:17: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:276:17: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:276:17: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:330:17: error: incompatible types in comparison expression (different address spaces): +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:330:17: struct dma_fence * +drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:330:17: struct dma_fence [noderef] __rcu * +drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:90:56: error: marked inline, but without a definition +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB" +drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Lucas Stach
reviewerRe: [PATCH 02/11] drm/panfrost: Remove sched_lock
In reply to Daniel VetterAm Freitag, dem 21.05.2021 um 11:09 +0200 schrieb Daniel Vetter:
Quoted 4 lines
Scheduler takes care of its own locking, dont worry. For everything else there's reservation locking on each bo.
So seems to be entirely redundnant and just a bit in the way.
I haven't read all the surrounding code, but this looks wrong from a glance. You must hold a lock across drm_sched_job_init -> drm_sched_entity_push_job as the scheduler fences are initialized in the job init, so if there's no exclusive section across those two function calls you might end up with jobs being queued with their fence seqnos not monotonically increasing, which breaks all kinds of other stuff.
I don't see a reason to hold the lock across the reservation calls, though.
Regards,
Lucas
Quoted 79 lines
Signed-off-by Daniel Vetter <[email protected]>Cc Rob Herring <[email protected]>Cc Tomeu Vizoso <[email protected]>Cc Steven Price <[email protected]>Cc Alyssa Rosenzweig <[email protected]>--- drivers/gpu/drm/panfrost/panfrost_device.c | 1 - drivers/gpu/drm/panfrost/panfrost_device.h | 2 -- drivers/gpu/drm/panfrost/panfrost_job.c | 13 ++----------- 3 files changed, 2 insertions(+), 14 deletions(-)drivers/gpu/drm/panfrost/panfrost_device.c +0
-1@@ -199,7 +199,6 @@ int panfrost_device_init(struct panfrost_device *pfdev)int err;struct resource *res; -mutex_init (&pfdev->sched_lock);INIT_LIST_HEAD (&pfdev->scheduled_jobs);INIT_LIST_HEAD (&pfdev->as_lru_list);drivers/gpu/drm/panfrost/panfrost_device.h +0
-2@@ -105,8 +105,6 @@ struct panfrost_device {struct panfrost_perfcnt *perfcnt; -struct mutex sched_lock; -struct {struct work_struct work;atomic_t pending;drivers/gpu/drm/panfrost/panfrost_job.c +2
-11@@ -218,26 +218,19 @@ static void panfrost_attach_object_fences(struct drm_gem_object **bos,int panfrost_job_push (struct panfrost_job *job) { -struct panfrost_device *pfdev = job->pfdev;int slot =panfrost_job_get_slot (job);struct drm_sched_entity *entity = &job->file_priv->sched_entity[slot];struct ww_acquire_ctx acquire_ctx;int ret =0 ; -mutex_lock (&pfdev->sched_lock); - ret =drm_gem_lock_reservations (job->bos, job->bo_count, &acquire_ctx); -if (ret) { -mutex_unlock (&pfdev->sched_lock); +if (ret)return ret; - } ret =drm_sched_job_init (&job->base, entity,NULL ); -if (ret) { -mutex_unlock (&pfdev->sched_lock); +if (ret) goto unlock; - } job->render_done_fence =dma_fence_get (&job->base.s_fence->finished);@@ -248,8 +241,6 @@ int panfrost_job_push(struct panfrost_job *job)drm_sched_entity_push_job (&job->base, entity); -mutex_unlock (&pfdev->sched_lock); -panfrost_attach_object_fences (job->bos, job->bo_count, job->render_done_fence);
Re: [PATCH 08/11] drm/vram-helpers: Create DRM_GEM_VRAM_PLANE_HELPER_FUNCS
In reply to Daniel VetterQuoted 38 lines · Daniel Vetter
Like we have for the shadow helpers too, and roll it out to drivers.
Signed-off-by Daniel Vetter <[email protected]>Cc Dave Airlie <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Hans de Goede <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Tian Tao <[email protected]>Cc Laurent Pinchart <[email protected]>--- drivers/gpu/drm/ast/ast_mode.c | 3 +-- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 3 +-- drivers/gpu/drm/vboxvideo/vbox_mode.c | 3 +-- include/drm/drm_gem_vram_helper.h | 12 ++++++++++++ 4 files changed, 15 insertions(+), 6 deletions(-)drivers/gpu/drm/ast/ast_mode.c +1
-2@@ -612,8 +612,7 @@ ast_primary_plane_helper_atomic_disable(struct drm_plane *plane, }static const struct drm_plane_helper_funcs ast_primary_plane_helper_funcs = { - .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, - .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb, +DRM_GEM_VRAM_PLANE_HELPER_FUNCS , .atomic_check = ast_primary_plane_helper_atomic_check, .atomic_update = ast_primary_plane_helper_atomic_update, .atomic_disable = ast_primary_plane_helper_atomic_disable,drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +0
-0
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c static const struct drm_plane_funcs hibmc_plane_funcs = { · line 164
Quoted 9 lines
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +1
-2@@ -158,8 +158,7 @@ static const struct drm_plane_funcs hibmc_plane_funcs = { };static const struct drm_plane_helper_funcs hibmc_plane_helper_funcs = { - .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, - .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb, +DRM_GEM_VRAM_PLANE_HELPER_FUNCS , .atomic_check = hibmc_plane_atomic_check, .atomic_update = hibmc_plane_atomic_update, };
Quoted 37 lines
drivers/gpu/drm/vboxvideo/vbox_mode.c +1
-2@@ -488,8 +488,7 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = { .atomic_check = vbox_primary_atomic_check, .atomic_update = vbox_primary_atomic_update, .atomic_disable = vbox_primary_atomic_disable, - .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, - .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb, + DRM_GEM_VRAM_PLANE_HELPER_FUNCS, };static const struct drm_plane_funcs vbox_primary_plane_funcs = {include/drm/drm_gem_vram_helper.h +12
-0@@ -124,6 +124,18 @@ void drm_gem_vram_plane_helper_cleanup_fb(struct drm_plane *plane, struct drm_plane_state *old_state); +/** +* DRM_GEM_VRAM_PLANE_HELPER_FUNCS - +* Initializes struct drm_plane_helper_funcs for VRAM handling +* +* Drivers may use GEM BOs as VRAM helpers for the framebuffer memory. This +* macro initializes struct drm_plane_helper_funcs to use the respective helper +* functions. +*/ +#define DRM_GEM_VRAM_PLANE_HELPER_FUNCS \ + .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, \ + .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb +/* * Helpers for struct drm_simple_display_pipe_funcs */
Re: [PATCH 06/11] drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterAm Freitag, dem 21.05.2021 um 11:09 +0200 schrieb Daniel Vetter:
Quoted 5 lines
No need to set it explicitly.
Signed-off-by Daniel Vetter <[email protected]>Cc Laurentiu Palcu <[email protected]>Cc Lucas Stach <[email protected]>
For dcss and imx-drm:
Quoted 225 lines
Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Pengutronix Kernel Team <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP Linux Team <[email protected]>Cc Philipp Zabel <[email protected]>Cc Paul Cercueil <[email protected]>Cc Chun-Kuang Hu <[email protected]>Cc Matthias Brugger <[email protected]>Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Cc Jerome Brunet <[email protected]>Cc Martin Blumenstingl <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Agner <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Cc Jyri Sarha <[email protected]>Cc Tomi Valkeinen <[email protected]>--- drivers/gpu/drm/imx/dcss/dcss-plane.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 - drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 - drivers/gpu/drm/stm/ltdc.c | 1 - drivers/gpu/drm/sun4i/sun4i_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 1 - drivers/gpu/drm/tidss/tidss_plane.c | 1 - 14 files changed, 15 deletions(-)drivers/gpu/drm/imx/dcss/dcss-plane.c +0
-1@@ -361,7 +361,6 @@ static void dcss_plane_atomic_disable(struct drm_plane *plane, }static const struct drm_plane_helper_funcs dcss_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = dcss_plane_atomic_check, .atomic_update = dcss_plane_atomic_update, .atomic_disable = dcss_plane_atomic_disable,drivers/gpu/drm/imx/ipuv3-plane.c +0
-1@@ -772,7 +772,6 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = ipu_plane_atomic_check, .atomic_disable = ipu_plane_atomic_disable, .atomic_update = ipu_plane_atomic_update,drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0
-1@@ -786,7 +786,6 @@ static const struct drm_plane_helper_funcs ingenic_drm_plane_helper_funcs = { .atomic_update = ingenic_drm_plane_atomic_update, .atomic_check = ingenic_drm_plane_atomic_check, .atomic_disable = ingenic_drm_plane_atomic_disable, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static const struct drm_crtc_helper_funcs ingenic_drm_crtc_helper_funcs = {drivers/gpu/drm/ingenic/ingenic-ipu.c +0
-1@@ -615,7 +615,6 @@ static const struct drm_plane_helper_funcs ingenic_ipu_plane_helper_funcs = { .atomic_update = ingenic_ipu_plane_atomic_update, .atomic_check = ingenic_ipu_plane_atomic_check, .atomic_disable = ingenic_ipu_plane_atomic_disable, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static intdrivers/gpu/drm/mediatek/mtk_drm_plane.c +0
-1@@ -227,7 +227,6 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mtk_plane_atomic_check, .atomic_update = mtk_plane_atomic_update, .atomic_disable = mtk_plane_atomic_disable,drivers/gpu/drm/meson/meson_overlay.c +0
-1@@ -747,7 +747,6 @@ static const struct drm_plane_helper_funcs meson_overlay_helper_funcs = { .atomic_check = meson_overlay_atomic_check, .atomic_disable = meson_overlay_atomic_disable, .atomic_update = meson_overlay_atomic_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static bool meson_overlay_format_mod_supported(struct drm_plane *plane,drivers/gpu/drm/meson/meson_plane.c +0
-1@@ -422,7 +422,6 @@ static const struct drm_plane_helper_funcs meson_plane_helper_funcs = { .atomic_check = meson_plane_atomic_check, .atomic_disable = meson_plane_atomic_disable, .atomic_update = meson_plane_atomic_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static bool meson_plane_format_mod_supported(struct drm_plane *plane,drivers/gpu/drm/mxsfb/mxsfb_kms.c +0
-2@@ -500,13 +500,11 @@ static bool mxsfb_format_mod_supported(struct drm_plane *plane, }static const struct drm_plane_helper_funcs mxsfb_plane_primary_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_primary_atomic_update, };static const struct drm_plane_helper_funcs mxsfb_plane_overlay_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_overlay_atomic_update, };drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0
-1@@ -1109,7 +1109,6 @@ static const struct drm_plane_helper_funcs plane_helper_funcs = { .atomic_disable = vop_plane_atomic_disable, .atomic_async_check = vop_plane_atomic_async_check, .atomic_async_update = vop_plane_atomic_async_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static const struct drm_plane_funcs vop_plane_funcs = {drivers/gpu/drm/stm/ltdc.c +0
-1@@ -946,7 +946,6 @@ static const struct drm_plane_funcs ltdc_plane_funcs = { };static const struct drm_plane_helper_funcs ltdc_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = ltdc_plane_atomic_check, .atomic_update = ltdc_plane_atomic_update, .atomic_disable = ltdc_plane_atomic_disable,drivers/gpu/drm/sun4i/sun4i_layer.c +0
-1@@ -127,7 +127,6 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_disable = sun4i_backend_layer_atomic_disable, .atomic_update = sun4i_backend_layer_atomic_update, };drivers/gpu/drm/sun4i/sun8i_ui_layer.c +0
-1@@ -332,7 +332,6 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = sun8i_ui_layer_atomic_check, .atomic_disable = sun8i_ui_layer_atomic_disable, .atomic_update = sun8i_ui_layer_atomic_update,drivers/gpu/drm/sun4i/sun8i_vi_layer.c +0
-1@@ -436,7 +436,6 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = sun8i_vi_layer_atomic_check, .atomic_disable = sun8i_vi_layer_atomic_disable, .atomic_update = sun8i_vi_layer_atomic_update,drivers/gpu/drm/tidss/tidss_plane.c +0
-1@@ -158,7 +158,6 @@ static void drm_plane_destroy(struct drm_plane *plane) }static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = tidss_plane_atomic_check, .atomic_update = tidss_plane_atomic_update, .atomic_disable = tidss_plane_atomic_disable,
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [01/11] drm/amdgpu: Comply with implicit fencing rules
In reply to Daniel Vetter== Series Details ==
== Series Details ==
Series: series starting with [01/11] drm/amdgpu: Comply with implicit fencing rules
URL : https://patchwork.freedesktop.org/series/90401/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_10119 -> Patchwork_20167
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/index.html
Known issues
------------
Here are the changes found in Patchwork_20167 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s0:
- fi-kbl-soraka: [PASS][1] -> [INCOMPLETE][2] ([i915#155])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/fi-kbl-soraka/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-kbl-soraka/igt@[email protected]
* igt@i915_selftest@live@hangcheck:
- fi-snb-2600: [PASS][3] -> [INCOMPLETE][4] ([i915#2782])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/fi-snb-2600/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-snb-2600/igt@i915_selftest@[email protected]
* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- fi-bdw-5557u: NOTRUN -> [SKIP][5] ([fdo#109271]) +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-bdw-5557u/igt@[email protected]
* igt@kms_chamelium@dp-crc-fast:
- fi-bdw-5557u: NOTRUN -> [SKIP][6] ([fdo#109271] / [fdo#111827]) +8 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-bdw-5557u/igt@[email protected]
#### Warnings ####
* igt@i915_selftest@live@execlists:
- fi-bsw-nick: [DMESG-FAIL][7] ([i915#3462]) -> [INCOMPLETE][8] ([i915#2782] / [i915#2940] / [i915#3462])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/fi-bsw-nick/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-bsw-nick/igt@i915_selftest@[email protected]
- fi-bsw-kefka: [DMESG-FAIL][9] ([i915#3462]) -> [INCOMPLETE][10] ([i915#2782] / [i915#2940] / [i915#3462])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/fi-bsw-kefka/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-bsw-kefka/igt@i915_selftest@[email protected]
* igt@runner@aborted:
- fi-cml-u2: [FAIL][11] ([i915#3363] / [i915#3462]) -> [FAIL][12] ([i915#2082] / [i915#2426] / [i915#3363] / [i915#3462])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/fi-cml-u2/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-cml-u2/igt@[email protected]
- fi-cfl-guc: [FAIL][13] ([i915#3363]) -> [FAIL][14] ([i915#2426] / [i915#3363])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/fi-cfl-guc/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-cfl-guc/igt@[email protected]
- fi-kbl-7567u: [FAIL][15] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][16] ([i915#1436] / [i915#3363])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/fi-kbl-7567u/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-kbl-7567u/igt@[email protected]
- fi-skl-6700k2: [FAIL][17] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][18] ([i915#1436] / [i915#3363])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/fi-skl-6700k2/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/fi-skl-6700k2/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
[i915#2082]: https://gitlab.freedesktop.org/drm/intel/issues/2082
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2782]: https://gitlab.freedesktop.org/drm/intel/issues/2782
[i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
[i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
[i915#3462]: https://gitlab.freedesktop.org/drm/intel/issues/3462
Participating hosts (42 -> 38)
------------------------------
Missing (4): fi-glk-dsi fi-bsw-cyan fi-bdw-samus fi-hsw-4200u
Build changes
-------------
* Linux: CI_DRM_10119 -> Patchwork_20167
CI-20190529: 20190529
CI_DRM_10119: 1aa3a4edb0aa53e7a302c540f9b947cb55dbadc5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6090: 8eeb9c130e75d4063d0dc2ed69c8acde66b6b5d0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_20167: 8e1fe156d4559125daa9683fe684c80a5eead3cc @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
8e1fe156d455 drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default f13bd70bbd81 drm/simple-helper: drm_gem_simple_display_pipe_prepare_fb as default bdd282fc50b5 drm/omap: Follow implicit fencing in prepare_fb 808bc32c760a drm/vram-helpers: Create DRM_GEM_VRAM_PLANE_HELPER_FUNCS c6de563ba9b7 drm/armada: Remove prepare/cleanup_fb hooks b88bbf562ada drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default 611ea094f310 drm/atomic-helper: make drm_gem_plane_helper_prepare_fb the default 953b17b9a69e drm/panfrost: Fix implicit sync2edd25e5fe08 drm/panfrost: Use xarray and helpers for depedency tracking 624f38550c70 drm/panfrost: Remove sched_lock6771ddb74407 drm/amdgpu: Comply with implicit fencing rules
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 236 lines · Daniel Vetter
Docs for struct
dma_resvare fairly clear:"A reservation object can have attached one exclusive fence (normally associated with write operations) or N shared fences (read operations)."
https://dri.freedesktop.org/docs/drm/driver-api/dma-buf.html#reservation-objects
Furthermore a review across all of upstream.
First of render drivers and how they set implicit fences:
- nouveau follows this contract, see in
validate_fini_no_ticket()nouveau_bo_fence(nvbo, fence, !!b->write_domains);and that last boolean controls whether the exclusive or shared fence slot is used.
- radeon follows this contract by setting
p->relocs[i].tv.num_shared = !r->write_domain;in
radeon_cs_parser_relocs(), which ensures that the call tottm_eu_fence_buffer_objects()inradeon_cs_parser_fini()will do the right thing.- vmwgfx seems to follow this contract with the shotgun approach of always setting
ttm_val_buf->num_shared= 0, which meansttm_eu_fence_buffer_objects()will only use the exclusive slot.- etnaviv follows this contract, as can be trivially seen by looking at
submit_attach_object_fences()- i915 is a bit a convoluted maze with multiple paths leading to
i915_vma_move_to_active(). Which sets the exclusive flag ifEXEC_OBJECT_WRITEis set. This can either come as a buffer flag for softpin mode, or through thewrite_domainwhen using relocations. It follows this contract.- lima follows this contract, see
lima_gem_submit()which sets the exclusive fence when theLIMA_SUBMIT_BO_WRITEflag is set for that bo- msm follows this contract, see
msm_gpu_submit()which sets the exclusive flag when theMSM_SUBMIT_BO_WRITEis set for that buffer- panfrost follows this contract with the shotgun approach of just always setting the exclusive fence, see
panfrost_attach_object_fences(). Benefits of a single engine I guess- v3d follows this contract with the same shotgun approach in
v3d_attach_fences_and_unlock_reservation(), but it has at least an XXX comment that maybe this should be improved- v4c uses the same shotgun approach of always setting an exclusive fence, see
vc4_update_bo_seqnos()- vgem also follows this contract, see
vgem_fence_attach_ioctl()and theVGEM_FENCE_WRITE. This is used in some igts to validate prime sharing with i915.ko without the need of a 2nd gpu- vritio follows this contract again with the shotgun approach of always setting an exclusive fence, see
virtio_gpu_array_add_fence()This covers the setting of the exclusive fences when writing.
Synchronizing against the exclusive fence is a lot more tricky, and I only spot checked a few:
- i915 does it, with the optional
EXEC_OBJECT_ASYNCto skip all implicit dependencies (which is used by vulkan)- etnaviv does this. Implicit dependencies are collected in
submit_fence_sync(), again with an opt-out flagETNA_SUBMIT_NO_IMPLICIT. These are then picked up inetnaviv_sched_dependencywhich is thedrm_sched_backend_ops->dependencycallback.- v4c seems to not do much here, maybe gets away with it by not having a scheduler and only a single engine. Since all newer broadcom chips than the OG vc4 use v3d for rendering, which follows this contract, the impact of this issue is fairly small.
- v3d does this using the
drm_gem_fence_array_add_implicit()helper, which then it'sdrm_sched_backend_ops->dependencycallbackv3d_job_dependency()picks up.- panfrost is nice here and tracks the implicit fences in
panfrost_job->implicit_fences, which again thedrm_sched_backend_ops->dependencycallbackpanfrost_job_dependency()picks up. It is mildly questionable though since it only picks up exclusive fences inpanfrost_acquire_object_fences(), but not buggy in practice because it also always sets the exclusive fence. It should pick up both sets of fences, just in case there's ever going to be a 2nd gpu in a SoC with a mali gpu. Or maybe a mali SoC with a pcie port and a real gpu, which might actually happen eventually. A bug, but easy to fix. Should probably use thedrm_gem_fence_array_add_implicit()helper.- lima is nice an easy, uses
drm_gem_fence_array_add_implicit()and the same schema as v3d.- msm is mildly entertaining. It also supports
MSM_SUBMIT_NO_IMPLICIT, but because it doesn't use the drm/scheduler it handles fences from the wrong context with a synchronousdma_fence_wait. Seesubmit_fence_sync()leading tomsm_gem_sync_object(). Investing into a scheduler might be a good idea.- all the remaining drivers are ttm based, where I hope they do appropriately obey implicit fences already. I didn't do the full audit there because a) not follow the contract would confuse ttm quite well and b) reading non-standard scheduler and submit code which isn't based on drm/scheduler is a pain.
Onwards to the display side.
- Any driver using the
drm_gem_plane_helper_prepare_fb()helper will correctly. Overwhelmingly most drivers get this right, except a few totally dont. I'll follow up with a patch to make this the default and avoid a bunch of bugs.- I didn't audit the ttm drivers, but given that
dma_resvstarted there I hope they get this right.In conclusion this IS the contract, both as documented and overwhelmingly implemented, specically as implemented by all render drivers except amdgpu.
Amdgpu tried to fix this already in
commit
049aca4363d8af87cab8d53de5401602db3b9999Author: Christian König <[email protected]> Date: Wed Sep 19 16:54:35 2018 +0200drm/amdgpu: fix using shared fence for exported BOs v2
but this fix falls short on a number of areas:
- It's racy, by the time the buffer is shared it might be too late. To make sure there's definitely never a problem we need to set the fences correctly for any buffer that's potentially exportable.
- It's breaking uapi, dma-buf fds support
poll()and differentitiate between, which was introduced incommit
9b495a5887994a6d74d5c261d012083a92b94738
Author: Maarten Lankhorst <[email protected]>
Date: Tue Jul 1 12:57:43 2014 +0200dma-buf: add poll support, v3
- Christian König wants to nack new uapi building further on this
dma_resvcontract because it breaks amdgpu, quoting"Yeah, and that is exactly the reason why I will NAK this uAPI change.
"This doesn't works for amdgpu at all for the reasons outlined above."
https://lore.kernel.org/dri-devel/[email protected]/
Rejecting new development because your own driver is broken and violates established cross driver contracts and uapi is really not how upstream works.
Now this patch will have a severe performance impact on anything that runs on multiple engines. So we can't just merge it outright, but need a bit a plan:
- amdgpu needs a proper uapi for handling implicit fencing. The funny thing is that to do it correctly, implicit fencing must be treated as a very strange IPC mechanism for transporting fences, where both setting the fence and dependency intercepts must be handled explicitly. Current best practices is a per-bo flag to indicate writes, and a per-bo flag to to skip implicit fencing in the CS ioctl as a new chunk.
- Since amdgpu has been shipping with broken behaviour we need an opt-out flag from the butchered implicit fencing model to enable the proper explicit implicit fencing model.
- for kernel memory fences due to bo moves at least the i915 idea is to use
ttm_bo->moving. amdgpu probably needs the same.- since the current p2p dma-buf interface assumes the kernel memory fence is in the exclusive
dma_resvfence slot we need to add a new fence slot for kernel fences, which must never be ignored. Since currently only amdgpu supports this there's no real problem here yet, until amdgpu gains aNO_IMPLICITCS flag.- New userspace needs to ship in enough desktop distros so that users wont notice the perf impact. I think we can ignore LTS distros who upgrade their kernels but not their mesa3d snapshot.
- Then when this is all in place we can merge this patch here.
What is not a solution to this problem here is trying to make the
dma_resvrules in the kernel more clever. The fundamental issue here is that the amdgpu CS uapi is the least expressive one across all drivers (only equalled by panfrost, which has an actual excuse) by not allowing any userspace control over how implicit sync is conducted.Until this is fixed it's completely pointless to make the kernel more clever to improve amdgpu, because all we're doing is papering over this uapi design issue. amdgpu needs to attain the status quo established by other drivers first, once that's achieved we can tackle the remaining issues in a consistent way across drivers.
Cc Bas Nieuwenhuizen <[email protected]>Cc Dave Airlie <[email protected]>Cc Rob Clark <[email protected]>Cc Kristian H. Kristensen <[email protected]>Cc Michel Dänzer <[email protected]>Cc Daniel Stone <[email protected]>Cc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc Daniel Vetter <[email protected]>Cc Deepak R Varma <[email protected]>Cc Chen Li <[email protected]>Cc Kevin Wang <[email protected]>Cc Dennis Li <[email protected]>Cc Luben Tuikov <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · line 622
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2@@ -617,8 +617,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,amdgpu_bo_list_for_each_entry (e, p->bo_list) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (e->tv.bo); -/* Make sure we use the exclusive slot for shared BOs */ -if (bo->prime_shared_count) +/* Make sure we use the exclusive slot for all potentially shared BOs */ +if (!(bo->flags &AMDGPU_GEM_CREATE_VM_ALWAYS_VALID )) e->tv.num_shared =0 ;
I think it also makes sense to skip this with AMDGPU_GEM_CREATE_EXPLICIT_SYNC? It can be shared but I don't think anyone expects implicit sync to happen with those.
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-1e->bo_va =amdgpu_vm_bo_find (vm, bo); } --2.31.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Christian König
maintainerAm 21.05.21 um 11:09 schrieb Daniel Vetter:
Quoted 218 lines
Docs for struct
dma_resvare fairly clear:"A reservation object can have attached one exclusive fence (normally associated with write operations) or N shared fences (read operations)."
Furthermore a review across all of upstream.
First of render drivers and how they set implicit fences:
- nouveau follows this contract, see in
validate_fini_no_ticket()nouveau_bo_fence(nvbo, fence, !!b->write_domains);and that last boolean controls whether the exclusive or shared fence slot is used.
- radeon follows this contract by setting
p->relocs[i].tv.num_shared = !r->write_domain;in
radeon_cs_parser_relocs(), which ensures that the call tottm_eu_fence_buffer_objects()inradeon_cs_parser_fini()will do the right thing.- vmwgfx seems to follow this contract with the shotgun approach of always setting
ttm_val_buf->num_shared= 0, which meansttm_eu_fence_buffer_objects()will only use the exclusive slot.- etnaviv follows this contract, as can be trivially seen by looking at
submit_attach_object_fences()- i915 is a bit a convoluted maze with multiple paths leading to
i915_vma_move_to_active(). Which sets the exclusive flag ifEXEC_OBJECT_WRITEis set. This can either come as a buffer flag for softpin mode, or through thewrite_domainwhen using relocations. It follows this contract.- lima follows this contract, see
lima_gem_submit()which sets the exclusive fence when theLIMA_SUBMIT_BO_WRITEflag is set for that bo- msm follows this contract, see
msm_gpu_submit()which sets the exclusive flag when theMSM_SUBMIT_BO_WRITEis set for that buffer- panfrost follows this contract with the shotgun approach of just always setting the exclusive fence, see
panfrost_attach_object_fences(). Benefits of a single engine I guess- v3d follows this contract with the same shotgun approach in
v3d_attach_fences_and_unlock_reservation(), but it has at least an XXX comment that maybe this should be improved- v4c uses the same shotgun approach of always setting an exclusive fence, see
vc4_update_bo_seqnos()- vgem also follows this contract, see
vgem_fence_attach_ioctl()and theVGEM_FENCE_WRITE. This is used in some igts to validate prime sharing with i915.ko without the need of a 2nd gpu- vritio follows this contract again with the shotgun approach of always setting an exclusive fence, see
virtio_gpu_array_add_fence()This covers the setting of the exclusive fences when writing.
Synchronizing against the exclusive fence is a lot more tricky, and I only spot checked a few:
- i915 does it, with the optional
EXEC_OBJECT_ASYNCto skip all implicit dependencies (which is used by vulkan)- etnaviv does this. Implicit dependencies are collected in
submit_fence_sync(), again with an opt-out flagETNA_SUBMIT_NO_IMPLICIT. These are then picked up inetnaviv_sched_dependencywhich is thedrm_sched_backend_ops->dependencycallback.- v4c seems to not do much here, maybe gets away with it by not having a scheduler and only a single engine. Since all newer broadcom chips than the OG vc4 use v3d for rendering, which follows this contract, the impact of this issue is fairly small.
- v3d does this using the
drm_gem_fence_array_add_implicit()helper, which then it'sdrm_sched_backend_ops->dependencycallbackv3d_job_dependency()picks up.- panfrost is nice here and tracks the implicit fences in
panfrost_job->implicit_fences, which again thedrm_sched_backend_ops->dependencycallbackpanfrost_job_dependency()picks up. It is mildly questionable though since it only picks up exclusive fences inpanfrost_acquire_object_fences(), but not buggy in practice because it also always sets the exclusive fence. It should pick up both sets of fences, just in case there's ever going to be a 2nd gpu in a SoC with a mali gpu. Or maybe a mali SoC with a pcie port and a real gpu, which might actually happen eventually. A bug, but easy to fix. Should probably use thedrm_gem_fence_array_add_implicit()helper.- lima is nice an easy, uses
drm_gem_fence_array_add_implicit()and the same schema as v3d.- msm is mildly entertaining. It also supports
MSM_SUBMIT_NO_IMPLICIT, but because it doesn't use the drm/scheduler it handles fences from the wrong context with a synchronousdma_fence_wait. Seesubmit_fence_sync()leading tomsm_gem_sync_object(). Investing into a scheduler might be a good idea.- all the remaining drivers are ttm based, where I hope they do appropriately obey implicit fences already. I didn't do the full audit there because a) not follow the contract would confuse ttm quite well and b) reading non-standard scheduler and submit code which isn't based on drm/scheduler is a pain.
Onwards to the display side.
- Any driver using the
drm_gem_plane_helper_prepare_fb()helper will correctly. Overwhelmingly most drivers get this right, except a few totally dont. I'll follow up with a patch to make this the default and avoid a bunch of bugs.- I didn't audit the ttm drivers, but given that
dma_resvstarted there I hope they get this right.In conclusion this IS the contract, both as documented and overwhelmingly implemented, specically as implemented by all render drivers except amdgpu.
Amdgpu tried to fix this already in
commit
049aca4363d8af87cab8d53de5401602db3b9999Author: Christian König <[email protected]> Date: Wed Sep 19 16:54:35 2018 +0200drm/amdgpu: fix using shared fence for exported BOs v2
but this fix falls short on a number of areas:
- It's racy, by the time the buffer is shared it might be too late. To make sure there's definitely never a problem we need to set the fences correctly for any buffer that's potentially exportable.
- It's breaking uapi, dma-buf fds support
poll()and differentitiate between, which was introduced incommit 9b495a5887994a6d74d5c261d012083a92b94738 Author: Maarten Lankhorst <[email protected]> Date: Tue Jul 1 12:57:43 2014 +0200 dma-buf: add poll support, v3- Christian König wants to nack new uapi building further on this
dma_resvcontract because it breaks amdgpu, quoting"Yeah, and that is exactly the reason why I will NAK this uAPI change.
"This doesn't works for amdgpu at all for the reasons outlined above."
Rejecting new development because your own driver is broken and violates established cross driver contracts and uapi is really not how upstream works.
Now this patch will have a severe performance impact on anything that runs on multiple engines. So we can't just merge it outright, but need a bit a plan:
- amdgpu needs a proper uapi for handling implicit fencing. The funny thing is that to do it correctly, implicit fencing must be treated as a very strange IPC mechanism for transporting fences, where both setting the fence and dependency intercepts must be handled explicitly. Current best practices is a per-bo flag to indicate writes, and a per-bo flag to to skip implicit fencing in the CS ioctl as a new chunk.
- Since amdgpu has been shipping with broken behaviour we need an opt-out flag from the butchered implicit fencing model to enable the proper explicit implicit fencing model.
- for kernel memory fences due to bo moves at least the i915 idea is to use
ttm_bo->moving. amdgpu probably needs the same.- since the current p2p dma-buf interface assumes the kernel memory fence is in the exclusive
dma_resvfence slot we need to add a new fence slot for kernel fences, which must never be ignored. Since currently only amdgpu supports this there's no real problem here yet, until amdgpu gains aNO_IMPLICITCS flag.- New userspace needs to ship in enough desktop distros so that users wont notice the perf impact. I think we can ignore LTS distros who upgrade their kernels but not their mesa3d snapshot.
- Then when this is all in place we can merge this patch here.
What is not a solution to this problem here is trying to make the
dma_resvrules in the kernel more clever. The fundamental issue here is that the amdgpu CS uapi is the least expressive one across all drivers (only equalled by panfrost, which has an actual excuse) by not allowing any userspace control over how implicit sync is conducted.Until this is fixed it's completely pointless to make the kernel more clever to improve amdgpu, because all we're doing is papering over this uapi design issue. amdgpu needs to attain the status quo established by other drivers first, once that's achieved we can tackle the remaining issues in a consistent way across drivers.
Cc Bas Nieuwenhuizen <[email protected]>Cc Dave Airlie <[email protected]>Cc Rob Clark <[email protected]>Cc Kristian H. Kristensen <[email protected]>Cc Michel Dänzer <[email protected]>Cc Daniel Stone <[email protected]>Cc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>
Quoted 8 lines
Cc Daniel Vetter <[email protected]>Cc Deepak R Varma <[email protected]>Cc Chen Li <[email protected]>Cc Kevin Wang <[email protected]>Cc Dennis Li <[email protected]>Cc Luben Tuikov <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
And as explained before this is a general NAK.
I'm not discussing this further until we have fixed the dma_resv rules for implicit synchronization since this will just result in every command submission serializing all accesses to BOs which is certainly not what we want.
Regards,
Christian.
Quoted 19 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2@@ -617,8 +617,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,amdgpu_bo_list_for_each_entry (e, p->bo_list) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (e->tv.bo); -/* Make sure we use the exclusive slot for shared BOs */ -if (bo->prime_shared_count) +/* Make sure we use the exclusive slot for all potentially shared BOs */ +if (!(bo->flags &AMDGPU_GEM_CREATE_VM_ALWAYS_VALID )) e->tv.num_shared =0 ; e->bo_va =amdgpu_vm_bo_find (vm, bo); }
Re: [PATCH 06/11] drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterAm Freitag, 21. Mai 2021, 11:09:54 CEST schrieb Daniel Vetter:
Quoted 39 lines
No need to set it explicitly.
Signed-off-by Daniel Vetter <[email protected]>Cc Laurentiu Palcu <[email protected]>Cc Lucas Stach <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Pengutronix Kernel Team <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP Linux Team <[email protected]>Cc Philipp Zabel <[email protected]>Cc Paul Cercueil <[email protected]>Cc Chun-Kuang Hu <[email protected]>Cc Matthias Brugger <[email protected]>Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Cc Jerome Brunet <[email protected]>Cc Martin Blumenstingl <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Agner <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Cc Jyri Sarha <[email protected]>Cc Tomi Valkeinen <[email protected]>
Quoted 10 lines
--- drivers/gpu/drm/imx/dcss/dcss-plane.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 - drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 -
For Rockchip
Re: [PATCH 06/11] drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterHi Daniel,
Quoted 39 lines · Daniel Vetter
No need to set it explicitly.
Signed-off-by Daniel Vetter <[email protected]>Cc Laurentiu Palcu <[email protected]>Cc Lucas Stach <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Pengutronix Kernel Team <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP Linux Team <[email protected]>Cc Philipp Zabel <[email protected]>Cc Paul Cercueil <[email protected]>Cc Chun-Kuang Hu <[email protected]>Cc Matthias Brugger <[email protected]>Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Cc Jerome Brunet <[email protected]>Cc Martin Blumenstingl <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Agner <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Cc Jyri Sarha <[email protected]>Cc Tomi Valkeinen <[email protected]>
Quoted 5 lines
--- drivers/gpu/drm/imx/dcss/dcss-plane.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 -
For drivers/gpu/drm/ingenic/*:
Cheers,
-Paul
Quoted 213 lines
drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 - drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 - drivers/gpu/drm/stm/ltdc.c | 1 - drivers/gpu/drm/sun4i/sun4i_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 1 - drivers/gpu/drm/tidss/tidss_plane.c | 1 - 14 files changed, 15 deletions(-)drivers/gpu/drm/imx/dcss/dcss-plane.c +0
-1@@ -361,7 +361,6 @@ static void dcss_plane_atomic_disable(struct drm_plane *plane, }static const struct drm_plane_helper_funcs dcss_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = dcss_plane_atomic_check,drivers/gpu/drm/imx/dcss/dcss-plane.c +0
-0.atomic_update = dcss_plane_atomic_update, .atomic_disable = dcss_plane_atomic_disable,drivers/gpu/drm/imx/ipuv3-plane.c +0
-1@@ -772,7 +772,6 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = ipu_plane_atomic_check, .atomic_disable = ipu_plane_atomic_disable,drivers/gpu/drm/imx/ipuv3-plane.c +0
-0.atomic_update = ipu_plane_atomic_update,drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0
-1@@ -786,7 +786,6 @@ static const struct drm_plane_helper_funcs ingenic_drm_plane_helper_funcs = { .atomic_update = ingenic_drm_plane_atomic_update, .atomic_check = ingenic_drm_plane_atomic_check, .atomic_disable = ingenic_drm_plane_atomic_disable, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static const struct
drm_crtc_helper_funcsingenic_drm_crtc_helper_funcs= {drivers/gpu/drm/ingenic/ingenic-ipu.c +0
-1@@ -615,7 +615,6 @@ static const struct drm_plane_helper_funcs ingenic_ipu_plane_helper_funcs = { .atomic_update = ingenic_ipu_plane_atomic_update, .atomic_check = ingenic_ipu_plane_atomic_check, .atomic_disable = ingenic_ipu_plane_atomic_disable, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static int
drivers/gpu/drm/mediatek/mtk_drm_plane.c +0
-1@@ -227,7 +227,6 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mtk_plane_atomic_check, .atomic_update = mtk_plane_atomic_update,drivers/gpu/drm/mediatek/mtk_drm_plane.c +0
-0.atomic_disable = mtk_plane_atomic_disable,drivers/gpu/drm/meson/meson_overlay.c +0
-1@@ -747,7 +747,6 @@ static const struct drm_plane_helper_funcs meson_overlay_helper_funcs = { .atomic_check = meson_overlay_atomic_check, .atomic_disable = meson_overlay_atomic_disable, .atomic_update = meson_overlay_atomic_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static bool meson_overlay_format_mod_supported(struct
drm_plane
*plane,drivers/gpu/drm/meson/meson_plane.c +0
-1@@ -422,7 +422,6 @@ static const struct drm_plane_helper_funcs meson_plane_helper_funcs = { .atomic_check = meson_plane_atomic_check, .atomic_disable = meson_plane_atomic_disable, .atomic_update = meson_plane_atomic_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static bool meson_plane_format_mod_supported(struct
drm_plane*plane,drivers/gpu/drm/mxsfb/mxsfb_kms.c +0
-2@@ -500,13 +500,11 @@ static bool mxsfb_format_mod_supported(struct drm_plane *plane, }static const struct drm_plane_helper_funcs mxsfb_plane_primary_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_primary_atomic_update, };static const struct drm_plane_helper_funcs mxsfb_plane_overlay_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb,drivers/gpu/drm/mxsfb/mxsfb_kms.c +0
-0.atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_overlay_atomic_update, };drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0
-1@@ -1109,7 +1109,6 @@ static const struct drm_plane_helper_funcs plane_helper_funcs = { .atomic_disable = vop_plane_atomic_disable, .atomic_async_check = vop_plane_atomic_async_check, .atomic_async_update = vop_plane_atomic_async_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static const struct
drm_plane_funcsvop_plane_funcs= {drivers/gpu/drm/stm/ltdc.c +0
-1@@ -946,7 +946,6 @@ static const struct drm_plane_funcs ltdc_plane_funcs = { };static const struct drm_plane_helper_funcs ltdc_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = ltdc_plane_atomic_check,drivers/gpu/drm/stm/ltdc.c +0
-0.atomic_update = ltdc_plane_atomic_update, .atomic_disable = ltdc_plane_atomic_disable,drivers/gpu/drm/sun4i/sun4i_layer.c +0
-1@@ -127,7 +127,6 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_disable = sun4i_backend_layer_atomic_disable,drivers/gpu/drm/sun4i/sun4i_layer.c +0
-0.atomic_update = sun4i_backend_layer_atomic_update, };drivers/gpu/drm/sun4i/sun8i_ui_layer.c +0
-1@@ -332,7 +332,6 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = sun8i_ui_layer_atomic_check,drivers/gpu/drm/sun4i/sun8i_ui_layer.c +0
-0.atomic_disable = sun8i_ui_layer_atomic_disable, .atomic_update = sun8i_ui_layer_atomic_update,drivers/gpu/drm/sun4i/sun8i_vi_layer.c +0
-1@@ -436,7 +436,6 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = sun8i_vi_layer_atomic_check,drivers/gpu/drm/sun4i/sun8i_vi_layer.c +0
-0.atomic_disable = sun8i_vi_layer_atomic_disable, .atomic_update = sun8i_vi_layer_atomic_update,drivers/gpu/drm/tidss/tidss_plane.c +0
-1@@ -158,7 +158,6 @@ static void drm_plane_destroy(struct drm_plane *plane) }static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = tidss_plane_atomic_check,drivers/gpu/drm/tidss/tidss_plane.c +0
-1.atomic_update = tidss_plane_atomic_update, .atomic_disable = tidss_plane_atomic_disable, --2.31.0
Re: [PATCH 04/11] drm/panfrost: Fix implicit sync
In reply to Daniel VetterHi,
Quoted 11 lines · Daniel Vetter
Currently this has no practial relevance I think because there's not many who can pull off a setup with panfrost and another gpu in the same system. But the rules are that if you're setting an exclusive fence, indicating a gpu write access in the implicit fencing system, then you need to wait for all fences, not just the previous exclusive fence.
panfrost against itself has no problem, because it always sets the exclusive fence (but that's probably something that will need to be fixed for vulkan and/or multi-engine gpus, or you'll suffer badly). Also no problem with that against display.
Yeah, the 'second-generation Valhall' GPUs coming later this year / early next year are starting to get pretty weird. Firmware-mediated job scheduling out of multiple queues, userspace having direct access to the queues and can do inter-queue synchronisation (at least I think so), etc. For bonus points, synchronisation is based on $addr = $val to signal and $addr == $val to wait, with a separate fence primitive as well.
Obviously Arm should be part of this conversation here, but I guess we'll have to wait for a while yet to see how everything's shaken out with this new gen, and hope that whatever's been designed upstream in the meantime is actually vaguely compatible ...
Cheers,
Daniel
Christian König
maintainerRe: [Linaro-mm-sig] [PATCH 04/11] drm/panfrost: Fix implicit sync
Am 21.05.21 um 14:22 schrieb Daniel Stone:
Quoted 14 lines
Hi,
Quoted 11 lines · Daniel Vetter
Currently this has no practial relevance I think because there's not many who can pull off a setup with panfrost and another gpu in the same system. But the rules are that if you're setting an exclusive fence, indicating a gpu write access in the implicit fencing system, then you need to wait for all fences, not just the previous exclusive fence.
panfrost against itself has no problem, because it always sets the exclusive fence (but that's probably something that will need to be fixed for vulkan and/or multi-engine gpus, or you'll suffer badly). Also no problem with that against display.
Quoted 7 lines
Yeah, the 'second-generation Valhall' GPUs coming later this year / early next year are starting to get pretty weird. Firmware-mediated job scheduling out of multiple queues, userspace having direct access to the queues and can do inter-queue synchronisation (at least I think so), etc. For bonus points, synchronisation is based on $addr = $val to signal and $addr == $val to wait, with a separate fence primitive as well.
Well that sounds familiar :)
Quoted 4 lines
Obviously Arm should be part of this conversation here, but I guess we'll have to wait for a while yet to see how everything's shaken out with this new gen, and hope that whatever's been designed upstream in the meantime is actually vaguely compatible ...
Yeah, going to keep you in CC when we start to code and review user fences.
Cheers,
Christian.
Quoted 7 lines
Cheers,
Daniel
_______________________________________________
Linaro-mm-sig mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/linaro-mm-sig
Re: [Linaro-mm-sig] [PATCH 04/11] drm/panfrost: Fix implicit sync
Quoted 10 lines · Christian König
Am 21.05.21 um 14:22 schrieb Daniel Stone:
Quoted 7 lines
Yeah, the 'second-generation Valhall' GPUs coming later this year / early next year are starting to get pretty weird. Firmware-mediated job scheduling out of multiple queues, userspace having direct access to the queues and can do inter-queue synchronisation (at least I think so), etc. For bonus points, synchronisation is based on $addr = $val to signal and $addr == $val to wait, with a separate fence primitive as well.
Well that sounds familiar :)
I laughed when I first saw it, because it was better than crying I guess.
If you're curious, the interface definitions are in the csf/ directory in the 'Bifrost kernel driver' r30p0 download you can get from the Arm developer site. Unfortunately the exact semantics aren't completely clear.
Quoted 6 lines
Quoted 4 lines
Obviously Arm should be part of this conversation here, but I guess we'll have to wait for a while yet to see how everything's shaken out with this new gen, and hope that whatever's been designed upstream in the meantime is actually vaguely compatible ...
Yeah, going to keep you in CC when we start to code and review user fences.
Awesome, thanks Christian. Appreciate it. :)
Cheers,
Daniel
Christian König
maintainerRe: [Linaro-mm-sig] [PATCH 04/11] drm/panfrost: Fix implicit sync
Am 21.05.21 um 14:54 schrieb Daniel Stone:
Quoted 11 lines · Christian König
Quoted 9 lines
Am 21.05.21 um 14:22 schrieb Daniel Stone:
Quoted 7 lines
Yeah, the 'second-generation Valhall' GPUs coming later this year / early next year are starting to get pretty weird. Firmware-mediated job scheduling out of multiple queues, userspace having direct access to the queues and can do inter-queue synchronisation (at least I think so), etc. For bonus points, synchronisation is based on $addr = $val to signal and $addr == $val to wait, with a separate fence primitive as well.
Well that sounds familiar :)
I laughed when I first saw it, because it was better than crying I guess.
In Germany we say "Ich freue mich drauf wie auf Zahnschmerzen".
Quoted 4 lines
If you're curious, the interface definitions are in the csf/ directory in the 'Bifrost kernel driver' r30p0 download you can get from the Arm developer site. Unfortunately the exact semantics aren't completely clear.
Well it is actually relatively simple. Take a look at the timeline semaphores from Vulkan, everybody is basically implementing the same semantics now.
When you queued up a bunch of commands on your hardware, the first one will write value 1 to a 64bit memory location, the second one will write value 2, the third value 3 and so on. After writing the value the hardware raises and interrupt signal to everybody interested.
In other words pretty standard memory fence behavior.
When you now have a second queue which depends on work of the first one you look at the memory location and do a compare. If you depend on the third submission you just wait for the value to be >3 and are done.
Regards,
Christian.
Quoted 10 lines
Quoted 6 lines
Quoted 5 lines
Obviously Arm should be part of this conversation here, but I guess we'll have to wait for a while yet to see how everything's shaken out with this new gen, and hope that whatever's been designed upstream in the meantime is actually vaguely compatible ...
Yeah, going to keep you in CC when we start to code and review user fences.
Awesome, thanks Christian. Appreciate it. :)
Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Linaro-mm-sig] [PATCH 04/11] drm/panfrost: Fix implicit sync
Quoted 15 lines · Christian König
Am 21.05.21 um 14:54 schrieb Daniel Stone:
Quoted 4 lines
If you're curious, the interface definitions are in the csf/ directory in the 'Bifrost kernel driver' r30p0 download you can get from the Arm developer site. Unfortunately the exact semantics aren't completely clear.
Well it is actually relatively simple. Take a look at the timeline semaphores from Vulkan, everybody is basically implementing the same semantics now.
When you queued up a bunch of commands on your hardware, the first one will write value 1 to a 64bit memory location, the second one will write value 2, the third value 3 and so on. After writing the value the hardware raises and interrupt signal to everybody interested.
Quoted 5 lines
In other words pretty standard memory fence behavior.
When you now have a second queue which depends on work of the first one you look at the memory location and do a compare. If you depend on the third submission you just wait for the value to be >3 and are done.
Right, it is clearly defined to the timeline semaphore semantics, I just meant that it's not clear how it works at a lower level wrt the synchronisation and signaling. The simplest possible interpretation is that wait_addrval blocks infinitely before kick-cmdbuf, but that seems painful with only 32 queues. And the same for fences, which are a binary signal. I guess we'll find out. My tooth hurts.
Cheers,
Daniel
Re: [PATCH 11/11] drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default
In reply to Daniel VetterQuoted 2 lines · Daniel Vetter
Goes through all the drivers and deletes the default hook since it's the default now.
Re: [PATCH 11/11] drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default
In reply to Daniel VetterDen 21.05.2021 11.09, skrev Daniel Vetter:
Quoted 4 lines
Goes through all the drivers and deletes the default hook since it's the default now.
Signed-off-by Daniel Vetter <[email protected]>
Re: [PATCH 11/11] drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default
In reply to Daniel VetterQuoted 4 lines · Daniel Vetter
Goes through all the drivers and deletes the default hook since it's the default now.
Signed-off-by Daniel Vetter<[email protected]>
Quoted 240 lines · Bas Nieuwenhuizen
Quoted 239 lines · Daniel Vetter
Docs for struct
dma_resvare fairly clear:"A reservation object can have attached one exclusive fence (normally associated with write operations) or N shared fences (read operations)."
https://dri.freedesktop.org/docs/drm/driver-api/dma-buf.html#reservation-objects
Furthermore a review across all of upstream.
First of render drivers and how they set implicit fences:
- nouveau follows this contract, see in
validate_fini_no_ticket()nouveau_bo_fence(nvbo, fence, !!b->write_domains);and that last boolean controls whether the exclusive or shared fence slot is used.
- radeon follows this contract by setting
p->relocs[i].tv.num_shared = !r->write_domain;in
radeon_cs_parser_relocs(), which ensures that the call tottm_eu_fence_buffer_objects()inradeon_cs_parser_fini()will do the right thing.- vmwgfx seems to follow this contract with the shotgun approach of always setting
ttm_val_buf->num_shared= 0, which meansttm_eu_fence_buffer_objects()will only use the exclusive slot.- etnaviv follows this contract, as can be trivially seen by looking at
submit_attach_object_fences()- i915 is a bit a convoluted maze with multiple paths leading to
i915_vma_move_to_active(). Which sets the exclusive flag ifEXEC_OBJECT_WRITEis set. This can either come as a buffer flag for softpin mode, or through thewrite_domainwhen using relocations. It follows this contract.- lima follows this contract, see
lima_gem_submit()which sets the exclusive fence when theLIMA_SUBMIT_BO_WRITEflag is set for that bo- msm follows this contract, see
msm_gpu_submit()which sets the exclusive flag when theMSM_SUBMIT_BO_WRITEis set for that buffer- panfrost follows this contract with the shotgun approach of just always setting the exclusive fence, see
panfrost_attach_object_fences(). Benefits of a single engine I guess- v3d follows this contract with the same shotgun approach in
v3d_attach_fences_and_unlock_reservation(), but it has at least an XXX comment that maybe this should be improved- v4c uses the same shotgun approach of always setting an exclusive fence, see
vc4_update_bo_seqnos()- vgem also follows this contract, see
vgem_fence_attach_ioctl()and theVGEM_FENCE_WRITE. This is used in some igts to validate prime sharing with i915.ko without the need of a 2nd gpu- vritio follows this contract again with the shotgun approach of always setting an exclusive fence, see
virtio_gpu_array_add_fence()This covers the setting of the exclusive fences when writing.
Synchronizing against the exclusive fence is a lot more tricky, and I only spot checked a few:
- i915 does it, with the optional
EXEC_OBJECT_ASYNCto skip all implicit dependencies (which is used by vulkan)- etnaviv does this. Implicit dependencies are collected in
submit_fence_sync(), again with an opt-out flagETNA_SUBMIT_NO_IMPLICIT. These are then picked up inetnaviv_sched_dependencywhich is thedrm_sched_backend_ops->dependencycallback.- v4c seems to not do much here, maybe gets away with it by not having a scheduler and only a single engine. Since all newer broadcom chips than the OG vc4 use v3d for rendering, which follows this contract, the impact of this issue is fairly small.
- v3d does this using the
drm_gem_fence_array_add_implicit()helper, which then it'sdrm_sched_backend_ops->dependencycallbackv3d_job_dependency()picks up.- panfrost is nice here and tracks the implicit fences in
panfrost_job->implicit_fences, which again thedrm_sched_backend_ops->dependencycallbackpanfrost_job_dependency()picks up. It is mildly questionable though since it only picks up exclusive fences inpanfrost_acquire_object_fences(), but not buggy in practice because it also always sets the exclusive fence. It should pick up both sets of fences, just in case there's ever going to be a 2nd gpu in a SoC with a mali gpu. Or maybe a mali SoC with a pcie port and a real gpu, which might actually happen eventually. A bug, but easy to fix. Should probably use thedrm_gem_fence_array_add_implicit()helper.- lima is nice an easy, uses
drm_gem_fence_array_add_implicit()and the same schema as v3d.- msm is mildly entertaining. It also supports
MSM_SUBMIT_NO_IMPLICIT, but because it doesn't use the drm/scheduler it handles fences from the wrong context with a synchronousdma_fence_wait. Seesubmit_fence_sync()leading tomsm_gem_sync_object(). Investing into a scheduler might be a good idea.- all the remaining drivers are ttm based, where I hope they do appropriately obey implicit fences already. I didn't do the full audit there because a) not follow the contract would confuse ttm quite well and b) reading non-standard scheduler and submit code which isn't based on drm/scheduler is a pain.
Onwards to the display side.
- Any driver using the
drm_gem_plane_helper_prepare_fb()helper will correctly. Overwhelmingly most drivers get this right, except a few totally dont. I'll follow up with a patch to make this the default and avoid a bunch of bugs.- I didn't audit the ttm drivers, but given that
dma_resvstarted there I hope they get this right.In conclusion this IS the contract, both as documented and overwhelmingly implemented, specically as implemented by all render drivers except amdgpu.
Amdgpu tried to fix this already in
commit
049aca4363d8af87cab8d53de5401602db3b9999Author: Christian König <[email protected]> Date: Wed Sep 19 16:54:35 2018 +0200drm/amdgpu: fix using shared fence for exported BOs v2
but this fix falls short on a number of areas:
- It's racy, by the time the buffer is shared it might be too late. To make sure there's definitely never a problem we need to set the fences correctly for any buffer that's potentially exportable.
- It's breaking uapi, dma-buf fds support
poll()and differentitiate between, which was introduced incommit
9b495a5887994a6d74d5c261d012083a92b94738
Author: Maarten Lankhorst <[email protected]>
Date: Tue Jul 1 12:57:43 2014 +0200dma-buf: add poll support, v3
- Christian König wants to nack new uapi building further on this
dma_resvcontract because it breaks amdgpu, quoting"Yeah, and that is exactly the reason why I will NAK this uAPI change.
"This doesn't works for amdgpu at all for the reasons outlined above."
https://lore.kernel.org/dri-devel/[email protected]/
Rejecting new development because your own driver is broken and violates established cross driver contracts and uapi is really not how upstream works.
Now this patch will have a severe performance impact on anything that runs on multiple engines. So we can't just merge it outright, but need a bit a plan:
- amdgpu needs a proper uapi for handling implicit fencing. The funny thing is that to do it correctly, implicit fencing must be treated as a very strange IPC mechanism for transporting fences, where both setting the fence and dependency intercepts must be handled explicitly. Current best practices is a per-bo flag to indicate writes, and a per-bo flag to to skip implicit fencing in the CS ioctl as a new chunk.
- Since amdgpu has been shipping with broken behaviour we need an opt-out flag from the butchered implicit fencing model to enable the proper explicit implicit fencing model.
- for kernel memory fences due to bo moves at least the i915 idea is to use
ttm_bo->moving. amdgpu probably needs the same.- since the current p2p dma-buf interface assumes the kernel memory fence is in the exclusive
dma_resvfence slot we need to add a new fence slot for kernel fences, which must never be ignored. Since currently only amdgpu supports this there's no real problem here yet, until amdgpu gains aNO_IMPLICITCS flag.- New userspace needs to ship in enough desktop distros so that users wont notice the perf impact. I think we can ignore LTS distros who upgrade their kernels but not their mesa3d snapshot.
- Then when this is all in place we can merge this patch here.
What is not a solution to this problem here is trying to make the
dma_resvrules in the kernel more clever. The fundamental issue here is that the amdgpu CS uapi is the least expressive one across all drivers (only equalled by panfrost, which has an actual excuse) by not allowing any userspace control over how implicit sync is conducted.Until this is fixed it's completely pointless to make the kernel more clever to improve amdgpu, because all we're doing is papering over this uapi design issue. amdgpu needs to attain the status quo established by other drivers first, once that's achieved we can tackle the remaining issues in a consistent way across drivers.
Cc Bas Nieuwenhuizen <[email protected]>Cc Dave Airlie <[email protected]>Cc Rob Clark <[email protected]>Cc Kristian H. Kristensen <[email protected]>Cc Michel Dänzer <[email protected]>Cc Daniel Stone <[email protected]>Cc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc Daniel Vetter <[email protected]>Cc Deepak R Varma <[email protected]>Cc Chen Li <[email protected]>Cc Kevin Wang <[email protected]>Cc Dennis Li <[email protected]>Cc Luben Tuikov <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0@@ -617,8 +617,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,amdgpu_bo_list_for_each_entry (e, p->bo_list) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (e->tv.bo);
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · line 622
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2-/* Make sure we use the exclusive slot for shared BOs */ -if (bo->prime_shared_count) +/* Make sure we use the exclusive slot for all potentially shared BOs */ +if (!(bo->flags &AMDGPU_GEM_CREATE_VM_ALWAYS_VALID )) e->tv.num_shared =0 ;I think it also makes sense to skip this with
AMDGPU_GEM_CREATE_EXPLICIT_SYNC? It can be shared but I don't think anyone expects implicit sync to happen with those.
Ah yes, I missed this entirely. So the "no implicit flag" is already there, and the _only_ thing that's missing really is a way to fish out the implicit fences, and set them.
https://lore.kernel.org/dri-devel/[email protected]/
So I think all that's really needed in radv is not setting RADEON_FLAG_IMPLICIT_SYNC for winsys buffers when Jason's dma-buf ioctl are present (means you need to do some import/export and keep the fd around for winsys buffers, but shouldn't be too bad), and then control the implicit fences entirely explicitly like vk expects.
Are you bored enough to type this up for radv? I'll give Jason's kernel stuff another review meanwhile.
-Daniel
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-1e->bo_va =amdgpu_vm_bo_find (vm, bo); } --2.31.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/11] drm/panfrost: Remove sched_lock
In reply to Lucas StachQuoted 6 lines · Lucas Stach
Am Freitag, dem 21.05.2021 um 11:09 +0200 schrieb Daniel Vetter:
Quoted 4 lines
Scheduler takes care of its own locking, dont worry. For everything else there's reservation locking on each bo.
So seems to be entirely redundnant and just a bit in the way.
Quoted 7 lines
I haven't read all the surrounding code, but this looks wrong from a glance. You must hold a lock across
drm_sched_job_init->drm_sched_entity_push_jobas the scheduler fences are initialized in the job init, so if there's no exclusive section across those two function calls you might end up with jobs being queued with their fence seqnos not monotonically increasing, which breaks all kinds of other stuff.
Uh indeed. That's a bit a loaded gun since generally _init() shouldn't have any such side effects.
Quoted 2 lines
I don't see a reason to hold the lock across the reservation calls, though.
Ok I'll adjust the patch.
-Daniel
Quoted 85 lines
Regards,
LucasQuoted 79 lines
Signed-off-by Daniel Vetter <[email protected]>Cc Rob Herring <[email protected]>Cc Tomeu Vizoso <[email protected]>Cc Steven Price <[email protected]>Cc Alyssa Rosenzweig <[email protected]>--- drivers/gpu/drm/panfrost/panfrost_device.c | 1 - drivers/gpu/drm/panfrost/panfrost_device.h | 2 -- drivers/gpu/drm/panfrost/panfrost_job.c | 13 ++----------- 3 files changed, 2 insertions(+), 14 deletions(-)drivers/gpu/drm/panfrost/panfrost_device.c +0
-1@@ -199,7 +199,6 @@ int panfrost_device_init(struct panfrost_device *pfdev)int err;struct resource *res; -mutex_init (&pfdev->sched_lock);INIT_LIST_HEAD (&pfdev->scheduled_jobs);INIT_LIST_HEAD (&pfdev->as_lru_list);drivers/gpu/drm/panfrost/panfrost_device.h +0
-2@@ -105,8 +105,6 @@ struct panfrost_device {struct panfrost_perfcnt *perfcnt; -struct mutex sched_lock; -struct {struct work_struct work;atomic_t pending;drivers/gpu/drm/panfrost/panfrost_job.c +2
-11@@ -218,26 +218,19 @@ static void panfrost_attach_object_fences(struct drm_gem_object **bos,int panfrost_job_push (struct panfrost_job *job) { -struct panfrost_device *pfdev = job->pfdev;int slot =panfrost_job_get_slot (job);struct drm_sched_entity *entity = &job->file_priv->sched_entity[slot];struct ww_acquire_ctx acquire_ctx;int ret =0 ; -mutex_lock (&pfdev->sched_lock); - ret =drm_gem_lock_reservations (job->bos, job->bo_count, &acquire_ctx); -if (ret) { -mutex_unlock (&pfdev->sched_lock); +if (ret)return ret; - } ret =drm_sched_job_init (&job->base, entity,NULL ); -if (ret) { -mutex_unlock (&pfdev->sched_lock); +if (ret) goto unlock; - } job->render_done_fence =dma_fence_get (&job->base.s_fence->finished);@@ -248,8 +241,6 @@ int panfrost_job_push(struct panfrost_job *job)drm_sched_entity_push_job (&job->base, entity); -mutex_unlock (&pfdev->sched_lock); -panfrost_attach_object_fences (job->bos, job->bo_count, job->render_done_fence);
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Daniel Vetter
- msm is mildly entertaining. It also supports
MSM_SUBMIT_NO_IMPLICIT, but because it doesn't use the drm/scheduler it handles fences from the wrong context with a synchronousdma_fence_wait. Seesubmit_fence_sync()leading tomsm_gem_sync_object(). Investing into a scheduler might be a good idea.
Yeah, drm/scheduler is (along with a lot of other things) on the TODO list. But this isn't quite as bad as it sounds because userspace uses a u_queue thread to call the submit ioctl rather than blocking the driver. (It also offloads some other work from the driver thread, like submit merging to reduce # of ioctls. Coincidentally that arrangement was a step towards preparing userspace for some hypothetical non-ioctl uapi ;-))
OTOH it would be good to move blocking until the system can free enough pages to repin bo's out of the ioctl path to better handle some memory pressure corner cases without having to be interruptable over a lot more of the submit path.. Running chrome+android on devices without a lot of memory is fun..
BR,
-R
Quoted 8 lines · Rob Clark
Quoted 6 lines · Daniel Vetter
- msm is mildly entertaining. It also supports
MSM_SUBMIT_NO_IMPLICIT, but because it doesn't use the drm/scheduler it handles fences from the wrong context with a synchronousdma_fence_wait. Seesubmit_fence_sync()leading tomsm_gem_sync_object(). Investing into a scheduler might be a good idea.
Quoted 7 lines
Yeah, drm/scheduler is (along with a lot of other things) on the TODO list. But this isn't quite as bad as it sounds because userspace uses a
u_queuethread to call the submit ioctl rather than blocking the driver. (It also offloads some other work from the driver thread, like submit merging to reduce # of ioctls. Coincidentally that arrangement was a step towards preparing userspace for some hypothetical non-ioctl uapi ;-))
You're also holding a pile of locks, which I expect latest with multi-engine buffer sharing will be pain. If you push this to the scheduler then the locks aren't held. Or maybe I've misread the flow, it's become all a bit a blurr after all these drivers :-)
Quoted 5 lines
OTOH it would be good to move blocking until the system can free enough pages to repin bo's out of the ioctl path to better handle some memory pressure corner cases without having to be interruptable over a lot more of the submit path.. Running chrome+android on devices without a lot of memory is fun..
Uh that one needs the userspace thread. Or entirely different semantics of your ioctl, because you're not allowed to allocate memory once any dma_fence is visible. So offloading the entire pinning to a submit thread is no-go.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 29 lines · Daniel Vetter
Quoted 13 lines · Bas Nieuwenhuizen
Quoted 12 lines · Daniel Vetter
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0@@ -617,8 +617,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,amdgpu_bo_list_for_each_entry (e, p->bo_list) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (e->tv.bo);Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · line 622
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2-/* Make sure we use the exclusive slot for shared BOs */ -if (bo->prime_shared_count) +/* Make sure we use the exclusive slot for all potentially shared BOs */ +if (!(bo->flags &AMDGPU_GEM_CREATE_VM_ALWAYS_VALID )) e->tv.num_shared =0 ;I think it also makes sense to skip this with
AMDGPU_GEM_CREATE_EXPLICIT_SYNC? It can be shared but I don't think anyone expects implicit sync to happen with those.Ah yes, I missed this entirely. So the "no implicit flag" is already there, and the _only_ thing that's missing really is a way to fish out the implicit fences, and set them.
Quoted 7 lines
https://lore.kernel.org/dri-devel/[email protected]/
So I think all that's really needed in radv is not setting
RADEON_FLAG_IMPLICIT_SYNCfor winsys buffers when Jason's dma-buf ioctl are present (means you need to do some import/export and keep the fd around for winsys buffers, but shouldn't be too bad), and then control the implicit fences entirely explicitly like vk expects.
That is the part I'm less sure about. This is a BO wide flag so we are also disabling implicit sync in the compositor. If the compositor does only do read stuff that is ok, as the inserted exclusive fence will work for that. But as I learned recently the app provided buffer may end up being written to by the X server which open a whole can of potential problems if implicit sync gets disabled between Xserver operations on the app provided buffer. Hence setting that on the WSI buffer is a whole new can of potential problems and hence I've said a submission based flag would be preferred.
I can certainly try it out though.
Quoted 11 lines
Are you bored enough to type this up for radv? I'll give Jason's kernel stuff another review meanwhile.
-DanielQuoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-1e->bo_va =amdgpu_vm_bo_find (vm, bo); } --2.31.0
Quoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 48 lines · Bas Nieuwenhuizen
Quoted 29 lines · Daniel Vetter
Quoted 13 lines · Bas Nieuwenhuizen
Quoted 12 lines · Daniel Vetter
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0@@ -617,8 +617,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,amdgpu_bo_list_for_each_entry (e, p->bo_list) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (e->tv.bo);Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · line 622
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2-/* Make sure we use the exclusive slot for shared BOs */ -if (bo->prime_shared_count) +/* Make sure we use the exclusive slot for all potentially shared BOs */ +if (!(bo->flags &AMDGPU_GEM_CREATE_VM_ALWAYS_VALID )) e->tv.num_shared =0 ;I think it also makes sense to skip this with
AMDGPU_GEM_CREATE_EXPLICIT_SYNC? It can be shared but I don't think anyone expects implicit sync to happen with those.Ah yes, I missed this entirely. So the "no implicit flag" is already there, and the _only_ thing that's missing really is a way to fish out the implicit fences, and set them.
Quoted 7 lines
https://lore.kernel.org/dri-devel/[email protected]/
So I think all that's really needed in radv is not setting
RADEON_FLAG_IMPLICIT_SYNCfor winsys buffers when Jason's dma-buf ioctl are present (means you need to do some import/export and keep the fd around for winsys buffers, but shouldn't be too bad), and then control the implicit fences entirely explicitly like vk expects.That is the part I'm less sure about. This is a BO wide flag so we are also disabling implicit sync in the compositor. If the compositor does only do read stuff that is ok, as the inserted exclusive fence will work for that. But as I learned recently the app provided buffer may end up being written to by the X server which open a whole can of potential problems if implicit sync gets disabled between Xserver operations on the app provided buffer. Hence setting that on the WSI buffer is a whole new can of potential problems and hence I've said a submission based flag would be preferred.
Quoted 1 line
I can certainly try it out though.
Hm yeah that's the wrong flag. We need a flag on the drm_file which the explicit userspace sets. And which is valid only for itself.
There's a nice flags field when creating a ctx, but it's not validated and there's already a comment that we have to filter out garbage priority, so that's not use. I'll whip up something entirely untested just as a draft. -Daniel
Quoted 16 lines
Quoted 16 lines
Are you bored enough to type this up for radv? I'll give Jason's kernel stuff another review meanwhile.
-DanielQuoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-1e->bo_va =amdgpu_vm_bo_find (vm, bo); } --2.31.0
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 06/11] drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterDne petek, 21. maj 2021 ob 11:09:54 CEST je Daniel Vetter napisal(a):
Quoted 31 lines
No need to set it explicitly.
Signed-off-by Daniel Vetter <[email protected]>Cc Laurentiu Palcu <[email protected]>Cc Lucas Stach <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Pengutronix Kernel Team <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP Linux Team <[email protected]>Cc Philipp Zabel <[email protected]>Cc Paul Cercueil <[email protected]>Cc Chun-Kuang Hu <[email protected]>Cc Matthias Brugger <[email protected]>Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Cc Jerome Brunet <[email protected]>Cc Martin Blumenstingl <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Agner <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Cc Jyri Sarha <[email protected]>
Quoted 8 lines
Cc Tomi Valkeinen <[email protected]>
For sun4i:
Best regards,
Jernej
Am 21.05.21 um 17:16 schrieb Daniel Vetter:
Quoted 45 lines · Bas Nieuwenhuizen
Quoted 44 lines · Daniel Vetter
Quoted 26 lines · Bas Nieuwenhuizen
Quoted 13 lines · Daniel Vetter
Quoted 12 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0@@ -617,8 +617,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,amdgpu_bo_list_for_each_entry (e, p->bo_list) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (e->tv.bo);Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · line 622
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2-/* Make sure we use the exclusive slot for shared BOs */ -if (bo->prime_shared_count) +/* Make sure we use the exclusive slot for all potentially shared BOs */ +if (!(bo->flags &AMDGPU_GEM_CREATE_VM_ALWAYS_VALID )) e->tv.num_shared =0 ;I think it also makes sense to skip this with
AMDGPU_GEM_CREATE_EXPLICIT_SYNC? It can be shared but I don't think anyone expects implicit sync to happen with those.Ah yes, I missed this entirely. So the "no implicit flag" is already there, and the _only_ thing that's missing really is a way to fish out the implicit fences, and set them.
Quoted 7 lines
https://lore.kernel.org/dri-devel/[email protected]/
So I think all that's really needed in radv is not setting
RADEON_FLAG_IMPLICIT_SYNCfor winsys buffers when Jason's dma-buf ioctl are present (means you need to do some import/export and keep the fd around for winsys buffers, but shouldn't be too bad), and then control the implicit fences entirely explicitly like vk expects.That is the part I'm less sure about. This is a BO wide flag so we are also disabling implicit sync in the compositor. If the compositor does only do read stuff that is ok, as the inserted exclusive fence will work for that. But as I learned recently the app provided buffer may end up being written to by the X server which open a whole can of potential problems if implicit sync gets disabled between Xserver operations on the app provided buffer. Hence setting that on the WSI buffer is a whole new can of potential problems and hence I've said a submission based flag would be preferred.
Quoted 7 lines
Quoted 1 line
I can certainly try it out though.
Hm yeah that's the wrong flag. We need a flag on the
drm_filewhich the explicit userspace sets. And which is valid only for itself.There's a nice flags field when creating a ctx, but it's not validated and there's already a comment that we have to filter out garbage priority, so that's not use. I'll whip up something entirely untested just as a draft.
We could provide an IOCTL for the BO to change the flag.
But could we first figure out the semantics we want to use here?
Cause I'm pretty sure we don't actually need those changes at all and as said before I'm certainly NAKing things which break existing use cases.
Regards,
Christian.
Quoted 17 lines
-Daniel
Quoted 13 lines
Quoted 13 lines
Are you bored enough to type this up for radv? I'll give Jason's kernel stuff another review meanwhile.
-DanielQuoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-1e->bo_va =amdgpu_vm_bo_find (vm, bo); } --2.31.0
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Quoted 48 lines · Christian König
Am 21.05.21 um 17:16 schrieb Daniel Vetter:
Quoted 46 lines · Bas Nieuwenhuizen
Quoted 45 lines · Daniel Vetter
Quoted 26 lines · Bas Nieuwenhuizen
Quoted 13 lines · Daniel Vetter
Quoted 12 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0@@ -617,8 +617,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,amdgpu_bo_list_for_each_entry (e, p->bo_list) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (e->tv.bo);Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · line 622
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2-/* Make sure we use the exclusive slot for shared BOs */ -if (bo->prime_shared_count) +/* Make sure we use the exclusive slot for all potentially shared BOs */ +if (!(bo->flags &AMDGPU_GEM_CREATE_VM_ALWAYS_VALID )) e->tv.num_shared =0 ;I think it also makes sense to skip this with
AMDGPU_GEM_CREATE_EXPLICIT_SYNC? It can be shared but I don't think anyone expects implicit sync to happen with those.Ah yes, I missed this entirely. So the "no implicit flag" is already there, and the _only_ thing that's missing really is a way to fish out the implicit fences, and set them.
Quoted 7 lines
https://lore.kernel.org/dri-devel/[email protected]/
So I think all that's really needed in radv is not setting
RADEON_FLAG_IMPLICIT_SYNCfor winsys buffers when Jason's dma-buf ioctl are present (means you need to do some import/export and keep the fd around for winsys buffers, but shouldn't be too bad), and then control the implicit fences entirely explicitly like vk expects.That is the part I'm less sure about. This is a BO wide flag so we are also disabling implicit sync in the compositor. If the compositor does only do read stuff that is ok, as the inserted exclusive fence will work for that. But as I learned recently the app provided buffer may end up being written to by the X server which open a whole can of potential problems if implicit sync gets disabled between Xserver operations on the app provided buffer. Hence setting that on the WSI buffer is a whole new can of potential problems and hence I've said a submission based flag would be preferred.
I can certainly try it out though.
Quoted 8 lines
Quoted 6 lines
Hm yeah that's the wrong flag. We need a flag on the
drm_filewhich the explicit userspace sets. And which is valid only for itself.There's a nice flags field when creating a ctx, but it's not validated and there's already a comment that we have to filter out garbage priority, so that's not use. I'll whip up something entirely untested just as a draft.
We could provide an IOCTL for the BO to change the flag.
That's not the semantics we need.
Quoted 4 lines
But could we first figure out the semantics we want to use here?
Cause I'm pretty sure we don't actually need those changes at all and as said before I'm certainly NAKing things which break existing use cases.
Please read how other drivers do this and at least _try_ to understand it. I'm really loosing my patience here with you NAKing patches you're not even understanding (or did you actually read and fully understand the entire story I typed up here, and your NAK is on the entire thing?). There's not much useful conversation to be had with that approach. And with drivers I mean kernel + userspace here.
That's the other frustration part: You're trying to fix this purely in the kernel. This is exactly one of these issues why we require open source userspace, so that we can fix the issues correctly across the entire stack. And meanwhile you're steadfastily refusing to even look at that the userspace side of the picture.
Also I thought through your tlb issue, why are you even putting these tlb flush fences into the shard dma_resv slots? If you store them somewhere else in the amdgpu private part, the oversync issues goes away
- in your ttm bo move callback, you can just make your bo copy job depend on them too (you have to anyway)
- even for p2p there's not an issue here, because you have the ->move_notify callback, and can then lift the tlb flush fences from your private place to the shared slots so the exporter can see them.
The kernel move fences otoh are a bit more nasty to wring through the p2p dma-buf interface. That one probably needs something new. -Daniel
Quoted 22 lines
Regards,
Christian.Quoted 17 lines
-Daniel
Quoted 13 lines
Quoted 13 lines
Are you bored enough to type this up for radv? I'll give Jason's kernel stuff another review meanwhile.
-DanielQuoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-1e->bo_va =amdgpu_vm_bo_find (vm, bo); } --2.31.0
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH 06/11] drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterHi, Daniel:
Daniel Vetter <[email protected]> 於 2021年5月21日 週五 下午5:10寫道:
Quoted 32 lines
No need to set it explicitly.
Signed-off-by Daniel Vetter <[email protected]>Cc Laurentiu Palcu <[email protected]>Cc Lucas Stach <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Pengutronix Kernel Team <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP Linux Team <[email protected]>Cc Philipp Zabel <[email protected]>Cc Paul Cercueil <[email protected]>Cc Chun-Kuang Hu <[email protected]>Cc Matthias Brugger <[email protected]>Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Cc Jerome Brunet <[email protected]>Cc Martin Blumenstingl <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Agner <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Cc Jyri Sarha <[email protected]>
Quoted 8 lines
Cc Tomi Valkeinen <[email protected]>
For Mediatek,
Christian König
maintainerAm 21.05.21 um 20:31 schrieb Daniel Vetter:
Quoted 6 lines
[SNIP]
Quoted 1 line
We could provide an IOCTL for the BO to change the flag.
That's not the semantics we need.
Quoted 2 lines
But could we first figure out the semantics we want to use here?
Quoted 8 lines
Quoted 2 lines
Cause I'm pretty sure we don't actually need those changes at all and as said before I'm certainly NAKing things which break existing use cases.
Please read how other drivers do this and at least _try_ to understand it. I'm really loosing my patience here with you NAKing patches you're not even understanding (or did you actually read and fully understand the entire story I typed up here, and your NAK is on the entire thing?). There's not much useful conversation to be had with that approach. And with drivers I mean kernel + userspace here.
Well to be honest I did fully read that, but I was just to emotionally attached to answer more appropriately in that moment.
And I'm sorry that I react emotional on that, but it is really frustrating that I'm not able to convince you that we have a major problem which affects all drivers and not just amdgpu.
Regarding the reason why I'm NAKing this particular patch, you are breaking existing uAPI for RADV with that. And as a maintainer of the driver I have simply no other choice than saying halt, stop we can't do it like this.
I'm perfectly aware that I've some holes in the understanding of how ANV or other Vulkan/OpenGL stacks work. But you should probably also admit that you have some holes how amdgpu works or otherwise I can't imagine why you suggest a patch which simply breaks RADV.
I mean we are working together for years now and I think you know me pretty well, do you really think I scream bloody hell we can't do this without a good reason?
So let's stop throwing halve backed solutions at each other and discuss what we can do to solve the different problems we are both seeing here.
Quoted 5 lines
That's the other frustration part: You're trying to fix this purely in the kernel. This is exactly one of these issues why we require open source userspace, so that we can fix the issues correctly across the entire stack. And meanwhile you're steadfastily refusing to even look at that the userspace side of the picture.
Well I do fully understand the userspace side of the picture for the AMD stack. I just don't think we should give userspace that much control over the fences in the dma_resv object without untangling them from resource management.
And RADV is exercising exclusive sync for amdgpu already. You can do submission to both the GFX, Compute and SDMA queues in Vulkan and those currently won't over-synchronize.
When you then send a texture generated by multiple engines to the Compositor the kernel will correctly inserts waits for all submissions of the other process.
So this already works for RADV and completely without the IOCTL Jason proposed. IIRC we also have unit tests which exercised that feature for the video decoding use case long before RADV even existed.
And yes I have to admit that I haven't thought about interaction with other drivers when I came up with this because the rules of that interaction wasn't clear to me at that time.
Quoted 9 lines
Also I thought through your tlb issue, why are you even putting these tlb flush fences into the shard
dma_resvslots? If you store them somewhere else in the amdgpu private part, the oversync issues goes away
- in your ttm bo move callback, you can just make your bo copy job depend on them too (you have to anyway)
- even for p2p there's not an issue here, because you have the ->move_notify callback, and can then lift the tlb flush fences from your private place to the shared slots so the exporter can see them.
Because adding a shared fence requires that this shared fence signals after the exclusive fence. And this is a perfect example to explain why this is so problematic and also why why we currently stumble over that only in amdgpu.
In TTM we have a feature which allows evictions to be pipelined and don't wait for the evicting DMA operation. Without that driver will stall waiting for their allocations to finish when we need to allocate memory.
For certain use cases this gives you a ~20% fps increase under memory pressure, so it is a really important feature.
This works by adding the fence of the last eviction DMA operation to BOs when their backing store is newly allocated. That's what the ttm_bo_add_move_fence() function you stumbled over is good for: https://elixir.bootlin.com/linux/v5.13-rc2/source/drivers/gpu/drm/ttm/ttm_bo.c#L692
Now the problem is it is possible that the application is terminated before it can complete it's command submission. But since resource management only waits for the shared fences when there are some there is a chance that we free up memory while it is still in use.
Because of this we have some rather crude workarounds in amdgpu. For example IIRC we manual wait for any potential exclusive fence before freeing memory.
We could enable this feature for radeon and nouveau as well with an one line change. But that would mean we need to maintain the workarounds for shortcomings of the dma_resv object design in those drivers as well.
To summarize I think that adding an unbound fence to protect an object is a perfectly valid operation for resource management, but this is restricted by the needs of implicit sync at the moment.
Quoted 2 lines
The kernel move fences otoh are a bit more nasty to wring through the p2p dma-buf interface. That one probably needs something new.
Well the p2p interface are my least concern.
Adding the move fence means that you need to touch every place we do CS or page flip since you now have something which is parallel to the explicit sync fence.
Otherwise having the move fence separately wouldn't make much sense in the first place if we always set it together with the exclusive fence.
Best regards and sorry for getting on your nerves so much, Christian.
Quoted 23 lines
-Daniel
Quoted 20 lines
Regards,
Christian.Quoted 17 lines
-Daniel
Quoted 13 lines
Quoted 13 lines
Are you bored enough to type this up for radv? I'll give Jason's kernel stuff another review meanwhile.
-DanielQuoted 5 lines
Quoted 5 lines
e->bo_va = amdgpu_vm_bo_find(vm, bo); }--
2.31.0--
Daniel Vetter
Software Engineer, Intel Corporation
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.ffwll.ch%2F&data=04%7C01%7Cchristian.koenig%40amd.com%7Cf0852f38c85046ca877908d91c86a719%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637572186953277692%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Vgz%2FkXFH4CD6ktZBnxnXFhHTG5tHhN1%2BDyf7pmxak6c%3D&reserved=0
Patchwork
CI[Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [01/11] drm/amdgpu: Comply with implicit fencing rules
In reply to Daniel Vetter== Series Details ==
== Series Details ==
Series: series starting with [01/11] drm/amdgpu: Comply with implicit fencing rules
URL : https://patchwork.freedesktop.org/series/90401/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_10119_full -> Patchwork_20167_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_20167_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_20167_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_20167_full:
### IGT changes ###
#### Possible regressions ####
* igt@perf@non-zero-reason:
- shard-skl: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-skl3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl2/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_20167_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_create@create-massive:
- shard-kbl: NOTRUN -> [DMESG-WARN][3] ([i915#3002])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@[email protected]
* igt@gem_ctx_isolation@preservation-s3@bcs0:
- shard-kbl: NOTRUN -> [DMESG-WARN][4] ([i915#180])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@gem_ctx_isolation@[email protected]
* igt@gem_ctx_persistence@clone:
- shard-snb: NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#1099]) +4 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-snb5/igt@[email protected]
* igt@gem_exec_fair@basic-deadline:
- shard-kbl: [PASS][6] -> [FAIL][7] ([i915#2846])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl3/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
- shard-skl: NOTRUN -> [FAIL][8] ([i915#2846])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@[email protected]
- shard-apl: NOTRUN -> [FAIL][9] ([i915#2846])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl6/igt@[email protected]
* igt@gem_exec_fair@basic-none-vip@rcs0:
- shard-glk: [PASS][10] -> [FAIL][11] ([i915#2842])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-glk5/igt@gem_exec_fair@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-glk1/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-pace-solo@rcs0:
- shard-kbl: [PASS][12] -> [FAIL][13] ([i915#2842])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl2/igt@gem_exec_fair@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-pace@rcs0:
- shard-kbl: NOTRUN -> [FAIL][14] ([i915#2876])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@gem_exec_fair@[email protected]
- shard-tglb: [PASS][15] -> [FAIL][16] ([i915#2842])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-tglb8/igt@gem_exec_fair@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb3/igt@gem_exec_fair@[email protected]
* igt@gem_mmap_gtt@cpuset-basic-small-copy-xy:
- shard-skl: NOTRUN -> [INCOMPLETE][17] ([i915#198] / [i915#3468])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@[email protected]
* igt@gem_mmap_gtt@fault-concurrent-x:
- shard-snb: NOTRUN -> [INCOMPLETE][18] ([i915#3468] / [i915#3485])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-snb2/igt@[email protected]
- shard-kbl: NOTRUN -> [INCOMPLETE][19] ([i915#3468])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
* igt@gem_mmap_gtt@fault-concurrent-y:
- shard-snb: NOTRUN -> [INCOMPLETE][20] ([i915#3468]) +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-snb6/igt@[email protected]
- shard-skl: NOTRUN -> [INCOMPLETE][21] ([i915#3468])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl2/igt@[email protected]
- shard-apl: NOTRUN -> [INCOMPLETE][22] ([i915#3468]) +2 similar issues
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl8/igt@[email protected]
* igt@gem_pwrite@basic-exhaustion:
- shard-skl: NOTRUN -> [WARN][23] ([i915#2658])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@[email protected]
- shard-apl: NOTRUN -> [WARN][24] ([i915#2658])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl6/igt@[email protected]
* igt@gem_userptr_blits@dmabuf-sync:
- shard-skl: NOTRUN -> [SKIP][25] ([fdo#109271] / [i915#3323])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl7/igt@[email protected]
* igt@gem_userptr_blits@set-cache-level:
- shard-apl: NOTRUN -> [FAIL][26] ([i915#3324])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl1/igt@[email protected]
* igt@gem_userptr_blits@vma-merge:
- shard-snb: NOTRUN -> [FAIL][27] ([i915#2724])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-snb5/igt@[email protected]
- shard-apl: NOTRUN -> [FAIL][28] ([i915#3318])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl7/igt@[email protected]
* igt@gen7_exec_parse@basic-offset:
- shard-apl: NOTRUN -> [SKIP][29] ([fdo#109271]) +229 similar issues
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl7/igt@[email protected]
* igt@gen9_exec_parse@batch-zero-length:
- shard-tglb: NOTRUN -> [SKIP][30] ([fdo#112306])
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@i915_module_load@reload-with-fault-injection:
- shard-skl: NOTRUN -> [DMESG-WARN][31] ([i915#1982])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl2/igt@[email protected]
* igt@i915_pm_dc@dc6-dpms:
- shard-skl: NOTRUN -> [FAIL][32] ([i915#454])
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl4/igt@[email protected]
* igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
- shard-apl: NOTRUN -> [SKIP][33] ([fdo#109271] / [i915#1937])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl6/igt@i915_pm_lpsp@[email protected]
* igt@i915_pm_rpm@modeset-pc8-residency-stress:
- shard-tglb: NOTRUN -> [SKIP][34] ([fdo#109506] / [i915#2411])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@i915_selftest@live@execlists:
- shard-kbl: NOTRUN -> [INCOMPLETE][35] ([i915#2782] / [i915#3462] / [i915#794])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@hangcheck:
- shard-snb: NOTRUN -> [INCOMPLETE][36] ([i915#2782])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-snb5/igt@i915_selftest@[email protected]
* igt@kms_ccs@pipe-c-bad-rotation-90:
- shard-skl: NOTRUN -> [SKIP][37] ([fdo#109271] / [fdo#111304]) +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@[email protected]
* igt@kms_chamelium@dp-audio-edid:
- shard-skl: NOTRUN -> [SKIP][38] ([fdo#109271] / [fdo#111827]) +13 similar issues
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl2/igt@[email protected]
* igt@kms_chamelium@dp-hpd-fast:
- shard-tglb: NOTRUN -> [SKIP][39] ([fdo#109284] / [fdo#111827]) +1 similar issue
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- shard-snb: NOTRUN -> [SKIP][40] ([fdo#109271] / [fdo#111827]) +21 similar issues
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-snb6/igt@[email protected]
* igt@kms_color_chamelium@pipe-a-ctm-limited-range:
- shard-apl: NOTRUN -> [SKIP][41] ([fdo#109271] / [fdo#111827]) +23 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl7/igt@[email protected]
* igt@kms_color_chamelium@pipe-c-ctm-limited-range:
- shard-kbl: NOTRUN -> [SKIP][42] ([fdo#109271] / [fdo#111827]) +2 similar issues
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@[email protected]
* igt@kms_content_protection@atomic:
- shard-kbl: NOTRUN -> [TIMEOUT][43] ([i915#1319])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@[email protected]
* igt@kms_content_protection@atomic-dpms:
- shard-apl: NOTRUN -> [TIMEOUT][44] ([i915#1319]) +1 similar issue
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl7/igt@[email protected]
* igt@kms_cursor_crc@pipe-a-cursor-512x512-offscreen:
- shard-tglb: NOTRUN -> [SKIP][45] ([fdo#109279] / [i915#3359])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@kms_cursor_crc@pipe-b-cursor-max-size-onscreen:
- shard-tglb: NOTRUN -> [SKIP][46] ([i915#3359])
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-32x32-offscreen:
- shard-tglb: NOTRUN -> [SKIP][47] ([i915#3319])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-atomic:
- shard-glk: [PASS][48] -> [FAIL][49] ([i915#2346])
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-glk5/igt@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-glk5/igt@[email protected]
* igt@kms_dp_dsc@basic-dsc-enable-dp:
- shard-tglb: NOTRUN -> [SKIP][50] ([fdo#109349])
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@kms_fbcon_fbt@fbc-suspend:
- shard-kbl: [PASS][51] -> [INCOMPLETE][52] ([i915#155] / [i915#180] / [i915#636])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl7/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
* igt@kms_flip@2x-plain-flip-fb-recreate-interruptible@ab-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][53] -> [FAIL][54] ([i915#2122])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-glk5/igt@kms_flip@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-glk1/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-edp1:
- shard-skl: NOTRUN -> [FAIL][55] ([i915#79])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-expired-vblank@a-edp1:
- shard-skl: NOTRUN -> [FAIL][56] ([i915#2122])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@kms_flip@[email protected]
* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs:
- shard-skl: NOTRUN -> [SKIP][57] ([fdo#109271] / [i915#2672])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl9/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs.html
* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile:
- shard-apl: NOTRUN -> [SKIP][58] ([fdo#109271] / [i915#2642])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl8/igt@[email protected]
* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytilercccs:
- shard-apl: NOTRUN -> [SKIP][59] ([fdo#109271] / [i915#2672])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl6/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-blt:
- shard-kbl: NOTRUN -> [SKIP][60] ([fdo#109271]) +37 similar issues
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-blt:
- shard-skl: NOTRUN -> [SKIP][61] ([fdo#109271]) +123 similar issues
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-onoff:
- shard-snb: NOTRUN -> [SKIP][62] ([fdo#109271]) +351 similar issues
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-snb2/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-move:
- shard-skl: [PASS][63] -> [FAIL][64] ([i915#2546] / [i915#49])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-skl3/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-pwrite:
- shard-tglb: NOTRUN -> [SKIP][65] ([fdo#111825]) +8 similar issues
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-pwrite.html
* igt@kms_pipe_crc_basic@read-crc-pipe-d:
- shard-kbl: NOTRUN -> [SKIP][66] ([fdo#109271] / [i915#533])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@[email protected]
- shard-apl: NOTRUN -> [SKIP][67] ([fdo#109271] / [i915#533])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl8/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- shard-kbl: [PASS][68] -> [DMESG-WARN][69] ([i915#180]) +1 similar issue
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl2/igt@[email protected]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
- shard-skl: NOTRUN -> [FAIL][70] ([fdo#108145] / [i915#265]) +2 similar issues
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl7/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-alpha-basic:
- shard-apl: NOTRUN -> [FAIL][71] ([fdo#108145] / [i915#265]) +1 similar issue
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-alpha-transparent-fb:
- shard-apl: NOTRUN -> [FAIL][72] ([i915#265])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl8/igt@[email protected]
- shard-skl: NOTRUN -> [FAIL][73] ([i915#265])
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl2/igt@[email protected]
* igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping:
- shard-apl: NOTRUN -> [SKIP][74] ([fdo#109271] / [i915#2733])
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl8/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html
- shard-kbl: NOTRUN -> [SKIP][75] ([fdo#109271] / [i915#2733])
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html
* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2:
- shard-apl: NOTRUN -> [SKIP][76] ([fdo#109271] / [i915#658]) +5 similar issues
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl7/igt@[email protected]
* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4:
- shard-kbl: NOTRUN -> [SKIP][77] ([fdo#109271] / [i915#658])
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@[email protected]
* igt@kms_psr2_sf@plane-move-sf-dmg-area-2:
- shard-skl: NOTRUN -> [SKIP][78] ([fdo#109271] / [i915#658]) +2 similar issues
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl3/igt@[email protected]
* igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1:
- shard-tglb: NOTRUN -> [SKIP][79] ([i915#2920])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@kms_psr@psr2_primary_page_flip:
- shard-tglb: NOTRUN -> [FAIL][80] ([i915#132] / [i915#3467])
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@kms_psr@psr2_primary_page_flip.html
* igt@kms_sysfs_edid_timing:
- shard-apl: NOTRUN -> [FAIL][81] ([IGT#2])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl7/igt@kms_sysfs_edid_timing.html
* igt@kms_writeback@writeback-fb-id:
- shard-apl: NOTRUN -> [SKIP][82] ([fdo#109271] / [i915#2437])
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl7/igt@[email protected]
* igt@nouveau_crc@pipe-c-source-outp-complete:
- shard-tglb: NOTRUN -> [SKIP][83] ([i915#2530])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
* igt@perf@polling-small-buf:
- shard-skl: NOTRUN -> [FAIL][84] ([i915#1722])
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl4/igt@[email protected]
* igt@prime_nv_api@i915_nv_import_twice:
- shard-tglb: NOTRUN -> [SKIP][85] ([fdo#109291])
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@prime_nv_api@i915_nv_import_twice.html
* igt@sysfs_clients@fair-3:
- shard-kbl: NOTRUN -> [SKIP][86] ([fdo#109271] / [i915#2994])
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@[email protected]
* igt@sysfs_clients@split-25:
- shard-apl: NOTRUN -> [SKIP][87] ([fdo#109271] / [i915#2994]) +1 similar issue
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-apl7/igt@[email protected]
* igt@sysfs_clients@split-50:
- shard-skl: NOTRUN -> [SKIP][88] ([fdo#109271] / [i915#2994])
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl7/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_fair@basic-none@vcs1:
- shard-kbl: [FAIL][89] ([i915#2842]) -> [PASS][90]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl7/igt@gem_exec_fair@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@gem_exec_fair@[email protected]
* igt@gem_mmap_gtt@basic-small-copy-odd:
- shard-skl: [FAIL][91] -> [PASS][92]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-skl4/igt@[email protected]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl7/igt@[email protected]
* igt@gem_mmap_gtt@cpuset-basic-small-copy:
- shard-tglb: [INCOMPLETE][93] ([i915#3468]) -> [PASS][94]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-tglb7/igt@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-tglb8/igt@[email protected]
- shard-kbl: [INCOMPLETE][95] ([i915#3468]) -> [PASS][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl1/igt@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
* igt@gem_mmap_gtt@cpuset-basic-small-copy-odd:
- shard-snb: [INCOMPLETE][97] ([i915#2055] / [i915#3468]) -> [PASS][98]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-snb2/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-snb5/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-skl: [INCOMPLETE][99] ([i915#146] / [i915#300]) -> [PASS][100]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-skl7/igt@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl7/igt@[email protected]
* igt@kms_cursor_edge_walk@pipe-a-256x256-left-edge:
- shard-glk: [DMESG-FAIL][101] ([i915#118] / [i915#70] / [i915#95]) -> [PASS][102]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-glk4/igt@[email protected]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-glk2/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-skl: [FAIL][103] ([i915#2346] / [i915#533]) -> [PASS][104]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-skl4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [DMESG-WARN][105] ([i915#180]) -> [PASS][106] +3 similar issues
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl1/igt@[email protected]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [FAIL][107] ([fdo#108145] / [i915#265]) -> [PASS][108]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-skl3/igt@[email protected]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl7/igt@[email protected]
* igt@perf@polling-parameterized:
- shard-skl: [FAIL][109] ([i915#1542]) -> [PASS][110]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-skl2/igt@[email protected]
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl4/igt@[email protected]
#### Warnings ####
* igt@gem_mmap_gtt@cpuset-basic-small-copy-odd:
- shard-skl: [INCOMPLETE][111] ([i915#198] / [i915#2910]) -> [INCOMPLETE][112] ([i915#198] / [i915#2910] / [i915#3468])
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-skl2/igt@[email protected]
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-skl4/igt@[email protected]
* igt@runner@aborted:
- shard-kbl: ([FAIL][113], [FAIL][114], [FAIL][115], [FAIL][116], [FAIL][117], [FAIL][118], [FAIL][119], [FAIL][120], [FAIL][121], [FAIL][122], [FAIL][123], [FAIL][124], [FAIL][125], [FAIL][126], [FAIL][127], [FAIL][128], [FAIL][129]) ([fdo#109271] / [i915#1436] / [i915#180] / [i915#1814] / [i915#2722] / [i915#3002] / [i915#3363]) -> ([FAIL][130], [FAIL][131], [FAIL][132], [FAIL][133], [FAIL][134], [FAIL][135], [FAIL][136], [FAIL][137], [FAIL][138], [FAIL][139], [FAIL][140], [FAIL][141], [FAIL][142], [FAIL][143], [FAIL][144], [FAIL][145], [FAIL][146], [FAIL][147], [FAIL][148]) ([i915#1436] / [i915#180] / [i915#1814] / [i915#2722] / [i915#3002] / [i915#3363] / [i915#92])
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl1/igt@[email protected]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl2/igt@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl7/igt@[email protected]
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl3/igt@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl7/igt@[email protected]
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl7/igt@[email protected]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl1/igt@[email protected]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl2/igt@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl2/igt@[email protected]
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl3/igt@[email protected]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl1/igt@[email protected]
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl3/igt@[email protected]
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl4/igt@[email protected]
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl1/igt@[email protected]
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl7/igt@[email protected]
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl2/igt@[email protected]
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-kbl2/igt@[email protected]
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl7/igt@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@[email protected]
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl2/igt@[email protected]
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl7/igt@[email protected]
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl2/igt@[email protected]
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl7/igt@[email protected]
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl4/igt@[email protected]
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl7/igt@[email protected]
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl1/igt@[email protected]
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/shard-kbl3/igt@[email protected]
- shard-apl: ([FAIL][149], [FAIL][150], [FAIL][151], [FAIL][152], [FAIL][153]) ([fdo#109271] / [i915#2722] / [i915#3002] / [i915#3363]) -> ([FAIL][154], [FAIL][155], [FAIL][156], [FAIL][157]) ([i915#2722] / [i915#3363])
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10119/shard-apl7/igt@[email protected]
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20167/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 06/11] drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterQuoted 40 lines · Daniel Vetter
No need to set it explicitly.
Signed-off-by Daniel Vetter <[email protected]>Cc Laurentiu Palcu <[email protected]>Cc Lucas Stach <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Pengutronix Kernel Team <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP Linux Team <[email protected]>Cc Philipp Zabel <[email protected]>Cc Paul Cercueil <[email protected]>Cc Chun-Kuang Hu <[email protected]>Cc Matthias Brugger <[email protected]>Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Cc Jerome Brunet <[email protected]>Cc Martin Blumenstingl <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Agner <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Cc Jyri Sarha <[email protected]>Cc Tomi Valkeinen <[email protected]>
Quoted 8 lines
--- drivers/gpu/drm/imx/dcss/dcss-plane.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 - drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 1 -
For drivers/gpu/drm/meson/*:
Re: [PATCH 09/11] drm/omap: Follow implicit fencing in prepare_fb
In reply to Daniel VetterQuoted 23 lines · Daniel Vetter
I guess no one ever tried running omap together with lima or panfrost, not even sure that's possible. Anyway for consistency, fix this.
Signed-off-by Daniel Vetter <[email protected]>Cc Tomi Valkeinen <[email protected]>--- drivers/gpu/drm/omapdrm/omap_plane.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/omapdrm/omap_plane.c +1
-0@@ -6,6 +6,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_plane_helper.h> #include "omap_dmm_tiler.h"
drivers/gpu/drm/omapdrm/omap_plane.c static int omap_plane_prepare_fb(struct drm_plane *plane, · line 37
Quoted 8 lines
drivers/gpu/drm/omapdrm/omap_plane.c +2
-0@@ -29,6 +30,8 @@ static int omap_plane_prepare_fb(struct drm_plane *plane,if (!new_state->fb)return 0 ; +drm_gem_plane_helper_prepare_fb (plane, new_state); +return omap_framebuffer_pin (new_state->fb); }
Tomi
Re: [PATCH 06/11] drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterQuoted 39 lines · Daniel Vetter
No need to set it explicitly.
Signed-off-by Daniel Vetter <[email protected]>Cc Laurentiu Palcu <[email protected]>Cc Lucas Stach <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Pengutronix Kernel Team <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP Linux Team <[email protected]>Cc Philipp Zabel <[email protected]>Cc Paul Cercueil <[email protected]>Cc Chun-Kuang Hu <[email protected]>Cc Matthias Brugger <[email protected]>Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Cc Jerome Brunet <[email protected]>Cc Martin Blumenstingl <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Agner <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Cc Jyri Sarha <[email protected]>Cc Tomi Valkeinen <[email protected]>
Quoted 16 lines
--- drivers/gpu/drm/imx/dcss/dcss-plane.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 - drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 - drivers/gpu/drm/stm/ltdc.c | 1 - drivers/gpu/drm/sun4i/sun4i_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 1 - drivers/gpu/drm/tidss/tidss_plane.c | 1 - 14 files changed, 15 deletions(-)
For tidss:
Tomi
Hi Christian,
Quoted 32 lines · Christian König
Am 21.05.21 um 20:31 schrieb Daniel Vetter:
Quoted 6 lines
[SNIP]
Quoted 1 line
We could provide an IOCTL for the BO to change the flag.
That's not the semantics we need.
Quoted 2 lines
But could we first figure out the semantics we want to use here?
Quoted 8 lines
Quoted 2 lines
Cause I'm pretty sure we don't actually need those changes at all and as said before I'm certainly NAKing things which break existing use cases.
Please read how other drivers do this and at least _try_ to understand it. I'm really loosing my patience here with you NAKing patches you're not even understanding (or did you actually read and fully understand the entire story I typed up here, and your NAK is on the entire thing?). There's not much useful conversation to be had with that approach. And with drivers I mean kernel + userspace here.
Well to be honest I did fully read that, but I was just to emotionally attached to answer more appropriately in that moment.
And I'm sorry that I react emotional on that, but it is really frustrating that I'm not able to convince you that we have a major problem which affects all drivers and not just amdgpu.
Regarding the reason why I'm NAKing this particular patch, you are breaking existing uAPI for RADV with that. And as a maintainer of the driver I have simply no other choice than saying halt, stop we can't do it like this.
I'm perfectly aware that I've some holes in the understanding of how ANV or other Vulkan/OpenGL stacks work. But you should probably also admit that you have some holes how amdgpu works or otherwise I can't imagine why you suggest a patch which simply breaks RADV.
Quoted 6 lines
I mean we are working together for years now and I think you know me pretty well, do you really think I scream bloody hell we can't do this without a good reason?
So let's stop throwing halve backed solutions at each other and discuss what we can do to solve the different problems we are both seeing here.
Well this was meant to be a goal post/semantics discussion starter. Yes the patch breaks performance (but not correctness) for amdgpu, but it also contains my suggestion for how to fix that issue (in text form at least).
Plus a plan how to roll it out so that anyone who cares doesn't hit the perf issues this patch can cause.
Also the overall series is really meant as a subsystem wide assessment of the status quo. Aside from a correctness issue Lucas spotted in my panfrost patches no substantial input from others on this yet unfortunately. I need to poke more people I think.
Anyway since the plan as a text didn't stick I'm typing up now something more detailed in form of amdgpu patches. Maybe Bas can do the radv conversion too.
It won't be complete by far either (I'm not working for amd after all ...), I'll leave out the opengl/media side entirely. But if this works for radv is should be a useful blueprint for gl/media too (with some changes in the interfaces, but not really the exposed semantics).
Quoted 15 lines
Quoted 5 lines
That's the other frustration part: You're trying to fix this purely in the kernel. This is exactly one of these issues why we require open source userspace, so that we can fix the issues correctly across the entire stack. And meanwhile you're steadfastily refusing to even look at that the userspace side of the picture.
Well I do fully understand the userspace side of the picture for the AMD stack. I just don't think we should give userspace that much control over the fences in the
dma_resvobject without untangling them from resource management.And RADV is exercising exclusive sync for amdgpu already. You can do submission to both the GFX, Compute and SDMA queues in Vulkan and those currently won't over-synchronize.
Quoted 7 lines
When you then send a texture generated by multiple engines to the Compositor the kernel will correctly inserts waits for all submissions of the other process.
So this already works for RADV and completely without the IOCTL Jason proposed. IIRC we also have unit tests which exercised that feature for the video decoding use case long before RADV even existed.
Yeah multiple engines on the producer side works fine with the current scheme you have (if we ignore for now that the way amdgpu uses dma_resv is different from other drivers by not setting the exclusive slots for producers).
Where it breaks down is you have overlapping reads once a frame is generated, on either side. E.g.
- compositors read the buffer as consumer
- but also producer reads the buffer again (maybe reference frame for media, or maybe for some post-processing like motion blurr or whatever).
Then your current scheme really badly oversyncs, while other drivers don't have this issue. Fixing this for amdgpu will have quite a big impact on how dma_resv will be used by amdgpu, and that's why I think before we've looked at this it doesn't make sense to look at changing dma_resv in big ways.
I do think the AMDGPU_SYNC_NE_OWNER trick is pretty neat, and should help with some very non-explicit userspace (gl, maybe also media but at least ours is internally moving to a more explicit model I think) when you split the workload over multiple engines. For vulkan I think the right model is AMDGPU_SYNC_EXPLICIT, plus something like what Jason has.
Except there's going to be quite some twist, but I think that's best explained in patches since text clearly doesn't work well.
Quoted 3 lines
And yes I have to admit that I haven't thought about interaction with other drivers when I came up with this because the rules of that interaction wasn't clear to me at that time.
Ok I think we're at least distilling the core of our disagreement here, that's some progress:
- my take: to make implicit sync work well and avoid oversync issues, userspace, and currently amgpu lacks these uapis so needs to get those added.
- your take: please lets not give so much control to userspace
Tbh I'm not yet fully understanding your concern here, but I do agree that there's a lot of things that need to be carefully audited here, at least in amdgpu. From my driver wide audit I do think in general playing clever tricks is ok, since drivers treat the exclusive fence as just a special type of shared fence and don't e.g. ignore the shard fences if an exclusive one is present. For the generic helper version of this see drm_gem_fence_array_add_implicit(), but afaiui amdgpu works the same (or at least similar enough), as do other drivers playing funny games.
Quoted 10 lines
Quoted 9 lines
Also I thought through your tlb issue, why are you even putting these tlb flush fences into the shard
dma_resvslots? If you store them somewhere else in the amdgpu private part, the oversync issues goes away
- in your ttm bo move callback, you can just make your bo copy job depend on them too (you have to anyway)
- even for p2p there's not an issue here, because you have the ->move_notify callback, and can then lift the tlb flush fences from your private place to the shared slots so the exporter can see them.
Quoted 3 lines
Because adding a shared fence requires that this shared fence signals after the exclusive fence. And this is a perfect example to explain why this is so problematic and also why why we currently stumble over that only in amdgpu.
So I also have vague collections that we agreed this is required, but I don't think it's the case. I'm at least pretty sure we already have multiple drivers which violate this (non of them using TTM yet).
Quoted 6 lines
In TTM we have a feature which allows evictions to be pipelined and don't wait for the evicting DMA operation. Without that driver will stall waiting for their allocations to finish when we need to allocate memory.
For certain use cases this gives you a ~20% fps increase under memory pressure, so it is a really important feature.
Yeah that's something I'm banging my head against right now a bit for my amdgpu demo patch series.
Quoted 8 lines
This works by adding the fence of the last eviction DMA operation to BOs
when their backing store is newly allocated. That's what thettm_bo_add_move_fence()function you stumbled over is good for: https://elixir.bootlin.com/linux/v5.13-rc2/source/drivers/gpu/drm/ttm/ttm_bo.c#L692Now the problem is it is possible that the application is terminated before it can complete it's command submission. But since resource management only waits for the shared fences when there are some there is a chance that we free up memory while it is still in use.
Hm where is this code? Would help in my audit that I wanted to do this week? If you look at most other places like drm_gem_fence_array_add_implicit() I mentioned earlier, then we don't treat the shared fences special and always also include the exclusive one.
Quoted 10 lines
Because of this we have some rather crude workarounds in amdgpu. For example IIRC we manual wait for any potential exclusive fence before freeing memory.
We could enable this feature for radeon and nouveau as well with an one line change. But that would mean we need to maintain the workarounds for shortcomings of the
dma_resvobject design in those drivers as well.To summarize I think that adding an unbound fence to protect an object is a perfectly valid operation for resource management, but this is restricted by the needs of implicit sync at the moment.
Hm how are unbound fences (what do you mean with this exactly) come into play here now? I think you lost me here on the last 1-2 paragraphs, before that I think I followed.
Quoted 11 lines
Quoted 2 lines
The kernel move fences otoh are a bit more nasty to wring through the p2p dma-buf interface. That one probably needs something new.
Well the p2p interface are my least concern.
Adding the move fence means that you need to touch every place we do CS or page flip since you now have something which is parallel to the explicit sync fence.
Otherwise having the move fence separately wouldn't make much sense in the first place if we always set it together with the exclusive fence.
Yeah it's a bunch of work. But for i915 this is the model we have, so we have to do it anyway, so I have really good excuse here to do that ttm audit.
Quoted 1 line
Best regards and sorry for getting on your nerves so much,
tbh I've also been rather thinly nerved on this. One side was that I spent the last 1+ years having an eerily similar with i915-gem team about how a single driver can't just have totally different rules for core stuff like dma_resv/fence/locks, and unfortunately that entire story went really, horribly wrong :-/ So I'm very much "oh noes pls not again".
But also the long w/e here helped, yay :-)
I think there's a few questions here that we can ping/pong a bit more, but I think for the next meaningful round I need to get this draft set of patches a bit into shape here, and audit more code. I think hopefully early next week I'll have something which isn't too much full of holes which should help in moving forward on this discussion.
Cheers, Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Hi Daniel,
Am 25.05.21 um 15:05 schrieb Daniel Vetter:
Quoted 38 lines
Hi Christian,
Quoted 35 lines · Christian König
Am 21.05.21 um 20:31 schrieb Daniel Vetter:
Quoted 6 lines
[SNIP]
Quoted 1 line
We could provide an IOCTL for the BO to change the flag.
That's not the semantics we need.
Quoted 2 lines
But could we first figure out the semantics we want to use here?
Quoted 8 lines
Quoted 2 lines
Cause I'm pretty sure we don't actually need those changes at all and as said before I'm certainly NAKing things which break existing use cases.
Please read how other drivers do this and at least _try_ to understand it. I'm really loosing my patience here with you NAKing patches you're not even understanding (or did you actually read and fully understand the entire story I typed up here, and your NAK is on the entire thing?). There's not much useful conversation to be had with that approach. And with drivers I mean kernel + userspace here.
Well to be honest I did fully read that, but I was just to emotionally attached to answer more appropriately in that moment.
And I'm sorry that I react emotional on that, but it is really frustrating that I'm not able to convince you that we have a major problem which affects all drivers and not just amdgpu.
Regarding the reason why I'm NAKing this particular patch, you are breaking existing uAPI for RADV with that. And as a maintainer of the driver I have simply no other choice than saying halt, stop we can't do it like this.
I'm perfectly aware that I've some holes in the understanding of how ANV or other Vulkan/OpenGL stacks work. But you should probably also admit that you have some holes how amdgpu works or otherwise I can't imagine why you suggest a patch which simply breaks RADV.
I mean we are working together for years now and I think you know me pretty well, do you really think I scream bloody hell we can't do this without a good reason?
Quoted 5 lines
Quoted 2 lines
So let's stop throwing halve backed solutions at each other and discuss what we can do to solve the different problems we are both seeing here.
Well this was meant to be a goal post/semantics discussion starter. Yes the patch breaks performance (but not correctness) for amdgpu, but it also contains my suggestion for how to fix that issue (in text form at least).
Well as far as I can see this really breaks uAPI, we have unit tests exercising this.
But see more on this below.
Quoted 8 lines
Plus a plan how to roll it out so that anyone who cares doesn't hit the perf issues this patch can cause.
Also the overall series is really meant as a subsystem wide assessment of the status quo. Aside from a correctness issue Lucas spotted in my panfrost patches no substantial input from others on this yet unfortunately. I need to poke more people I think.
Quoted 8 lines
Anyway since the plan as a text didn't stick I'm typing up now something more detailed in form of amdgpu patches. Maybe Bas can do the radv conversion too.
It won't be complete by far either (I'm not working for amd after all ...), I'll leave out the opengl/media side entirely. But if this works for radv is should be a useful blueprint for gl/media too (with some changes in the interfaces, but not really the exposed semantics).
Yeah, but to make my point clear once more: I can't allow any patch in which would change amdgpus existing uAPI behavior.
What we can talk about is changing the behavior by adding flags to the fpriv to change the behavior and/or stuff the CS fence by default into the exclusive slot.
For the later I think we could do something like using a dma_fence_chain for the exclusive fence in amdgpu. This way we would have the same semantics in the CS and still support the epoll and Jasons new import IOCTL.
But the semantics of the amdgpu CS interface to not serialize from the same process and always serialize if you see some different process must stay the same or otherwise I have quite a bunch of angry end users.
Quoted 29 lines
Quoted 14 lines
Quoted 5 lines
That's the other frustration part: You're trying to fix this purely in the kernel. This is exactly one of these issues why we require open source userspace, so that we can fix the issues correctly across the entire stack. And meanwhile you're steadfastily refusing to even look at that the userspace side of the picture.
Well I do fully understand the userspace side of the picture for the AMD stack. I just don't think we should give userspace that much control over the fences in the
dma_resvobject without untangling them from resource management.And RADV is exercising exclusive sync for amdgpu already. You can do submission to both the GFX, Compute and SDMA queues in Vulkan and those currently won't over-synchronize.
Quoted 7 lines
When you then send a texture generated by multiple engines to the Compositor the kernel will correctly inserts waits for all submissions of the other process.
So this already works for RADV and completely without the IOCTL Jason proposed. IIRC we also have unit tests which exercised that feature for the video decoding use case long before RADV even existed.
Yeah multiple engines on the producer side works fine with the current scheme you have (if we ignore for now that the way amdgpu uses
dma_resvis different from other drivers by not setting the exclusive slots for producers).Where it breaks down is you have overlapping reads once a frame is generated, on either side. E.g.
Quoted 6 lines
- compositors read the buffer as consumer
- but also producer reads the buffer again (maybe reference frame for media, or maybe for some post-processing like motion blurr or whatever).Then your current scheme really badly oversyncs, while other drivers don't have this issue.
No, that is correct behavior. This was added intentionally and we have an use cases which rely on this.
The concept is that when two processes access the same buffer object they should serialize, no matter what.
You can opt-out of that by setting the EXPLICIT_SYNC flag on the BO.
Quoted 5 lines
Fixing this for amdgpu will have quite a big impact
on howdma_resvwill be used by amdgpu, and that's why I think before we've looked at this it doesn't make sense to look at changingdma_resvin big ways.
Quoted 8 lines
I do think the
AMDGPU_SYNC_NE_OWNERtrick is pretty neat, and should help with some very non-explicit userspace (gl, maybe also media but at least ours is internally moving to a more explicit model I think) when you split the workload over multiple engines. For vulkan I think the right model isAMDGPU_SYNC_EXPLICIT, plus something like what Jason has.Except there's going to be quite some twist, but I think that's best explained in patches since text clearly doesn't work well.
Yeah, I'm also wondering how we can ever merge the two approaches back together. I'm not sure that this is possible.
Quoted 12 lines
Quoted 3 lines
And yes I have to admit that I haven't thought about interaction with other drivers when I came up with this because the rules of that interaction wasn't clear to me at that time.
Ok I think we're at least distilling the core of our disagreement here, that's some progress:
- my take: to make implicit sync work well and avoid oversync issues, userspace, and currently amgpu lacks these uapis so needs to get those added.
- your take: please lets not give so much control to userspace
Quoted 8 lines
Tbh I'm not yet fully understanding your concern here, but I do agree that there's a lot of things that need to be carefully audited here, at least in amdgpu. From my driver wide audit I do think in general playing clever tricks is ok, since drivers treat the exclusive fence as just a special type of shared fence and don't e.g. ignore the shard fences if an exclusive one is present. For the generic helper version of this see
drm_gem_fence_array_add_implicit(), but afaiui amdgpu works the same (or at least similar enough), as do other drivers playing funny games.
Well do you mean the other way around? E.g. that you can *not* ignore the exclusive fence when shared once are present?
As far as I know nouveau is the only driver left using that (maybe i915 somewhere, but not sure) and it would really help if we could remove that.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Also I thought through your tlb issue, why are you even putting these tlb flush fences into the shard
dma_resvslots? If you store them somewhere else in the amdgpu private part, the oversync issues goes away
- in your ttm bo move callback, you can just make your bo copy job depend on them too (you have to anyway)
- even for p2p there's not an issue here, because you have the ->move_notify callback, and can then lift the tlb flush fences from your private place to the shared slots so the exporter can see them.
Quoted 6 lines
Quoted 3 lines
Because adding a shared fence requires that this shared fence signals after the exclusive fence. And this is a perfect example to explain why this is so problematic and also why why we currently stumble over that only in amdgpu.
So I also have vague collections that we agreed this is required, but I don't think it's the case. I'm at least pretty sure we already have multiple drivers which violate this (non of them using TTM yet).
Yeah, I know. Basically everybody which adds more than a CS fence to the shared slots will ignore this.
As said above if we drop this (which would be great) at least nouveau would need to be fixed.
Quoted 13 lines
Quoted 6 lines
In TTM we have a feature which allows evictions to be pipelined and don't wait for the evicting DMA operation. Without that driver will stall waiting for their allocations to finish when we need to allocate memory.
For certain use cases this gives you a ~20% fps increase under memory pressure, so it is a really important feature.
Yeah that's something I'm banging my head against right now a bit for my amdgpu demo patch series.
Quoted 4 lines
This works by adding the fence of the last eviction DMA operation to BOs
when their backing store is newly allocated. That's what thettm_bo_add_move_fence()function you stumbled over is good for: https://elixir.bootlin.com/linux/v5.13-rc2/source/drivers/gpu/drm/ttm/ttm_bo.c#L692
Quoted 8 lines
Quoted 4 lines
Now the problem is it is possible that the application is terminated before it can complete it's command submission. But since resource management only waits for the shared fences when there are some there is a chance that we free up memory while it is still in use.
Hm where is this code? Would help in my audit that I wanted to do this week? If you look at most other places like
drm_gem_fence_array_add_implicit()I mentioned earlier, then we don't treat the shared fences special and always also include the exclusive one.
See amdgpu_gem_object_close():
...
fence = dma_resv_get_excl(bo->tbo.base.resv); if (fence) {
amdgpu_bo_fence(bo, fence, true); fence = NULL;
}
...
We explicitly added that because resource management of some other driver was going totally bananas without that.
But I'm not sure which one that was. Maybe dig a bit in the git and mailing history of that.
Quoted 7 lines
Quoted 7 lines
Because of this we have some rather crude workarounds in amdgpu. For example IIRC we manual wait for any potential exclusive fence before freeing memory.
We could enable this feature for radeon and nouveau as well with an one line change. But that would mean we need to maintain the workarounds for shortcomings of the
dma_resvobject design in those drivers as well.
Quoted 6 lines
Quoted 3 lines
To summarize I think that adding an unbound fence to protect an object is a perfectly valid operation for resource management, but this is restricted by the needs of implicit sync at the moment.
Hm how are unbound fences (what do you mean with this exactly) come into play here now? I think you lost me here on the last 1-2 paragraphs, before that I think I followed.
Unbound like in not waiting for the exclusive fence.
Quoted 14 lines
Quoted 10 lines
Quoted 2 lines
The kernel move fences otoh are a bit more nasty to wring through the p2p dma-buf interface. That one probably needs something new.
Well the p2p interface are my least concern.
Adding the move fence means that you need to touch every place we do CS or page flip since you now have something which is parallel to the explicit sync fence.
Otherwise having the move fence separately wouldn't make much sense in the first place if we always set it together with the exclusive fence.
Yeah it's a bunch of work. But for i915 this is the model we have, so we have to do it anyway, so I have really good excuse here to do that ttm audit.
Quoted 6 lines
Quoted 1 line
Best regards and sorry for getting on your nerves so much,
tbh I've also been rather thinly nerved on this. One side was that I spent the last 1+ years having an eerily similar with i915-gem team about how a single driver can't just have totally different rules for core stuff like dma_resv/fence/locks, and unfortunately that entire story went really, horribly wrong :-/ So I'm very much "oh noes pls not again".
Dito. I mean I didn't came up with the approach for amdgpu out of nowhere, but rather because we had some specific use cases for that.
Back in the R6xx days some guys where putting a semaphore at the end of each BO and serialized engine access to the BO using that. E.g. see how radeon works internally with the semaphore block.
This is basically the same concept implemented with the dma_resv object instead.
Quoted 1 line
But also the long w/e here helped, yay :-)
Yeah, indeed.
Cheers,
Christian.
Quoted 8 lines
I think there's a few questions here that we can ping/pong a bit more, but I think for the next meaningful round I need to get this draft set of patches a bit into shape here, and audit more code. I think hopefully early next week I'll have something which isn't too much full of holes which should help in moving forward on this discussion.
Cheers, Daniel
Quoted 29 lines · Christian König
Hi Daniel,
Am 25.05.21 um 15:05 schrieb Daniel Vetter:
Quoted 8 lines
Hi Christian,
Quoted 5 lines · Christian König
Am 21.05.21 um 20:31 schrieb Daniel Vetter:
This works by adding the fence of the last eviction DMA operation to BOs
when their backing store is newly allocated. That's what thettm_bo_add_move_fence()function you stumbled over is good for: https://elixir.bootlin.com/linux/v5.13-rc2/source/drivers/gpu/drm/ttm/ttm_bo.c#L692Quoted 8 lines
Quoted 4 lines
Now the problem is it is possible that the application is terminated before it can complete it's command submission. But since resource management only waits for the shared fences when there are some there is a chance that we free up memory while it is still in use.
Hm where is this code? Would help in my audit that I wanted to do this week? If you look at most other places like
drm_gem_fence_array_add_implicit()I mentioned earlier, then we don't treat the shared fences special and always also include the exclusive one.See
amdgpu_gem_object_close():...
fence = dma_resv_get_excl(bo->tbo.base.resv); if (fence) { amdgpu_bo_fence(bo, fence, true); fence = NULL; }
Quoted 7 lines
...
We explicitly added that because resource management of some other driver was going totally bananas without that.
But I'm not sure which one that was. Maybe dig a bit in the git and mailing history of that.
Hm I looked and it's
commit 82c416b13cb7d22b96ec0888b296a48dff8a09eb
Author: Christian König <[email protected]> Date: Thu Mar 12 12:03:34 2020 +0100
drm/amdgpu: fix and cleanup amdgpu_gem_object_close v4
That sounded more like amdgpu itself needing this, not another driver?
But looking at amdgpu_vm_bo_update_mapping() it seems to pick the right fencing mode for gpu pte clearing, so I'm really not sure what the bug was that you worked around here?The implementation boils down to amdgpu_sync_resv() which syncs for the exclusive fence, always. And there's nothing else that I could find in public history at least, no references to bug reports or anything. I think you need to dig internally, because as-is I'm not seeing the problem here.
Or am I missing something here?
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 11/11] drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default
In reply to Noralf TrønnesQuoted 9 lines · Noralf Tr?nnes
Den 21.05.2021 11.09, skrev Daniel Vetter:
Quoted 4 lines
Goes through all the drivers and deletes the default hook since it's the default now.
Signed-off-by Daniel Vetter <[email protected]>Acked-by Noralf Tr?nnes <[email protected]>
Can you perhaps also look at the prep patch right before this one? -Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH 10/11] drm/simple-helper: drm_gem_simple_display_pipe_prepare_fb as default
In reply to Daniel VetterQuoted 16 lines
It's tedious to review this all the time, and my audit showed that arcpgu actually forgot to set this.
Make this the default and stop worrying.
Again I sprinkled
WARN_ON_ONCEon top to make sure we don't have strange combinations of hooks:cleanup_fbwithoutprepare_fbdoesn't make sense, and since simpler drivers are all new they better be GEM based drivers.Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>
Review
Quoted 6 lines
--- drivers/gpu/drm/drm_simple_kms_helper.c | 12 ++++++++++-- include/drm/drm_simple_kms_helper.h | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_simple_kms_helper.c
drivers/gpu/drm/drm_simple_kms_helper.c static int drm_simple_kms_plane_prepare_fb(struct
Quoted 13 lines
index
0b095a313c44..1a97571d97d9100644drivers/gpu/drm/drm_simple_kms_helper.c +2
-0@@ -9,6 +9,8 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> +#include <drm/drm_drv.h> +#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_managed.h> #include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> @@ -225,8 +227,14 @@ static int drm_simple_kms_plane_prepare_fb(struct
drm_plane *plane,
drivers/gpu/drm/drm_simple_kms_helper.c static int drm_simple_kms_plane_prepare_fb(struct drm_plane *plane, · line 231
Quoted 7 lines
drivers/gpu/drm/drm_simple_kms_helper.c +2
-2struct drm_simple_display_pipe *pipe; pipe = container_of(plane, struct drm_simple_display_pipe, plane); -if (!pipe->funcs || !pipe->funcs->prepare_fb) -return 0 ; +if (!pipe->funcs || !pipe->funcs->prepare_fb) { +if (WARN_ON_ONCE (drm_core_check_feature (plane->dev,DRIVER_GEM )))
Shouldn't this check be inverted? Looks like it warns on GEM drivers.
With that considered:
Hopefully this reply will thread correctly, I had to reply from lore (I wasn't cc'ed) and I don't know if Thunderbird sets In-Reply-To. I'm not subscribed to dri-devel anymore since I'm winding down my Linux work and dri-devel is such a high volume list.
Noralf
Quoted 9 lines
drivers/gpu/drm/drm_simple_kms_helper.c +6
-0+return 0 ; + +WARN_ON_ONCE (pipe->funcs && pipe->funcs->cleanup_fb); + +return drm_gem_simple_display_pipe_prepare_fb (pipe, state); + }return pipe->funcs->prepare_fb (pipe, state); }
Re: [PATCH 10/11] drm/simple-helper: drm_gem_simple_display_pipe_prepare_fb as default
Quoted 39 lines · Noralf Trønnes
Quoted 16 lines
It's tedious to review this all the time, and my audit showed that arcpgu actually forgot to set this.
Make this the default and stop worrying.
Again I sprinkled
WARN_ON_ONCEon top to make sure we don't have strange combinations of hooks:cleanup_fbwithoutprepare_fbdoesn't make sense, and since simpler drivers are all new they better be GEM based drivers.Signed-off-by Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Review
Quoted 6 lines
--- drivers/gpu/drm/drm_simple_kms_helper.c | 12 ++++++++++-- include/drm/drm_simple_kms_helper.h | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/drm_simple_kms_helper.cdrivers/gpu/drm/drm_simple_kms_helper.c static int drm_simple_kms_plane_prepare_fb(struct
Quoted 13 lines
index
0b095a313c44..1a97571d97d9100644drivers/gpu/drm/drm_simple_kms_helper.c +2
-0@@ -9,6 +9,8 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> +#include <drm/drm_drv.h> +#include <drm/drm_gem_atomic_helper.h> #include <drm/drm_managed.h> #include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> @@ -225,8 +227,14 @@ static int drm_simple_kms_plane_prepare_fb(struct
drm_plane*plane,Quoted 2 lines
drivers/gpu/drm/drm_simple_kms_helper.c +0
-0struct drm_simple_display_pipe *pipe;
Quoted 7 lines
drivers/gpu/drm/drm_simple_kms_helper.c static int drm_simple_kms_plane_prepare_fb(struct drm_plane *plane, · line 231
Quoted 5 lines
drivers/gpu/drm/drm_simple_kms_helper.c +2
-2pipe = container_of(plane, struct drm_simple_display_pipe, plane); -if (!pipe->funcs || !pipe->funcs->prepare_fb) -return 0 ; +if (!pipe->funcs || !pipe->funcs->prepare_fb) { +if (WARN_ON_ONCE (drm_core_check_feature (plane->dev,DRIVER_GEM )))Shouldn't this check be inverted? Looks like it warns on GEM drivers.
Ah yes, I'll fix.
Quoted 8 lines
With that considered:
Acked-by Noralf Trønnes <[email protected]>Hopefully this reply will thread correctly, I had to reply from lore (I wasn't cc'ed) and I don't know if Thunderbird sets In-Reply-To. I'm not subscribed to dri-devel anymore since I'm winding down my Linux work and dri-devel is such a high volume list.
Thanks a lot for taking a look, threaded all correctly. -Daniel
Quoted 11 lines
Noralf
Quoted 9 lines
drivers/gpu/drm/drm_simple_kms_helper.c +6
-0+return 0 ; + +WARN_ON_ONCE (pipe->funcs && pipe->funcs->cleanup_fb); + +return drm_gem_simple_display_pipe_prepare_fb (pipe, state); + }return pipe->funcs->prepare_fb (pipe, state); }
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Am 25.05.21 um 17:23 schrieb Daniel Vetter:
Quoted 38 lines
Quoted 27 lines · Christian König
Hi Daniel,
Am 25.05.21 um 15:05 schrieb Daniel Vetter:
Quoted 8 lines
Hi Christian,
Quoted 5 lines · Christian König
Am 21.05.21 um 20:31 schrieb Daniel Vetter:
This works by adding the fence of the last eviction DMA operation to BOs
when their backing store is newly allocated. That's what thettm_bo_add_move_fence()function you stumbled over is good for: https://elixir.bootlin.com/linux/v5.13-rc2/source/drivers/gpu/drm/ttm/ttm_bo.c#L692Quoted 8 lines
Quoted 4 lines
Now the problem is it is possible that the application is terminated before it can complete it's command submission. But since resource management only waits for the shared fences when there are some there is a chance that we free up memory while it is still in use.
Hm where is this code? Would help in my audit that I wanted to do this week? If you look at most other places like
drm_gem_fence_array_add_implicit()I mentioned earlier, then we don't treat the shared fences special and always also include the exclusive one.See
amdgpu_gem_object_close():...
fence = dma_resv_get_excl(bo->tbo.base.resv); if (fence) { amdgpu_bo_fence(bo, fence, true); fence = NULL; }Quoted 7 lines
...
We explicitly added that because resource management of some other driver was going totally bananas without that.
But I'm not sure which one that was. Maybe dig a bit in the git and mailing history of that.
Hm I looked and it's
Quoted 7 lines
commit
82c416b13cb7d22b96ec0888b296a48dff8a09ebAuthor: Christian König <[email protected]> Date: Thu Mar 12 12:03:34 2020 +0100drm/amdgpu: fix and cleanup
amdgpu_gem_object_closev4That sounded more like amdgpu itself needing this, not another driver?
No, that patch was just a follow up moving the functionality around.
Quoted 9 lines
But looking at
amdgpu_vm_bo_update_mapping()it seems to pick the right fencing mode for gpu pte clearing, so I'm really not sure what the bug was that you worked around here?The implementation boils down toamdgpu_sync_resv()which syncs for the exclusive fence, always. And there's nothing else that I could find in public history at least, no references to bug reports or anything. I think you need to dig internally, because as-is I'm not seeing the problem here.Or am I missing something here?
See the code here for example: https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/nouveau/nouveau_fence.c#L361
Nouveau assumes that when a shared fence is present it doesn't need to wait for the exclusive one because the shared are always supposed to finish after the exclusive one.
But for page table unmap fences that isn't true and we ran into a really nasty and hard to reproduce bug because of this.
I think it would be much more defensive if we could say that we always wait for the exclusive fence and fix the use case in nouveau and double check if somebody else does stuff like that as well.
Christian.
Quoted 1 line
-Daniel
Quoted 44 lines · Christian König
Am 25.05.21 um 17:23 schrieb Daniel Vetter:
Quoted 42 lines
Quoted 27 lines · Christian König
Hi Daniel,
Am 25.05.21 um 15:05 schrieb Daniel Vetter:
Quoted 8 lines
Hi Christian,
Quoted 5 lines · Christian König
Am 21.05.21 um 20:31 schrieb Daniel Vetter:
This works by adding the fence of the last eviction DMA operation to BOs
when their backing store is newly allocated. That's what thettm_bo_add_move_fence()function you stumbled over is good for: https://elixir.bootlin.com/linux/v5.13-rc2/source/drivers/gpu/drm/ttm/ttm_bo.c#L692Quoted 8 lines
Quoted 4 lines
Now the problem is it is possible that the application is terminated before it can complete it's command submission. But since resource management only waits for the shared fences when there are some there is a chance that we free up memory while it is still in use.
Hm where is this code? Would help in my audit that I wanted to do this week? If you look at most other places like
drm_gem_fence_array_add_implicit()I mentioned earlier, then we don't treat the shared fences special and always also include the exclusive one.See
amdgpu_gem_object_close():...
fence = dma_resv_get_excl(bo->tbo.base.resv); if (fence) { amdgpu_bo_fence(bo, fence, true); fence = NULL; }Quoted 7 lines
...
We explicitly added that because resource management of some other driver was going totally bananas without that.
But I'm not sure which one that was. Maybe dig a bit in the git and mailing history of that.
Hm I looked and it's
commit
82c416b13cb7d22b96ec0888b296a48dff8a09ebAuthor: Christian König <[email protected]> Date: Thu Mar 12 12:03:34 2020 +0100
Quoted 5 lines
Quoted 3 lines
drm/amdgpu: fix and cleanup
amdgpu_gem_object_closev4That sounded more like amdgpu itself needing this, not another driver?
No, that patch was just a follow up moving the functionality around.
That patch added the "add exclusive fence to shared slots before amdgpu_vm_clear_freed() call", which I thought was at least part of your fix.
Quoted 17 lines
Quoted 9 lines
But looking at
amdgpu_vm_bo_update_mapping()it seems to pick the right fencing mode for gpu pte clearing, so I'm really not sure what the bug was that you worked around here?The implementation boils down toamdgpu_sync_resv()which syncs for the exclusive fence, always. And there's nothing else that I could find in public history at least, no references to bug reports or anything. I think you need to dig internally, because as-is I'm not seeing the problem here.Or am I missing something here?
See the code here for example:
https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/nouveau/nouveau_fence.c#L361Nouveau assumes that when a shared fence is present it doesn't need to wait for the exclusive one because the shared are always supposed to finish after the exclusive one.
Quoted 6 lines
But for page table unmap fences that isn't true and we ran into a really nasty and hard to reproduce bug because of this.
I think it would be much more defensive if we could say that we always wait for the exclusive fence and fix the use case in nouveau and double check if somebody else does stuff like that as well.
Yeah most other drivers do the defensive thing here. I think it would be good to standardize on that. I'll add that to my list and do more auditing.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH 11/11] drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default
In reply to Daniel VetterQuoted 13 lines · Daniel Vetter
Goes through all the drivers and deletes the default hook since it's the default now.
Signed-off-by Daniel Vetter <[email protected]>Cc Joel Stanley <[email protected]>Cc Andrew Jeffery <[email protected]>Cc "Noralf Tr?nnes" <[email protected]>Cc Linus Walleij <[email protected]>Cc Emma Anholt <[email protected]>Cc David Lechner <[email protected]>Cc Kamlesh Gurudasani <[email protected]>Cc Oleksandr Andrushchenko <[email protected]>Cc Daniel Vetter <[email protected]>
Quoted 8 lines
Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Sam Ravnborg <[email protected]>Cc Alex Deucher <[email protected]>Cc Andy Shevchenko <[email protected]>Cc linux-aspeed at lists.ozlabs.orgCc linux-arm-kernel at lists.infradead.orgCc xen-devel at lists.xenproject.org
Yours,
Linus Walleij
Re: [PATCH 06/11] drm/<driver>: drm_gem_plane_helper_prepare_fb is now the default
In reply to Daniel VetterQuoted 16 lines · Daniel Vetter
No need to set it explicitly.
Signed-off-by Daniel Vetter <[email protected]>Cc Laurentiu Palcu <[email protected]>Cc Lucas Stach <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>Cc Pengutronix Kernel Team <[email protected]>Cc Fabio Estevam <[email protected]>Cc NXP Linux Team <[email protected]>Cc Philipp Zabel <[email protected]>Cc Paul Cercueil <[email protected]>Cc Chun-Kuang Hu <[email protected]>Cc Matthias Brugger <[email protected]>Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>
Quoted 8 lines
Cc Jerome Brunet <[email protected]>Cc Martin Blumenstingl <[email protected]>Cc Marek Vasut <[email protected]>Cc Stefan Agner <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>
For stm
Many thanks
Philippe :-)
Quoted 200 lines
Cc Benjamin Gaignard <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Jernej Skrabec <[email protected]>Cc Jyri Sarha <[email protected]>Cc Tomi Valkeinen <[email protected]>--- drivers/gpu/drm/imx/dcss/dcss-plane.c | 1 - drivers/gpu/drm/imx/ipuv3-plane.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 1 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 - drivers/gpu/drm/meson/meson_overlay.c | 1 - drivers/gpu/drm/meson/meson_plane.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 - drivers/gpu/drm/stm/ltdc.c | 1 - drivers/gpu/drm/sun4i/sun4i_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 1 - drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 1 - drivers/gpu/drm/tidss/tidss_plane.c | 1 - 14 files changed, 15 deletions(-)drivers/gpu/drm/imx/dcss/dcss-plane.c +0
-1@@ -361,7 +361,6 @@ static void dcss_plane_atomic_disable(struct drm_plane *plane, }static const struct drm_plane_helper_funcs dcss_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = dcss_plane_atomic_check, .atomic_update = dcss_plane_atomic_update, .atomic_disable = dcss_plane_atomic_disable,drivers/gpu/drm/imx/ipuv3-plane.c +0
-1@@ -772,7 +772,6 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = ipu_plane_atomic_check, .atomic_disable = ipu_plane_atomic_disable, .atomic_update = ipu_plane_atomic_update,drivers/gpu/drm/ingenic/ingenic-drm-drv.c +0
-1@@ -786,7 +786,6 @@ static const struct drm_plane_helper_funcs ingenic_drm_plane_helper_funcs = { .atomic_update = ingenic_drm_plane_atomic_update, .atomic_check = ingenic_drm_plane_atomic_check, .atomic_disable = ingenic_drm_plane_atomic_disable, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static const struct drm_crtc_helper_funcs ingenic_drm_crtc_helper_funcs = {drivers/gpu/drm/ingenic/ingenic-ipu.c +0
-1@@ -615,7 +615,6 @@ static const struct drm_plane_helper_funcs ingenic_ipu_plane_helper_funcs = { .atomic_update = ingenic_ipu_plane_atomic_update, .atomic_check = ingenic_ipu_plane_atomic_check, .atomic_disable = ingenic_ipu_plane_atomic_disable, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static intdrivers/gpu/drm/mediatek/mtk_drm_plane.c +0
-1@@ -227,7 +227,6 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mtk_plane_atomic_check, .atomic_update = mtk_plane_atomic_update, .atomic_disable = mtk_plane_atomic_disable,drivers/gpu/drm/meson/meson_overlay.c +0
-1@@ -747,7 +747,6 @@ static const struct drm_plane_helper_funcs meson_overlay_helper_funcs = { .atomic_check = meson_overlay_atomic_check, .atomic_disable = meson_overlay_atomic_disable, .atomic_update = meson_overlay_atomic_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static bool meson_overlay_format_mod_supported(struct drm_plane *plane,drivers/gpu/drm/meson/meson_plane.c +0
-1@@ -422,7 +422,6 @@ static const struct drm_plane_helper_funcs meson_plane_helper_funcs = { .atomic_check = meson_plane_atomic_check, .atomic_disable = meson_plane_atomic_disable, .atomic_update = meson_plane_atomic_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, }; static bool meson_plane_format_mod_supported(struct drm_plane *plane,drivers/gpu/drm/mxsfb/mxsfb_kms.c +0
-2@@ -500,13 +500,11 @@ static bool mxsfb_format_mod_supported(struct drm_plane *plane, }static const struct drm_plane_helper_funcs mxsfb_plane_primary_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_primary_atomic_update, };static const struct drm_plane_helper_funcs mxsfb_plane_overlay_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_overlay_atomic_update, };drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0
-1@@ -1109,7 +1109,6 @@ static const struct drm_plane_helper_funcs plane_helper_funcs = { .atomic_disable = vop_plane_atomic_disable, .atomic_async_check = vop_plane_atomic_async_check, .atomic_async_update = vop_plane_atomic_async_update, - .prepare_fb = drm_gem_plane_helper_prepare_fb, };static const struct drm_plane_funcs vop_plane_funcs = {drivers/gpu/drm/stm/ltdc.c +0
-1@@ -946,7 +946,6 @@ static const struct drm_plane_funcs ltdc_plane_funcs = { };static const struct drm_plane_helper_funcs ltdc_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = ltdc_plane_atomic_check, .atomic_update = ltdc_plane_atomic_update, .atomic_disable = ltdc_plane_atomic_disable,drivers/gpu/drm/sun4i/sun4i_layer.c +0
-1@@ -127,7 +127,6 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_disable = sun4i_backend_layer_atomic_disable, .atomic_update = sun4i_backend_layer_atomic_update, };drivers/gpu/drm/sun4i/sun8i_ui_layer.c +0
-1@@ -332,7 +332,6 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = sun8i_ui_layer_atomic_check, .atomic_disable = sun8i_ui_layer_atomic_disable, .atomic_update = sun8i_ui_layer_atomic_update,drivers/gpu/drm/sun4i/sun8i_vi_layer.c +0
-1@@ -436,7 +436,6 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = sun8i_vi_layer_atomic_check, .atomic_disable = sun8i_vi_layer_atomic_disable, .atomic_update = sun8i_vi_layer_atomic_update,drivers/gpu/drm/tidss/tidss_plane.c +0
-0
drivers/gpu/drm/tidss/tidss_plane.c static void drm_plane_destroy(struct drm_plane *plane) · line 163
Quoted 7 lines
drivers/gpu/drm/tidss/tidss_plane.c +0
-1@@ -158,7 +158,6 @@ static void drm_plane_destroy(struct drm_plane *plane) }static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = { - .prepare_fb = drm_gem_plane_helper_prepare_fb, .atomic_check = tidss_plane_atomic_check, .atomic_update = tidss_plane_atomic_update, .atomic_disable = tidss_plane_atomic_disable,
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Steven Price
maintainerRe: [PATCH 03/11] drm/panfrost: Use xarray and helpers for depedency tracking
In reply to Daniel VetterQuoted 6 lines · Daniel Vetter
More consistency and prep work for the next patch.
Aside: I wonder whether we shouldn't just move this entire xarray business into the scheduler so that not everyone has to reinvent the same wheels. Cc'ing some scheduler people for this too.
Quoted 12 lines
Cc "Christian König" <[email protected]>Cc Luben Tuikov <[email protected]>Cc Alex Deucher <[email protected]>Cc Lee Jones <[email protected]>Cc Steven Price <[email protected]>Cc Rob Herring <[email protected]>Cc Tomeu Vizoso <[email protected]>Cc Alyssa Rosenzweig <[email protected]>Cc Sumit Semwal <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Two comments below, but otherwise looks like a nice cleanup.
Quoted 129 lines
--- drivers/gpu/drm/panfrost/panfrost_drv.c | 41 ++++++++--------- drivers/gpu/drm/panfrost/panfrost_job.c | 61 ++++++++++--------------- drivers/gpu/drm/panfrost/panfrost_job.h | 8 ++-- 3 files changed, 46 insertions(+), 64 deletions(-)drivers/gpu/drm/panfrost/panfrost_drv.c +18
-23@@ -137,12 +137,6 @@ panfrost_lookup_bos(struct drm_device *dev,if (!job->bo_count)return 0 ; - job->implicit_fences =kvmalloc_array (job->bo_count, -sizeof (struct dma_fence *), -GFP_KERNEL | __GFP_ZERO); -if (!job->implicit_fences) -return -ENOMEM ; - ret =drm_gem_objects_lookup (file_priv, (void __user *)(uintptr_t )args->bo_handles, job->bo_count, &job->bos);@@ -173,7 +167,7 @@ panfrost_lookup_bos(struct drm_device *dev, }/** -* panfrost_copy_in_sync() - Sets up job->in_fences[] with the sync objects +* panfrost_copy_in_sync() - Sets up job->deps with the sync objects * referenced by the job. * @dev: DRM device * @file_priv: DRM file for this fd @@ -193,22 +187,14 @@ panfrost_copy_in_sync(struct drm_device *dev, {u32 *handles;int ret =0 ; -int i; +int i, in_fence_count; - job->in_fence_count = args->in_sync_count; + in_fence_count = args->in_sync_count; -if (!job->in_fence_count) +if (!in_fence_count)return 0 ; - job->in_fences =kvmalloc_array (job->in_fence_count, -sizeof (struct dma_fence *), -GFP_KERNEL | __GFP_ZERO); -if (!job->in_fences) { -DRM_DEBUG ("Failed to allocate job in fences\n" ); -return -ENOMEM ; - } - - handles =kvmalloc_array (job->in_fence_count,sizeof (u32),GFP_KERNEL ); + handles =kvmalloc_array (in_fence_count,sizeof (u32),GFP_KERNEL );if (!handles) { ret = -ENOMEM ;DRM_DEBUG ("Failed to allocate incoming syncobj handles\n" );@@ -217,16 +203,23 @@ panfrost_copy_in_sync(struct drm_device *dev,if (copy_from_user (handles, (void __user *)(uintptr_t )args->in_syncs, - job->in_fence_count *sizeof (u32))) { + in_fence_count *sizeof (u32))) { ret = -EFAULT ;DRM_DEBUG ("Failed to copy in syncobj handles\n" ); goto fail; } -for (i =0 ; i < job->in_fence_count; i++) { +for (i =0 ; i < in_fence_count; i++) { +struct dma_fence *fence; + ret =drm_syncobj_find_fence (file_priv, handles[i],0 ,0 , - &job->in_fences[i]); -if (ret == -EINVAL ) + &fence); +if (ret) + goto fail; + + ret =drm_gem_fence_array_add (&job->deps, fence); + +if (ret) goto fail; }@@ -264,6 +257,8 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,kref_init (&job->refcount); +xa_init_flags (&job->deps,XA_FLAGS_ALLOC ); + job->pfdev = pfdev; job->jc = args->jc; job->requirements = args->requirements;drivers/gpu/drm/panfrost/panfrost_job.c +13
-6@@ -196,14 +196,21 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js)job_write (pfdev,JS_COMMAND_NEXT (js),JS_COMMAND_START ); } -static void panfrost_acquire_object_fences (struct drm_gem_object **bos, -int bo_count, -struct dma_fence **implicit_fences) +static int panfrost_acquire_object_fences (struct drm_gem_object **bos, +int bo_count, +struct xarray *deps) { -int i; +int i, ret; -for (i =0 ; i < bo_count; i++) - implicit_fences[i] =dma_resv_get_excl_rcu (bos[i]->resv); +for (i =0 ; i < bo_count; i++) { +struct dma_fence *fence =dma_resv_get_excl_rcu (bos[i]->resv); + + ret =drm_gem_fence_array_add (deps, fence); +if (ret) +return ret; + } + +return 0 ; } static void panfrost_attach_object_fences(struct drm_gem_object **bos,
drivers/gpu/drm/panfrost/panfrost_job.c int panfrost_job_push(struct panfrost_job *job) · line 249
Quoted 9 lines
drivers/gpu/drm/panfrost/panfrost_job.c +4
-2@@ -236,8 +243,10 @@ int panfrost_job_push(struct panfrost_job *job)kref_get (&job->refcount);/* put by scheduler job completion */ -panfrost_acquire_object_fences (job->bos, job->bo_count, - job->implicit_fences); + ret =panfrost_acquire_object_fences (job->bos, job->bo_count, + &job->deps); +if (ret) + goto unlock;
I think this needs to move above the kref_get() otherwise we'll leak the job on failure.
Quoted 44 lines
drivers/gpu/drm/panfrost/panfrost_job.c +6
-20drm_sched_entity_push_job (&job->base, entity);@@ -254,18 +263,15 @@ static void panfrost_job_cleanup(struct kref *ref) { struct panfrost_job *job = container_of(ref, struct panfrost_job, refcount); +struct dma_fence *fence; +unsigned long index;unsigned int i; -if (job->in_fences) { -for (i =0 ; i < job->in_fence_count; i++) -dma_fence_put (job->in_fences[i]); -kvfree (job->in_fences); - } -if (job->implicit_fences) { -for (i =0 ; i < job->bo_count; i++) -dma_fence_put (job->implicit_fences[i]); -kvfree (job->implicit_fences); +xa_for_each (&job->deps, index, fence) { +dma_fence_put (fence); } +xa_destroy (&job->deps); +dma_fence_put (job->done_fence);dma_fence_put (job->render_done_fence);@@ -308,26 +314,9 @@ static struct dma_fence *panfrost_job_dependency(struct drm_sched_job *sched_job struct drm_sched_entity *s_entity) {struct panfrost_job *job =to_panfrost_job (sched_job); -struct dma_fence *fence; -unsigned int i; -/* Explicit fences */ -for (i =0 ; i < job->in_fence_count; i++) { -if (job->in_fences[i]) { - fence = job->in_fences[i]; - job->in_fences[i] =NULL ; -return fence; - } - } -
drivers/gpu/drm/panfrost/panfrost_job.c static struct dma_fence *panfrost_job_dependency(struct drm_sched_job *sched_job · line 319
Quoted 10 lines
drivers/gpu/drm/panfrost/panfrost_job.c +2
-8-/* Implicit fences, max. one per BO */ -for (i =0 ; i < job->bo_count; i++) { -if (job->implicit_fences[i]) { - fence = job->implicit_fences[i]; - job->implicit_fences[i] =NULL ; -return fence; - } - } +if (!xa_empty (&job->deps)) +return xa_erase (&job->deps, job->last_dep++);
Rather than tracking last_dep separately this could be written using xa_find():
if (xa_find(&job->deps, &i, ULONG_MAX, XA_PRESENT)) return xa_erase(&job->deps, &i);
Steve
Quoted 22 lines
drivers/gpu/drm/panfrost/panfrost_job.c +0
-0return NULL ; }drivers/gpu/drm/panfrost/panfrost_job.h +3
-3@@ -19,9 +19,9 @@ struct panfrost_job {struct panfrost_device *pfdev;struct panfrost_file_priv *file_priv; -/* Optional fences userspace can pass in for the job to depend on. */ -struct dma_fence **in_fences; -u32 in_fence_count; +/* Contains both explicit and implicit fences */ +struct xarray deps; +unsigned long last_dep;/* Fence to be signaled by IRQ handler when the job is complete. */ struct dma_fence *done_fence;
drivers/gpu/drm/panfrost/panfrost_job.h struct panfrost_job { · line 35
Quoted 8 lines
drivers/gpu/drm/panfrost/panfrost_job.h +0
-2@@ -30,8 +30,6 @@ struct panfrost_job {__u32 requirements;__u32 flush_id; -/* Exclusive fences we have taken from the BOs to wait for */ -struct dma_fence **implicit_fences;struct panfrost_gem_mapping **mappings;struct drm_gem_object **bos;u32 bo_count;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 03/11] drm/panfrost: Use xarray and helpers for depedency tracking
Quoted 20 lines · Steven Price
Quoted 6 lines · Daniel Vetter
More consistency and prep work for the next patch.
Aside: I wonder whether we shouldn't just move this entire xarray business into the scheduler so that not everyone has to reinvent the same wheels. Cc'ing some scheduler people for this too.
Quoted 12 lines
Cc "Christian König" <[email protected]>Cc Luben Tuikov <[email protected]>Cc Alex Deucher <[email protected]>Cc Lee Jones <[email protected]>Cc Steven Price <[email protected]>Cc Rob Herring <[email protected]>Cc Tomeu Vizoso <[email protected]>Cc Alyssa Rosenzweig <[email protected]>Cc Sumit Semwal <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Quoted 1 line
Two comments below, but otherwise looks like a nice cleanup.
Thanks for taking a look.
Quoted 132 lines
Quoted 132 lines
--- drivers/gpu/drm/panfrost/panfrost_drv.c | 41 ++++++++--------- drivers/gpu/drm/panfrost/panfrost_job.c | 61 ++++++++++--------------- drivers/gpu/drm/panfrost/panfrost_job.h | 8 ++-- 3 files changed, 46 insertions(+), 64 deletions(-)drivers/gpu/drm/panfrost/panfrost_drv.c +18
-23@@ -137,12 +137,6 @@ panfrost_lookup_bos(struct drm_device *dev,if (!job->bo_count)return 0 ; - job->implicit_fences =kvmalloc_array (job->bo_count, -sizeof (struct dma_fence *), -GFP_KERNEL | __GFP_ZERO); -if (!job->implicit_fences) -return -ENOMEM ; - ret =drm_gem_objects_lookup (file_priv, (void __user *)(uintptr_t )args->bo_handles, job->bo_count, &job->bos);@@ -173,7 +167,7 @@ panfrost_lookup_bos(struct drm_device *dev, }/** -* panfrost_copy_in_sync() - Sets up job->in_fences[] with the sync objects +* panfrost_copy_in_sync() - Sets up job->deps with the sync objects * referenced by the job. * @dev: DRM device * @file_priv: DRM file for this fd @@ -193,22 +187,14 @@ panfrost_copy_in_sync(struct drm_device *dev, {u32 *handles;int ret =0 ; -int i; +int i, in_fence_count; - job->in_fence_count = args->in_sync_count; + in_fence_count = args->in_sync_count; -if (!job->in_fence_count) +if (!in_fence_count)return 0 ; - job->in_fences =kvmalloc_array (job->in_fence_count, -sizeof (struct dma_fence *), -GFP_KERNEL | __GFP_ZERO); -if (!job->in_fences) { -DRM_DEBUG ("Failed to allocate job in fences\n" ); -return -ENOMEM ; - } - - handles =kvmalloc_array (job->in_fence_count,sizeof (u32),GFP_KERNEL ); + handles =kvmalloc_array (in_fence_count,sizeof (u32),GFP_KERNEL );if (!handles) { ret = -ENOMEM ;DRM_DEBUG ("Failed to allocate incoming syncobj handles\n" );@@ -217,16 +203,23 @@ panfrost_copy_in_sync(struct drm_device *dev,if (copy_from_user (handles, (void __user *)(uintptr_t )args->in_syncs, - job->in_fence_count *sizeof (u32))) { + in_fence_count *sizeof (u32))) { ret = -EFAULT ;DRM_DEBUG ("Failed to copy in syncobj handles\n" ); goto fail; } -for (i =0 ; i < job->in_fence_count; i++) { +for (i =0 ; i < in_fence_count; i++) { +struct dma_fence *fence; + ret =drm_syncobj_find_fence (file_priv, handles[i],0 ,0 , - &job->in_fences[i]); -if (ret == -EINVAL ) + &fence); +if (ret) + goto fail; + + ret =drm_gem_fence_array_add (&job->deps, fence); + +if (ret) goto fail; }@@ -264,6 +257,8 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,kref_init (&job->refcount); +xa_init_flags (&job->deps,XA_FLAGS_ALLOC ); + job->pfdev = pfdev; job->jc = args->jc; job->requirements = args->requirements;drivers/gpu/drm/panfrost/panfrost_job.c +13
-6@@ -196,14 +196,21 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js)job_write (pfdev,JS_COMMAND_NEXT (js),JS_COMMAND_START ); } -static void panfrost_acquire_object_fences (struct drm_gem_object **bos, -int bo_count, -struct dma_fence **implicit_fences) +static int panfrost_acquire_object_fences (struct drm_gem_object **bos, +int bo_count, +struct xarray *deps) { -int i; +int i, ret; -for (i =0 ; i < bo_count; i++) - implicit_fences[i] =dma_resv_get_excl_rcu (bos[i]->resv); +for (i =0 ; i < bo_count; i++) { +struct dma_fence *fence =dma_resv_get_excl_rcu (bos[i]->resv); + + ret =drm_gem_fence_array_add (deps, fence); +if (ret) +return ret; + } + +return 0 ; } static void panfrost_attach_object_fences(struct drm_gem_object **bos,@@ -236,8 +243,10 @@ int panfrost_job_push(struct panfrost_job *job)kref_get (&job->refcount);/* put by scheduler job completion */
Quoted 9 lines
drivers/gpu/drm/panfrost/panfrost_job.c int panfrost_job_push(struct panfrost_job *job) · line 249
Quoted 6 lines
drivers/gpu/drm/panfrost/panfrost_job.c +4
-2-panfrost_acquire_object_fences (job->bos, job->bo_count, - job->implicit_fences); + ret =panfrost_acquire_object_fences (job->bos, job->bo_count, + &job->deps); +if (ret) + goto unlock;I think this needs to move above the
kref_get()otherwise we'll leak the job on failure.
Indeed, will fix for the next version.
Quoted 59 lines
Quoted 45 lines
drivers/gpu/drm/panfrost/panfrost_job.c +6
-20drm_sched_entity_push_job (&job->base, entity);@@ -254,18 +263,15 @@ static void panfrost_job_cleanup(struct kref *ref) { struct panfrost_job *job = container_of(ref, struct panfrost_job, refcount); +struct dma_fence *fence; +unsigned long index;unsigned int i; -if (job->in_fences) { -for (i =0 ; i < job->in_fence_count; i++) -dma_fence_put (job->in_fences[i]); -kvfree (job->in_fences); - } -if (job->implicit_fences) { -for (i =0 ; i < job->bo_count; i++) -dma_fence_put (job->implicit_fences[i]); -kvfree (job->implicit_fences); +xa_for_each (&job->deps, index, fence) { +dma_fence_put (fence); } +xa_destroy (&job->deps); +dma_fence_put (job->done_fence);dma_fence_put (job->render_done_fence);@@ -308,26 +314,9 @@ static struct dma_fence *panfrost_job_dependency(struct drm_sched_job *sched_job struct drm_sched_entity *s_entity) {struct panfrost_job *job =to_panfrost_job (sched_job); -struct dma_fence *fence; -unsigned int i; -/* Explicit fences */ -for (i =0 ; i < job->in_fence_count; i++) { -if (job->in_fences[i]) { - fence = job->in_fences[i]; - job->in_fences[i] =NULL ; -return fence; - } - } -drivers/gpu/drm/panfrost/panfrost_job.c static struct dma_fence *panfrost_job_dependency(struct drm_sched_job *sched_job · line 319
Quoted 10 lines
drivers/gpu/drm/panfrost/panfrost_job.c +2
-8-/* Implicit fences, max. one per BO */ -for (i =0 ; i < job->bo_count; i++) { -if (job->implicit_fences[i]) { - fence = job->implicit_fences[i]; - job->implicit_fences[i] =NULL ; -return fence; - } - } +if (!xa_empty (&job->deps)) +return xa_erase (&job->deps, job->last_dep++);Rather than tracking
last_depseparately this could be written usingxa_find():
Quoted 2 lines
if (xa_find(&job->deps, &i, ULONG_MAX, XA_PRESENT)) return xa_erase(&job->deps, &i);
I copypasted this from other drivers, imo consistency is better than looking pretty. I think eventually we should stuff this as optional helpers into drm/scheduler.
Also yours walks the xa twice.
-Daniel
Quoted 34 lines
Steve
Quoted 30 lines
drivers/gpu/drm/panfrost/panfrost_job.c +0
-0return NULL ; }drivers/gpu/drm/panfrost/panfrost_job.h +3
-5@@ -19,9 +19,9 @@ struct panfrost_job {struct panfrost_device *pfdev;struct panfrost_file_priv *file_priv; -/* Optional fences userspace can pass in for the job to depend on. */ -struct dma_fence **in_fences; -u32 in_fence_count; +/* Contains both explicit and implicit fences */ +struct xarray deps; +unsigned long last_dep;/* Fence to be signaled by IRQ handler when the job is complete. */ struct dma_fence *done_fence;@@ -30,8 +30,6 @@ struct panfrost_job {__u32 requirements;__u32 flush_id; -/* Exclusive fences we have taken from the BOs to wait for */ -struct dma_fence **implicit_fences;struct panfrost_gem_mapping **mappings;struct drm_gem_object **bos;u32 bo_count;
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Steven Price
maintainerRe: [PATCH 03/11] drm/panfrost: Use xarray and helpers for depedency tracking
Quoted 2 lines · Daniel Vetter
Quoted 1 line · Steven Price
On 21/05/2021 10:09, Daniel Vetter wrote:
[...]
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/panfrost/panfrost_job.c static struct dma_fence *panfrost_job_dependency(struct drm_sched_job *sched_job · line 319
Quoted 2 lines
drivers/gpu/drm/panfrost/panfrost_job.c +2
-0+if (!xa_empty (&job->deps)) +return xa_erase (&job->deps, job->last_dep++);Rather than tracking
last_depseparately this could be written usingxa_find():
Quoted 8 lines
Quoted 2 lines
if (xa_find(&job->deps, &i, ULONG_MAX, XA_PRESENT)) return xa_erase(&job->deps, &i);I copypasted this from other drivers, imo consistency is better than looking pretty. I think eventually we should stuff this as optional helpers into drm/scheduler.
Also yours walks the xa twice.
Agreed this isn't as efficient (I was somewhat disappointed xarray doesn't expose a "get and remove the first element" API). Moving this into drm/scheduler seems like the right long term solution - so matching other drivers first is a good move.
Thanks,
Steve