From: kernel test robot <lkp@intel.com>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [robh:rust/panthor-6.10 9/10] drivers/gpu/drm/panthor/panthor_drv.c:749:5: warning: no previous prototype for '_panthor_ioctl_dev_query'
Date: Fri, 26 Jul 2024 02:15:49 +0800 [thread overview]
Message-ID: <202407260221.kYZGePy2-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git rust/panthor-6.10
head: 8d146622f07c7965de15d20b04e0d92bcaa50d87
commit: 1bd8126e54589ff493836d6dc93b829ba99211f4 [9/10] drm/panthor: Add rust driver stub
config: arm-randconfig-002-20240726 (https://download.01.org/0day-ci/archive/20240726/202407260221.kYZGePy2-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240726/202407260221.kYZGePy2-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407260221.kYZGePy2-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/panthor/panthor_drv.c:749:5: warning: no previous prototype for '_panthor_ioctl_dev_query' [-Wmissing-prototypes]
749 | int _panthor_ioctl_dev_query(struct panthor_device *ptdev, struct drm_panthor_dev_query *args)
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:778:5: warning: no previous prototype for 'panthor_ioctl_dev_query' [-Wmissing-prototypes]
778 | int panthor_ioctl_dev_query(struct drm_device *ddev, void *data, struct drm_file *file)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:787:5: warning: no previous prototype for '_panthor_ioctl_vm_create' [-Wmissing-prototypes]
787 | int _panthor_ioctl_vm_create(struct panthor_device *ptdev, struct drm_panthor_vm_create *args,
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:806:5: warning: no previous prototype for 'panthor_ioctl_vm_create' [-Wmissing-prototypes]
806 | int panthor_ioctl_vm_create(struct drm_device *ddev, void *data,
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:888:5: warning: no previous prototype for 'panthor_group_submit' [-Wmissing-prototypes]
888 | int panthor_group_submit(struct drm_device *ddev, struct drm_panthor_group_submit *args,
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:1010:5: warning: no previous prototype for '_panthor_group_create' [-Wmissing-prototypes]
1010 | int _panthor_group_create(struct drm_panthor_group_create *args,
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:1048:5: warning: no previous prototype for 'panthor_tiler_heap_create' [-Wmissing-prototypes]
1048 | int panthor_tiler_heap_create(struct panthor_file *pfile,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:1096:5: warning: no previous prototype for 'panthor_tiler_heap_destroy' [-Wmissing-prototypes]
1096 | int panthor_tiler_heap_destroy(struct panthor_file *pfile,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:1131:5: warning: no previous prototype for 'panthor_ioctl_vm_bind_async' [-Wmissing-prototypes]
1131 | int panthor_ioctl_vm_bind_async(struct drm_panthor_vm_bind *args,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/panthor/panthor_drv.c:1199:5: warning: no previous prototype for 'panthor_ioctl_vm_bind_sync' [-Wmissing-prototypes]
1199 | int panthor_ioctl_vm_bind_sync(struct drm_panthor_vm_bind *args,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/panthor/panthor_drv.c:1272:1: warning: no previous prototype for '_panthor_open' [-Wmissing-prototypes]
1272 | _panthor_open(struct panthor_device *ptdev, struct drm_file *file)
| ^~~~~~~~~~~~~
vim +/_panthor_ioctl_dev_query +749 drivers/gpu/drm/panthor/panthor_drv.c
748
> 749 int _panthor_ioctl_dev_query(struct panthor_device *ptdev, struct drm_panthor_dev_query *args)
750 {
751 if (!args->pointer) {
752 switch (args->type) {
753 case DRM_PANTHOR_DEV_QUERY_GPU_INFO:
754 args->size = sizeof(ptdev->gpu_info);
755 return 0;
756
757 case DRM_PANTHOR_DEV_QUERY_CSIF_INFO:
758 args->size = sizeof(ptdev->csif_info);
759 return 0;
760
761 default:
762 return -EINVAL;
763 }
764 }
765
766 switch (args->type) {
767 case DRM_PANTHOR_DEV_QUERY_GPU_INFO:
768 return PANTHOR_UOBJ_SET(args->pointer, args->size, ptdev->gpu_info);
769
770 case DRM_PANTHOR_DEV_QUERY_CSIF_INFO:
771 return PANTHOR_UOBJ_SET(args->pointer, args->size, ptdev->csif_info);
772
773 default:
774 return -EINVAL;
775 }
776 }
777
> 778 int panthor_ioctl_dev_query(struct drm_device *ddev, void *data, struct drm_file *file)
779 {
780 struct panthor_file *pfile = file->driver_priv;
781
782 return _panthor_ioctl_dev_query(pfile->ptdev, data);
783 }
784
785 #define PANTHOR_VM_CREATE_FLAGS 0
786
> 787 int _panthor_ioctl_vm_create(struct panthor_device *ptdev, struct drm_panthor_vm_create *args,
788 const struct drm_file *file)
789 {
790 struct panthor_file *pfile = file->driver_priv;
791 int cookie, ret;
792
793 if (!drm_dev_enter(ptdev->base, &cookie))
794 return -ENODEV;
795
796 ret = panthor_vm_pool_create_vm(ptdev, pfile->vms, args);
797 if (ret >= 0) {
798 args->id = ret;
799 ret = 0;
800 }
801
802 drm_dev_exit(cookie);
803 return ret;
804 }
805
> 806 int panthor_ioctl_vm_create(struct drm_device *ddev, void *data,
807 struct drm_file *file)
808 {
809 struct panthor_file *pfile = file->driver_priv;
810
811 return _panthor_ioctl_vm_create(pfile->ptdev, data, file);
812 }
813
814 static int panthor_ioctl_vm_destroy(struct drm_device *ddev, void *data,
815 struct drm_file *file)
816 {
817 struct panthor_file *pfile = file->driver_priv;
818 struct drm_panthor_vm_destroy *args = data;
819
820 if (args->pad)
821 return -EINVAL;
822
823 return panthor_vm_pool_destroy_vm(pfile->vms, args->id);
824 }
825
826 #define PANTHOR_BO_FLAGS DRM_PANTHOR_BO_NO_MMAP
827
828 static int panthor_ioctl_bo_create(struct drm_device *ddev, void *data,
829 struct drm_file *file)
830 {
831 struct panthor_file *pfile = file->driver_priv;
832 struct drm_panthor_bo_create *args = data;
833 struct panthor_vm *vm = NULL;
834 int cookie, ret;
835
836 if (!drm_dev_enter(ddev, &cookie))
837 return -ENODEV;
838
839 if (!args->size || args->pad ||
840 (args->flags & ~PANTHOR_BO_FLAGS)) {
841 ret = -EINVAL;
842 goto out_dev_exit;
843 }
844
845 if (args->exclusive_vm_id) {
846 vm = panthor_vm_pool_get_vm(pfile->vms, args->exclusive_vm_id);
847 if (!vm) {
848 ret = -EINVAL;
849 goto out_dev_exit;
850 }
851 }
852
853 ret = panthor_gem_create_with_handle(file, ddev, vm, &args->size,
854 args->flags, &args->handle);
855
856 panthor_vm_put(vm);
857
858 out_dev_exit:
859 drm_dev_exit(cookie);
860 return ret;
861 }
862
863 static int panthor_ioctl_bo_mmap_offset(struct drm_device *ddev, void *data,
864 struct drm_file *file)
865 {
866 struct drm_panthor_bo_mmap_offset *args = data;
867 struct drm_gem_object *obj;
868 int ret;
869
870 if (args->pad)
871 return -EINVAL;
872
873 obj = drm_gem_object_lookup(file, args->handle);
874 if (!obj)
875 return -ENOENT;
876
877 ret = drm_gem_create_mmap_offset(obj);
878 if (ret)
879 goto out;
880
881 args->offset = drm_vma_node_offset_addr(&obj->vma_node);
882
883 out:
884 drm_gem_object_put(obj);
885 return ret;
886 }
887
> 888 int panthor_group_submit(struct drm_device *ddev, struct drm_panthor_group_submit *args,
889 struct drm_file *file)
890 {
891 struct panthor_file *pfile = file->driver_priv;
892 struct drm_panthor_queue_submit *jobs_args;
893 struct panthor_submit_ctx ctx;
894 int ret = 0, cookie;
895
896 if (args->pad)
897 return -EINVAL;
898
899 if (!drm_dev_enter(ddev, &cookie))
900 return -ENODEV;
901
902 ret = PANTHOR_UOBJ_GET_ARRAY(jobs_args, &args->queue_submits);
903 if (ret)
904 goto out_dev_exit;
905
906 ret = panthor_submit_ctx_init(&ctx, file, args->queue_submits.count);
907 if (ret)
908 goto out_free_jobs_args;
909
910 /* Create jobs and attach sync operations */
911 for (u32 i = 0; i < args->queue_submits.count; i++) {
912 const struct drm_panthor_queue_submit *qsubmit = &jobs_args[i];
913 struct drm_sched_job *job;
914
915 job = panthor_job_create(pfile, args->group_handle, qsubmit);
916 if (IS_ERR(job)) {
917 ret = PTR_ERR(job);
918 goto out_cleanup_submit_ctx;
919 }
920
921 ret = panthor_submit_ctx_add_job(&ctx, i, job, &qsubmit->syncs);
922 if (ret)
923 goto out_cleanup_submit_ctx;
924 }
925
926 /*
927 * Collect signal operations on all jobs, such that each job can pick
928 * from it for its dependencies and update the fence to signal when the
929 * job is submitted.
930 */
931 ret = panthor_submit_ctx_collect_jobs_signal_ops(&ctx);
932 if (ret)
933 goto out_cleanup_submit_ctx;
934
935 /*
936 * We acquire/prepare revs on all jobs before proceeding with the
937 * dependency registration.
938 *
939 * This is solving two problems:
940 * 1. drm_sched_job_arm() and drm_sched_entity_push_job() must be
941 * protected by a lock to make sure no concurrent access to the same
942 * entity get interleaved, which would mess up with the fence seqno
943 * ordering. Luckily, one of the resv being acquired is the VM resv,
944 * and a scheduling entity is only bound to a single VM. As soon as
945 * we acquire the VM resv, we should be safe.
946 * 2. Jobs might depend on fences that were issued by previous jobs in
947 * the same batch, so we can't add dependencies on all jobs before
948 * arming previous jobs and registering the fence to the signal
949 * array, otherwise we might miss dependencies, or point to an
950 * outdated fence.
951 */
952 if (args->queue_submits.count > 0) {
953 /* All jobs target the same group, so they also point to the same VM. */
954 struct panthor_vm *vm = panthor_job_vm(ctx.jobs[0].job);
955
956 drm_exec_until_all_locked(&ctx.exec) {
957 ret = panthor_vm_prepare_mapped_bos_resvs(&ctx.exec, vm,
958 args->queue_submits.count);
959 }
960
961 if (ret)
962 goto out_cleanup_submit_ctx;
963 }
964
965 /*
966 * Now that resvs are locked/prepared, we can iterate over each job to
967 * add the dependencies, arm the job fence, register the job fence to
968 * the signal array.
969 */
970 ret = panthor_submit_ctx_add_deps_and_arm_jobs(&ctx);
971 if (ret)
972 goto out_cleanup_submit_ctx;
973
974 /* Nothing can fail after that point, so we can make our job fences
975 * visible to the outside world. Push jobs and set the job fences to
976 * the resv slots we reserved. This also pushes the fences to the
977 * syncobjs that are part of the signal array.
978 */
979 panthor_submit_ctx_push_jobs(&ctx, panthor_job_update_resvs);
980
981 out_cleanup_submit_ctx:
982 panthor_submit_ctx_cleanup(&ctx, panthor_job_put);
983
984 out_free_jobs_args:
985 kvfree(jobs_args);
986
987 out_dev_exit:
988 drm_dev_exit(cookie);
989 return ret;
990 }
991
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-07-25 18:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202407260221.kYZGePy2-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.