Lines Matching full:ge2d

28 #include "ge2d-regs.h"
30 #define GE2D_NAME "meson-ge2d"
72 struct meson_ge2d *ge2d; member
165 dev_warn(ctx->ge2d->dev, "%s: invalid buffer type\n", __func__); in get_frame()
170 static void ge2d_hw_start(struct meson_ge2d *ge2d) in ge2d_hw_start() argument
172 struct ge2d_ctx *ctx = ge2d->curr; in ge2d_hw_start()
176 regmap_update_bits(ge2d->map, GE2D_GEN_CTRL1, in ge2d_hw_start()
178 regmap_update_bits(ge2d->map, GE2D_GEN_CTRL1, in ge2d_hw_start()
184 regmap_write(ge2d->map, GE2D_SRC1_BADDR_CTRL, in ge2d_hw_start()
186 regmap_write(ge2d->map, GE2D_SRC1_STRIDE_CTRL, in ge2d_hw_start()
188 regmap_write(ge2d->map, GE2D_SRC2_BADDR_CTRL, in ge2d_hw_start()
190 regmap_write(ge2d->map, GE2D_SRC2_STRIDE_CTRL, in ge2d_hw_start()
192 regmap_write(ge2d->map, GE2D_DST1_BADDR_CTRL, in ge2d_hw_start()
194 regmap_write(ge2d->map, GE2D_DST1_STRIDE_CTRL, in ge2d_hw_start()
197 regmap_write(ge2d->map, GE2D_GEN_CTRL0, 0); in ge2d_hw_start()
198 regmap_write(ge2d->map, GE2D_GEN_CTRL1, in ge2d_hw_start()
203 regmap_write(ge2d->map, GE2D_GEN_CTRL2, in ge2d_hw_start()
213 regmap_write(ge2d->map, GE2D_GEN_CTRL3, in ge2d_hw_start()
216 regmap_write(ge2d->map, GE2D_SRC1_CLIPY_START_END, in ge2d_hw_start()
219 regmap_write(ge2d->map, GE2D_SRC1_CLIPX_START_END, in ge2d_hw_start()
222 regmap_write(ge2d->map, GE2D_SRC2_CLIPY_START_END, in ge2d_hw_start()
225 regmap_write(ge2d->map, GE2D_SRC2_CLIPX_START_END, in ge2d_hw_start()
228 regmap_write(ge2d->map, GE2D_DST_CLIPY_START_END, in ge2d_hw_start()
231 regmap_write(ge2d->map, GE2D_DST_CLIPX_START_END, in ge2d_hw_start()
235 regmap_write(ge2d->map, GE2D_SRC1_Y_START_END, in ge2d_hw_start()
237 regmap_write(ge2d->map, GE2D_SRC1_X_START_END, in ge2d_hw_start()
239 regmap_write(ge2d->map, GE2D_SRC2_Y_START_END, in ge2d_hw_start()
241 regmap_write(ge2d->map, GE2D_SRC2_X_START_END, in ge2d_hw_start()
243 regmap_write(ge2d->map, GE2D_DST_Y_START_END, in ge2d_hw_start()
245 regmap_write(ge2d->map, GE2D_DST_X_START_END, in ge2d_hw_start()
265 regmap_write(ge2d->map, GE2D_ALU_OP_CTRL, reg); in ge2d_hw_start()
268 regmap_write(ge2d->map, GE2D_CMD_CTRL, in ge2d_hw_start()
278 struct meson_ge2d *ge2d = ctx->ge2d; in device_run() local
280 ge2d->curr = ctx; in device_run()
285 ge2d_hw_start(ge2d); in device_run()
290 struct meson_ge2d *ge2d = priv; in ge2d_isr() local
293 regmap_read(ge2d->map, GE2D_STATUS0, &intr); in ge2d_isr()
297 struct ge2d_ctx *ctx = ge2d->curr; in ge2d_isr()
299 ge2d->curr = NULL; in ge2d_isr()
313 v4l2_m2m_job_finish(ge2d->m2m_dev, ctx->fh.m2m_ctx); in ge2d_isr()
411 src_vq->lock = &ctx->ge2d->mutex; in queue_init()
412 src_vq->dev = ctx->ge2d->v4l2_dev.dev; in queue_init()
425 dst_vq->lock = &ctx->ge2d->mutex; in queue_init()
426 dst_vq->dev = ctx->ge2d->v4l2_dev.dev; in queue_init()
508 struct meson_ge2d *ge2d = ctx->ge2d; in vidioc_s_selection() local
544 v4l2_err(&ge2d->v4l2_dev, in vidioc_s_selection()
551 v4l2_err(&ge2d->v4l2_dev, "unsupported rectangle value.\n"); in vidioc_s_selection()
596 struct meson_ge2d *ge2d = ctx->ge2d; in vidioc_s_fmt_cap() local
610 v4l2_err(&ge2d->v4l2_dev, "queue (%d) bust\n", f->type); in vidioc_s_fmt_cap()
671 struct meson_ge2d *ge2d = ctx->ge2d; in vidioc_s_fmt_out() local
685 v4l2_err(&ge2d->v4l2_dev, "queue (%d) bust\n", f->type); in vidioc_s_fmt_out()
796 struct meson_ge2d *ge2d = ctx->ge2d; in ge2d_setup_ctrls() local
812 v4l2_err(&ge2d->v4l2_dev, "%s failed\n", __func__); in ge2d_setup_ctrls()
835 struct meson_ge2d *ge2d = video_drvdata(file); in ge2d_open() local
842 ctx->ge2d = ge2d; in ge2d_open()
848 if (mutex_lock_interruptible(&ge2d->mutex)) { in ge2d_open()
852 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(ge2d->m2m_dev, ctx, &queue_init); in ge2d_open()
855 mutex_unlock(&ge2d->mutex); in ge2d_open()
869 mutex_unlock(&ge2d->mutex); in ge2d_open()
878 struct meson_ge2d *ge2d = ctx->ge2d; in ge2d_release() local
880 mutex_lock(&ge2d->mutex); in ge2d_release()
889 mutex_unlock(&ge2d->mutex); in ge2d_release()
904 .name = "meson-ge2d",
924 struct meson_ge2d *ge2d; in ge2d_probe() local
932 ge2d = devm_kzalloc(&pdev->dev, sizeof(*ge2d), GFP_KERNEL); in ge2d_probe()
933 if (!ge2d) in ge2d_probe()
936 ge2d->dev = &pdev->dev; in ge2d_probe()
937 mutex_init(&ge2d->mutex); in ge2d_probe()
943 ge2d->map = devm_regmap_init_mmio(ge2d->dev, regs, in ge2d_probe()
945 if (IS_ERR(ge2d->map)) in ge2d_probe()
946 return PTR_ERR(ge2d->map); in ge2d_probe()
949 ret = devm_request_irq(ge2d->dev, irq, ge2d_isr, 0, in ge2d_probe()
950 dev_name(ge2d->dev), ge2d); in ge2d_probe()
952 dev_err(ge2d->dev, "failed to request irq\n"); in ge2d_probe()
956 rst = devm_reset_control_get(ge2d->dev, NULL); in ge2d_probe()
958 dev_err(ge2d->dev, "failed to get core reset controller\n"); in ge2d_probe()
962 ge2d->clk = devm_clk_get(ge2d->dev, NULL); in ge2d_probe()
963 if (IS_ERR(ge2d->clk)) { in ge2d_probe()
964 dev_err(ge2d->dev, "failed to get clock\n"); in ge2d_probe()
965 return PTR_ERR(ge2d->clk); in ge2d_probe()
972 ret = clk_prepare_enable(ge2d->clk); in ge2d_probe()
974 dev_err(ge2d->dev, "Cannot enable ge2d sclk: %d\n", ret); in ge2d_probe()
978 ret = v4l2_device_register(&pdev->dev, &ge2d->v4l2_dev); in ge2d_probe()
984 v4l2_err(&ge2d->v4l2_dev, "Failed to allocate video device\n"); in ge2d_probe()
990 vfd->lock = &ge2d->mutex; in ge2d_probe()
991 vfd->v4l2_dev = &ge2d->v4l2_dev; in ge2d_probe()
993 video_set_drvdata(vfd, ge2d); in ge2d_probe()
994 ge2d->vfd = vfd; in ge2d_probe()
996 platform_set_drvdata(pdev, ge2d); in ge2d_probe()
997 ge2d->m2m_dev = v4l2_m2m_init(&ge2d_m2m_ops); in ge2d_probe()
998 if (IS_ERR(ge2d->m2m_dev)) { in ge2d_probe()
999 v4l2_err(&ge2d->v4l2_dev, "Failed to init mem2mem device\n"); in ge2d_probe()
1000 ret = PTR_ERR(ge2d->m2m_dev); in ge2d_probe()
1006 v4l2_err(&ge2d->v4l2_dev, "Failed to register video device\n"); in ge2d_probe()
1010 v4l2_info(&ge2d->v4l2_dev, "Registered %s as /dev/%s\n", in ge2d_probe()
1016 v4l2_m2m_release(ge2d->m2m_dev); in ge2d_probe()
1018 video_device_release(ge2d->vfd); in ge2d_probe()
1020 v4l2_device_unregister(&ge2d->v4l2_dev); in ge2d_probe()
1022 clk_disable_unprepare(ge2d->clk); in ge2d_probe()
1029 struct meson_ge2d *ge2d = platform_get_drvdata(pdev); in ge2d_remove() local
1031 video_unregister_device(ge2d->vfd); in ge2d_remove()
1032 v4l2_m2m_release(ge2d->m2m_dev); in ge2d_remove()
1033 v4l2_device_unregister(&ge2d->v4l2_dev); in ge2d_remove()
1034 clk_disable_unprepare(ge2d->clk); in ge2d_remove()
1039 .compatible = "amlogic,axg-ge2d",
1050 .name = "meson-ge2d",