drm/bridge: analogix_dp: add helpers for capture of frame CRCs
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 3 Mar 2017 13:39:35 +0000 (14:39 +0100)
committerSean Paul <seanpaul@chromium.org>
Mon, 6 Mar 2017 17:14:27 +0000 (12:14 -0500)
Add two simple functions that just take the drm_dp_aux from our struct
and calls the corresponding DP helpers with it.

v6: Pass to the DP helper the drm_crtc of the current connector (Sean Paul)

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170303133936.14964-4-tomeu.vizoso@collabora.com
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
include/drm/bridge/analogix_dp.h

index e7cd105..c26997a 100644 (file)
@@ -1488,6 +1488,28 @@ int analogix_dp_resume(struct device *dev)
 EXPORT_SYMBOL_GPL(analogix_dp_resume);
 #endif
 
+int analogix_dp_start_crc(struct drm_connector *connector)
+{
+       struct analogix_dp_device *dp = to_dp(connector);
+
+       if (!connector->state->crtc) {
+               DRM_ERROR("Connector %s doesn't currently have a CRTC.\n",
+                         connector->name);
+               return -EINVAL;
+       }
+
+       return drm_dp_start_crc(&dp->aux, connector->state->crtc);
+}
+EXPORT_SYMBOL_GPL(analogix_dp_start_crc);
+
+int analogix_dp_stop_crc(struct drm_connector *connector)
+{
+       struct analogix_dp_device *dp = to_dp(connector);
+
+       return drm_dp_stop_crc(&dp->aux);
+}
+EXPORT_SYMBOL_GPL(analogix_dp_stop_crc);
+
 MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
 MODULE_DESCRIPTION("Analogix DP Core Driver");
 MODULE_LICENSE("GPL v2");
index f6f0c06..c99d6ea 100644 (file)
@@ -49,4 +49,7 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
                     struct analogix_dp_plat_data *plat_data);
 void analogix_dp_unbind(struct device *dev, struct device *master, void *data);
 
+int analogix_dp_start_crc(struct drm_connector *connector);
+int analogix_dp_stop_crc(struct drm_connector *connector);
+
 #endif /* _ANALOGIX_DP_H_ */