Skip to content

Commit 9ffdb67

Browse files
committed
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 <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: [email protected] # 6.1 Cc: [email protected] Reviewed-by: Ville Syrjälä <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Acked-by: Lyude Paul <[email protected]> Acked-by: Daniel Vetter <[email protected]> Acked-by: Wayne Lin <[email protected]> Acked-by: Jani Nikula <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e761cc2 commit 9ffdb67

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

drivers/gpu/drm/display/drm_dp_mst_topology.c

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5364,28 +5364,53 @@ struct drm_dp_mst_topology_state *drm_atomic_get_mst_topology_state(struct drm_a
53645364
}
53655365
EXPORT_SYMBOL(drm_atomic_get_mst_topology_state);
53665366

5367+
/**
5368+
* drm_atomic_get_old_mst_topology_state: get old MST topology state in atomic state, if any
5369+
* @state: global atomic state
5370+
* @mgr: MST topology manager, also the private object in this case
5371+
*
5372+
* This function wraps drm_atomic_get_old_private_obj_state() passing in the MST atomic
5373+
* state vtable so that the private object state returned is that of a MST
5374+
* topology object.
5375+
*
5376+
* Returns:
5377+
*
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+
53675392
/**
53685393
* drm_atomic_get_new_mst_topology_state: get new MST topology state in atomic state, if any
53695394
* @state: global atomic state
53705395
* @mgr: MST topology manager, also the private object in this case
53715396
*
5372-
* This function wraps drm_atomic_get_priv_obj_state() passing in the MST atomic
5397+
* This function wraps drm_atomic_get_new_private_obj_state() passing in the MST atomic
53735398
* state vtable so that the private object state returned is that of a MST
53745399
* topology object.
53755400
*
53765401
* Returns:
53775402
*
5378-
* The MST topology state, or NULL if there's no topology state for this MST mgr
5403+
* The new MST topology state, or NULL if there's no topology state for this MST mgr
53795404
* in the global atomic state
53805405
*/
53815406
struct drm_dp_mst_topology_state *
53825407
drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state,
53835408
struct drm_dp_mst_topology_mgr *mgr)
53845409
{
5385-
struct drm_private_state *priv_state =
5410+
struct drm_private_state *new_priv_state =
53865411
drm_atomic_get_new_private_obj_state(state, &mgr->base);
53875412

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;
53895414
}
53905415
EXPORT_SYMBOL(drm_atomic_get_new_mst_topology_state);
53915416

include/drm/display/drm_dp_mst_helper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,9 @@ struct drm_dp_mst_topology_state *
868868
drm_atomic_get_mst_topology_state(struct drm_atomic_state *state,
869869
struct drm_dp_mst_topology_mgr *mgr);
870870
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 *
871874
drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state,
872875
struct drm_dp_mst_topology_mgr *mgr);
873876
struct drm_dp_mst_atomic_payload *

0 commit comments

Comments
 (0)