Commit 5e433b63 authored by Laurent Pinchart's avatar Laurent Pinchart

drm: rcar-du: Remove LVDS and HDMI encoders chaining restriction

The rcar-du driver refuses connecting an LVDS output to an HDMI encoder.
There is not technical reason for that restriction, remove it.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
parent 49785e25
...@@ -190,13 +190,6 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, ...@@ -190,13 +190,6 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
} }
if (type == RCAR_DU_ENCODER_HDMI) { if (type == RCAR_DU_ENCODER_HDMI) {
if (renc->lvds) {
dev_err(rcdu->dev,
"Chaining LVDS and HDMI encoders not supported\n");
ret = -EINVAL;
goto done;
}
ret = rcar_du_hdmienc_init(rcdu, renc, enc_node); ret = rcar_du_hdmienc_init(rcdu, renc, enc_node);
if (ret < 0) if (ret < 0)
goto done; goto done;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "rcar_du_drv.h" #include "rcar_du_drv.h"
#include "rcar_du_encoder.h" #include "rcar_du_encoder.h"
#include "rcar_du_hdmienc.h" #include "rcar_du_hdmienc.h"
#include "rcar_du_lvdsenc.h"
struct rcar_du_hdmienc { struct rcar_du_hdmienc {
struct rcar_du_encoder *renc; struct rcar_du_encoder *renc;
...@@ -39,9 +40,15 @@ static void rcar_du_hdmienc_dpms(struct drm_encoder *encoder, int mode) ...@@ -39,9 +40,15 @@ static void rcar_du_hdmienc_dpms(struct drm_encoder *encoder, int mode)
if (hdmienc->dpms == mode) if (hdmienc->dpms == mode)
return; return;
if (mode == DRM_MODE_DPMS_ON && hdmienc->renc->lvds)
rcar_du_lvdsenc_dpms(hdmienc->renc->lvds, encoder->crtc, mode);
if (sfuncs->dpms) if (sfuncs->dpms)
sfuncs->dpms(encoder, mode); sfuncs->dpms(encoder, mode);
if (mode != DRM_MODE_DPMS_ON && hdmienc->renc->lvds)
rcar_du_lvdsenc_dpms(hdmienc->renc->lvds, encoder->crtc, mode);
hdmienc->dpms = mode; hdmienc->dpms = mode;
} }
...@@ -49,8 +56,16 @@ static bool rcar_du_hdmienc_mode_fixup(struct drm_encoder *encoder, ...@@ -49,8 +56,16 @@ static bool rcar_du_hdmienc_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode, const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct rcar_du_hdmienc *hdmienc = to_rcar_hdmienc(encoder);
struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder); struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder);
/* The internal LVDS encoder has a clock frequency operating range of
* 30MHz to 150MHz. Clamp the clock accordingly.
*/
if (hdmienc->renc->lvds)
adjusted_mode->clock = clamp(adjusted_mode->clock,
30000, 150000);
if (sfuncs->mode_fixup == NULL) if (sfuncs->mode_fixup == NULL)
return true; return true;
......
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