Commit eee0912a authored by Jessica Zhang's avatar Jessica Zhang Committed by Dmitry Baryshkov
Browse files

drm: add clone mode check for CRTC



Add a common helper to check if the given CRTC state is in clone mode.
This can be used by drivers to help detect if a CRTC is being shared by
multiple encoders

Signed-off-by: default avatarJessica Zhang <quic_jesszhan@quicinc.com>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: default avatarMaxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241216-concurrent-wb-v4-1-fe220297a7f0@quicinc.com


Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent 73d934d7
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -939,3 +939,23 @@ int drm_crtc_create_scaling_filter_property(struct drm_crtc *crtc,
	return 0;
}
EXPORT_SYMBOL(drm_crtc_create_scaling_filter_property);

/**
 * drm_crtc_in_clone_mode - check if the given CRTC state is in clone mode
 *
 * @crtc_state: CRTC state to check
 *
 * This function determines if the given CRTC state is being cloned by multiple
 * encoders.
 *
 * RETURNS:
 * True if the CRTC state is in clone mode. False otherwise
 */
bool drm_crtc_in_clone_mode(struct drm_crtc_state *crtc_state)
{
	if (!crtc_state)
		return false;

	return hweight32(crtc_state->encoder_mask) > 1;
}
EXPORT_SYMBOL(drm_crtc_in_clone_mode);
+1 −1
Original line number Diff line number Diff line
@@ -1323,5 +1323,5 @@ static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,

int drm_crtc_create_scaling_filter_property(struct drm_crtc *crtc,
					    unsigned int supported_filters);

bool drm_crtc_in_clone_mode(struct drm_crtc_state *crtc_state);
#endif /* __DRM_CRTC_H__ */