summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_encoder.c
AgeCommit message (Collapse)AuthorFilesLines
2025-08-12drm/i915/display: add intel_dig_port_alloc()Jani Nikula1-0/+18
Add a common allocator function for struct intel_digital_port, with some member default initialization to deduplicate them from everywhere else. This is similar to intel_connector_alloc(). At least for now, place this in intel_encoder.[ch]. We don't have a dedicated file for dig port stuff, and there wouldn't be much to add there anyway. A digital port is a sort of subclass of encoder, so the location isn't far off the mark. Reviewed-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com> Link: https://lore.kernel.org/r/4d2da1a40698f85014140f586405b19795437e81.1753787803.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-08-04drm/{i915,xe}/display: Block hpd during suspendDibin Moolakadan Subrahmanian1-0/+23
It has been observed that during `xe_display_pm_suspend()` execution, an HPD interrupt can still be triggered, resulting in `dig_port_work` being scheduled. The issue arises when this work executes after `xe_display_pm_suspend_late()`, by which time the display is fully suspended. This can lead to errors such as "DC state mismatch", as the dig_port work accesses display resources that are no longer available or powered. To address this, introduce 'intel_encoder_block_all_hpds' and 'intel_encoder_unblock_all_hpds' functions, which iterate over all encoders and block/unblock HPD respectively. These are used to: - Block HPD IRQs before calling 'intel_hpd_cancel_work' in suspend and shutdown - Unblock HPD IRQs after 'intel_hpd_init' in resume This will prevent 'dig_port_work' being scheduled during display suspend. Continuation of previous patch discussion: https://patchwork.freedesktop.org/patch/663964/ Changes in v2: - Add 'intel_encoder_block_all_hpds' to 'xe_display_pm_shutdown'.(Imre Deak) - Add 'intel_hpd_cancel_work' to 'xe_display_fini_early' to cancel any HPD pending work at late driver removal. (Imre Deak) Changes in v3: - Move 'intel_encoder_block_all_hpds' after intel_dp_mst_suspend in 'xe_display_pm_shutdown'.(Imre Deak) Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://lore.kernel.org/r/20250724083928.2298199-1-dibin.moolakadan.subrahmanian@intel.com
2025-07-01drm/i915/display: drop a number of dependencies on i915_drv.hJani Nikula1-2/+1
With the switch to an unordered workqueue dedicated to display, we've stopped using struct drm_i915_private in a number of places, and can drop the dependencies on i915_drv.h. Cc: Luca Coelho <luciano.coelho@intel.com> Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://lore.kernel.org/r/20250626101636.1896365-1-jani.nikula@intel.com
2025-06-26drm/i915/display: move unordered works to new private workqueueLuca Coelho1-2/+2
Create a new unordered workqueue to be used by the display code instead of relying on the i915 one. Then move all the unordered works used in the display code to use this new queue. Since this is an unordered workqueue, by definition there can't be any order dependency with non-display works, so no extra care is needed in regard to that. This is part of the effort to isolate the display code from i915. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: https://lore.kernel.org/r/20250620091632.1256135-1-luciano.coelho@intel.com Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2025-05-27drm/i915: stop including display/intel_display_{core, limits}.h from i915_drv.hJani Nikula1-1/+1
Make i915->display pointer opaque to most of core i915 driver. Lots of places now need explicit include of intel_display_core.h, or a more specific header. With this dependency broken, changes in display should cause radically less recompilation of i915. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://lore.kernel.org/r/b381b59acb7e4f600e0282935a68aedf77768109.1747907216.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2024-06-20drm/i915: Pass intel_display to the encoder suspend/shutdown helpersImre Deak1-12/+12
Pass intel_display to the encoder suspend/shutdown helpers instead of drm_i915_private for better isolation. v2: Pass intel_display to HAS_DISPLAY() as well, update commit log accordingly. (Jani) Cc: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> # v1 Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240618125255.4080303-2-imre.deak@intel.com
2024-06-20drm/i915: Move encoder suspend/shutdown helpers to intel_encoder.cImre Deak1-0/+44
Move the encoder suspend/shutdown helpers to intel_encoder.c, this being the logical place for encoder functions. This also allows sharing the above helpers with the xe driver, done in a follow-up patch. While at it rename the functions using the usual intel_encoder prefix and in the functions rename the dev_priv parameter to i915. v2: Remove extra w/s in the include section. (Jani) Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> # v1 Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240618125255.4080303-1-imre.deak@intel.com
2024-06-13drm/i915/dp: Recheck link state after modesetImre Deak1-0/+39
Recheck the link state after a passing link training, with a 2 sec delay to account for cases where the link goes bad following the link training and the sink doesn't report this via an HPD IRQ. The delayed work added here will be also used by a later patch after a failed link training to try to retrain the link with unchanged link params before reducing the link params. v2: Don't flush an uninitialized delayed work (on HDMI-only DDI ports). v3: - Move the helpers to a new intel_encoder.c file, rename them accordingly. (Ville) - Add the work to intel_encoder instead of intel_digital_port. - Call the encoder specific link check function via an encoder hook. - Flush the link check work during encoder destroy from intel_dp_encoder_flush_work(). - Flush the link check work during encoder suspend as well. v4: Call intel_encoder_link_check_init() with a valid encoder pointer. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240610181428.2955658-1-imre.deak@intel.com