aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-03-14 21:30:46 -0400
committerDave Airlie <airlied@redhat.com>2017-03-14 21:30:46 -0400
commit490b89813c24f2362f46fea3bbc222a273a0a7a8 (patch)
tree7d1857960f2883ff4530595c62f21f416034a987
parent6ed511757702abaa1b9925fd87e049bae3489f05 (diff)
parentd1479f6108006555fe33d7cfe8db4f95ad614b9a (diff)
Merge branch 'for-upstream/malidp-fixes' of git://linux-arm.org/linux-ld into drm-fixes
* 'for-upstream/malidp-fixes' of git://linux-arm.org/linux-ld: drm: mali-dp: Fix smart layer not going to composition drm: mali-dp: Remove mclk rate management
-rw-r--r--drivers/gpu/drm/arm/malidp_crtc.c3
-rw-r--r--drivers/gpu/drm/arm/malidp_hw.c2
-rw-r--r--drivers/gpu/drm/arm/malidp_planes.c18
-rw-r--r--drivers/gpu/drm/arm/malidp_regs.h1
4 files changed, 19 insertions, 5 deletions
diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c
index 08e6a71f5d05..294b53697334 100644
--- a/drivers/gpu/drm/arm/malidp_crtc.c
+++ b/drivers/gpu/drm/arm/malidp_crtc.c
@@ -63,8 +63,7 @@ static void malidp_crtc_enable(struct drm_crtc *crtc)
63 63
64 clk_prepare_enable(hwdev->pxlclk); 64 clk_prepare_enable(hwdev->pxlclk);
65 65
66 /* mclk needs to be set to the same or higher rate than pxlclk */ 66 /* We rely on firmware to set mclk to a sensible level. */
67 clk_set_rate(hwdev->mclk, crtc->state->adjusted_mode.crtc_clock * 1000);
68 clk_set_rate(hwdev->pxlclk, crtc->state->adjusted_mode.crtc_clock * 1000); 67 clk_set_rate(hwdev->pxlclk, crtc->state->adjusted_mode.crtc_clock * 1000);
69 68
70 hwdev->modeset(hwdev, &vm); 69 hwdev->modeset(hwdev, &vm);
diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c
index 488aedf5b58d..9f5513006eee 100644
--- a/drivers/gpu/drm/arm/malidp_hw.c
+++ b/drivers/gpu/drm/arm/malidp_hw.c
@@ -83,7 +83,7 @@ static const struct malidp_layer malidp550_layers[] = {
83 { DE_VIDEO1, MALIDP550_DE_LV1_BASE, MALIDP550_DE_LV1_PTR_BASE, MALIDP_DE_LV_STRIDE0 }, 83 { DE_VIDEO1, MALIDP550_DE_LV1_BASE, MALIDP550_DE_LV1_PTR_BASE, MALIDP_DE_LV_STRIDE0 },
84 { DE_GRAPHICS1, MALIDP550_DE_LG_BASE, MALIDP550_DE_LG_PTR_BASE, MALIDP_DE_LG_STRIDE }, 84 { DE_GRAPHICS1, MALIDP550_DE_LG_BASE, MALIDP550_DE_LG_PTR_BASE, MALIDP_DE_LG_STRIDE },
85 { DE_VIDEO2, MALIDP550_DE_LV2_BASE, MALIDP550_DE_LV2_PTR_BASE, MALIDP_DE_LV_STRIDE0 }, 85 { DE_VIDEO2, MALIDP550_DE_LV2_BASE, MALIDP550_DE_LV2_PTR_BASE, MALIDP_DE_LV_STRIDE0 },
86 { DE_SMART, MALIDP550_DE_LS_BASE, MALIDP550_DE_LS_PTR_BASE, 0 }, 86 { DE_SMART, MALIDP550_DE_LS_BASE, MALIDP550_DE_LS_PTR_BASE, MALIDP550_DE_LS_R1_STRIDE },
87}; 87};
88 88
89#define MALIDP_DE_DEFAULT_PREFETCH_START 5 89#define MALIDP_DE_DEFAULT_PREFETCH_START 5
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 414aada10fe5..d5aec082294c 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -37,6 +37,8 @@
37#define LAYER_V_VAL(x) (((x) & 0x1fff) << 16) 37#define LAYER_V_VAL(x) (((x) & 0x1fff) << 16)
38#define MALIDP_LAYER_COMP_SIZE 0x010 38#define MALIDP_LAYER_COMP_SIZE 0x010
39#define MALIDP_LAYER_OFFSET 0x014 39#define MALIDP_LAYER_OFFSET 0x014
40#define MALIDP550_LS_ENABLE 0x01c
41#define MALIDP550_LS_R1_IN_SIZE 0x020
40 42
41/* 43/*
42 * This 4-entry look-up-table is used to determine the full 8-bit alpha value 44 * This 4-entry look-up-table is used to determine the full 8-bit alpha value
@@ -242,6 +244,11 @@ static void malidp_de_plane_update(struct drm_plane *plane,
242 LAYER_V_VAL(plane->state->crtc_y), 244 LAYER_V_VAL(plane->state->crtc_y),
243 mp->layer->base + MALIDP_LAYER_OFFSET); 245 mp->layer->base + MALIDP_LAYER_OFFSET);
244 246
247 if (mp->layer->id == DE_SMART)
248 malidp_hw_write(mp->hwdev,
249 LAYER_H_VAL(src_w) | LAYER_V_VAL(src_h),
250 mp->layer->base + MALIDP550_LS_R1_IN_SIZE);
251
245 /* first clear the rotation bits */ 252 /* first clear the rotation bits */
246 val = malidp_hw_read(mp->hwdev, mp->layer->base + MALIDP_LAYER_CONTROL); 253 val = malidp_hw_read(mp->hwdev, mp->layer->base + MALIDP_LAYER_CONTROL);
247 val &= ~LAYER_ROT_MASK; 254 val &= ~LAYER_ROT_MASK;
@@ -330,9 +337,16 @@ int malidp_de_planes_init(struct drm_device *drm)
330 plane->hwdev = malidp->dev; 337 plane->hwdev = malidp->dev;
331 plane->layer = &map->layers[i]; 338 plane->layer = &map->layers[i];
332 339
333 /* Skip the features which the SMART layer doesn't have */ 340 if (id == DE_SMART) {
334 if (id == DE_SMART) 341 /*
342 * Enable the first rectangle in the SMART layer to be
343 * able to use it as a drm plane.
344 */
345 malidp_hw_write(malidp->dev, 1,
346 plane->layer->base + MALIDP550_LS_ENABLE);
347 /* Skip the features which the SMART layer doesn't have. */
335 continue; 348 continue;
349 }
336 350
337 drm_plane_create_rotation_property(&plane->base, DRM_ROTATE_0, flags); 351 drm_plane_create_rotation_property(&plane->base, DRM_ROTATE_0, flags);
338 malidp_hw_write(malidp->dev, MALIDP_ALPHA_LUT, 352 malidp_hw_write(malidp->dev, MALIDP_ALPHA_LUT,
diff --git a/drivers/gpu/drm/arm/malidp_regs.h b/drivers/gpu/drm/arm/malidp_regs.h
index aff6d4a84e99..b816067a65c5 100644
--- a/drivers/gpu/drm/arm/malidp_regs.h
+++ b/drivers/gpu/drm/arm/malidp_regs.h
@@ -84,6 +84,7 @@
84/* Stride register offsets relative to Lx_BASE */ 84/* Stride register offsets relative to Lx_BASE */
85#define MALIDP_DE_LG_STRIDE 0x18 85#define MALIDP_DE_LG_STRIDE 0x18
86#define MALIDP_DE_LV_STRIDE0 0x18 86#define MALIDP_DE_LV_STRIDE0 0x18
87#define MALIDP550_DE_LS_R1_STRIDE 0x28
87 88
88/* macros to set values into registers */ 89/* macros to set values into registers */
89#define MALIDP_DE_H_FRONTPORCH(x) (((x) & 0xfff) << 0) 90#define MALIDP_DE_H_FRONTPORCH(x) (((x) & 0xfff) << 0)