mbox series

[v5,0/8] media: mediatek: vcodec: Add debugfs file for decode and encode

Message ID 20230525021219.23638-1-yunfei.dong@mediatek.com (mailing list archive)
Headers show
Series media: mediatek: vcodec: Add debugfs file for decode and encode | expand

Message

Yunfei Dong May 25, 2023, 2:12 a.m. UTC
Need to change kernel driver to open decode and encode debug log at current period,
it's very unreasonable. Adding debugfs common interface to support decode and encode,
using echo command to control debug log level and getting useful information for each
instance.

patch 1 add dbgfs common interface.
patch 2~5 support decode.
patch 6~7 support encode
patch 8 add help function
---
changed with v4:
- rebase to the top of media stage header.

changed with v3:
- add help function for patch 8
- remove append '\0' and enlarge buffer size for patch 4

changed with v2:
- using pr_debug and dev_dbg instead of pr_info for patch 2.
- fix word fail: informatiaoin -> information for patch 3.
- used to print each instance format information for patch 5.

changed with v1:
- add new patch 4 and 5.
- using cmd 'cat vdec' to show debug information instead of pr_info directly.
---
Yunfei Dong (8):
  media: mediatek: vcodec: Add debugfs interface to get debug
    information
  media: mediatek: vcodec: Add debug params to control different log
    level
  media: mediatek: vcodec: Add a debugfs file to get different useful
    information
  media: mediatek: vcodec: Get each context resolution information
  media: mediatek: vcodec: Get each instance format type
  media: mediatek: vcodec: Change dbgfs interface to support encode
  media: mediatek: vcodec: Add encode to support dbgfs
  media: mediatek: vcodec: Add dbgfs help function

 .../media/platform/mediatek/vcodec/Makefile   |   6 +
 .../mediatek/vcodec/mtk_vcodec_dbgfs.c        | 216 ++++++++++++++++++
 .../mediatek/vcodec/mtk_vcodec_dbgfs.h        |  72 ++++++
 .../mediatek/vcodec/mtk_vcodec_dec_drv.c      |   4 +
 .../platform/mediatek/vcodec/mtk_vcodec_drv.h |   4 +
 .../mediatek/vcodec/mtk_vcodec_enc_drv.c      |   2 +
 .../mediatek/vcodec/mtk_vcodec_util.c         |   8 +
 .../mediatek/vcodec/mtk_vcodec_util.h         |  26 ++-
 8 files changed, 335 insertions(+), 3 deletions(-)
 create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
 create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h

Comments

Yunfei Dong May 30, 2023, 8:27 a.m. UTC | #1
Hi Hans,

Sorry to disturb you.

Could you please help to review and apply this patch series if it is ok
for you? Or whose review is expected before you can apply?

Best Regards,
Yunfei Dong

On Thu, 2023-05-25 at 10:12 +0800, Yunfei Dong wrote:
> Need to change kernel driver to open decode and encode debug log at
> current period,
> it's very unreasonable. Adding debugfs common interface to support
> decode and encode,
> using echo command to control debug log level and getting useful
> information for each
> instance.
> 
> patch 1 add dbgfs common interface.
> patch 2~5 support decode.
> patch 6~7 support encode
> patch 8 add help function
> ---
> changed with v4:
> - rebase to the top of media stage header.
> 
> changed with v3:
> - add help function for patch 8
> - remove append '\0' and enlarge buffer size for patch 4
> 
> changed with v2:
> - using pr_debug and dev_dbg instead of pr_info for patch 2.
> - fix word fail: informatiaoin -> information for patch 3.
> - used to print each instance format information for patch 5.
> 
> changed with v1:
> - add new patch 4 and 5.
> - using cmd 'cat vdec' to show debug information instead of pr_info
> directly.
> ---
> Yunfei Dong (8):
>   media: mediatek: vcodec: Add debugfs interface to get debug
>     information
>   media: mediatek: vcodec: Add debug params to control different log
>     level
>   media: mediatek: vcodec: Add a debugfs file to get different useful
>     information
>   media: mediatek: vcodec: Get each context resolution information
>   media: mediatek: vcodec: Get each instance format type
>   media: mediatek: vcodec: Change dbgfs interface to support encode
>   media: mediatek: vcodec: Add encode to support dbgfs
>   media: mediatek: vcodec: Add dbgfs help function
> 
>  .../media/platform/mediatek/vcodec/Makefile   |   6 +
>  .../mediatek/vcodec/mtk_vcodec_dbgfs.c        | 216
> ++++++++++++++++++
>  .../mediatek/vcodec/mtk_vcodec_dbgfs.h        |  72 ++++++
>  .../mediatek/vcodec/mtk_vcodec_dec_drv.c      |   4 +
>  .../platform/mediatek/vcodec/mtk_vcodec_drv.h |   4 +
>  .../mediatek/vcodec/mtk_vcodec_enc_drv.c      |   2 +
>  .../mediatek/vcodec/mtk_vcodec_util.c         |   8 +
>  .../mediatek/vcodec/mtk_vcodec_util.h         |  26 ++-
>  8 files changed, 335 insertions(+), 3 deletions(-)
>  create mode 100644
> drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
>  create mode 100644
> drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h
>
Hans Verkuil May 30, 2023, 8:55 a.m. UTC | #2
On 5/30/23 10:27, Yunfei Dong (董云飞) wrote:
> Hi Hans,
> 
> Sorry to disturb you.
> 
> Could you please help to review and apply this patch series if it is ok
> for you? Or whose review is expected before you can apply?

