diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-11-24 13:02:52 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-02-24 12:04:00 +0000 |
commit | e76171b046e95e45266f3a4f4b900a5647e80d70 (patch) | |
tree | 5be58ff4ff51bb58120710b2e87ca7df48ea6da8 /drivers/staging/imx-drm/imx-ldb.c | |
parent | cf83eb24d22f3a9580fb86ee64e2830c65df062a (diff) |
imx-drm: imx-drm-core: sanitise imx_drm_encoder_get_mux_id()
Address the following issues:
- imx_drm_encoder_get_mux_id() searches the CRTC list for the matching
CRTC, and returns the position within this list as the MUX programming
value for encoders. This is sub-optimal for two reasons:
1. It relies upon the CRTC list not changing during the lifetime of
the driver.
2. It is dependent on the initialisation order of the CRTCs.
We address (1) in this patch, leaving (2) until a better solution can
be found, as (2) requires larger changes.
- imx_drm_encoder is unused. Instead, pass the drm_encoder which is
slightly more useful; all callers pass encoder->crtc as the required
crtc, so move this inside the function.
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/staging/imx-drm/imx-ldb.c')
-rw-r--r-- | drivers/staging/imx-drm/imx-ldb.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/imx-drm/imx-ldb.c b/drivers/staging/imx-drm/imx-ldb.c index 7e593296ac47..4aa47ae2a3ca 100644 --- a/drivers/staging/imx-drm/imx-ldb.c +++ b/drivers/staging/imx-drm/imx-ldb.c @@ -179,8 +179,7 @@ static void imx_ldb_encoder_prepare(struct drm_encoder *encoder) u32 pixel_fmt; unsigned long serial_clk; unsigned long di_clk = mode->clock * 1000; - int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->imx_drm_encoder, - encoder->crtc); + int mux = imx_drm_encoder_get_mux_id(encoder); if (ldb->ldb_ctrl & LDB_SPLIT_MODE_EN) { /* dual channel LVDS mode */ @@ -216,8 +215,7 @@ static void imx_ldb_encoder_commit(struct drm_encoder *encoder) struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder); struct imx_ldb *ldb = imx_ldb_ch->ldb; int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; - int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->imx_drm_encoder, - encoder->crtc); + int mux = imx_drm_encoder_get_mux_id(encoder); if (dual) { clk_prepare_enable(ldb->clk[0]); |