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.
Unified · Split
| @@ -270,7 +270,6 @@ struct exynos_dsi { · 269 unmodified lines | |||
| 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) · 604 unmodified lines | |||
| 881 | 880 | ||
| 882 | static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi) | 881 | static 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 | ||
| 910 | static void exynos_dsi_set_display_enable(struct exynos_dsi *dsi, bool enable) | 909 | static 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) · 574 unmodified lines | |||
| 1485 | return 0; | 1484 | return 0; |
| 1486 | } | 1485 | } |
| 1487 | 1486 | ||
| 1488 | static 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 | |||
| 1506 | static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = { | 1487 | static 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 | }; |