Commit ee2fcc0f authored by Paloma Arellano's avatar Paloma Arellano Committed by Dmitry Baryshkov

drm/msm/dp: allow YUV420 mode for DP connector when CDM available

All the components of YUV420 over DP are added. Therefore, let's mark the
connector property as true for DP connector when the DP type is not eDP
and when there is a CDM block available.

Changes in v3:
	- Move setting the connector's ycbcr_420_allowed parameter so
	  that it is not dependent on if the dp_display is not eDP

Changes in v2:
	- Check for if dp_catalog has a CDM block available instead of
	  checking if VSC SDP is allowed when setting the dp connector's
	  ycbcr_420_allowed parameter
Signed-off-by: default avatarPaloma Arellano <quic_parellan@quicinc.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/579628/
Link: https://lore.kernel.org/r/20240222194025.25329-20-quic_parellan@quicinc.comSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent 984809d8
...@@ -563,6 +563,7 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, ...@@ -563,6 +563,7 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev,
{ {
struct drm_encoder *encoder = NULL; struct drm_encoder *encoder = NULL;
struct msm_display_info info; struct msm_display_info info;
bool yuv_supported;
int rc; int rc;
int i; int i;
...@@ -581,7 +582,8 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, ...@@ -581,7 +582,8 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev,
return PTR_ERR(encoder); return PTR_ERR(encoder);
} }
rc = msm_dp_modeset_init(priv->dp[i], dev, encoder); yuv_supported = !!dpu_kms->catalog->cdm;
rc = msm_dp_modeset_init(priv->dp[i], dev, encoder, yuv_supported);
if (rc) { if (rc) {
DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc); DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc);
return rc; return rc;
......
...@@ -1426,7 +1426,7 @@ void dp_display_debugfs_init(struct msm_dp *dp_display, struct dentry *root, boo ...@@ -1426,7 +1426,7 @@ void dp_display_debugfs_init(struct msm_dp *dp_display, struct dentry *root, boo
} }
int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev,
struct drm_encoder *encoder) struct drm_encoder *encoder, bool yuv_supported)
{ {
struct dp_display_private *dp_priv; struct dp_display_private *dp_priv;
int ret; int ret;
...@@ -1442,7 +1442,7 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, ...@@ -1442,7 +1442,7 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev,
return ret; return ret;
} }
dp_display->connector = dp_drm_connector_init(dp_display, encoder); dp_display->connector = dp_drm_connector_init(dp_display, encoder, yuv_supported);
if (IS_ERR(dp_display->connector)) { if (IS_ERR(dp_display->connector)) {
ret = PTR_ERR(dp_display->connector); ret = PTR_ERR(dp_display->connector);
DRM_DEV_ERROR(dev->dev, DRM_DEV_ERROR(dev->dev,
......
...@@ -353,7 +353,8 @@ int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, ...@@ -353,7 +353,8 @@ int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev,
} }
/* connector initialization */ /* connector initialization */
struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct drm_encoder *encoder) struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct drm_encoder *encoder,
bool yuv_supported)
{ {
struct drm_connector *connector = NULL; struct drm_connector *connector = NULL;
...@@ -364,6 +365,9 @@ struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct dr ...@@ -364,6 +365,9 @@ struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct dr
if (!dp_display->is_edp) if (!dp_display->is_edp)
drm_connector_attach_dp_subconnector_property(connector); drm_connector_attach_dp_subconnector_property(connector);
if (yuv_supported)
connector->ycbcr_420_allowed = true;
drm_connector_attach_encoder(connector, encoder); drm_connector_attach_encoder(connector, encoder);
return connector; return connector;
......
...@@ -19,7 +19,8 @@ struct msm_dp_bridge { ...@@ -19,7 +19,8 @@ struct msm_dp_bridge {
#define to_dp_bridge(x) container_of((x), struct msm_dp_bridge, bridge) #define to_dp_bridge(x) container_of((x), struct msm_dp_bridge, bridge)
struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct drm_encoder *encoder); struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct drm_encoder *encoder,
bool yuv_supported);
int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev,
struct drm_encoder *encoder); struct drm_encoder *encoder);
......
...@@ -385,7 +385,7 @@ static inline struct drm_dsc_config *msm_dsi_get_dsc_config(struct msm_dsi *msm_ ...@@ -385,7 +385,7 @@ static inline struct drm_dsc_config *msm_dsi_get_dsc_config(struct msm_dsi *msm_
int __init msm_dp_register(void); int __init msm_dp_register(void);
void __exit msm_dp_unregister(void); void __exit msm_dp_unregister(void);
int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev,
struct drm_encoder *encoder); struct drm_encoder *encoder, bool yuv_supported);
void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp_display); void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp_display);
bool msm_dp_is_yuv_420_enabled(const struct msm_dp *dp_display, bool msm_dp_is_yuv_420_enabled(const struct msm_dp *dp_display,
const struct drm_display_mode *mode); const struct drm_display_mode *mode);
...@@ -403,7 +403,8 @@ static inline void __exit msm_dp_unregister(void) ...@@ -403,7 +403,8 @@ static inline void __exit msm_dp_unregister(void)
} }
static inline int msm_dp_modeset_init(struct msm_dp *dp_display, static inline int msm_dp_modeset_init(struct msm_dp *dp_display,
struct drm_device *dev, struct drm_device *dev,
struct drm_encoder *encoder) struct drm_encoder *encoder,
bool yuv_supported)
{ {
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment