diff options
Diffstat (limited to 'drivers/media/platform/coda/coda-bit.c')
-rw-r--r-- | drivers/media/platform/coda/coda-bit.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index d336cb66b42b..d0430071d2ee 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <media/videobuf2-vmalloc.h> | 30 | #include <media/videobuf2-vmalloc.h> |
31 | 31 | ||
32 | #include "coda.h" | 32 | #include "coda.h" |
33 | #define CREATE_TRACE_POINTS | ||
34 | #include "trace.h" | ||
33 | 35 | ||
34 | #define CODA_PARA_BUF_SIZE (10 * 1024) | 36 | #define CODA_PARA_BUF_SIZE (10 * 1024) |
35 | #define CODA7_PS_BUF_SIZE 0x28000 | 37 | #define CODA7_PS_BUF_SIZE 0x28000 |
@@ -88,15 +90,21 @@ static void coda_command_async(struct coda_ctx *ctx, int cmd) | |||
88 | coda_write(dev, ctx->params.codec_mode, CODA_REG_BIT_RUN_COD_STD); | 90 | coda_write(dev, ctx->params.codec_mode, CODA_REG_BIT_RUN_COD_STD); |
89 | coda_write(dev, ctx->params.codec_mode_aux, CODA7_REG_BIT_RUN_AUX_STD); | 91 | coda_write(dev, ctx->params.codec_mode_aux, CODA7_REG_BIT_RUN_AUX_STD); |
90 | 92 | ||
93 | trace_coda_bit_run(ctx, cmd); | ||
94 | |||
91 | coda_write(dev, cmd, CODA_REG_BIT_RUN_COMMAND); | 95 | coda_write(dev, cmd, CODA_REG_BIT_RUN_COMMAND); |
92 | } | 96 | } |
93 | 97 | ||
94 | static int coda_command_sync(struct coda_ctx *ctx, int cmd) | 98 | static int coda_command_sync(struct coda_ctx *ctx, int cmd) |
95 | { | 99 | { |
96 | struct coda_dev *dev = ctx->dev; | 100 | struct coda_dev *dev = ctx->dev; |
101 | int ret; | ||
97 | 102 | ||
98 | coda_command_async(ctx, cmd); | 103 | coda_command_async(ctx, cmd); |
99 | return coda_wait_timeout(dev); | 104 | ret = coda_wait_timeout(dev); |
105 | trace_coda_bit_done(ctx); | ||
106 | |||
107 | return ret; | ||
100 | } | 108 | } |
101 | 109 | ||
102 | int coda_hw_reset(struct coda_ctx *ctx) | 110 | int coda_hw_reset(struct coda_ctx *ctx) |
@@ -265,6 +273,8 @@ void coda_fill_bitstream(struct coda_ctx *ctx, bool streaming) | |||
265 | ctx->bitstream_fifo.kfifo.mask; | 273 | ctx->bitstream_fifo.kfifo.mask; |
266 | list_add_tail(&meta->list, | 274 | list_add_tail(&meta->list, |
267 | &ctx->buffer_meta_list); | 275 | &ctx->buffer_meta_list); |
276 | |||
277 | trace_coda_bit_queue(ctx, src_buf, meta); | ||
268 | } | 278 | } |
269 | 279 | ||
270 | v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE); | 280 | v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE); |
@@ -1240,6 +1250,8 @@ static int coda_prepare_encode(struct coda_ctx *ctx) | |||
1240 | coda_write(dev, ctx->iram_info.axi_sram_use, | 1250 | coda_write(dev, ctx->iram_info.axi_sram_use, |
1241 | CODA7_REG_BIT_AXI_SRAM_USE); | 1251 | CODA7_REG_BIT_AXI_SRAM_USE); |
1242 | 1252 | ||
1253 | trace_coda_enc_pic_run(ctx, src_buf); | ||
1254 | |||
1243 | coda_command_async(ctx, CODA_COMMAND_PIC_RUN); | 1255 | coda_command_async(ctx, CODA_COMMAND_PIC_RUN); |
1244 | 1256 | ||
1245 | return 0; | 1257 | return 0; |
@@ -1254,6 +1266,8 @@ static void coda_finish_encode(struct coda_ctx *ctx) | |||
1254 | src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); | 1266 | src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); |
1255 | dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); | 1267 | dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); |
1256 | 1268 | ||
1269 | trace_coda_enc_pic_done(ctx, dst_buf); | ||
1270 | |||
1257 | /* Get results from the coda */ | 1271 | /* Get results from the coda */ |
1258 | start_ptr = coda_read(dev, CODA_CMD_ENC_PIC_BB_START); | 1272 | start_ptr = coda_read(dev, CODA_CMD_ENC_PIC_BB_START); |
1259 | wr_ptr = coda_read(dev, CODA_REG_BIT_WR_PTR(ctx->reg_idx)); | 1273 | wr_ptr = coda_read(dev, CODA_REG_BIT_WR_PTR(ctx->reg_idx)); |
@@ -1743,6 +1757,8 @@ static int coda_prepare_decode(struct coda_ctx *ctx) | |||
1743 | /* Clear decode success flag */ | 1757 | /* Clear decode success flag */ |
1744 | coda_write(dev, 0, CODA_RET_DEC_PIC_SUCCESS); | 1758 | coda_write(dev, 0, CODA_RET_DEC_PIC_SUCCESS); |
1745 | 1759 | ||
1760 | trace_coda_dec_pic_run(ctx, meta); | ||
1761 | |||
1746 | coda_command_async(ctx, CODA_COMMAND_PIC_RUN); | 1762 | coda_command_async(ctx, CODA_COMMAND_PIC_RUN); |
1747 | 1763 | ||
1748 | return 0; | 1764 | return 0; |
@@ -1903,6 +1919,8 @@ static void coda_finish_decode(struct coda_ctx *ctx) | |||
1903 | } | 1919 | } |
1904 | mutex_unlock(&ctx->bitstream_mutex); | 1920 | mutex_unlock(&ctx->bitstream_mutex); |
1905 | 1921 | ||
1922 | trace_coda_dec_pic_done(ctx, &ctx->frame_metas[decoded_idx]); | ||
1923 | |||
1906 | val = coda_read(dev, CODA_RET_DEC_PIC_TYPE) & 0x7; | 1924 | val = coda_read(dev, CODA_RET_DEC_PIC_TYPE) & 0x7; |
1907 | if (val == 0) | 1925 | if (val == 0) |
1908 | ctx->frame_types[decoded_idx] = V4L2_BUF_FLAG_KEYFRAME; | 1926 | ctx->frame_types[decoded_idx] = V4L2_BUF_FLAG_KEYFRAME; |
@@ -1942,6 +1960,8 @@ static void coda_finish_decode(struct coda_ctx *ctx) | |||
1942 | dst_buf->v4l2_buf.timecode = meta->timecode; | 1960 | dst_buf->v4l2_buf.timecode = meta->timecode; |
1943 | dst_buf->v4l2_buf.timestamp = meta->timestamp; | 1961 | dst_buf->v4l2_buf.timestamp = meta->timestamp; |
1944 | 1962 | ||
1963 | trace_coda_dec_rot_done(ctx, meta, dst_buf); | ||
1964 | |||
1945 | switch (q_data_dst->fourcc) { | 1965 | switch (q_data_dst->fourcc) { |
1946 | case V4L2_PIX_FMT_YUV420: | 1966 | case V4L2_PIX_FMT_YUV420: |
1947 | case V4L2_PIX_FMT_YVU420: | 1967 | case V4L2_PIX_FMT_YVU420: |
@@ -2000,6 +2020,8 @@ irqreturn_t coda_irq_handler(int irq, void *data) | |||
2000 | return IRQ_HANDLED; | 2020 | return IRQ_HANDLED; |
2001 | } | 2021 | } |
2002 | 2022 | ||
2023 | trace_coda_bit_done(ctx); | ||
2024 | |||
2003 | if (ctx->aborting) { | 2025 | if (ctx->aborting) { |
2004 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, | 2026 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, |
2005 | "task has been aborted\n"); | 2027 | "task has been aborted\n"); |