diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2015-11-30 08:53:25 -0500 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2015-12-13 08:22:57 -0500 |
commit | fd2d2fc2db28d3a2a18b7504e2d6d8b0753f90e8 (patch) | |
tree | 41b521e137aa1c50319fd0054dda643f438a505c /drivers/gpu/drm/exynos/exynos_drm_fimd.c | |
parent | ab14420125c3cd1111f57731f0f9359c4e64d76a (diff) |
drm/exynos: introduce exynos_drm_plane_config structure
This patch adds common structure for keeping plane configuration and
capabilities data. This patch is inspired by similar code developed by
Tobias Jakobi.
Changelog v2:
- fix vidi_win_types(i) call. vidi_win_types is not a function.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fimd.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 739544871589..70cd2681e343 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -88,7 +88,6 @@ | |||
88 | 88 | ||
89 | /* FIMD has totally five hardware windows. */ | 89 | /* FIMD has totally five hardware windows. */ |
90 | #define WINDOWS_NR 5 | 90 | #define WINDOWS_NR 5 |
91 | #define CURSOR_WIN 4 | ||
92 | 91 | ||
93 | struct fimd_driver_data { | 92 | struct fimd_driver_data { |
94 | unsigned int timing_base; | 93 | unsigned int timing_base; |
@@ -151,6 +150,7 @@ struct fimd_context { | |||
151 | struct drm_device *drm_dev; | 150 | struct drm_device *drm_dev; |
152 | struct exynos_drm_crtc *crtc; | 151 | struct exynos_drm_crtc *crtc; |
153 | struct exynos_drm_plane planes[WINDOWS_NR]; | 152 | struct exynos_drm_plane planes[WINDOWS_NR]; |
153 | struct exynos_drm_plane_config configs[WINDOWS_NR]; | ||
154 | struct clk *bus_clk; | 154 | struct clk *bus_clk; |
155 | struct clk *lcd_clk; | 155 | struct clk *lcd_clk; |
156 | void __iomem *regs; | 156 | void __iomem *regs; |
@@ -188,6 +188,14 @@ static const struct of_device_id fimd_driver_dt_match[] = { | |||
188 | }; | 188 | }; |
189 | MODULE_DEVICE_TABLE(of, fimd_driver_dt_match); | 189 | MODULE_DEVICE_TABLE(of, fimd_driver_dt_match); |
190 | 190 | ||
191 | static const enum drm_plane_type fimd_win_types[WINDOWS_NR] = { | ||
192 | DRM_PLANE_TYPE_PRIMARY, | ||
193 | DRM_PLANE_TYPE_OVERLAY, | ||
194 | DRM_PLANE_TYPE_OVERLAY, | ||
195 | DRM_PLANE_TYPE_OVERLAY, | ||
196 | DRM_PLANE_TYPE_CURSOR, | ||
197 | }; | ||
198 | |||
191 | static const uint32_t fimd_formats[] = { | 199 | static const uint32_t fimd_formats[] = { |
192 | DRM_FORMAT_C8, | 200 | DRM_FORMAT_C8, |
193 | DRM_FORMAT_XRGB1555, | 201 | DRM_FORMAT_XRGB1555, |
@@ -927,18 +935,19 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) | |||
927 | struct drm_device *drm_dev = data; | 935 | struct drm_device *drm_dev = data; |
928 | struct exynos_drm_private *priv = drm_dev->dev_private; | 936 | struct exynos_drm_private *priv = drm_dev->dev_private; |
929 | struct exynos_drm_plane *exynos_plane; | 937 | struct exynos_drm_plane *exynos_plane; |
930 | enum drm_plane_type type; | 938 | unsigned int i; |
931 | unsigned int zpos; | ||
932 | int ret; | 939 | int ret; |
933 | 940 | ||
934 | ctx->drm_dev = drm_dev; | 941 | ctx->drm_dev = drm_dev; |
935 | ctx->pipe = priv->pipe++; | 942 | ctx->pipe = priv->pipe++; |
936 | 943 | ||
937 | for (zpos = 0; zpos < WINDOWS_NR; zpos++) { | 944 | for (i = 0; i < WINDOWS_NR; i++) { |
938 | type = exynos_plane_get_type(zpos, CURSOR_WIN); | 945 | ctx->configs[i].pixel_formats = fimd_formats; |
939 | ret = exynos_plane_init(drm_dev, &ctx->planes[zpos], | 946 | ctx->configs[i].num_pixel_formats = ARRAY_SIZE(fimd_formats); |
940 | 1 << ctx->pipe, type, fimd_formats, | 947 | ctx->configs[i].zpos = i; |
941 | ARRAY_SIZE(fimd_formats), zpos); | 948 | ctx->configs[i].type = fimd_win_types[i]; |
949 | ret = exynos_plane_init(drm_dev, &ctx->planes[i], | ||
950 | 1 << ctx->pipe, &ctx->configs[i]); | ||
942 | if (ret) | 951 | if (ret) |
943 | return ret; | 952 | return ret; |
944 | } | 953 | } |