aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2018-05-23 07:00:02 -0400
committerInki Dae <inki.dae@samsung.com>2018-05-23 21:21:15 -0400
commitcb5fba715babc599e82f40d53b6b956efcc8fc25 (patch)
treed56cf7f81d2e39d826365808d89a41125f56e746
parente05f3ea260d6db1fb9aede6af29d7cf8f491f0ed (diff)
drm/exynos: decon: Add support for hardware windows no 4 and 5
Enable support for 2 more hardware windows. This require enabling a few more clocks and set proper plane type for all windows. In the new configuration primary plane uses hardware window no 3 and cursor uses window no 5. The remaining hardware windows are used for overlays. This gives us an overlay plane both below and above primary plane for both Decon and DeconTV (which uses hardware window nr 0 for background). Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos5433_drm_decon.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index 1c330f2a7a5d..82c95c34447f 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -31,7 +31,10 @@
31#define DSD_CFG_MUX 0x1004 31#define DSD_CFG_MUX 0x1004
32#define DSD_CFG_MUX_TE_UNMASK_GLOBAL BIT(13) 32#define DSD_CFG_MUX_TE_UNMASK_GLOBAL BIT(13)
33 33
34#define WINDOWS_NR 3 34#define WINDOWS_NR 5
35#define PRIMARY_WIN 2
36#define CURSON_WIN 4
37
35#define MIN_FB_WIDTH_FOR_16WORD_BURST 128 38#define MIN_FB_WIDTH_FOR_16WORD_BURST 128
36 39
37#define I80_HW_TRG (1 << 0) 40#define I80_HW_TRG (1 << 0)
@@ -43,6 +46,9 @@ static const char * const decon_clks_name[] = {
43 "aclk_smmu_decon0x", 46 "aclk_smmu_decon0x",
44 "aclk_xiu_decon0x", 47 "aclk_xiu_decon0x",
45 "pclk_smmu_decon0x", 48 "pclk_smmu_decon0x",
49 "aclk_smmu_decon1x",
50 "aclk_xiu_decon1x",
51 "pclk_smmu_decon1x",
46 "sclk_decon_vclk", 52 "sclk_decon_vclk",
47 "sclk_decon_eclk", 53 "sclk_decon_eclk",
48}; 54};
@@ -74,9 +80,8 @@ static const uint32_t decon_formats[] = {
74}; 80};
75 81
76static const enum drm_plane_type decon_win_types[WINDOWS_NR] = { 82static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
77 DRM_PLANE_TYPE_PRIMARY, 83 [PRIMARY_WIN] = DRM_PLANE_TYPE_PRIMARY,
78 DRM_PLANE_TYPE_OVERLAY, 84 [CURSON_WIN] = DRM_PLANE_TYPE_CURSOR,
79 DRM_PLANE_TYPE_CURSOR,
80}; 85};
81 86
82static inline void decon_set_bits(struct decon_context *ctx, u32 reg, u32 mask, 87static inline void decon_set_bits(struct decon_context *ctx, u32 reg, u32 mask,
@@ -552,12 +557,10 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
552 drm_dev->max_vblank_count = 0xffffffff; 557 drm_dev->max_vblank_count = 0xffffffff;
553 558
554 for (win = ctx->first_win; win < WINDOWS_NR; win++) { 559 for (win = ctx->first_win; win < WINDOWS_NR; win++) {
555 int tmp = (win == ctx->first_win) ? 0 : win;
556
557 ctx->configs[win].pixel_formats = decon_formats; 560 ctx->configs[win].pixel_formats = decon_formats;
558 ctx->configs[win].num_pixel_formats = ARRAY_SIZE(decon_formats); 561 ctx->configs[win].num_pixel_formats = ARRAY_SIZE(decon_formats);
559 ctx->configs[win].zpos = win; 562 ctx->configs[win].zpos = win - ctx->first_win;
560 ctx->configs[win].type = decon_win_types[tmp]; 563 ctx->configs[win].type = decon_win_types[win];
561 564
562 ret = exynos_plane_init(drm_dev, &ctx->planes[win], win, 565 ret = exynos_plane_init(drm_dev, &ctx->planes[win], win,
563 &ctx->configs[win]); 566 &ctx->configs[win]);
@@ -565,7 +568,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
565 return ret; 568 return ret;
566 } 569 }
567 570
568 exynos_plane = &ctx->planes[ctx->first_win]; 571 exynos_plane = &ctx->planes[PRIMARY_WIN];
569 out_type = (ctx->out_type & IFTYPE_HDMI) ? EXYNOS_DISPLAY_TYPE_HDMI 572 out_type = (ctx->out_type & IFTYPE_HDMI) ? EXYNOS_DISPLAY_TYPE_HDMI
570 : EXYNOS_DISPLAY_TYPE_LCD; 573 : EXYNOS_DISPLAY_TYPE_LCD;
571 ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base, 574 ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,