mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 13:22:55 +07:00
eceae14724
There has been a TODO waiting for quite a long time in drm_dp_mst_topology.c: /* We cannot rely on port->vcpi.num_slots to update * topology_state->avail_slots as the port may not exist if the parent * branch device was unplugged. This should be fixed by tracking * per-port slot allocation in drm_dp_mst_topology_state instead of * depending on the caller to tell us how many slots to release. */ That's not the only reason we should fix this: forcing the driver to track the VCPI allocations throughout a state's atomic check is error prone, because it means that extra care has to be taken with the order that drm_dp_atomic_find_vcpi_slots() and drm_dp_atomic_release_vcpi_slots() are called in in order to ensure idempotency. Currently the only driver actually using these helpers, i915, doesn't even do this correctly: multiple ->best_encoder() checks with i915's current implementation would not be idempotent and would over-allocate VCPI slots, something I learned trying to implement fallback retraining in MST. So: simplify this whole mess, and teach drm_dp_atomic_find_vcpi_slots() and drm_dp_atomic_release_vcpi_slots() to track the VCPI allocations for each port. This allows us to ensure idempotency without having to rely on the driver as much. Additionally: the driver doesn't need to do any kind of VCPI slot tracking anymore if it doesn't need it for it's own internal state. Additionally; this adds a new drm_dp_mst_atomic_check() helper which must be used by atomic drivers to perform validity checks for the new VCPI allocations incurred by a state. Also: update the documentation and make it more obvious that these /must/ be called by /all/ atomic drivers supporting MST. Changes since v9: * Add some missing changes that were requested by danvet that I forgot about after I redid all of the kref stuff: * Remove unnecessary state changes in intel_dp_mst_atomic_check * Cleanup atomic check logic for VCPI allocations - all we need to check in compute_config is whether or not this state disables a CRTC, then free VCPI based off that Changes since v8: * Fix compile errors, whoops! Changes since v7: - Don't check for mixed stale/valid VCPI allocations, just rely on connector registration to stop such erroneous modesets Changes since v6: - Keep a kref to all of the ports we have allocations on. This required a good bit of changing to when we call drm_dp_find_vcpi_slots(), mainly that we need to ensure that we only redo VCPI allocations on actual mode or CRTC changes, not crtc_state->active changes. Additionally, we no longer take the registration of the DRM connector for each port into account because so long as we have a kref to the port in the new or previous atomic state, the connector will stay registered. - Use the small changes to drm_dp_put_port() to add even more error checking to make misusage of the helpers more obvious. I added this after having to chase down various use-after-free conditions that started popping up from the new helpers so no one else has to troubleshoot that. - Move some accidental DRM_DEBUG_KMS() calls to DRM_DEBUG_ATOMIC() - Update documentation again, note that find/release() should both not be called on the same port in a single atomic check phase (but multiple calls to one or the other is OK) Changes since v4: - Don't skip the atomic checks for VCPI allocations if no new VCPI allocations happen in a state. This makes the next change I'm about to list here a lot easier to implement. - Don't ignore VCPI allocations on destroyed ports, instead ensure that when ports are destroyed and still have VCPI allocations in the topology state, the only state changes allowed are releasing said ports' VCPI. This prevents a state with a mix of VCPI allocations from destroyed ports, and allocations from valid ports. Changes since v3: - Don't release VCPI allocations in the topology state immediately in drm_dp_atomic_release_vcpi_slots(), instead mark them as 0 and skip over them in drm_dp_mst_duplicate_state(). This makes it so drm_dp_atomic_release_vcpi_slots() is still idempotent while also throwing warnings if the driver messes up it's book keeping and tries to release VCPI slots on a port that doesn't have any pre-existing VCPI allocation - danvet - Change mst_state/state in some debugging messages to "mst state" Changes since v2: - Use kmemdup() for duplicating MST state - danvet - Move port validation out of duplicate state callback - danvet - Handle looping through MST topology states in drm_dp_mst_atomic_check() so the driver doesn't have to do it - Fix documentation in drm_dp_atomic_find_vcpi_slots() - Move the atomic check for each individual topology state into it's own function, reduces indenting - Don't consider "stale" MST ports when calculating the bandwidth requirements. This is needed because originally we relied on the state duplication functions to prune any stale ports from the new state, which would prevent us from incorrectly considering their bandwidth requirements alongside legitimate new payloads. - Add function references in drm_dp_atomic_release_vcpi_slots() - danvet - Annotate atomic VCPI and atomic check functions with __must_check - danvet Changes since v1: - Don't use the now-removed ->atomic_check() for private objects hook, just give drivers a function to call themselves Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Cc: David Airlie <airlied@redhat.com> Cc: Jerry Zuo <Jerry.Zuo@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Juston Li <juston.li@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190111005343.17443-19-lyude@redhat.com |
||
---|---|---|
.. | ||
gvt | ||
selftests | ||
dvo_ch7xxx.c | ||
dvo_ch7017.c | ||
dvo_ivch.c | ||
dvo_ns2501.c | ||
dvo_sil164.c | ||
dvo_tfp410.c | ||
dvo.h | ||
i915_cmd_parser.c | ||
i915_debugfs.c | ||
i915_drv.c | ||
i915_drv.h | ||
i915_fixed.h | ||
i915_gem_batch_pool.c | ||
i915_gem_batch_pool.h | ||
i915_gem_clflush.c | ||
i915_gem_clflush.h | ||
i915_gem_context.c | ||
i915_gem_context.h | ||
i915_gem_dmabuf.c | ||
i915_gem_evict.c | ||
i915_gem_execbuffer.c | ||
i915_gem_fence_reg.c | ||
i915_gem_fence_reg.h | ||
i915_gem_gtt.c | ||
i915_gem_gtt.h | ||
i915_gem_internal.c | ||
i915_gem_object.c | ||
i915_gem_object.h | ||
i915_gem_render_state.c | ||
i915_gem_render_state.h | ||
i915_gem_shrinker.c | ||
i915_gem_stolen.c | ||
i915_gem_tiling.c | ||
i915_gem_userptr.c | ||
i915_gem.c | ||
i915_gem.h | ||
i915_gemfs.c | ||
i915_gemfs.h | ||
i915_gpu_error.c | ||
i915_gpu_error.h | ||
i915_ioc32.c | ||
i915_irq.c | ||
i915_memcpy.c | ||
i915_mm.c | ||
i915_oa_bdw.c | ||
i915_oa_bdw.h | ||
i915_oa_bxt.c | ||
i915_oa_bxt.h | ||
i915_oa_cflgt2.c | ||
i915_oa_cflgt2.h | ||
i915_oa_cflgt3.c | ||
i915_oa_cflgt3.h | ||
i915_oa_chv.c | ||
i915_oa_chv.h | ||
i915_oa_cnl.c | ||
i915_oa_cnl.h | ||
i915_oa_glk.c | ||
i915_oa_glk.h | ||
i915_oa_hsw.c | ||
i915_oa_hsw.h | ||
i915_oa_icl.c | ||
i915_oa_icl.h | ||
i915_oa_kblgt2.c | ||
i915_oa_kblgt2.h | ||
i915_oa_kblgt3.c | ||
i915_oa_kblgt3.h | ||
i915_oa_sklgt2.c | ||
i915_oa_sklgt2.h | ||
i915_oa_sklgt3.c | ||
i915_oa_sklgt3.h | ||
i915_oa_sklgt4.c | ||
i915_oa_sklgt4.h | ||
i915_params.c | ||
i915_params.h | ||
i915_pci.c | ||
i915_perf.c | ||
i915_pmu.c | ||
i915_pmu.h | ||
i915_pvinfo.h | ||
i915_query.c | ||
i915_query.h | ||
i915_reg.h | ||
i915_request.c | ||
i915_request.h | ||
i915_scheduler.c | ||
i915_scheduler.h | ||
i915_selftest.h | ||
i915_suspend.c | ||
i915_sw_fence.c | ||
i915_sw_fence.h | ||
i915_syncmap.c | ||
i915_syncmap.h | ||
i915_sysfs.c | ||
i915_timeline.c | ||
i915_timeline.h | ||
i915_trace_points.c | ||
i915_trace.h | ||
i915_utils.h | ||
i915_vgpu.c | ||
i915_vgpu.h | ||
i915_vma.c | ||
i915_vma.h | ||
icl_dsi.c | ||
intel_acpi.c | ||
intel_atomic_plane.c | ||
intel_atomic.c | ||
intel_audio.c | ||
intel_bios.c | ||
intel_bios.h | ||
intel_breadcrumbs.c | ||
intel_cdclk.c | ||
intel_color.c | ||
intel_combo_phy.c | ||
intel_connector.c | ||
intel_crt.c | ||
intel_csr.c | ||
intel_ddi.c | ||
intel_device_info.c | ||
intel_device_info.h | ||
intel_display.c | ||
intel_display.h | ||
intel_dp_aux_backlight.c | ||
intel_dp_link_training.c | ||
intel_dp_mst.c | ||
intel_dp.c | ||
intel_dpio_phy.c | ||
intel_dpll_mgr.c | ||
intel_dpll_mgr.h | ||
intel_drv.h | ||
intel_dsi_dcs_backlight.c | ||
intel_dsi_vbt.c | ||
intel_dsi.c | ||
intel_dsi.h | ||
intel_dvo.c | ||
intel_engine_cs.c | ||
intel_fbc.c | ||
intel_fbdev.c | ||
intel_fifo_underrun.c | ||
intel_frontbuffer.c | ||
intel_frontbuffer.h | ||
intel_gpu_commands.h | ||
intel_guc_ads.c | ||
intel_guc_ads.h | ||
intel_guc_ct.c | ||
intel_guc_ct.h | ||
intel_guc_fw.c | ||
intel_guc_fw.h | ||
intel_guc_fwif.h | ||
intel_guc_log.c | ||
intel_guc_log.h | ||
intel_guc_reg.h | ||
intel_guc_submission.c | ||
intel_guc_submission.h | ||
intel_guc.c | ||
intel_guc.h | ||
intel_gvt.c | ||
intel_gvt.h | ||
intel_hangcheck.c | ||
intel_hdcp.c | ||
intel_hdmi.c | ||
intel_hotplug.c | ||
intel_huc_fw.c | ||
intel_huc_fw.h | ||
intel_huc.c | ||
intel_huc.h | ||
intel_i2c.c | ||
intel_lpe_audio.c | ||
intel_lrc_reg.h | ||
intel_lrc.c | ||
intel_lrc.h | ||
intel_lspcon.c | ||
intel_lvds.c | ||
intel_mocs.c | ||
intel_mocs.h | ||
intel_opregion.c | ||
intel_opregion.h | ||
intel_overlay.c | ||
intel_panel.c | ||
intel_pipe_crc.c | ||
intel_pm.c | ||
intel_psr.c | ||
intel_quirks.c | ||
intel_renderstate_gen6.c | ||
intel_renderstate_gen7.c | ||
intel_renderstate_gen8.c | ||
intel_renderstate_gen9.c | ||
intel_renderstate.h | ||
intel_ringbuffer.c | ||
intel_ringbuffer.h | ||
intel_runtime_pm.c | ||
intel_sdvo_regs.h | ||
intel_sdvo.c | ||
intel_sideband.c | ||
intel_sprite.c | ||
intel_tv.c | ||
intel_uc_fw.c | ||
intel_uc_fw.h | ||
intel_uc.c | ||
intel_uc.h | ||
intel_uncore.c | ||
intel_uncore.h | ||
intel_vbt_defs.h | ||
intel_wopcm.c | ||
intel_wopcm.h | ||
intel_workarounds.c | ||
intel_workarounds.h | ||
Kconfig | ||
Kconfig.debug | ||
Makefile | ||
vlv_dsi_pll.c | ||
vlv_dsi.c |