tree:
https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 52d269f32500581166246e0e494b2b62d979dba6
commit: bc0b0ae994e6bb17b12bfd882c2eb837eb29c078 [56/243] CHROMIUM: media: mtk-vcodec: Add
vp9 slice api driver for mt8192
config: nios2-randconfig-s032-20210420 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
git remote add chrome-os
https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout bc0b0ae994e6bb17b12bfd882c2eb837eb29c078
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2028:44: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void volatile
[noderef] <asn:2> *addr @@ got unsigned int * @@
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2028:44: sparse: expected
void volatile [noderef] <asn:2> *addr
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2028:44: sparse: got
unsigned int *
>
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:543:34: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void const
volatile [noderef] <asn:2> *addr @@ got struct vdec_vp9_slice_frame_ctx
*[assigned] remote_frame_ctx @@
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:543:34: sparse: expected
void const volatile [noderef] <asn:2> *addr
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:543:34: sparse: got
struct vdec_vp9_slice_frame_ctx *[assigned] remote_frame_ctx
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:689:40: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void const
volatile [noderef] <asn:2> *addr @@ got struct vdec_vp9_slice_compressed_header
* @@
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:689:40: sparse:
expected void const volatile [noderef] <asn:2> *addr
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:689:40: sparse: got
struct vdec_vp9_slice_compressed_header *
>
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:690:48: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void const
volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] ( * )[8][4] @@
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:690:48: sparse:
expected void const volatile [noderef] <asn:2> *addr
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:690:48: sparse: got
unsigned int [usertype] ( * )[8][4]
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:692:45: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void const
volatile [noderef] <asn:2> *addr @@ got struct vdec_vp9_slice_mem * @@
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:692:45: sparse:
expected void const volatile [noderef] <asn:2> *addr
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:692:45: sparse: got
struct vdec_vp9_slice_mem *
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:696:37: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void const
volatile [noderef] <asn:2> *addr @@ got struct vdec_vp9_slice_state * @@
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:696:37: sparse:
expected void const volatile [noderef] <asn:2> *addr
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:696:37: sparse: got
struct vdec_vp9_slice_state *
>
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:703:21: sparse: sparse:
incorrect type in argument 1 (different address spaces) @@ expected void volatile
[noderef] <asn:2> *addr @@ got struct vdec_vp9_slice_vsi *remote_vsi @@
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:703:21: sparse: expected
void volatile [noderef] <asn:2> *addr
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:703:21: sparse: got
struct vdec_vp9_slice_vsi *remote_vsi
>
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1930:45: sparse: sparse:
Using plain integer as NULL pointer
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1945:44: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void volatile
[noderef] <asn:2> *addr @@ got unsigned int * @@
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1945:44: sparse:
expected void volatile [noderef] <asn:2> *addr
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1945:44: sparse: got
unsigned int *
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c: note: in included file
(through arch/nios2/include/asm/io.h, include/linux/io.h,
arch/nios2/include/asm/pgtable.h, ...):
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1
(different base types) @@ expected unsigned int [usertype] value @@ got restricted
__le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1
(different base types) @@ expected unsigned int [usertype] value @@ got restricted
__le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
vim +2028 drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c
1881
1882 static int vdec_vp9_slice_lat_decode(void *h_vdec,
1883 struct mtk_vcodec_mem *bs,
1884 struct vdec_fb *fb,
1885 bool *res_chg)
1886 {
1887 struct vdec_vp9_slice_instance *instance = h_vdec;
1888 struct vdec_lat_buf *lat_buf;
1889 struct vdec_vp9_slice_pfc *pfc;
1890 struct vdec_vp9_slice_vsi *vsi;
1891 struct mtk_vcodec_ctx *ctx;
1892 int ret;
1893
1894 if (!instance || !instance->ctx)
1895 return -EINVAL;
1896 ctx = instance->ctx;
1897
1898 /* init msgQ for the first time */
1899 if (!ctx->msg_queue.init_done) {
1900 if (vdec_msg_queue_init(ctx, &ctx->msg_queue,
1901 vdec_vp9_slice_core_decode, sizeof(*pfc))) {
1902 mtk_vcodec_err(instance,
1903 "Failed to init VP9 msg queue\n");
1904 return -ENOMEM;
1905 }
1906 }
1907
1908 /* bs NULL means flush decoder */
1909 if (!bs)
1910 return vdec_vp9_slice_flush(h_vdec, bs, fb, res_chg);
1911
1912 lat_buf = vdec_msg_queue_get_lat_buf(&ctx->msg_queue);
1913 if (!lat_buf) {
1914 mtk_vcodec_err(instance, "Failed to get VP9 lat buf\n");
1915 return -EBUSY;
1916 }
1917 pfc = (struct vdec_vp9_slice_pfc *)lat_buf->private_data;
1918 if (!pfc)
1919 return -EINVAL;
1920 vsi = &pfc->vsi;
1921
1922 ret = vdec_vp9_slice_setup_lat(instance, bs, lat_buf, pfc);
1923 if (ret) {
1924 mtk_vcodec_err(instance,
1925 "Failed to setup VP9 lat ret %d\n", ret);
1926 return ret;
1927 }
1928 vdec_vp9_slice_vsi_to_remote(vsi, instance->vsi);
1929
1930 ret = vpu_dec_start(&instance->vpu, 0, 0);
1931 if (ret) {
1932 mtk_vcodec_err(instance,
1933 "Failed to dec VP9 ret %d\n", ret);
1934 return ret;
1935 }
1936
1937 if (instance->irq) {
1938 ret = mtk_vcodec_wait_for_done_ctx(ctx,
1939 MTK_INST_IRQ_RECEIVED,
1940 WAIT_INTR_TIMEOUT_MS);
1941 /* update remote vsi if decode timeout */
1942 if (ret) {
1943 mtk_vcodec_err(instance,
1944 "VP9 decode timeout %d\n", ret);
1945 writel(1, &instance->vsi->state.timeout);
1946 }
1947 vpu_dec_end(&instance->vpu);
1948 }
1949
1950 vdec_vp9_slice_vsi_from_remote(vsi, instance->vsi, 0);
1951 ret = vdec_vp9_slice_update_lat(instance, lat_buf, pfc);
1952
1953 /* LAT trans full, re-decode */
1954 if (ret == -EAGAIN) {
1955 mtk_vcodec_err(instance, "VP9 trans full\n");
1956 vdec_msg_queue_buf_to_lat(lat_buf);
1957 return 0;
1958 }
1959
1960 /*
1961 * LAT trans full, no more UBE
1962 * decode timeout
1963 */
1964 if (ret == -ENOMEM || vsi->state.timeout) {
1965 mtk_vcodec_err(instance,
1966 "VP9 insufficient buffer or timeout\n");
1967 vdec_msg_queue_buf_to_lat(lat_buf);
1968 return -EBUSY;
1969 }
1970
1971 mtk_vcodec_debug(instance, "lat dma 1 0x%lx 0x%lx\n",
1972 pfc->vsi.trans.dma_addr, pfc->vsi.trans.dma_addr_end);
1973
1974 vdec_msg_queue_update_ube_wptr(&ctx->msg_queue,
1975 vsi->trans.dma_addr_end + ctx->msg_queue.wdma_addr.dma_addr);
1976 vdec_msg_queue_buf_to_core(ctx->dev, lat_buf);
1977
1978 return 0;
1979 }
1980
1981 static int vdec_vp9_slice_core_decode(
1982 struct vdec_lat_buf *lat_buf)
1983 {
1984 struct vdec_vp9_slice_instance *instance;
1985 struct vdec_vp9_slice_pfc *pfc;
1986 struct mtk_vcodec_ctx *ctx = NULL;
1987 struct vdec_fb *fb = NULL;
1988 int ret = -EINVAL;
1989
1990 if (!lat_buf)
1991 goto err;
1992
1993 pfc = lat_buf->private_data;
1994 ctx = lat_buf->ctx;
1995 if (!pfc || !ctx)
1996 goto err;
1997
1998 instance = ctx->drv_handle;
1999 if (!instance)
2000 goto err;
2001
2002 fb = ctx->dev->vdec_pdata->get_cap_buffer(ctx);
2003 if (!fb) {
2004 ret = -EBUSY;
2005 goto err;
2006 }
2007
2008 ret = vdec_vp9_slice_setup_core(instance, fb, lat_buf, pfc);
2009 if (ret) {
2010 mtk_vcodec_err(instance, "vdec_vp9_slice_setup_core\n");
2011 goto err;
2012 }
2013 vdec_vp9_slice_vsi_to_remote(&pfc->vsi, instance->core_vsi);
2014
2015 ret = vpu_dec_core(&instance->vpu);
2016 if (ret) {
2017 mtk_vcodec_err(instance, "vpu_dec_core\n");
2018 goto err;
2019 }
2020
2021 if (instance->irq) {
2022 ret = mtk_vcodec_wait_for_core_done_ctx(ctx,
2023 MTK_INST_IRQ_RECEIVED,
2024 WAIT_INTR_TIMEOUT_MS);
2025 /* update remote vsi if decode timeout */
2026 if (ret) {
2027 mtk_vcodec_err(instance, "VP9 core timeout\n");
2028 writel(1, &instance->core_vsi->state.timeout);
2029 }
2030 vpu_dec_core_end(&instance->vpu);
2031 }
2032
2033 vdec_vp9_slice_vsi_from_remote(&pfc->vsi, instance->core_vsi, 1);
2034 ret = vdec_vp9_slice_update_core(instance, lat_buf, pfc);
2035 if (ret) {
2036 mtk_vcodec_err(instance, "vdec_vp9_slice_update_core\n");
2037 goto err;
2038 }
2039
2040 pfc->vsi.trans.dma_addr_end += ctx->msg_queue.wdma_addr.dma_addr;
2041 mtk_vcodec_debug(instance, "core dma_addr_end 0x%lx\n",
2042 pfc->vsi.trans.dma_addr_end);
2043 vdec_msg_queue_update_ube_rptr(&ctx->msg_queue,
2044 pfc->vsi.trans.dma_addr_end);
2045 ctx->dev->vdec_pdata->cap_to_disp(ctx, fb, 0);
2046
2047 return 0;
2048
2049 err:
2050 if (ctx) {
2051 /* always update read pointer */
2052 vdec_msg_queue_update_ube_rptr(&ctx->msg_queue,
2053 pfc->vsi.trans.dma_addr_end);
2054
2055 if (fb)
2056 ctx->dev->vdec_pdata->cap_to_disp(ctx, fb, 1);
2057 }
2058 return ret;
2059 }
2060
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org