AngeloGioacchino Del Regno reviewed this series before, so I'd like to
have his OK for this series.

Regards,

	Hans

> 
> Best Regards,
> Yunfei Dong
> 
> On Thu, 2023-05-25 at 10:12 +0800, Yunfei Dong wrote:
>> Need to change kernel driver to open decode and encode debug log at
>> current period,
>> it's very unreasonable. Adding debugfs common interface to support
>> decode and encode,
>> using echo command to control debug log level and getting useful
>> information for each
>> instance.
>>
>> patch 1 add dbgfs common interface.
>> patch 2~5 support decode.
>> patch 6~7 support encode
>> patch 8 add help function
>> ---
>> changed with v4:
>> - rebase to the top of media stage header.
>>
>> changed with v3:
>> - add help function for patch 8
>> - remove append '\0' and enlarge buffer size for patch 4
>>
>> changed with v2:
>> - using pr_debug and dev_dbg instead of pr_info for patch 2.
>> - fix word fail: informatiaoin -> information for patch 3.
>> - used to print each instance format information for patch 5.
>>
>> changed with v1:
>> - add new patch 4 and 5.
>> - using cmd 'cat vdec' to show debug information instead of pr_info
>> directly.
>> ---
>> Yunfei Dong (8):
>>   media: mediatek: vcodec: Add debugfs interface to get debug
>>     information
>>   media: mediatek: vcodec: Add debug params to control different log
>>     level
>>   media: mediatek: vcodec: Add a debugfs file to get different useful
>>     information
>>   media: mediatek: vcodec: Get each context resolution information
>>   media: mediatek: vcodec: Get each instance format type
>>   media: mediatek: vcodec: Change dbgfs interface to support encode
>>   media: mediatek: vcodec: Add encode to support dbgfs
>>   media: mediatek: vcodec: Add dbgfs help function
>>
>>  .../media/platform/mediatek/vcodec/Makefile   |   6 +
>>  .../mediatek/vcodec/mtk_vcodec_dbgfs.c        | 216
>> ++++++++++++++++++
>>  .../mediatek/vcodec/mtk_vcodec_dbgfs.h        |  72 ++++++
>>  .../mediatek/vcodec/mtk_vcodec_dec_drv.c      |   4 +
>>  .../platform/mediatek/vcodec/mtk_vcodec_drv.h |   4 +
>>  .../mediatek/vcodec/mtk_vcodec_enc_drv.c      |   2 +
>>  .../mediatek/vcodec/mtk_vcodec_util.c         |   8 +
>>  .../mediatek/vcodec/mtk_vcodec_util.h         |  26 ++-
>>  8 files changed, 335 insertions(+), 3 deletions(-)
>>  create mode 100644
>> drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
>>  create mode 100644
>> drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h
>>
Chen-Yu Tsai May 30, 2023, 10:13 a.m. UTC | #3
On Thu, May 25, 2023 at 10:12 AM Yunfei Dong <yunfei.dong@mediatek.com> wrote:
>
> Need to change kernel driver to open decode and encode debug log at current period,
> it's very unreasonable. Adding debugfs common interface to support decode and encode,
> using echo command to control debug log level and getting useful information for each
> instance.
>
> patch 1 add dbgfs common interface.
> patch 2~5 support decode.
> patch 6~7 support encode
> patch 8 add help function

I find the interface kind of weird. A lot of debugfs usage in other places
just dumps out the current state. Here you are writing to it to ask it to
do a snapshot, and then you read it later. This ends up requiring manual
management of a buffer, instead of using seq_file, which is commonly used
for virtual files.

ChenYu

> ---
> changed with v4:
> - rebase to the top of media stage header.
>
> changed with v3:
> - add help function for patch 8
> - remove append '\0' and enlarge buffer size for patch 4
>
> changed with v2:
> - using pr_debug and dev_dbg instead of pr_info for patch 2.
> - fix word fail: informatiaoin -> information for patch 3.
> - used to print each instance format information for patch 5.
>
> changed with v1:
> - add new patch 4 and 5.
> - using cmd 'cat vdec' to show debug information instead of pr_info directly.
> ---
> Yunfei Dong (8):
>   media: mediatek: vcodec: Add debugfs interface to get debug
>     information
>   media: mediatek: vcodec: Add debug params to control different log
>     level
>   media: mediatek: vcodec: Add a debugfs file to get different useful
>     information
>   media: mediatek: vcodec: Get each context resolution information
>   media: mediatek: vcodec: Get each instance format type
>   media: mediatek: vcodec: Change dbgfs interface to support encode
>   media: mediatek: vcodec: Add encode to support dbgfs
>   media: mediatek: vcodec: Add dbgfs help function
>
>  .../media/platform/mediatek/vcodec/Makefile   |   6 +
>  .../mediatek/vcodec/mtk_vcodec_dbgfs.c        | 216 ++++++++++++++++++
>  .../mediatek/vcodec/mtk_vcodec_dbgfs.h        |  72 ++++++
>  .../mediatek/vcodec/mtk_vcodec_dec_drv.c      |   4 +
>  .../platform/mediatek/vcodec/mtk_vcodec_drv.h |   4 +
>  .../mediatek/vcodec/mtk_vcodec_enc_drv.c      |   2 +
>  .../mediatek/vcodec/mtk_vcodec_util.c         |   8 +
>  .../mediatek/vcodec/mtk_vcodec_util.h         |  26 ++-
>  8 files changed, 335 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
>  create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h
>
> --
> 2.25.1
>