Skip to content

Commit 2bf6b5b

Browse files
Elyotnasuperna9999
authored andcommitted
drm/meson: exclusively use the canvas provider module
Now that the DMC register range is no longer in the bindings, remove any mention towards it and exclusively use the meson-canvas module. Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190311105144.7276-3-mjourdan@baylibre.com
1 parent dc5b961 commit 2bf6b5b

9 files changed

Lines changed: 51 additions & 243 deletions

File tree

‎drivers/gpu/drm/meson/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
meson-drm-y := meson_drv.o meson_plane.o meson_crtc.o meson_venc_cvbs.o
2-
meson-drm-y += meson_viu.o meson_vpp.o meson_venc.o meson_vclk.o meson_canvas.o meson_overlay.o
2+
meson-drm-y += meson_viu.o meson_vpp.o meson_venc.o meson_vclk.o meson_overlay.o
33

44
obj-$(CONFIG_DRM_MESON) += meson-drm.o
55
obj-$(CONFIG_DRM_MESON_DW_HDMI) += meson_dw_hdmi.o

‎drivers/gpu/drm/meson/meson_canvas.c‎

Lines changed: 0 additions & 73 deletions
This file was deleted.

‎drivers/gpu/drm/meson/meson_canvas.h‎

Lines changed: 0 additions & 51 deletions
This file was deleted.

‎drivers/gpu/drm/meson/meson_crtc.c‎

Lines changed: 25 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include "meson_venc.h"
3838
#include "meson_vpp.h"
3939
#include "meson_viu.h"
40-
#include "meson_canvas.h"
4140
#include "meson_registers.h"
4241

4342
/* CRTC definition */
@@ -214,13 +213,7 @@ void meson_crtc_irq(struct meson_drm *priv)
214213
writel_relaxed(priv->viu.osd_sc_v_ctrl0,
215214
priv->io_base + _REG(VPP_OSD_VSC_CTRL0));
216215

