Lines Matching refs:scaler
27 #define scaler_read(offset) readl(scaler->regs + (offset))
28 #define scaler_write(cfg, offset) writel(cfg, scaler->regs + (offset))
93 static inline int scaler_reset(struct scaler_context *scaler) in scaler_reset() argument
110 static inline void scaler_enable_int(struct scaler_context *scaler) in scaler_enable_int() argument
143 static inline void scaler_set_src_fmt(struct scaler_context *scaler, in scaler_set_src_fmt() argument
152 static inline void scaler_set_src_base(struct scaler_context *scaler, in scaler_set_src_base() argument
166 static inline void scaler_set_src_span(struct scaler_context *scaler, in scaler_set_src_span() argument
180 static inline void scaler_set_src_luma_chroma_pos(struct scaler_context *scaler, in scaler_set_src_luma_chroma_pos() argument
196 static inline void scaler_set_src_wh(struct scaler_context *scaler, in scaler_set_src_wh() argument
206 static inline void scaler_set_dst_fmt(struct scaler_context *scaler, in scaler_set_dst_fmt() argument
215 static inline void scaler_set_dst_base(struct scaler_context *scaler, in scaler_set_dst_base() argument
229 static inline void scaler_set_dst_span(struct scaler_context *scaler, in scaler_set_dst_span() argument
243 static inline void scaler_set_dst_luma_pos(struct scaler_context *scaler, in scaler_set_dst_luma_pos() argument
253 static inline void scaler_set_dst_wh(struct scaler_context *scaler, in scaler_set_dst_wh() argument
263 static inline void scaler_set_hv_ratio(struct scaler_context *scaler, in scaler_set_hv_ratio() argument
285 static inline void scaler_set_rotation(struct scaler_context *scaler, in scaler_set_rotation() argument
303 static inline void scaler_set_csc(struct scaler_context *scaler, in scaler_set_csc() argument
341 static inline void scaler_set_timer(struct scaler_context *scaler, in scaler_set_timer() argument
352 static inline void scaler_start_hw(struct scaler_context *scaler) in scaler_start_hw() argument
360 struct scaler_context *scaler = in scaler_commit() local
371 ret = pm_runtime_resume_and_get(scaler->dev); in scaler_commit()
375 if (scaler_reset(scaler)) in scaler_commit()
378 scaler->task = task; in scaler_commit()
381 scaler, src_fmt->internal_fmt, task->src.buf.modifier != 0); in scaler_commit()
382 scaler_set_src_base(scaler, &task->src); in scaler_commit()
383 scaler_set_src_span(scaler, &task->src); in scaler_commit()
384 scaler_set_src_luma_chroma_pos(scaler, src_pos, src_fmt); in scaler_commit()
385 scaler_set_src_wh(scaler, src_pos); in scaler_commit()
387 scaler_set_dst_fmt(scaler, dst_fmt->internal_fmt); in scaler_commit()
388 scaler_set_dst_base(scaler, &task->dst); in scaler_commit()
389 scaler_set_dst_span(scaler, &task->dst); in scaler_commit()
390 scaler_set_dst_luma_pos(scaler, dst_pos); in scaler_commit()
391 scaler_set_dst_wh(scaler, dst_pos); in scaler_commit()
393 scaler_set_hv_ratio(scaler, task->transform.rotation, src_pos, dst_pos); in scaler_commit()
394 scaler_set_rotation(scaler, task->transform.rotation); in scaler_commit()
396 scaler_set_csc(scaler, task->src.format); in scaler_commit()
398 scaler_set_timer(scaler, 0xffff, 0xf); in scaler_commit()
400 scaler_enable_int(scaler); in scaler_commit()
401 scaler_start_hw(scaler); in scaler_commit()
410 static inline void scaler_disable_int(struct scaler_context *scaler) in scaler_disable_int() argument
415 static inline u32 scaler_get_int_status(struct scaler_context *scaler) in scaler_get_int_status() argument
431 struct scaler_context *scaler = arg; in scaler_irq_handler() local
433 u32 val = scaler_get_int_status(scaler); in scaler_irq_handler()
435 scaler_disable_int(scaler); in scaler_irq_handler()
437 if (scaler->task) { in scaler_irq_handler()
438 struct exynos_drm_ipp_task *task = scaler->task; in scaler_irq_handler()
440 scaler->task = NULL; in scaler_irq_handler()
441 pm_runtime_mark_last_busy(scaler->dev); in scaler_irq_handler()
442 pm_runtime_put_autosuspend(scaler->dev); in scaler_irq_handler()
451 struct scaler_context *scaler = dev_get_drvdata(dev); in scaler_bind() local
453 struct exynos_drm_ipp *ipp = &scaler->ipp; in scaler_bind()
455 scaler->drm_dev = drm_dev; in scaler_bind()
457 exynos_drm_register_dma(drm_dev, dev, &scaler->dma_priv); in scaler_bind()
462 scaler->scaler_data->formats, in scaler_bind()
463 scaler->scaler_data->num_formats, "scaler"); in scaler_bind()
473 struct scaler_context *scaler = dev_get_drvdata(dev); in scaler_unbind() local
474 struct exynos_drm_ipp *ipp = &scaler->ipp; in scaler_unbind()
477 exynos_drm_unregister_dma(scaler->drm_dev, scaler->dev, in scaler_unbind()
478 &scaler->dma_priv); in scaler_unbind()
489 struct scaler_context *scaler; in scaler_probe() local
493 scaler = devm_kzalloc(dev, sizeof(*scaler), GFP_KERNEL); in scaler_probe()
494 if (!scaler) in scaler_probe()
497 scaler->scaler_data = in scaler_probe()
500 scaler->dev = dev; in scaler_probe()
501 scaler->regs = devm_platform_ioremap_resource(pdev, 0); in scaler_probe()
502 if (IS_ERR(scaler->regs)) in scaler_probe()
503 return PTR_ERR(scaler->regs); in scaler_probe()
510 IRQF_ONESHOT, "drm_scaler", scaler); in scaler_probe()
516 for (i = 0; i < scaler->scaler_data->num_clk; ++i) { in scaler_probe()
517 scaler->clock[i] = devm_clk_get(dev, in scaler_probe()
518 scaler->scaler_data->clk_name[i]); in scaler_probe()
519 if (IS_ERR(scaler->clock[i])) { in scaler_probe()
521 return PTR_ERR(scaler->clock[i]); in scaler_probe()
528 platform_set_drvdata(pdev, scaler); in scaler_probe()
558 static int scaler_clk_ctrl(struct scaler_context *scaler, bool enable) in scaler_clk_ctrl() argument
564 for (i = 0; i < scaler->scaler_data->num_clk; ++i) in scaler_clk_ctrl()
565 clk_fun(scaler->clock[i]); in scaler_clk_ctrl()
572 struct scaler_context *scaler = dev_get_drvdata(dev); in scaler_runtime_suspend() local
574 return scaler_clk_ctrl(scaler, false); in scaler_runtime_suspend()
579 struct scaler_context *scaler = dev_get_drvdata(dev); in scaler_runtime_resume() local
581 return scaler_clk_ctrl(scaler, true); in scaler_runtime_resume()