This patchset is to update plane and fimd of exynos-drm. it includes modification about coordinates calculation of plane and fimd and device tree support of fimd.
The patchset is based exynos-drm-next branch on of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git
Joonyoung Shim (4): drm/exynos: fix fb offset calculation for plane drm/exynos: fix x, y coordinates for right bottom pixel drm/exynos: support extended screen coordinate of fimd drm/exynos: support device tree for fimd
There is no any reason to change fb offset when CRTC is out of screen. Also, this fixes a typing error.
Signed-off-by: Joonyoung Shim jy0922.shim@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_plane.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 399b026..83efc66 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -40,7 +40,7 @@ static const uint32_t formats[] = { * CRTC ---------------- * ^ start ^ end * - * There are six cases from a to b. + * There are six cases from a to f. * * <----- SCREEN -----> * 0 last @@ -104,16 +104,12 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, if (crtc_x < 0) { if (actual_w) src_x -= crtc_x; - else - src_x += crtc_w; crtc_x = 0; }
if (crtc_y < 0) { if (actual_h) src_y -= crtc_y; - else - src_y += crtc_h; crtc_y = 0; }
The x, y coordinates of right bottom pixel cannot be negative numbers.
Signed-off-by: Joonyoung Shim jy0922.shim@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 90ca4b2..ae0153b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -471,6 +471,8 @@ static void fimd_win_commit(struct device *dev, int zpos) struct fimd_win_data *win_data; int win = zpos; unsigned long val, alpha, size; + unsigned int last_x; + unsigned int last_y;
DRM_DEBUG_KMS("%s\n", __FILE__);
@@ -524,16 +526,18 @@ static void fimd_win_commit(struct device *dev, int zpos) VIDOSDxA_TOPLEFT_Y(win_data->offset_y); writel(val, ctx->regs + VIDOSD_A(win));
- val = VIDOSDxB_BOTRIGHT_X(win_data->offset_x + - win_data->ovl_width - 1) | - VIDOSDxB_BOTRIGHT_Y(win_data->offset_y + - win_data->ovl_height - 1); + last_x = win_data->offset_x + win_data->ovl_width; + if (last_x) + last_x--; + last_y = win_data->offset_y + win_data->ovl_height; + if (last_y) + last_y--; + + val = VIDOSDxB_BOTRIGHT_X(last_x) | VIDOSDxB_BOTRIGHT_Y(last_y); writel(val, ctx->regs + VIDOSD_B(win));
DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n", - win_data->offset_x, win_data->offset_y, - win_data->offset_x + win_data->ovl_width - 1, - win_data->offset_y + win_data->ovl_height - 1); + win_data->offset_x, win_data->offset_y, last_x, last_y);
/* hardware window 0 doesn't support alpha channel. */ if (win != 0) {
The fimd of exynos5 SoC supports extended screen coordinate.
Signed-off-by: Joonyoung Shim jy0922.shim@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index ae0153b..1e4ea96 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -243,7 +243,9 @@ static void fimd_commit(struct device *dev)
/* setup horizontal and vertical display size. */ val = VIDTCON2_LINEVAL(timing->yres - 1) | - VIDTCON2_HOZVAL(timing->xres - 1); + VIDTCON2_HOZVAL(timing->xres - 1) | + VIDTCON2_LINEVAL_E(timing->yres - 1) | + VIDTCON2_HOZVAL_E(timing->xres - 1); writel(val, ctx->regs + driver_data->timing_base + VIDTCON2);
/* setup clock source, clock divider, enable dma. */ @@ -518,12 +520,16 @@ static void fimd_win_commit(struct device *dev, int zpos)
/* buffer size */ val = VIDW_BUF_SIZE_OFFSET(win_data->buf_offsize) | - VIDW_BUF_SIZE_PAGEWIDTH(win_data->line_size); + VIDW_BUF_SIZE_PAGEWIDTH(win_data->line_size) | + VIDW_BUF_SIZE_OFFSET_E(win_data->buf_offsize) | + VIDW_BUF_SIZE_PAGEWIDTH_E(win_data->line_size); writel(val, ctx->regs + VIDWx_BUF_SIZE(win, 0));
/* OSD position */ val = VIDOSDxA_TOPLEFT_X(win_data->offset_x) | - VIDOSDxA_TOPLEFT_Y(win_data->offset_y); + VIDOSDxA_TOPLEFT_Y(win_data->offset_y) | + VIDOSDxA_TOPLEFT_X_E(win_data->offset_x) | + VIDOSDxA_TOPLEFT_Y_E(win_data->offset_y); writel(val, ctx->regs + VIDOSD_A(win));
last_x = win_data->offset_x + win_data->ovl_width; @@ -533,7 +539,9 @@ static void fimd_win_commit(struct device *dev, int zpos) if (last_y) last_y--;
- val = VIDOSDxB_BOTRIGHT_X(last_x) | VIDOSDxB_BOTRIGHT_Y(last_y); + val = VIDOSDxB_BOTRIGHT_X(last_x) | VIDOSDxB_BOTRIGHT_Y(last_y) | + VIDOSDxB_BOTRIGHT_X_E(last_x) | VIDOSDxB_BOTRIGHT_Y_E(last_y); + writel(val, ctx->regs + VIDOSD_B(win));
DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n",
This adds the of_match_table to exynos-drm fimd driver to be probed from the device tree.
Signed-off-by: Joonyoung Shim jy0922.shim@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 1e4ea96..21a4f12 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -17,6 +17,7 @@ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/clk.h> +#include <linux/of_device.h> #include <linux/pm_runtime.h>
#include <video/samsung_fimd.h> @@ -106,9 +107,26 @@ struct fimd_context { struct exynos_drm_panel_info *panel; };
+#ifdef CONFIG_OF +static const struct of_device_id fimd_driver_dt_match[] = { + { .compatible = "samsung,exynos4-fimd", + .data = &exynos4_fimd_driver_data }, + { .compatible = "samsung,exynos5-fimd", + .data = &exynos5_fimd_driver_data }, + {}, +}; +MODULE_DEVICE_TABLE(of, fimd_driver_dt_match); +#endif + static inline struct fimd_driver_data *drm_fimd_get_driver_data( struct platform_device *pdev) { + const struct of_device_id *of_id = + of_match_device(fimd_driver_dt_match, &pdev->dev); + + if (of_id) + return (struct fimd_driver_data *)of_id->data; + return (struct fimd_driver_data *) platform_get_device_id(pdev)->driver_data; } @@ -1091,5 +1109,6 @@ struct platform_driver fimd_driver = { .name = "exynos4-fb", .owner = THIS_MODULE, .pm = &fimd_pm_ops, + .of_match_table = of_match_ptr(fimd_driver_dt_match), }, };
dri-devel@lists.freedesktop.org