217-
if (priv->canvas)
218-
meson_canvas_config(priv->canvas, priv->canvas_id_osd1,
219-
priv->viu.osd1_addr, priv->viu.osd1_stride,
220-
priv->viu.osd1_height, MESON_CANVAS_WRAP_NONE,
221-
MESON_CANVAS_BLKMODE_LINEAR, 0);
222-
else
223-
meson_canvas_setup(priv, MESON_CANVAS_ID_OSD1,
216+
meson_canvas_config(priv->canvas, priv->canvas_id_osd1,
224217
priv->viu.osd1_addr, priv->viu.osd1_stride,
225218
priv->viu.osd1_height, MESON_CANVAS_WRAP_NONE,
226219
MESON_CANVAS_BLKMODE_LINEAR, 0);
@@ -237,61 +230,34 @@ void meson_crtc_irq(struct meson_drm *priv)
237230

238231
switch (priv->viu.vd1_planes) {
239232
case 3:
240-
if (priv->canvas)
241-
meson_canvas_config(priv->canvas,
242-
priv->canvas_id_vd1_2,
243-
priv->viu.vd1_addr2,
244-
priv->viu.vd1_stride2,
245-
priv->viu.vd1_height2,
246-
MESON_CANVAS_WRAP_NONE,
247-
MESON_CANVAS_BLKMODE_LINEAR,
248-
MESON_CANVAS_ENDIAN_SWAP64);
249-
else
250-
meson_canvas_setup(priv, MESON_CANVAS_ID_VD1_2,
251-
priv->viu.vd1_addr2,
252-
priv->viu.vd1_stride2,
253-
priv->viu.vd1_height2,
254-
MESON_CANVAS_WRAP_NONE,
255-
MESON_CANVAS_BLKMODE_LINEAR,
256-
MESON_CANVAS_ENDIAN_SWAP64);
233+
meson_canvas_config(priv->canvas,
234+
priv->canvas_id_vd1_2,
235+
priv->viu.vd1_addr2,
236+
priv->viu.vd1_stride2,
237+
priv->viu.vd1_height2,
238+
MESON_CANVAS_WRAP_NONE,
239+
MESON_CANVAS_BLKMODE_LINEAR,
240+
MESON_CANVAS_ENDIAN_SWAP64);
257241
/* fallthrough */
258242
case 2:
259-
if (priv->canvas)
260-
meson_canvas_config(priv->canvas,
261-
priv->canvas_id_vd1_1,
262-
priv->viu.vd1_addr1,
263-
priv->viu.vd1_stride1,
264-
priv->viu.vd1_height1,
265-
MESON_CANVAS_WRAP_NONE,
266-
MESON_CANVAS_BLKMODE_LINEAR,
267-
MESON_CANVAS_ENDIAN_SWAP64);
268-
else
269-
meson_canvas_setup(priv, MESON_CANVAS_ID_VD1_1,
270-
priv->viu.vd1_addr2,
271-
priv->viu.vd1_stride2,
272-
priv->viu.vd1_height2,
273-
MESON_CANVAS_WRAP_NONE,
274-
MESON_CANVAS_BLKMODE_LINEAR,
275-
MESON_CANVAS_ENDIAN_SWAP64);
243+
meson_canvas_config(priv->canvas,
244+
priv->canvas_id_vd1_1,
245+
priv->viu.vd1_addr1,
246+
priv->viu.vd1_stride1,
247+
priv->viu.vd1_height1,
248+
MESON_CANVAS_WRAP_NONE,
249+
MESON_CANVAS_BLKMODE_LINEAR,
250+
MESON_CANVAS_ENDIAN_SWAP64);
276251
/* fallthrough */
277252
case 1:
278-
if (priv->canvas)
279-
meson_canvas_config(priv->canvas,
280-
priv->canvas_id_vd1_0,
281-
priv->viu.vd1_addr0,
282-
priv->viu.vd1_stride0,
283-
priv->viu.vd1_height0,
284-
MESON_CANVAS_WRAP_NONE,
285-
MESON_CANVAS_BLKMODE_LINEAR,
286-
MESON_CANVAS_ENDIAN_SWAP64);
287-
else
288-
meson_canvas_setup(priv, MESON_CANVAS_ID_VD1_0,
289-
priv->viu.vd1_addr2,
290-
priv->viu.vd1_stride2,
291-
priv->viu.vd1_height2,
292-
MESON_CANVAS_WRAP_NONE,
293-
MESON_CANVAS_BLKMODE_LINEAR,
294-
MESON_CANVAS_ENDIAN_SWAP64);
253+
meson_canvas_config(priv->canvas,
254+
priv->canvas_id_vd1_0,
255+
priv->viu.vd1_addr0,
256+
priv->viu.vd1_stride0,
257+
priv->viu.vd1_height0,
258+
MESON_CANVAS_WRAP_NONE,
259+
MESON_CANVAS_BLKMODE_LINEAR,
260+
MESON_CANVAS_ENDIAN_SWAP64);
295261
};
296262

297263
writel_relaxed(priv->viu.vd1_if0_gen_reg,

‎drivers/gpu/drm/meson/meson_drv.c‎

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "meson_vpp.h"
4949
#include "meson_viu.h"
5050
#include "meson_venc.h"
51-
#include "meson_canvas.h"
5251
#include "meson_registers.h"
5352

5453
#define DRIVER_NAME "meson"
@@ -231,50 +230,31 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
231230
}
232231

233232
priv->canvas = meson_canvas_get(dev);
234-
if (!IS_ERR(priv->canvas)) {
235-
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_osd1);
236-
if (ret)
237-
goto free_drm;
238-
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_0);
239-
if (ret) {
240-
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
241-
goto free_drm;
242-
}
243-
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_1);
244-
if (ret) {
245-
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
246-
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0);
247-
goto free_drm;
248-
}
249-
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_2);
250-
if (ret) {
251-
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
252-
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0);
253-
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_1);
254-
goto free_drm;
255-
}
256-
} else {
257-
priv->canvas = NULL;
258-
259-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc");
260-
if (!res) {
261-
ret = -EINVAL;
262-
goto free_drm;
263-
}
264-
/* Simply ioremap since it may be a shared register zone */
265-
regs = devm_ioremap(dev, res->start, resource_size(res));
266-
if (!regs) {
267-
ret = -EADDRNOTAVAIL;
268-
goto free_drm;
269-
}
233+
if (IS_ERR(priv->canvas)) {
234+
ret = PTR_ERR(priv->canvas);
235+
goto free_drm;
236+
}
270237

271-
priv->dmc = devm_regmap_init_mmio(dev, regs,
272-
&meson_regmap_config);
273-
if (IS_ERR(priv->dmc)) {
274-
dev_err(&pdev->dev, "Couldn't create the DMC regmap\n");
275-
ret = PTR_ERR(priv->dmc);
276-
goto free_drm;
277-
}
238+
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_osd1);
239+
if (ret)
240+
goto free_drm;
241+
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_0);
242+
if (ret) {
243+
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
244+
goto free_drm;
245+
}
246+
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_1);
247+
if (ret) {
248+
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
249+
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0);
250+
goto free_drm;
251+
}
252+
ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_2);
253+
if (ret) {
254+
meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
255+
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0);
256+
meson_canvas_free(priv->canvas, priv->canvas_id_vd1_1);
257+
goto free_drm;
278258
}
279259

