drm/amdkfd: add debug wave launch override operation
[linux-2.6-microblaze.git] / drivers / gpu / drm / drm_atomic.c
index 5457c02..b4c6ffc 100644 (file)
@@ -984,6 +984,66 @@ drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state,
 }
 EXPORT_SYMBOL(drm_atomic_get_new_connector_for_encoder);
 
+/**
+ * drm_atomic_get_old_crtc_for_encoder - Get old crtc for an encoder
+ * @state: Atomic state
+ * @encoder: The encoder to fetch the crtc state for
+ *
+ * This function finds and returns the crtc that was connected to @encoder
+ * as specified by the @state.
+ *
+ * Returns: The old crtc connected to @encoder, or NULL if the encoder is
+ * not connected.
+ */
+struct drm_crtc *
+drm_atomic_get_old_crtc_for_encoder(struct drm_atomic_state *state,
+                                   struct drm_encoder *encoder)
+{
+       struct drm_connector *connector;
+       struct drm_connector_state *conn_state;
+
+       connector = drm_atomic_get_old_connector_for_encoder(state, encoder);
+       if (!connector)
+               return NULL;
+
+       conn_state = drm_atomic_get_old_connector_state(state, connector);
+       if (!conn_state)
+               return NULL;
+
+       return conn_state->crtc;
+}
+EXPORT_SYMBOL(drm_atomic_get_old_crtc_for_encoder);
+
+/**
+ * drm_atomic_get_new_crtc_for_encoder - Get new crtc for an encoder
+ * @state: Atomic state
+ * @encoder: The encoder to fetch the crtc state for
+ *
+ * This function finds and returns the crtc that will be connected to @encoder
+ * as specified by the @state.
+ *
+ * Returns: The new crtc connected to @encoder, or NULL if the encoder is
+ * not connected.
+ */
+struct drm_crtc *
+drm_atomic_get_new_crtc_for_encoder(struct drm_atomic_state *state,
+                                   struct drm_encoder *encoder)
+{
+       struct drm_connector *connector;
+       struct drm_connector_state *conn_state;
+
+       connector = drm_atomic_get_new_connector_for_encoder(state, encoder);
+       if (!connector)
+               return NULL;
+
+       conn_state = drm_atomic_get_new_connector_state(state, connector);
+       if (!conn_state)
+               return NULL;
+
+       return conn_state->crtc;
+}
+EXPORT_SYMBOL(drm_atomic_get_new_crtc_for_encoder);
+
 /**
  * drm_atomic_get_connector_state - get connector state
  * @state: global atomic state object
@@ -1070,6 +1130,7 @@ static void drm_atomic_connector_print_state(struct drm_printer *p,
        drm_printf(p, "connector[%u]: %s\n", connector->base.id, connector->name);
        drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)");
        drm_printf(p, "\tself_refresh_aware=%d\n", state->self_refresh_aware);
+       drm_printf(p, "\tmax_requested_bpc=%d\n", state->max_requested_bpc);
 
        if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)
                if (state->writeback_job && state->writeback_job->fb)