diff mbox series

[1/2] hantro: vp8: Move noisy WARN_ON to vpu_debug

Message ID 20210621231157.226962-2-ezequiel@collabora.com
State Superseded
Headers show
Series [1/2] hantro: vp8: Move noisy WARN_ON to vpu_debug | expand

Commit Message

Ezequiel Garcia June 21, 2021, 11:11 p.m. UTC
When the VP8 decoders can't find a reference frame,
the driver falls back to the current output frame.

This will probably produce some undesirable results,
leading to frame corruption, but shouldn't cause
noisy warnings.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/hantro/hantro_g1_vp8_dec.c    | 13 ++++++++++---
 .../staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c | 13 ++++++++++---
 2 files changed, 20 insertions(+), 6 deletions(-)

Comments

kernel test robot June 22, 2021, 5:52 a.m. UTC | #1
Hi Ezequiel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on rockchip/for-next pza/reset/next v5.13-rc7 next-20210621]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ezequiel-Garcia/hantro-Small-nitpicks/20210622-071354
base:   git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-a006-20210622 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project b3634d3e88b7f26534a5057bff182b7dced584fc)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/a4118b182653ffbf6229d186eb46052c34ae995c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ezequiel-Garcia/hantro-Small-nitpicks/20210622-071354
        git checkout a4118b182653ffbf6229d186eb46052c34ae995c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/staging/media/hantro/hantro_g1_vp8_dec.c:381:6: warning: format specifies type 'long' but the argument has type '__u64' (aka 'unsigned long long') [-Wformat]

                             hdr->last_frame_ts);
                             ^~~~~~~~~~~~~~~~~~
   drivers/staging/media/hantro/hantro.h:322:28: note: expanded from macro 'vpu_debug'
                                    __func__, __LINE__, ##args);   \
                                                          ^~~~
   include/linux/printk.h:373:34: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                   ~~~     ^~~~~~~~~~~
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c:389:6: warning: format specifies type 'long' but the argument has type '__u64' (aka 'unsigned long long') [-Wformat]
                             hdr->golden_frame_ts);
                             ^~~~~~~~~~~~~~~~~~~~
   drivers/staging/media/hantro/hantro.h:322:28: note: expanded from macro 'vpu_debug'
                                    __func__, __LINE__, ##args);   \
                                                          ^~~~
   include/linux/printk.h:373:34: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                   ~~~     ^~~~~~~~~~~
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c:399:6: warning: format specifies type 'long' but the argument has type '__u64' (aka 'unsigned long long') [-Wformat]
                             hdr->alt_frame_ts);
                             ^~~~~~~~~~~~~~~~~
   drivers/staging/media/hantro/hantro.h:322:28: note: expanded from macro 'vpu_debug'
                                    __func__, __LINE__, ##args);   \
                                                          ^~~~
   include/linux/printk.h:373:34: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                   ~~~     ^~~~~~~~~~~
   3 warnings generated.
--
>> drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:458:6: warning: format specifies type 'long' but the argument has type '__u64' (aka 'unsigned long long') [-Wformat]

                             hdr->last_frame_ts);
                             ^~~~~~~~~~~~~~~~~~
   drivers/staging/media/hantro/hantro.h:322:28: note: expanded from macro 'vpu_debug'
                                    __func__, __LINE__, ##args);   \
                                                          ^~~~
   include/linux/printk.h:373:34: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                   ~~~     ^~~~~~~~~~~
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:466:6: warning: format specifies type 'long' but the argument has type '__u64' (aka 'unsigned long long') [-Wformat]
                             hdr->golden_frame_ts);
                             ^~~~~~~~~~~~~~~~~~~~
   drivers/staging/media/hantro/hantro.h:322:28: note: expanded from macro 'vpu_debug'
                                    __func__, __LINE__, ##args);   \
                                                          ^~~~
   include/linux/printk.h:373:34: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                   ~~~     ^~~~~~~~~~~
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:476:6: warning: format specifies type 'long' but the argument has type '__u64' (aka 'unsigned long long') [-Wformat]
                             hdr->alt_frame_ts);
                             ^~~~~~~~~~~~~~~~~
   drivers/staging/media/hantro/hantro.h:322:28: note: expanded from macro 'vpu_debug'
                                    __func__, __LINE__, ##args);   \
                                                          ^~~~
   include/linux/printk.h:373:34: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                   ~~~     ^~~~~~~~~~~
   3 warnings generated.


