drm/display/dp_mst: Add drm_atomic_get_old_mst_topology_state()
authorjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 07:28:37 +0000 (07:28 +0000)
committerjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 07:28:37 +0000 (07:28 +0000)
From Imre Deak
6130b22fb677430af8fe4a2ac4fbf2f5b8572d12 in linux-6.1.y/6.1.18
9ffdb67af0ee625ae127711845532f670cc6a4e7 in mainline linux

sys/dev/pci/drm/display/drm_dp_mst_topology.c
sys/dev/pci/drm/include/drm/display/drm_dp_mst_helper.h

index ef500fa..3d4c084 100644 (file)
@@ -5364,28 +5364,53 @@ struct drm_dp_mst_topology_state *drm_atomic_get_mst_topology_state(struct drm_a
 }
 EXPORT_SYMBOL(drm_atomic_get_mst_topology_state);
 
+/**
+ * drm_atomic_get_old_mst_topology_state: get old MST topology state in atomic state, if any
+ * @state: global atomic state
+ * @mgr: MST topology manager, also the private object in this case
+ *
+ * This function wraps drm_atomic_get_old_private_obj_state() passing in the MST atomic
+ * state vtable so that the private object state returned is that of a MST
+ * topology object.
+ *
+ * Returns:
+ *
+ * The old MST topology state, or NULL if there's no topology state for this MST mgr
+ * in the global atomic state
+ */
+struct drm_dp_mst_topology_state *
+drm_atomic_get_old_mst_topology_state(struct drm_atomic_state *state,
+                                     struct drm_dp_mst_topology_mgr *mgr)
+{
+       struct drm_private_state *old_priv_state =
+               drm_atomic_get_old_private_obj_state(state, &mgr->base);
+
+       return old_priv_state ? to_dp_mst_topology_state(old_priv_state) : NULL;
+}
+EXPORT_SYMBOL(drm_atomic_get_old_mst_topology_state);
+
 /**
  * drm_atomic_get_new_mst_topology_state: get new MST topology state in atomic state, if any
  * @state: global atomic state
  * @mgr: MST topology manager, also the private object in this case
  *
- * This function wraps drm_atomic_get_priv_obj_state() passing in the MST atomic
+ * This function wraps drm_atomic_get_new_private_obj_state() passing in the MST atomic
  * state vtable so that the private object state returned is that of a MST
  * topology object.
  *
  * Returns:
  *
- * The MST topology state, or NULL if there's no topology state for this MST mgr
+ * The new MST topology state, or NULL if there's no topology state for this MST mgr
  * in the global atomic state
  */
 struct drm_dp_mst_topology_state *
 drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state,
                                      struct drm_dp_mst_topology_mgr *mgr)
 {
-       struct drm_private_state *priv_state =
+       struct drm_private_state *new_priv_state =
                drm_atomic_get_new_private_obj_state(state, &mgr->base);
 
-       return priv_state ? to_dp_mst_topology_state(priv_state) : NULL;
+       return new_priv_state ? to_dp_mst_topology_state(new_priv_state) : NULL;
 }
 EXPORT_SYMBOL(drm_atomic_get_new_mst_topology_state);
 
index 2cb8b99..bf55728 100644 (file)
@@ -867,6 +867,9 @@ struct drm_dp_mst_topology_state *
 drm_atomic_get_mst_topology_state(struct drm_atomic_state *state,
                                  struct drm_dp_mst_topology_mgr *mgr);
 struct drm_dp_mst_topology_state *
+drm_atomic_get_old_mst_topology_state(struct drm_atomic_state *state,
+                                     struct drm_dp_mst_topology_mgr *mgr);
+struct drm_dp_mst_topology_state *
 drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state,
                                      struct drm_dp_mst_topology_mgr *mgr);
 struct drm_dp_mst_atomic_payload *