Commit d96aaada authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/omap: Pass both output and display omap_dss_device to encoder init

The drm_encoder implementation requires access to the omap_dss_device
corresponding to the display, which is passed to its initialization
function and stored internally. Clean up of the HDMI mode and infoframe
handling will require access to the output omap_dss_device. To prepare
for that, pass it to the encoder initialization function and store it
internally as well.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 70f9cbfc
...@@ -318,7 +318,7 @@ static int omap_modeset_init(struct drm_device *dev) ...@@ -318,7 +318,7 @@ static int omap_modeset_init(struct drm_device *dev)
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_crtc *crtc; struct drm_crtc *crtc;
encoder = omap_encoder_init(dev, display); encoder = omap_encoder_init(dev, pipe->output, display);
if (!encoder) if (!encoder)
return -ENOMEM; return -ENOMEM;
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
*/ */
struct omap_encoder { struct omap_encoder {
struct drm_encoder base; struct drm_encoder base;
struct omap_dss_device *dssdev; struct omap_dss_device *output;
struct omap_dss_device *display;
}; };
static void omap_encoder_destroy(struct drm_encoder *encoder) static void omap_encoder_destroy(struct drm_encoder *encoder)
...@@ -57,7 +58,7 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, ...@@ -57,7 +58,7 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev; struct omap_dss_device *dssdev = omap_encoder->display;
struct drm_connector *connector; struct drm_connector *connector;
bool hdmi_mode; bool hdmi_mode;
int r; int r;
...@@ -86,7 +87,7 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, ...@@ -86,7 +87,7 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
static void omap_encoder_disable(struct drm_encoder *encoder) static void omap_encoder_disable(struct drm_encoder *encoder)
{ {
struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev; struct omap_dss_device *dssdev = omap_encoder->display;
dssdev->ops->disable(dssdev); dssdev->ops->disable(dssdev);
} }
...@@ -97,7 +98,7 @@ static int omap_encoder_update(struct drm_encoder *encoder, ...@@ -97,7 +98,7 @@ static int omap_encoder_update(struct drm_encoder *encoder,
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev; struct omap_dss_device *dssdev = omap_encoder->display;
int ret; int ret;
if (dssdev->ops->check_timings) { if (dssdev->ops->check_timings) {
...@@ -127,7 +128,7 @@ static int omap_encoder_update(struct drm_encoder *encoder, ...@@ -127,7 +128,7 @@ static int omap_encoder_update(struct drm_encoder *encoder,
static void omap_encoder_enable(struct drm_encoder *encoder) static void omap_encoder_enable(struct drm_encoder *encoder)
{ {
struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev; struct omap_dss_device *dssdev = omap_encoder->display;
int r; int r;
omap_encoder_update(encoder, omap_crtc_channel(encoder->crtc), omap_encoder_update(encoder, omap_crtc_channel(encoder->crtc),
...@@ -156,7 +157,8 @@ static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = { ...@@ -156,7 +157,8 @@ static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = {
/* initialize encoder */ /* initialize encoder */
struct drm_encoder *omap_encoder_init(struct drm_device *dev, struct drm_encoder *omap_encoder_init(struct drm_device *dev,
struct omap_dss_device *dssdev) struct omap_dss_device *output,
struct omap_dss_device *display)
{ {
struct drm_encoder *encoder = NULL; struct drm_encoder *encoder = NULL;
struct omap_encoder *omap_encoder; struct omap_encoder *omap_encoder;
...@@ -165,7 +167,8 @@ struct drm_encoder *omap_encoder_init(struct drm_device *dev, ...@@ -165,7 +167,8 @@ struct drm_encoder *omap_encoder_init(struct drm_device *dev,
if (!omap_encoder) if (!omap_encoder)
goto fail; goto fail;
omap_encoder->dssdev = dssdev; omap_encoder->output = output;
omap_encoder->display = display;
encoder = &omap_encoder->base; encoder = &omap_encoder->base;
......
...@@ -25,6 +25,7 @@ struct drm_encoder; ...@@ -25,6 +25,7 @@ struct drm_encoder;
struct omap_dss_device; struct omap_dss_device;
struct drm_encoder *omap_encoder_init(struct drm_device *dev, struct drm_encoder *omap_encoder_init(struct drm_device *dev,
struct omap_dss_device *dssdev); struct omap_dss_device *output,
struct omap_dss_device *display);
#endif /* __OMAPDRM_ENCODER_H__ */ #endif /* __OMAPDRM_ENCODER_H__ */
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