freenode
Desktop & Graphics

MSM DRM gains msm_display interface to untangle backends

A 24-patch series replaces type-specific DSI, DP, and HDMI helpers and cached connectors with a shared callback interface and common connector setup.

Dmitry Baryshkov has posted a 24-patch series that refactors Qualcomm's MSM KMS driver around a new shared display interface for its DSI, DisplayPort, and HDMI sub-blocks.

The MSM stack had grown tightly coupled. The KMS core and its DPU, MDP5, and MDP4 backends reached into concrete DSI, DP, and HDMI code through type-specific helpers and interface-type switches. Connector creation was open-coded in each backend and sub-block. Bonded-DSI dispatch was duplicated three times with subtle variations. In the other direction, sub-blocks cached connector pointers they did not own, so the core had to hand those pointers back down the stack.

The series embeds a small msm_display interface in each sub-block and folds the cross-module work into it one callback at a time: modeset init, snapshot, and queries for wide bus, command mode, DSC, tear-check source, peripheral flush, bonding, and encoder state. Once those paths go through the interface, the KMS core can store sub-blocks as msm_display pointers and drop the concrete accessors.

Connector creation moves into common code. Each backend only builds its encoder and attaches the bridge chain; a shared helper then walks the encoders and creates a bridge connector for each, skipping virtual writeback encoders that bring their own. The last DisplayPort-specific step, attaching the DP subconnector property, is generalized into the core bridge-connector helper so any DisplayPort bridge connector gets it, not only the MSM path. Two patches from Yongxing Mou are folded in along the way.

The work is internal plumbing, but it cuts duplication and layering violations that every extension of Qualcomm display support has had to navigate.