Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/display/dp_mst: Add drm_atomic_get_old_mst_topology_state()

Add a function to get the old MST topology state, required by a
follow-up i915 patch.

While at it clarify the code comment of
drm_atomic_get_new_mst_topology_state() and add _new prefix
to the new state pointer to remind about its difference from the old
state.

v2: Use old_/new_ prefixes for the state pointers. (Ville)

Cc: Lyude Paul <lyude@redhat.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: stable@vger.kernel.org # 6.1
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Lyude Paul <lyude@redhat.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230206114856.2665066-3-imre.deak@intel.com

+33 -5
+30 -5
drivers/gpu/drm/display/drm_dp_mst_topology.c
··· 5365 5365 EXPORT_SYMBOL(drm_atomic_get_mst_topology_state); 5366 5366 5367 5367 /** 5368 - * drm_atomic_get_new_mst_topology_state: get new MST topology state in atomic state, if any 5368 + * drm_atomic_get_old_mst_topology_state: get old MST topology state in atomic state, if any 5369 5369 * @state: global atomic state 5370 5370 * @mgr: MST topology manager, also the private object in this case 5371 5371 * 5372 - * This function wraps drm_atomic_get_priv_obj_state() passing in the MST atomic 5372 + * This function wraps drm_atomic_get_old_private_obj_state() passing in the MST atomic 5373 5373 * state vtable so that the private object state returned is that of a MST 5374 5374 * topology object. 5375 5375 * 5376 5376 * Returns: 5377 5377 * 5378 - * The MST topology state, or NULL if there's no topology state for this MST mgr 5378 + * The old MST topology state, or NULL if there's no topology state for this MST mgr 5379 + * in the global atomic state 5380 + */ 5381 + struct drm_dp_mst_topology_state * 5382 + drm_atomic_get_old_mst_topology_state(struct drm_atomic_state *state, 5383 + struct drm_dp_mst_topology_mgr *mgr) 5384 + { 5385 + struct drm_private_state *old_priv_state = 5386 + drm_atomic_get_old_private_obj_state(state, &mgr->base); 5387 + 5388 + return old_priv_state ? to_dp_mst_topology_state(old_priv_state) : NULL; 5389 + } 5390 + EXPORT_SYMBOL(drm_atomic_get_old_mst_topology_state); 5391 + 5392 + /** 5393 + * drm_atomic_get_new_mst_topology_state: get new MST topology state in atomic state, if any 5394 + * @state: global atomic state 5395 + * @mgr: MST topology manager, also the private object in this case 5396 + * 5397 + * This function wraps drm_atomic_get_new_private_obj_state() passing in the MST atomic 5398 + * state vtable so that the private object state returned is that of a MST 5399 + * topology object. 5400 + * 5401 + * Returns: 5402 + * 5403 + * The new MST topology state, or NULL if there's no topology state for this MST mgr 5379 5404 * in the global atomic state 5380 5405 */ 5381 5406 struct drm_dp_mst_topology_state * 5382 5407 drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state, 5383 5408 struct drm_dp_mst_topology_mgr *mgr) 5384 5409 { 5385 - struct drm_private_state *priv_state = 5410 + struct drm_private_state *new_priv_state = 5386 5411 drm_atomic_get_new_private_obj_state(state, &mgr->base); 5387 5412 5388 - return priv_state ? to_dp_mst_topology_state(priv_state) : NULL; 5413 + return new_priv_state ? to_dp_mst_topology_state(new_priv_state) : NULL; 5389 5414 } 5390 5415 EXPORT_SYMBOL(drm_atomic_get_new_mst_topology_state); 5391 5416
+3
include/drm/display/drm_dp_mst_helper.h
··· 868 868 drm_atomic_get_mst_topology_state(struct drm_atomic_state *state, 869 869 struct drm_dp_mst_topology_mgr *mgr); 870 870 struct drm_dp_mst_topology_state * 871 + drm_atomic_get_old_mst_topology_state(struct drm_atomic_state *state, 872 + struct drm_dp_mst_topology_mgr *mgr); 873 + struct drm_dp_mst_topology_state * 871 874 drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state, 872 875 struct drm_dp_mst_topology_mgr *mgr); 873 876 struct drm_dp_mst_atomic_payload *