aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2018-05-07 05:29:28 -0400
committerInki Dae <inki.dae@samsung.com>2018-05-13 19:06:45 -0400
commite8929999fa718da5758ff877592f33fea368ca8a (patch)
treec5e1b0226e5b942d7ca551e782a6e15945ec8290 /drivers/gpu
parent01fb9185dc180940f90510215ef8764d6155d088 (diff)
drm/exynos/dsi: remove mode_set callback
The callback was used only to copy provided mode to context for later usage. Since the mode is always available from crtc atomic state this code can be removed. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dsi.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 7904ffa9abfb..eae44fd714f0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -270,7 +270,6 @@ struct exynos_dsi {
270 u32 lanes; 270 u32 lanes;
271 u32 mode_flags; 271 u32 mode_flags;
272 u32 format; 272 u32 format;
273 struct videomode vm;
274 273
275 int state; 274 int state;
276 struct drm_property *brightness; 275 struct drm_property *brightness;
@@ -881,30 +880,30 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi)
881 880
882static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi) 881static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi)
883{ 882{
884 struct videomode *vm = &dsi->vm; 883 struct drm_display_mode *m = &dsi->encoder.crtc->state->adjusted_mode;
885 unsigned int num_bits_resol = dsi->driver_data->num_bits_resol; 884 unsigned int num_bits_resol = dsi->driver_data->num_bits_resol;
886 u32 reg; 885 u32 reg;
887 886
888 if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) { 887 if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
889 reg = DSIM_CMD_ALLOW(0xf) 888 reg = DSIM_CMD_ALLOW(0xf)
890 | DSIM_STABLE_VFP(vm->vfront_porch) 889 | DSIM_STABLE_VFP(m->vsync_start - m->vdisplay)
891 | DSIM_MAIN_VBP(vm->vback_porch); 890 | DSIM_MAIN_VBP(m->vtotal - m->vsync_end);
892 exynos_dsi_write(dsi, DSIM_MVPORCH_REG, reg); 891 exynos_dsi_write(dsi, DSIM_MVPORCH_REG, reg);
893 892
894 reg = DSIM_MAIN_HFP(vm->hfront_porch) 893 reg = DSIM_MAIN_HFP(m->hsync_start - m->hdisplay)
895 | DSIM_MAIN_HBP(vm->hback_porch); 894 | DSIM_MAIN_HBP(m->htotal - m->hsync_end);
896 exynos_dsi_write(dsi, DSIM_MHPORCH_REG, reg); 895 exynos_dsi_write(dsi, DSIM_MHPORCH_REG, reg);
897 896
898 reg = DSIM_MAIN_VSA(vm->vsync_len) 897 reg = DSIM_MAIN_VSA(m->vsync_end - m->vsync_start)
899 | DSIM_MAIN_HSA(vm->hsync_len); 898 | DSIM_MAIN_HSA(m->hsync_end - m->hsync_start);
900 exynos_dsi_write(dsi, DSIM_MSYNC_REG, reg); 899 exynos_dsi_write(dsi, DSIM_MSYNC_REG, reg);
901 } 900 }
902 reg = DSIM_MAIN_HRESOL(vm->hactive, num_bits_resol) | 901 reg = DSIM_MAIN_HRESOL(m->hdisplay, num_bits_resol) |
903 DSIM_MAIN_VRESOL(vm->vactive, num_bits_resol); 902 DSIM_MAIN_VRESOL(m->vdisplay, num_bits_resol);
904 903
905 exynos_dsi_write(dsi, DSIM_MDRESOL_REG, reg); 904 exynos_dsi_write(dsi, DSIM_MDRESOL_REG, reg);
906 905
907 dev_dbg(dsi->dev, "LCD size = %dx%d\n", vm->hactive, vm->vactive); 906 dev_dbg(dsi->dev, "LCD size = %dx%d\n", m->hdisplay, m->vdisplay);
908} 907}
909 908
910static void exynos_dsi_set_display_enable(struct exynos_dsi *dsi, bool enable) 909static void exynos_dsi_set_display_enable(struct exynos_dsi *dsi, bool enable)
@@ -1485,26 +1484,7 @@ static int exynos_dsi_create_connector(struct drm_encoder *encoder)
1485 return 0; 1484 return 0;
1486} 1485}
1487 1486
1488static void exynos_dsi_mode_set(struct drm_encoder *encoder,
1489 struct drm_display_mode *mode,
1490 struct drm_display_mode *adjusted_mode)
1491{
1492 struct exynos_dsi *dsi = encoder_to_dsi(encoder);
1493 struct videomode *vm = &dsi->vm;
1494 struct drm_display_mode *m = adjusted_mode;
1495
1496 vm->hactive = m->hdisplay;
1497 vm->vactive = m->vdisplay;
1498 vm->vfront_porch = m->vsync_start - m->vdisplay;
1499 vm->vback_porch = m->vtotal - m->vsync_end;
1500 vm->vsync_len = m->vsync_end - m->vsync_start;
1501 vm->hfront_porch = m->hsync_start - m->hdisplay;
1502 vm->hback_porch = m->htotal - m->hsync_end;
1503 vm->hsync_len = m->hsync_end - m->hsync_start;
1504}
1505
1506static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = { 1487static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = {
1507 .mode_set = exynos_dsi_mode_set,
1508 .enable = exynos_dsi_enable, 1488 .enable = exynos_dsi_enable,
1509 .disable = exynos_dsi_disable, 1489 .disable = exynos_dsi_disable,
1510}; 1490};