280260
priv->vsync_irq = platform_get_irq(pdev, 0);

‎drivers/gpu/drm/meson/meson_drv.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct meson_drm {
2929
struct device *dev;
3030
void __iomem *io_base;
3131
struct regmap *hhi;
32-
struct regmap *dmc;
3332
int vsync_irq;
3433

3534
struct meson_canvas *canvas;

‎drivers/gpu/drm/meson/meson_overlay.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "meson_overlay.h"
2323
#include "meson_vpp.h"
2424
#include "meson_viu.h"
25-
#include "meson_canvas.h"
2625
#include "meson_registers.h"
2726

2827
/* VD1_IF0_GEN_REG */
@@ -350,13 +349,6 @@ static void meson_overlay_atomic_update(struct drm_plane *plane,
350349

351350
DRM_DEBUG_DRIVER("\n");
352351

353-
/* Fallback is canvas provider is not available */
354-
if (!priv->canvas) {
355-
priv->canvas_id_vd1_0 = MESON_CANVAS_ID_VD1_0;
356-
priv->canvas_id_vd1_1 = MESON_CANVAS_ID_VD1_1;
357-
priv->canvas_id_vd1_2 = MESON_CANVAS_ID_VD1_2;
358-
}
359-
360352
interlace_mode = state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE;
361353

362354
spin_lock_irqsave(&priv->drm->event_lock, flags);

‎drivers/gpu/drm/meson/meson_plane.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "meson_plane.h"
3939
#include "meson_vpp.h"
4040
#include "meson_viu.h"
41-
#include "meson_canvas.h"
4241
#include "meson_registers.h"
4342

4443
/* OSD_SCI_WH_M1 */
@@ -148,10 +147,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
148147
(0xFF << OSD_GLOBAL_ALPHA_SHIFT) |
149148
OSD_BLK0_ENABLE;
150149

151-
if (priv->canvas)
152-
canvas_id_osd1 = priv->canvas_id_osd1;
153-
else
154-
canvas_id_osd1 = MESON_CANVAS_ID_OSD1;
150+
canvas_id_osd1 = priv->canvas_id_osd1;
155151

156152
/* Set up BLK0 to point to the right canvas */
157153
priv->viu.osd1_blk0_cfg[0] = ((canvas_id_osd1 << OSD_CANVAS_SEL) |

‎drivers/gpu/drm/meson/meson_viu.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "meson_viu.h"
2626
#include "meson_vpp.h"
2727
#include "meson_venc.h"
28-
#include "meson_canvas.h"
2928
#include "meson_registers.h"
3029

3130
/**

0 commit comments

Comments
 (0)