[PATCH] drm/sched: Add device pointer to drm_gpu_scheduler

Alex Deucher alexdeucher at gmail.com
Wed Feb 23 14:35:26 UTC 2022


On Wed, Feb 23, 2022 at 2:42 AM Christian König
<christian.koenig at amd.com> wrote:
>
> Well that's bad. This should not be pushed to amd-staging-drm-next at all.
>
> This patch is touching multiple drivers and therefore needs to go
> upstream through drm-misc-next.
>
> Alex can you drop that one before you send out a pull request? I'm going
> to cherry-pick it over to drm-misc-next.

Yeah, no problem.

Alex

>
> Thanks,
> Christian.
>
> Am 23.02.22 um 08:15 schrieb Gu, JiaWei (Will):
> > [AMD Official Use Only]
> >
> > Hi Christian,
> >
> > I noticed that and it has been fixed with the latest patch.
> > And I pushed it to amd-staging-drm-next already.
> >
> > Best regards,
> > Jiawei
> >
> > -----Original Message-----
> > From: Koenig, Christian <Christian.Koenig at amd.com>
> > Sent: Wednesday, February 23, 2022 3:12 PM
> > To: kernel test robot <lkp at intel.com>; Gu, JiaWei (Will) <JiaWei.Gu at amd.com>; dri-devel at lists.freedesktop.org; amd-gfx at lists.freedesktop.org; Grodzovsky, Andrey <Andrey.Grodzovsky at amd.com>; Liu, Monk <Monk.Liu at amd.com>; Deng, Emily <Emily.Deng at amd.com>; Chen, Horace <Horace.Chen at amd.com>
> > Cc: kbuild-all at lists.01.org
> > Subject: Re: [PATCH] drm/sched: Add device pointer to drm_gpu_scheduler
> >
> > Hi Jiawei,
> >
> >
> > can you take a look at this? The kernel build robots screaming that this breaks the V3D build. Probably just a typo or missing include.
> >
> > I would rather like to push this sooner than later.
> >
> > Thanks,
> > Christian.
> >
> > Am 21.02.22 um 16:51 schrieb kernel test robot:
> >> Hi Jiawei,
> >>
> >> Thank you for the patch! Yet something to improve:
> >>
> >> [auto build test ERROR on drm/drm-next] [also build test ERROR on
> >> drm-intel/for-linux-next drm-exynos/exynos-drm-next
> >> tegra-drm/drm/tegra/for-next v5.17-rc5 next-20220217] [cannot apply to
> >> drm-tip/drm-tip] [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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-
> >> scm.com%2Fdocs%2Fgit-format-patch&data=04%7C01%7CChristian.Koenig%
> >> 40amd.com%7C33c94d7ecffe465c671d08d9f5522651%7C3dd8961fe4884e608e11a82
> >> d994e183d%7C0%7C0%7C637810555454343325%7CUnknown%7CTWFpbGZsb3d8eyJWIjo
> >> iMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp
> >> ;sdata=8Kj1h9%2BCR%2B8nDeUXW%2B%2FQOFbiavK5oHons0mRPyHhq%2F0%3D&re
> >> served=0]
> >>
> >> url:    https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinux%2Fcommits%2FJiawei-Gu%2Fdrm-sched-Add-device-pointer-to-drm_gpu_scheduler%2F20220221-175818&data=04%7C01%7CChristian.Koenig%40amd.com%7C33c94d7ecffe465c671d08d9f5522651%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637810555454343325%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=KMrQ%2FsAoUV768eWdTF1FdmXo44kDPjWKnwoi4rvVnqs%3D&reserved=0
> >> base:   git://anongit.freedesktop.org/drm/drm drm-next
> >> config: ia64-allmodconfig
> >> (https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdow
> >> nload.01.org%2F0day-ci%2Farchive%2F20220221%2F202202212330.nxcvFWEe-lk
> >> p%40intel.com%2Fconfig&data=04%7C01%7CChristian.Koenig%40amd.com%7
> >> C33c94d7ecffe465c671d08d9f5522651%7C3dd8961fe4884e608e11a82d994e183d%7
> >> C0%7C0%7C637810555454343325%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD
> >> AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=tLVb
> >> OkxAyxSD%2BVUHUmS6BT5RfOzO4q3sotVZ2YHGV9o%3D&reserved=0)
> >> compiler: ia64-linux-gcc (GCC) 11.2.0
> >> reproduce (this is a W=1 build):
> >>           wget https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.cross&data=04%7C01%7CChristian.Koenig%40amd.com%7C33c94d7ecffe465c671d08d9f5522651%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637810555454343325%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=8QLSr7JTjK87bBGwgOLxU6AU4bCeHoWX2zyx7SGYL7M%3D&reserved=0 -O ~/bin/make.cross
> >>           chmod +x ~/bin/make.cross
> >>           # https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinux%2Fcommit%2F9fdafca855faca0a3b8f213f024985c4112fa0bb&data=04%7C01%7CChristian.Koenig%40amd.com%7C33c94d7ecffe465c671d08d9f5522651%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637810555454343325%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=W9HKTScDzhoA1DClCigH2QQUgcIzLStBS%2Bx9ieYPbK4%3D&reserved=0
> >>           git remote add linux-review https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinux&data=04%7C01%7CChristian.Koenig%40amd.com%7C33c94d7ecffe465c671d08d9f5522651%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637810555454343325%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=FNJyugHVXenGmYqwgoK9kzKKjC3WGMia%2BNUduLNb0Pc%3D&reserved=0
> >>           git fetch --no-tags linux-review Jiawei-Gu/drm-sched-Add-device-pointer-to-drm_gpu_scheduler/20220221-175818
> >>           git checkout 9fdafca855faca0a3b8f213f024985c4112fa0bb
> >>           # save the config file to linux build tree
> >>           mkdir build_dir
> >>           COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0
> >> make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/gpu/drm/msm/
> >> drivers/gpu/drm/v3d/
> >>
> >> If you fix the issue, kindly add following tag as appropriate
> >> Reported-by: kernel test robot <lkp at intel.com>
> >>
> >> All errors (new ones prefixed by >>):
> >>
> >>      drivers/gpu/drm/msm/msm_ringbuffer.c: In function 'msm_ringbuffer_new':
> >>>> drivers/gpu/drm/msm/msm_ringbuffer.c:90:15: error: too few arguments to function 'drm_sched_init'
> >>         90 |         ret = drm_sched_init(&ring->sched, &msm_sched_ops,
> >>            |               ^~~~~~~~~~~~~~
> >>      In file included from drivers/gpu/drm/msm/msm_ringbuffer.h:10,
> >>                       from drivers/gpu/drm/msm/msm_ringbuffer.c:7:
> >>      include/drm/gpu_scheduler.h:463:5: note: declared here
> >>        463 | int drm_sched_init(struct drm_gpu_scheduler *sched,
> >>            |     ^~~~~~~~~~~~~~
> >> --
> >>      In file included from drivers/gpu/drm/v3d/v3d_sched.c:23:
> >>      drivers/gpu/drm/v3d/v3d_sched.c: In function 'v3d_sched_init':
> >>>> drivers/gpu/drm/v3d/v3d_drv.h:158:26: error: implicit declaration of
> >>>> function 'to_platform_device'
> >>>> [-Werror=implicit-function-declaration]
> >>        158 | #define v3d_to_pdev(v3d) to_platform_device((v3d)->drm.dev)
> >>            |                          ^~~~~~~~~~~~~~~~~~
> >>      drivers/gpu/drm/v3d/v3d_sched.c:394:49: note: in expansion of macro 'v3d_to_pdev'
> >>        394 |                              NULL, "v3d_bin", &(v3d_to_pdev(v3d)->dev));
> >>            |                                                 ^~~~~~~~~~~
> >>>> drivers/gpu/drm/v3d/v3d_sched.c:394:65: error: invalid type argument
> >>>> of '->' (have 'int')
> >>        394 |                              NULL, "v3d_bin", &(v3d_to_pdev(v3d)->dev));
> >>            |                                                                 ^~
> >>      drivers/gpu/drm/v3d/v3d_sched.c:404:68: error: invalid type argument of '->' (have 'int')
> >>        404 |                              NULL, "v3d_render", &(v3d_to_pdev(v3d)->dev));
> >>            |                                                                    ^~
> >>      drivers/gpu/drm/v3d/v3d_sched.c:416:65: error: invalid type argument of '->' (have 'int')
> >>        416 |                              NULL, "v3d_tfu", &(v3d_to_pdev(v3d)->dev));
> >>            |                                                                 ^~
> >>      drivers/gpu/drm/v3d/v3d_sched.c:429:73: error: invalid type argument of '->' (have 'int')
> >>        429 |                                      NULL, "v3d_csd", &(v3d_to_pdev(v3d)->dev));
> >>            |                                                                         ^~
> >>      drivers/gpu/drm/v3d/v3d_sched.c:441:81: error: invalid type argument of '->' (have 'int')
> >>        441 |                                      NULL, "v3d_cache_clean", &(v3d_to_pdev(v3d)->dev));
> >>            |                                                                                 ^~
> >>      cc1: some warnings being treated as errors
> >>
> >>
> >> vim +/drm_sched_init +90 drivers/gpu/drm/msm/msm_ringbuffer.c
> >>
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   47
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   48  struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id,
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   49                 void *memptrs, uint64_t memptrs_iova)
> >> 7198e6b03155f6 Rob Clark     2013-07-19   50  {
> >> 7198e6b03155f6 Rob Clark     2013-07-19   51         struct msm_ringbuffer *ring;
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   52         long sched_timeout;
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   53         char name[32];
> >> 7198e6b03155f6 Rob Clark     2013-07-19   54         int ret;
> >> 7198e6b03155f6 Rob Clark     2013-07-19   55
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   56         /* We assume everwhere that MSM_GPU_RINGBUFFER_SZ is a power of 2 */
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   57         BUILD_BUG_ON(!is_power_of_2(MSM_GPU_RINGBUFFER_SZ));
> >> 7198e6b03155f6 Rob Clark     2013-07-19   58
> >> 7198e6b03155f6 Rob Clark     2013-07-19   59         ring = kzalloc(sizeof(*ring), GFP_KERNEL);
> >> 7198e6b03155f6 Rob Clark     2013-07-19   60         if (!ring) {
> >> 7198e6b03155f6 Rob Clark     2013-07-19   61                 ret = -ENOMEM;
> >> 7198e6b03155f6 Rob Clark     2013-07-19   62                 goto fail;
> >> 7198e6b03155f6 Rob Clark     2013-07-19   63         }
> >> 7198e6b03155f6 Rob Clark     2013-07-19   64
> >> 7198e6b03155f6 Rob Clark     2013-07-19   65         ring->gpu = gpu;
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   66         ring->id = id;
> >> 84c6127580c1ce Jordan Crouse 2018-11-07   67
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   68         ring->start = msm_gem_kernel_new(gpu->dev, MSM_GPU_RINGBUFFER_SZ,
> >> 604234f33658cd Jordan Crouse 2020-09-03   69                 check_apriv(gpu, MSM_BO_WC | MSM_BO_GPU_READONLY),
> >> 604234f33658cd Jordan Crouse 2020-09-03   70                 gpu->aspace, &ring->bo, &ring->iova);
> >> 8223286d62e296 Jordan Crouse 2017-07-27   71
> >> 69a834c28fb514 Rob Clark     2016-05-24   72         if (IS_ERR(ring->start)) {
> >> 69a834c28fb514 Rob Clark     2016-05-24   73                 ret = PTR_ERR(ring->start);
> >> 375f9a63a66bae Rob Clark     2021-07-27   74                 ring->start = NULL;
> >> 69a834c28fb514 Rob Clark     2016-05-24   75                 goto fail;
> >> 69a834c28fb514 Rob Clark     2016-05-24   76         }
> >> 0815d7749a6852 Jordan Crouse 2018-11-07   77
> >> 0815d7749a6852 Jordan Crouse 2018-11-07   78         msm_gem_object_set_name(ring->bo, "ring%d", id);
> >> 0815d7749a6852 Jordan Crouse 2018-11-07   79
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   80         ring->end   = ring->start + (MSM_GPU_RINGBUFFER_SZ >> 2);
> >> 4c7085a5d581a5 Jordan Crouse 2017-10-20   81         ring->next  = ring->start;
> >> 7198e6b03155f6 Rob Clark     2013-07-19   82         ring->cur   = ring->start;
> >> 7198e6b03155f6 Rob Clark     2013-07-19   83
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   84         ring->memptrs = memptrs;
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   85         ring->memptrs_iova = memptrs_iova;
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   86
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   87          /* currently managing hangcheck ourselves: */
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   88         sched_timeout = MAX_SCHEDULE_TIMEOUT;
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   89
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27  @90         ret = drm_sched_init(&ring->sched, &msm_sched_ops,
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   91                         num_hw_submissions, 0, sched_timeout,
> >> f1b7996551a40a Dave Airlie   2021-07-30   92                         NULL, NULL, to_msm_bo(ring->bo)->name);
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   93         if (ret) {
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   94                 goto fail;
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   95         }
> >> 1d8a5ca436ee4a Rob Clark     2021-07-27   96
> >> f97decac5f4c2d Jordan Crouse 2017-10-20   97         INIT_LIST_HEAD(&ring->submits);
> >> 77d205290aa944 Rob Clark     2020-10-23   98         spin_lock_init(&ring->submit_lock);
> >> 77c406038e830a Rob Clark     2020-10-23   99         spin_lock_init(&ring->preempt_lock);
> >> f97decac5f4c2d Jordan Crouse 2017-10-20  100
> >> f97decac5f4c2d Jordan Crouse 2017-10-20  101         snprintf(name, sizeof(name), "gpu-ring-%d", ring->id);
> >> f97decac5f4c2d Jordan Crouse 2017-10-20  102
> >> da3d378dec8634 Rob Clark     2021-07-26  103         ring->fctx = msm_fence_context_alloc(gpu->dev, &ring->memptrs->fence, name);
> >> 7198e6b03155f6 Rob Clark     2013-07-19  104
> >> 7198e6b03155f6 Rob Clark     2013-07-19  105         return ring;
> >> 7198e6b03155f6 Rob Clark     2013-07-19  106
> >> 7198e6b03155f6 Rob Clark     2013-07-19  107  fail:
> >> 7198e6b03155f6 Rob Clark     2013-07-19  108         msm_ringbuffer_destroy(ring);
> >> 7198e6b03155f6 Rob Clark     2013-07-19  109         return ERR_PTR(ret);
> >> 7198e6b03155f6 Rob Clark     2013-07-19  110  }
> >> 7198e6b03155f6 Rob Clark     2013-07-19  111
> >>
> >> ---
> >> 0-DAY CI Kernel Test Service, Intel Corporation
> >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> >> s.01.org%2Fhyperkitty%2Flist%2Fkbuild-all%40lists.01.org&data=04%7
> >> C01%7CChristian.Koenig%40amd.com%7C33c94d7ecffe465c671d08d9f5522651%7C
> >> 3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637810555454343325%7CUnknow
> >> n%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLC
> >> JXVCI6Mn0%3D%7C3000&sdata=JTbXE%2Fv85yMSdX1zm4Em1aUZ32N29bf3FrllBk
> >> r%2BsMQ%3D&reserved=0
>


More information about the amd-gfx mailing list