vim +381 drivers/staging/media/hantro/hantro_g1_vp8_dec.c

   368	
   369	static void cfg_ref(struct hantro_ctx *ctx,
   370			    const struct v4l2_ctrl_vp8_frame *hdr)
   371	{
   372		struct hantro_dev *vpu = ctx->dev;
   373		struct vb2_v4l2_buffer *vb2_dst;
   374		dma_addr_t ref;
   375	
   376		vb2_dst = hantro_get_dst_buf(ctx);
   377	
   378		ref = hantro_get_ref(ctx, hdr->last_frame_ts);
   379		if (!ref) {
   380			vpu_debug(0, "failed to find last frame ts=%ld\n",
 > 381				  hdr->last_frame_ts);

   382			ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
   383		}
   384		vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(0));
   385	
   386		ref = hantro_get_ref(ctx, hdr->golden_frame_ts);
   387		if (!ref && hdr->golden_frame_ts)
   388			vpu_debug(0, "failed to find golden frame ts=%ld\n",
   389				  hdr->golden_frame_ts);
   390		if (!ref)
   391			ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
   392		if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN)
   393			ref |= G1_REG_ADDR_REF_TOPC_E;
   394		vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(4));
   395	
   396		ref = hantro_get_ref(ctx, hdr->alt_frame_ts);
   397		if (!ref && hdr->alt_frame_ts)
   398			vpu_debug(0, "failed to find alt frame ts=%ld\n",
   399				  hdr->alt_frame_ts);
   400		if (!ref)
   401			ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
   402		if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT)
   403			ref |= G1_REG_ADDR_REF_TOPC_E;
   404		vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(5));
   405	}
   406	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot June 23, 2021, 11:38 a.m. UTC | #2
