mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
drm: add helper functions to retrieve old and new crtc
Add new helper functions, drm_atomic_get_old_crtc_for_encoder and drm_atomic_get_new_crtc_for_encoder to retrieve the corresponding crtc for the encoder. Signed-off-by: Sankeerth Billakanti <quic_sbillaka@quicinc.com> Signed-off-by: Vinod Polimera <quic_vpolimer@quicinc.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Patchwork: https://patchwork.freedesktop.org/patch/524718/ Link: https://lore.kernel.org/r/1677774797-31063-2-git-send-email-quic_vpolimer@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
committed by
Dmitry Baryshkov
parent
dbd7a2a941
commit
7b9a9e35e4
@@ -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);
|
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
|
* drm_atomic_get_connector_state - get connector state
|
||||||
* @state: global atomic state object
|
* @state: global atomic state object
|
||||||
|
|||||||
@@ -528,6 +528,13 @@ struct drm_connector *
|
|||||||
drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state,
|
drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state,
|
||||||
struct drm_encoder *encoder);
|
struct drm_encoder *encoder);
|
||||||
|
|
||||||
|
struct drm_crtc *
|
||||||
|
drm_atomic_get_old_crtc_for_encoder(struct drm_atomic_state *state,
|
||||||
|
struct drm_encoder *encoder);
|
||||||
|
struct drm_crtc *
|
||||||
|
drm_atomic_get_new_crtc_for_encoder(struct drm_atomic_state *state,
|
||||||
|
struct drm_encoder *encoder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_atomic_get_existing_crtc_state - get CRTC state, if it exists
|
* drm_atomic_get_existing_crtc_state - get CRTC state, if it exists
|
||||||
* @state: global atomic state object
|
* @state: global atomic state object
|
||||||
|
|||||||
Reference in New Issue
Block a user