mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2026-01-27 12:35:36 +01:00
LF-7555-1: drm: imx: lcdifv3: Remove mode_valid function
Remove mode_valid function, video modes should be checked in encoder or bridge drivers. Signed-off-by: Sandor Yu <Sandor.yu@nxp.com> Reviewed-by: Liu Ying <victor.liu@nxp.com>
This commit is contained in:
parent
268081c936
commit
248e047b2d
|
|
@ -12,7 +12,6 @@
|
|||
#include <linux/pm_runtime.h>
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_framebuffer.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <video/imx-lcdifv3.h>
|
||||
|
|
@ -204,57 +203,12 @@ static void lcdifv3_crtc_atomic_disable(struct drm_crtc *crtc,
|
|||
pm_runtime_put(lcdifv3_crtc->dev->parent);
|
||||
}
|
||||
|
||||
static enum drm_mode_status lcdifv3_crtc_mode_valid(struct drm_crtc * crtc,
|
||||
const struct drm_display_mode *mode)
|
||||
{
|
||||
u8 vic;
|
||||
long rounded_rate;
|
||||
unsigned long pclk_rate;
|
||||
struct drm_display_mode *dmt, copy;
|
||||
struct lcdifv3_crtc *lcdifv3_crtc = to_lcdifv3_crtc(crtc);
|
||||
struct lcdifv3_soc *lcdifv3 = dev_get_drvdata(lcdifv3_crtc->dev->parent);
|
||||
|
||||
/* check CEA-861 mode */
|
||||
vic = drm_match_cea_mode(mode);
|
||||
if (vic)
|
||||
goto check_pix_clk;
|
||||
|
||||
/* check DMT mode */
|
||||
dmt = drm_mode_find_dmt(crtc->dev, mode->hdisplay, mode->vdisplay,
|
||||
drm_mode_vrefresh(mode), false);
|
||||
if (dmt) {
|
||||
drm_mode_copy(©, dmt);
|
||||
drm_mode_destroy(crtc->dev, dmt);
|
||||
|
||||
if (drm_mode_equal(mode, ©))
|
||||
goto check_pix_clk;
|
||||
}
|
||||
|
||||
return MODE_OK;
|
||||
|
||||
check_pix_clk:
|
||||
pclk_rate = mode->clock * 1000;
|
||||
|
||||
rounded_rate = lcdifv3_pix_clk_round_rate(lcdifv3, pclk_rate);
|
||||
|
||||
if (rounded_rate <= 0)
|
||||
return MODE_BAD;
|
||||
|
||||
/* allow +/-0.5% HDMI pixel clock rate shift */
|
||||
if (rounded_rate < pclk_rate * 995 / 1000 ||
|
||||
rounded_rate > pclk_rate * 1005 / 1000)
|
||||
return MODE_BAD;
|
||||
|
||||
return MODE_OK;
|
||||
}
|
||||
|
||||
static const struct drm_crtc_helper_funcs lcdifv3_helper_funcs = {
|
||||
.atomic_check = lcdifv3_crtc_atomic_check,
|
||||
.atomic_begin = lcdifv3_crtc_atomic_begin,
|
||||
.atomic_flush = lcdifv3_crtc_atomic_flush,
|
||||
.atomic_enable = lcdifv3_crtc_atomic_enable,
|
||||
.atomic_disable = lcdifv3_crtc_atomic_disable,
|
||||
.mode_valid = lcdifv3_crtc_mode_valid,
|
||||
};
|
||||
|
||||
static int lcdifv3_enable_vblank(struct drm_crtc *crtc)
|
||||
|
|
|
|||
|
|
@ -501,16 +501,6 @@ void lcdifv3_disable_controller(struct lcdifv3_soc *lcdifv3)
|
|||
}
|
||||
EXPORT_SYMBOL(lcdifv3_disable_controller);
|
||||
|
||||
long lcdifv3_pix_clk_round_rate(struct lcdifv3_soc *lcdifv3,
|
||||
unsigned long rate)
|
||||
{
|
||||
if (unlikely(!rate))
|
||||
return -EINVAL;
|
||||
|
||||
return clk_round_rate(lcdifv3->clk_pix, rate);
|
||||
}
|
||||
EXPORT_SYMBOL(lcdifv3_pix_clk_round_rate);
|
||||
|
||||
static int platform_remove_device_fn(struct device *dev, void *data)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,5 @@ void lcdifv3_en_shadow_load(struct lcdifv3_soc *lcdifv3);
|
|||
void lcdifv3_enable_controller(struct lcdifv3_soc *lcdifv3);
|
||||
void lcdifv3_disable_controller(struct lcdifv3_soc *lcdifv3);
|
||||
void lcdifv3_dump_registers(struct lcdifv3_soc *lcdifv3);
|
||||
long lcdifv3_pix_clk_round_rate(struct lcdifv3_soc *lcdifv3,
|
||||
unsigned long rate);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user