summaryrefslogtreecommitdiff
path: root/drivers/media/platform/sti/hva/hva-hw.c
diff options
context:
space:
mode:
authorJean-Christophe Trotin <jean-christophe.trotin@st.com>2017-01-31 08:37:56 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-01-31 11:59:01 -0200
commitf7e1a6dba9ddac1da6fec2eb4dbf95b5b0cb3ce5 (patch)
tree9f1deba1d3e4b621e2dc4c88cac74e5bc50119ba /drivers/media/platform/sti/hva/hva-hw.c
parent0df03379c541ec027c94b025f2ef259f243eeb58 (diff)
[media] st-hva: encoding summary at instance release
This patch adds a short summary about the encoding operation at each instance closing, for debug purpose (through dev_dbg()): - information about the frame (format, resolution) - information about the stream (format, profile, level, resolution) - number of encoded frames - potential (system, encoding...) errors Signed-off-by: Yannick Fertre <yannick.fertre@st.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/sti/hva/hva-hw.c')
-rw-r--r--drivers/media/platform/sti/hva/hva-hw.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/platform/sti/hva/hva-hw.c b/drivers/media/platform/sti/hva/hva-hw.c
index 68d625b412b6..5104068caf32 100644
--- a/drivers/media/platform/sti/hva/hva-hw.c
+++ b/drivers/media/platform/sti/hva/hva-hw.c
@@ -470,6 +470,7 @@ int hva_hw_execute_task(struct hva_ctx *ctx, enum hva_hw_cmd_type cmd,
if (pm_runtime_get_sync(dev) < 0) {
dev_err(dev, "%s failed to get pm_runtime\n", ctx->name);
+ ctx->sys_errors++;
ret = -EFAULT;
goto out;
}
@@ -481,6 +482,7 @@ int hva_hw_execute_task(struct hva_ctx *ctx, enum hva_hw_cmd_type cmd,
break;
default:
dev_dbg(dev, "%s unknown command 0x%x\n", ctx->name, cmd);
+ ctx->encode_errors++;
ret = -EFAULT;
goto out;
}
@@ -511,6 +513,7 @@ int hva_hw_execute_task(struct hva_ctx *ctx, enum hva_hw_cmd_type cmd,
msecs_to_jiffies(2000))) {
dev_err(dev, "%s %s: time out on completion\n", ctx->name,
__func__);
+ ctx->encode_errors++;
ret = -EFAULT;
goto out;
}
@@ -518,6 +521,8 @@ int hva_hw_execute_task(struct hva_ctx *ctx, enum hva_hw_cmd_type cmd,
/* get encoding status */
ret = ctx->hw_err ? -EFAULT : 0;
+ ctx->encode_errors += ctx->hw_err ? 1 : 0;
+
out:
disable_irq(hva->irq_its);
disable_irq(hva->irq_err);