int sc_set_blur;
module_param_named(sc_set_blur, sc_set_blur, uint, 0644);
+int sc_show_stat;
+module_param_named(sc_show_stat, sc_show_stat, uint, 0644);
+
#define BUF_EXT_SIZE 512
#define BUF_WIDTH_ALIGN 128
if (test_bit(DEV_RUN, &sc->state)) {
sc_hwregs_dump(sc);
+ if (sc->current_ctx)
+ sc_ctx_dump(sc->current_ctx);
exynos_sysmmu_show_status(sc->dev);
atomic_inc(&sc->wdt.cnt);
dev_err(sc->dev, "scaler is still running\n");
sc_hwset_int_en(sc);
+ if (sc_show_stat & 0x1)
+ sc_hwregs_dump(sc);
+ if (sc_show_stat & 0x2)
+ sc_ctx_dump(ctx);
+
mod_timer(&sc->wdt.timer, jiffies + SC_TIMEOUT);
if (__measure_hw_latency) {
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Core file for Samsung EXYNOS Scaler driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include "scaler.h"
+
+static void show_crop(struct v4l2_rect *rect)
+{
+ pr_info(" - crop: L,T,W,H: %d, %d, %d, %d\n",
+ rect->left, rect->top, rect->width, rect->height);
+}
+
+static void show_addr(struct sc_addr *addr)
+{
+ int i;
+
+ for (i = 0; i < SC_MAX_PLANES; i++)
+ pr_info(" * plane%d. addr: %#lx, size: %#x\n",
+ i, (unsigned long)addr->ioaddr[i], addr->size[i]);
+}
+
+static void show_frame(char *name, struct sc_frame *frame)
+{
+ pr_info(" * %s) WxH : %d x %d\n", name, frame->width, frame->height);
+ show_crop(&frame->crop);
+ show_addr(&frame->addr);
+ if (frame->sc_fmt)
+ pr_info(" * Name : %s\n", frame->sc_fmt->name);
+
+}
+
+static void show_int_frame(struct sc_int_frame *i_frame)
+{
+ show_addr(&i_frame->src_addr);
+ show_addr(&i_frame->dst_addr);
+}
+
+void sc_ctx_dump(struct sc_ctx *ctx)
+{
+ pr_info("> scaler context info <\n");
+ show_frame("source", &ctx->s_frame);
+ show_frame("dest", &ctx->d_frame);
+ pr_info(" - h_ratio: %#x, v_ratio: %#x\n", ctx->h_ratio, ctx->v_ratio);
+ pr_info(" - flip_rot_cfg: %#x\n", ctx->flip_rot_cfg);
+ pr_info(" - flags: %#lx\n", ctx->flags);
+
+ if (test_bit(CTX_INT_FRAME, &ctx->flags)) {
+ show_frame("Internal", &ctx->i_frame->frame);
+ show_int_frame(ctx->i_frame);
+ }
+}