Hi Ezequiel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on rockchip/for-next pza/reset/next v5.13-rc7 next-20210622]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ezequiel-Garcia/hantro-Small-nitpicks/20210622-071354
base:   git://linuxtv.org/media_tree.git master
config: microblaze-randconfig-r026-20210622 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/a4118b182653ffbf6229d186eb46052c34ae995c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ezequiel-Garcia/hantro-Small-nitpicks/20210622-071354
        git checkout a4118b182653ffbf6229d186eb46052c34ae995c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:17,
                    from include/linux/videodev2.h:60,
                    from include/media/videobuf2-v4l2.h:15,
                    from include/media/v4l2-mem2mem.h:16,
                    from drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:15:
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c: In function 'cfg_ref':
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__u64' {aka 'const long long unsigned int'} [-Wformat=]

       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:373:9: note: in expansion of macro 'KERN_INFO'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/staging/media/hantro/hantro.h:321:4: note: in expansion of macro 'pr_info'
     321 |    pr_info("%s:%d: " fmt,                 \
         |    ^~~~~~~
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:457:3: note: in expansion of macro 'vpu_debug'
     457 |   vpu_debug(0, "failed to find last frame ts=%ld\n",
         |   ^~~~~~~~~
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:457:48: note: format string is defined here
     457 |   vpu_debug(0, "failed to find last frame ts=%ld\n",
         |                                              ~~^
         |                                                |
         |                                                long int
         |                                              %lld
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:17,
                    from include/linux/videodev2.h:60,
                    from include/media/videobuf2-v4l2.h:15,
                    from include/media/v4l2-mem2mem.h:16,
                    from drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:15:
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__u64' {aka 'const long long unsigned int'} [-Wformat=]

       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:373:9: note: in expansion of macro 'KERN_INFO'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/staging/media/hantro/hantro.h:321:4: note: in expansion of macro 'pr_info'
     321 |    pr_info("%s:%d: " fmt,                 \
         |    ^~~~~~~
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:465:3: note: in expansion of macro 'vpu_debug'
     465 |   vpu_debug(0, "failed to find golden frame ts=%ld\n",
         |   ^~~~~~~~~
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:465:50: note: format string is defined here
     465 |   vpu_debug(0, "failed to find golden frame ts=%ld\n",
         |                                                ~~^
         |                                                  |
         |                                                  long int
         |                                                %lld
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:17,
                    from include/linux/videodev2.h:60,
                    from include/media/videobuf2-v4l2.h:15,
                    from include/media/v4l2-mem2mem.h:16,
                    from drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:15:
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__u64' {aka 'const long long unsigned int'} [-Wformat=]

       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:373:9: note: in expansion of macro 'KERN_INFO'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/staging/media/hantro/hantro.h:321:4: note: in expansion of macro 'pr_info'
     321 |    pr_info("%s:%d: " fmt,                 \
         |    ^~~~~~~
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:475:3: note: in expansion of macro 'vpu_debug'
     475 |   vpu_debug(0, "failed to find alt frame ts=%ld\n",
         |   ^~~~~~~~~
   drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c:475:47: note: format string is defined here
     475 |   vpu_debug(0, "failed to find alt frame ts=%ld\n",
         |                                             ~~^
         |                                               |
         |                                               long int
         |                                             %lld
--
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:17,
                    from include/linux/videodev2.h:60,
                    from include/media/videobuf2-v4l2.h:15,
                    from include/media/v4l2-mem2mem.h:16,
                    from drivers/staging/media/hantro/hantro_g1_vp8_dec.c:12:
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c: In function 'cfg_ref':
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__u64' {aka 'const long long unsigned int'} [-Wformat=]

       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:373:9: note: in expansion of macro 'KERN_INFO'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/staging/media/hantro/hantro.h:321:4: note: in expansion of macro 'pr_info'
     321 |    pr_info("%s:%d: " fmt,                 \
         |    ^~~~~~~
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c:380:3: note: in expansion of macro 'vpu_debug'
     380 |   vpu_debug(0, "failed to find last frame ts=%ld\n",
         |   ^~~~~~~~~
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c:380:48: note: format string is defined here
     380 |   vpu_debug(0, "failed to find last frame ts=%ld\n",
         |                                              ~~^
         |                                                |
         |                                                long int
         |                                              %lld
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:17,
                    from include/linux/videodev2.h:60,
                    from include/media/videobuf2-v4l2.h:15,
                    from include/media/v4l2-mem2mem.h:16,
                    from drivers/staging/media/hantro/hantro_g1_vp8_dec.c:12:
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__u64' {aka 'const long long unsigned int'} [-Wformat=]

       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:373:9: note: in expansion of macro 'KERN_INFO'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/staging/media/hantro/hantro.h:321:4: note: in expansion of macro 'pr_info'
     321 |    pr_info("%s:%d: " fmt,                 \
         |    ^~~~~~~
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c:388:3: note: in expansion of macro 'vpu_debug'
     388 |   vpu_debug(0, "failed to find golden frame ts=%ld\n",
         |   ^~~~~~~~~
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c:388:50: note: format string is defined here
     388 |   vpu_debug(0, "failed to find golden frame ts=%ld\n",
         |                                                ~~^
         |                                                  |
         |                                                  long int
         |                                                %lld
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:17,
                    from include/linux/videodev2.h:60,
                    from include/media/videobuf2-v4l2.h:15,
                    from include/media/v4l2-mem2mem.h:16,
                    from drivers/staging/media/hantro/hantro_g1_vp8_dec.c:12:
>> include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__u64' {aka 'const long long unsigned int'} [-Wformat=]

       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:373:9: note: in expansion of macro 'KERN_INFO'
     373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/staging/media/hantro/hantro.h:321:4: note: in expansion of macro 'pr_info'
     321 |    pr_info("%s:%d: " fmt,                 \
         |    ^~~~~~~
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c:398:3: note: in expansion of macro 'vpu_debug'
     398 |   vpu_debug(0, "failed to find alt frame ts=%ld\n",
         |   ^~~~~~~~~
   drivers/staging/media/hantro/hantro_g1_vp8_dec.c:398:47: note: format string is defined here
     398 |   vpu_debug(0, "failed to find alt frame ts=%ld\n",
         |                                             ~~^
         |                                               |
         |                                               long int
         |                                             %lld


vim +5 include/linux/kern_levels.h

314ba3520e513a Joe Perches 2012-07-30  4  
04d2c8c83d0e3a Joe Perches 2012-07-30 @5  #define KERN_SOH	"\001"		/* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30  6  #define KERN_SOH_ASCII	'\001'
04d2c8c83d0e3a Joe Perches 2012-07-30  7  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Nicolas Dufresne June 23, 2021, 8:39 p.m. UTC | #3
Le lundi 21 juin 2021 à 20:11 -0300, Ezequiel Garcia a écrit :
> When the VP8 decoders can't find a reference frame,

> the driver falls back to the current output frame.

> 

> This will probably produce some undesirable results,

> leading to frame corruption, but shouldn't cause

> noisy warnings.

> 

> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>


Greatly appreciated fix.

Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>


> ---

>  drivers/staging/media/hantro/hantro_g1_vp8_dec.c    | 13 ++++++++++---

>  .../staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c | 13 ++++++++++---

>  2 files changed, 20 insertions(+), 6 deletions(-)

> 

> diff --git a/drivers/staging/media/hantro/hantro_g1_vp8_dec.c b/drivers/staging/media/hantro/hantro_g1_vp8_dec.c

> index 96622a7f8279..7f88dcee1473 100644

> --- a/drivers/staging/media/hantro/hantro_g1_vp8_dec.c

> +++ b/drivers/staging/media/hantro/hantro_g1_vp8_dec.c

> @@ -376,12 +376,17 @@ static void cfg_ref(struct hantro_ctx *ctx,

>  	vb2_dst = hantro_get_dst_buf(ctx);

>  

>  	ref = hantro_get_ref(ctx, hdr->last_frame_ts);

> -	if (!ref)

> +	if (!ref) {

> +		vpu_debug(0, "failed to find last frame ts=%ld\n",

> +			  hdr->last_frame_ts);

>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);

> +	}

>  	vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(0));

>  

>  	ref = hantro_get_ref(ctx, hdr->golden_frame_ts);

> -	WARN_ON(!ref && hdr->golden_frame_ts);

> +	if (!ref && hdr->golden_frame_ts)

> +		vpu_debug(0, "failed to find golden frame ts=%ld\n",

> +			  hdr->golden_frame_ts);

>  	if (!ref)

>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);

>  	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN)

> @@ -389,7 +394,9 @@ static void cfg_ref(struct hantro_ctx *ctx,

>  	vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(4));

>  

>  	ref = hantro_get_ref(ctx, hdr->alt_frame_ts);

> -	WARN_ON(!ref && hdr->alt_frame_ts);

> +	if (!ref && hdr->alt_frame_ts)

> +		vpu_debug(0, "failed to find alt frame ts=%ld\n",

> +			  hdr->alt_frame_ts);

>  	if (!ref)

>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);

>  	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT)

> diff --git a/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c b/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c

> index 951b55f58a61..cd53748efe4e 100644

> --- a/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c

> +++ b/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c

> @@ -453,12 +453,17 @@ static void cfg_ref(struct hantro_ctx *ctx,

>  	vb2_dst = hantro_get_dst_buf(ctx);

>  

>  	ref = hantro_get_ref(ctx, hdr->last_frame_ts);

> -	if (!ref)

> +	if (!ref) {

> +		vpu_debug(0, "failed to find last frame ts=%ld\n",

> +			  hdr->last_frame_ts);

>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);

> +	}

>  	vdpu_write_relaxed(vpu, ref, VDPU_REG_VP8_ADDR_REF0);

>  

>  	ref = hantro_get_ref(ctx, hdr->golden_frame_ts);

> -	WARN_ON(!ref && hdr->golden_frame_ts);

> +	if (!ref && hdr->golden_frame_ts)

> +		vpu_debug(0, "failed to find golden frame ts=%ld\n",

> +			  hdr->golden_frame_ts);

>  	if (!ref)

>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);

>  	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN)

> @@ -466,7 +471,9 @@ static void cfg_ref(struct hantro_ctx *ctx,

>  	vdpu_write_relaxed(vpu, ref, VDPU_REG_VP8_ADDR_REF2_5(2));

>  

>  	ref = hantro_get_ref(ctx, hdr->alt_frame_ts);

> -	WARN_ON(!ref && hdr->alt_frame_ts);

> +	if (!ref && hdr->alt_frame_ts)

> +		vpu_debug(0, "failed to find alt frame ts=%ld\n",

> +			  hdr->alt_frame_ts);

>  	if (!ref)

>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);

>  	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT)
diff mbox series

Patch

diff --git a/drivers/staging/media/hantro/hantro_g1_vp8_dec.c b/drivers/staging/media/hantro/hantro_g1_vp8_dec.c
index 96622a7f8279..7f88dcee1473 100644
--- a/drivers/staging/media/hantro/hantro_g1_vp8_dec.c
+++ b/drivers/staging/media/hantro/hantro_g1_vp8_dec.c
@@ -376,12 +376,17 @@  static void cfg_ref(struct hantro_ctx *ctx,
 	vb2_dst = hantro_get_dst_buf(ctx);
 
 	ref = hantro_get_ref(ctx, hdr->last_frame_ts);
-	if (!ref)
+	if (!ref) {
+		vpu_debug(0, "failed to find last frame ts=%ld\n",
+			  hdr->last_frame_ts);
 		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
+	}
 	vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(0));
 
 	ref = hantro_get_ref(ctx, hdr->golden_frame_ts);
-	WARN_ON(!ref && hdr->golden_frame_ts);
+	if (!ref && hdr->golden_frame_ts)
+		vpu_debug(0, "failed to find golden frame ts=%ld\n",
+			  hdr->golden_frame_ts);
 	if (!ref)
 		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
 	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN)
@@ -389,7 +394,9 @@  static void cfg_ref(struct hantro_ctx *ctx,
 	vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(4));
 
 	ref = hantro_get_ref(ctx, hdr->alt_frame_ts);
-	WARN_ON(!ref && hdr->alt_frame_ts);
+	if (!ref && hdr->alt_frame_ts)
+		vpu_debug(0, "failed to find alt frame ts=%ld\n",
+			  hdr->alt_frame_ts);
 	if (!ref)
 		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
 	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT)
diff --git a/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c b/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c
index 951b55f58a61..cd53748efe4e 100644
--- a/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c
+++ b/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c
@@ -453,12 +453,17 @@  static void cfg_ref(struct hantro_ctx *ctx,
 	vb2_dst = hantro_get_dst_buf(ctx);
 
 	ref = hantro_get_ref(ctx, hdr->last_frame_ts);
-	if (!ref)
+	if (!ref) {
+		vpu_debug(0, "failed to find last frame ts=%ld\n",
+			  hdr->last_frame_ts);
 		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
+	}
 	vdpu_write_relaxed(vpu, ref, VDPU_REG_VP8_ADDR_REF0);
 
 	ref = hantro_get_ref(ctx, hdr->golden_frame_ts);
-	WARN_ON(!ref && hdr->golden_frame_ts);
+	if (!ref && hdr->golden_frame_ts)
+		vpu_debug(0, "failed to find golden frame ts=%ld\n",
+			  hdr->golden_frame_ts);
 	if (!ref)
 		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
 	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN)
@@ -466,7 +471,9 @@  static void cfg_ref(struct hantro_ctx *ctx,
 	vdpu_write_relaxed(vpu, ref, VDPU_REG_VP8_ADDR_REF2_5(2));
 
 	ref = hantro_get_ref(ctx, hdr->alt_frame_ts);
-	WARN_ON(!ref && hdr->alt_frame_ts);
+	if (!ref && hdr->alt_frame_ts)
+		vpu_debug(0, "failed to find alt frame ts=%ld\n",
+			  hdr->alt_frame_ts);
 	if (!ref)
 		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
 	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT)