drm/i915: Add GETPARAM for GuC submission version
Subsystems (3)
Joonas Lahtinen
maintainerRFC PATCH 1/1 drm/i915: Add GETPARAM for GuC submission version
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)
drivers/gpu/drm/i915/i915_getparam.c +12 -0
@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,if (value <0 )return value;break ; +case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH : +if (!intel_uc_uses_guc_submission (&to_gt (i915)->uc)) +return -ENODEV ; +if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR ) + value =to_gt (i915)->uc.guc.submission_version.major; +else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value =to_gt (i915)->uc.guc.submission_version.minor; +else + value =to_gt (i915)->uc.guc.submission_version.patch; +break ;case I915_PARAM_MMAP_GTT_VERSION :/* Though we've started our numbering from 1, and so class all * earlier versions as 0, in effect their value is undefined as
include/uapi/drm/i915_drm.h +13 -0
@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number +* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 +/* Must be kept compact -- no holes and well documented */ /**
Signature · 1 line
2.43.0
Patchwork
CI✗ Fi.CI.SPARSE: warning for drm/i915: Add GETPARAM for GuC submission version
== Series Details ==
== Series Details ==
Series: drm/i915: Add GETPARAM for GuC submission version
URL : https://patchwork.freedesktop.org/series/129122/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Add GETPARAM for GuC submission version
In reply to Joonas Lahtinen== Series Details ==
== Series Details ==
Series: drm/i915: Add GETPARAM for GuC submission version
URL : https://patchwork.freedesktop.org/series/129122/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_14168 -> Patchwork_129122v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_129122v1 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_129122v1, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/index.html
Participating hosts (38 -> 37)
------------------------------
Additional (1): bat-kbl-2
Missing (2): fi-snb-2520m fi-pnv-d510
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_129122v1:
### IGT changes ###
#### Possible regressions ####
* igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size:
- fi-tgl-1115g4: [PASS][1] -> [SKIP][2] +5 other tests skip
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14168/fi-tgl-1115g4/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
* igt@kms_pipe_crc_basic@hang-read-crc:
- fi-tgl-1115g4: NOTRUN -> [SKIP][3] +6 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
#### Warnings ####
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-tgl-1115g4: [SKIP][4] ([i915#4103]) -> [SKIP][5] +1 other test skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14168/fi-tgl-1115g4/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
* igt@kms_dsc@dsc-basic:
- fi-tgl-1115g4: [SKIP][6] ([i915#3555] / [i915#3840]) -> [SKIP][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14168/fi-tgl-1115g4/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_129122v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@fbdev@info:
- bat-kbl-2: NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#1849])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-kbl-2/igt@[email protected]
- fi-tgl-1115g4: [PASS][9] -> [SKIP][10] ([i915#1849] / [i915#2582])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14168/fi-tgl-1115g4/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
* igt@fbdev@nullptr:
- fi-tgl-1115g4: [PASS][11] -> [SKIP][12] ([i915#2582]) +3 other tests skip
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14168/fi-tgl-1115g4/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
* igt@gem_lmem_swapping@basic:
- fi-apl-guc: NOTRUN -> [SKIP][13] ([fdo#109271] / [i915#4613]) +3 other tests skip
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-apl-guc/igt@[email protected]
* igt@gem_lmem_swapping@parallel-random-engines:
- bat-kbl-2: NOTRUN -> [SKIP][14] ([fdo#109271]) +35 other tests skip
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-kbl-2/igt@[email protected]
* igt@gem_lmem_swapping@verify-random:
- bat-mtlp-8: NOTRUN -> [SKIP][15] ([i915#4613]) +3 other tests skip
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@i915_pm_rps@basic-api:
- bat-mtlp-8: NOTRUN -> [SKIP][16] ([i915#6621])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-mtlp-8: NOTRUN -> [SKIP][17] ([i915#5190])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@kms_addfb_basic@basic-y-tiled-legacy:
- bat-mtlp-8: NOTRUN -> [SKIP][18] ([i915#4212]) +8 other tests skip
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@kms_busy@basic:
- fi-tgl-1115g4: NOTRUN -> [SKIP][19] ([i915#4303])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-mtlp-8: NOTRUN -> [SKIP][20] ([i915#4213]) +1 other test skip
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@kms_dsc@dsc-basic:
- bat-mtlp-8: NOTRUN -> [SKIP][21] ([i915#3555] / [i915#3840] / [i915#9159])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@kms_flip@basic-plain-flip:
- fi-tgl-1115g4: NOTRUN -> [SKIP][22] ([i915#3637]) +3 other tests skip
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
* igt@kms_force_connector_basic@force-load-detect:
- bat-mtlp-8: NOTRUN -> [SKIP][23] ([fdo#109285])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@kms_force_connector_basic@prune-stale-modes:
- bat-mtlp-8: NOTRUN -> [SKIP][24] ([i915#5274])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-tgl-1115g4: [PASS][25] -> [SKIP][26] ([i915#1849])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14168/fi-tgl-1115g4/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
* igt@kms_hdmi_inject@inject-audio:
- fi-apl-guc: NOTRUN -> [SKIP][27] ([fdo#109271]) +13 other tests skip
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-apl-guc/igt@[email protected]
* igt@kms_setmode@basic-clone-single-crtc:
- bat-mtlp-8: NOTRUN -> [SKIP][28] ([i915#3555] / [i915#8809])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@prime_vgem@basic-fence-flip:
- fi-tgl-1115g4: [PASS][29] -> [SKIP][30] ([fdo#109295])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14168/fi-tgl-1115g4/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/fi-tgl-1115g4/igt@[email protected]
* igt@prime_vgem@basic-fence-mmap:
- bat-mtlp-8: NOTRUN -> [SKIP][31] ([i915#3708] / [i915#4077]) +1 other test skip
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
* igt@prime_vgem@basic-fence-read:
- bat-mtlp-8: NOTRUN -> [SKIP][32] ([i915#3708]) +2 other tests skip
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
#### Possible fixes ####
* igt@i915_hangman@error-state-basic:
- bat-mtlp-8: [ABORT][33] ([i915#9414]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14168/bat-mtlp-8/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/bat-mtlp-8/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4303]: https://gitlab.freedesktop.org/drm/intel/issues/4303
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#5591]: https://gitlab.freedesktop.org/drm/intel/issues/5591
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#8809]: https://gitlab.freedesktop.org/drm/intel/issues/8809
[i915#9159]: https://gitlab.freedesktop.org/drm/intel/issues/9159
[i915#9414]: https://gitlab.freedesktop.org/drm/intel/issues/9414
[i915#9688]: https://gitlab.freedesktop.org/drm/intel/issues/9688
Build changes
-------------
* Linux: CI_DRM_14168 -> Patchwork_129122v1
CI-20190529: 20190529
CI_DRM_14168: 0496fe20d8ed5e73ed186d293ef67e7bae4658eb @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7690: aa45298ff675abbe6bf8f04ae186e2388c35f03a @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_129122v1: 0496fe20d8ed5e73ed186d293ef67e7bae4658eb @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
eed8c4ce7e14 drm/i915: Add GETPARAM for GuC submission version
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129122v1/index.html
Quoted 4 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
There was https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1 which does everything in one go so would be my preference.
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 42 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,if (value <0 )return value;break ; +case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH : +if (!intel_uc_uses_guc_submission (&to_gt (i915)->uc)) +return -ENODEV ; +if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR ) + value =to_gt (i915)->uc.guc.submission_version.major; +else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value =to_gt (i915)->uc.guc.submission_version.minor; +else + value =to_gt (i915)->uc.guc.submission_version.patch; +break ;case I915_PARAM_MMAP_GTT_VERSION :/* Though we've started our numbering from 1, and so class all * earlier versions as 0, in effect their value is undefined as include/uapi/drm/i915_drm.h +0
-0
include/uapi/drm/i915_drm.h typedef struct drm_i915_irq_wait { · line 810
Quoted 5 lines
include/uapi/drm/i915_drm.h +2
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number
What is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
include/uapi/drm/i915_drm.h +11
-0+* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 +/* Must be kept compact -- no holes and well documented */ /**
Quoted 7 lines · Tvrtko Ursulin
Quoted 4 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
There was https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1 which does everything in one go so would be my preference.
I also think that the original version is a cleaner implementation.
Quoted 2 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
The file version number should not be exposed to UMDs, only the submission version. The whole purpose of the submission version is to track user facing changes. There was a very, very, very long discussion about that to which all parties did eventually agree on using the submission version.
The outstanding issues were simply a) whether UMDs should be tracking version numbers and all the complications that arise with branching and non-linear numbering, b) should it just be exposed as a feature flag instead and c) this will prevent hangs in certain specific situations but it won't prevent the system running slowly and not using the full capabilities of the hardware, for that we need to be making sure that distros actually update to a firmware release that is not ancient.
Quoted 43 lines
Quoted 43 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>---
drivers/gpu/drm/i915/i915_getparam.c| 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, if (value < 0) return value; break; + case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH: + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR) + value = to_gt(i915)->uc.guc.submission_version.major; + else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value = to_gt(i915)->uc.guc.submission_version.minor; + else + value = to_gt(i915)->uc.guc.submission_version.patch; + break;case
I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined asinclude/uapi/drm/i915_drm.h +0
-1--- a/include/uapi/drm/i915_drm.h
Quoted 8 lines
Quoted 6 lines
+++
b/include/uapi/drm/i915_drm.hinclude/uapi/drm/i915_drm.h +0
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58+/*
+ * Query for the GuC submission/VF interface version numberWhat is this VF you speak of? :/
Agreed. There is no SRIOV support in i915 so i915 should not be mentioning SRIOV specific features.
John.
Quoted 19 lines
Regards,
Tvrtko
Quoted 14 lines
+ *
+ *-ENODEVis returned if GuC submission is not used
+ *
+ * On success, returns the respective GuC submission/VF interface major,
+ * minor or patch version as per the requested parameter.
+ *
+ */include/uapi/drm/i915_drm.h +4
-0+#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 +/* Must be kept compact -- no holes and well documented */ /**
Kenneth Graunke
Reviewed-byQuoted 10 lines · PST Tvrtko Ursulin
Quoted 4 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.
Joonas's patch posted here is:
I'm fine with the approach that Tvrtko linked as well, querying all three in one ioctl makes some sense. That particular patch looked like it needed some (trivial) cleaning up before landing, though. Either approach works for me.
I agree with John, the submission version should be fine for us.
Thanks a lot for taking care of this.
Quoted 9 lines · Tvrtko Ursulin
Quoted 4 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.
IMO Joonas version brings less burden to be maintained(no new struct).
But both versions works, please just get into some agreement so we can move this forward.
Quoted 73 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 42 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,if (value <0 )return value;break ; +case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH : +if (!intel_uc_uses_guc_submission (&to_gt (i915)->uc)) +return -ENODEV ; +if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR ) + value =to_gt (i915)->uc.guc.submission_version.major; +else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value =to_gt (i915)->uc.guc.submission_version.minor; +else + value =to_gt (i915)->uc.guc.submission_version.patch; +break ;case I915_PARAM_MMAP_GTT_VERSION :/* Though we've started our numbering from 1, and so class all * earlier versions as 0, in effect their value is undefined as include/uapi/drm/i915_drm.h +0
-0include/uapi/drm/i915_drm.h typedef struct drm_i915_irq_wait { · line 810
Quoted 5 lines
include/uapi/drm/i915_drm.h +2
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number What is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
include/uapi/drm/i915_drm.h +11
-0+* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 +/* Must be kept compact -- no holes and well documented */ /**
Quoted 7 lines · Jose
Quoted 6 lines · Tvrtko Ursulin
Quoted 4 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
Quoted 6 lines
Quoted 3 lines
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.IMO Joonas version brings less burden to be maintained(no new struct).
But both versions works, please just get into some agreement so we can move this forward.
So I would really prefer the query. Simplified version would do like the compile tested only:
drivers/gpu/drm/i915/i915_query.c +32 -0
@@ -551,6 +551,37 @@ static int query_hwconfig_blob(struct drm_i915_private *i915,return hwconfig->size; } +static int +query_guc_submission_version (struct drm_i915_private *i915, +struct drm_i915_query_item *query) +{ +struct drm_i915_query_guc_submission_version __user *query_ptr = +u64_to_user_ptr (query->data_ptr); +struct drm_i915_query_guc_submission_version ver; +struct intel_guc *guc = &to_gt (i915)->uc.guc; +const size_t size =sizeof (ver); +int ret; + +if (!intel_uc_uses_guc_submission (&to_gt (i915)->uc)) +return -ENODEV ; + + ret =copy_query_item (&ver, size, size, query); +if (ret !=0 ) +return ret; + +if (ver.major || ver.minor || ver.patch) +return -EINVAL ; + + ver.major = guc->submission_version.major; + ver.minor = guc->submission_version.minor; + ver.patch = guc->submission_version.patch; + +if (copy_to_user (query_ptr, &ver, size)) +return -EFAULT ; + +return 0 ; +} +static int (*const i915_query_funcs[])(struct drm_i915_private *dev_priv,struct drm_i915_query_item *query_item) = { query_topology_info,
@@ -559,6 +590,7 @@ static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv, query_memregion_info, query_hwconfig_blob, query_geometry_subslices, + query_guc_submission_version, };int i915_query_ioctl (struct drm_device *dev,void *data,struct drm_file *file)
include/uapi/drm/i915_drm.h +11 -0
@@ -3038,6 +3038,7 @@ struct drm_i915_query_item {* - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions) * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`) * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info) +* - %DRM_I915_QUERY_GUC_SUBMISSION_VERSION (see struct drm_i915_query_guc_submission_version) */ __u64 query_id;#define DRM_I915_QUERY_TOPOLOGY_INFO 1
@@ -3046,6 +3047,7 @@ struct drm_i915_query_item {#define DRM_I915_QUERY_MEMORY_REGIONS 4#define DRM_I915_QUERY_HWCONFIG_BLOB 5#define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +#define DRM_I915_QUERY_GUC_SUBMISSION_VERSION 7/* Must be kept compact -- no holes and well documented */ /**
@@ -3591,6 +3593,15 @@ struct drm_i915_query_memory_regions {struct drm_i915_memory_region_info regions[]; }; +/** +* struct drm_i915_query_guc_submission_version - query GuC submission interface version +*/ +struct drm_i915_query_guc_submission_version { +__u64 major; +__u64 minor; +__u64 patch; +}; +/** * DOC: GuC HWCONFIG blob uAPI *
It is not that much bigger that the triple get param and IMO nicer.
But if there is no motivation to do it properly then feel free to proceed with this, I will not block it.
Regards,
Tvrtko
P.S.
Probably still make sure to remove the reference to SR-IOV.
Quoted 75 lines
Quoted 74 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 42 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,if (value <0 )return value;break ; +case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH : +if (!intel_uc_uses_guc_submission (&to_gt (i915)->uc)) +return -ENODEV ; +if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR ) + value =to_gt (i915)->uc.guc.submission_version.major; +else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value =to_gt (i915)->uc.guc.submission_version.minor; +else + value =to_gt (i915)->uc.guc.submission_version.patch; +break ;case I915_PARAM_MMAP_GTT_VERSION :/* Though we've started our numbering from 1, and so class all * earlier versions as 0, in effect their value is undefined as include/uapi/drm/i915_drm.h +0
-0include/uapi/drm/i915_drm.h typedef struct drm_i915_irq_wait { · line 810
Quoted 5 lines
include/uapi/drm/i915_drm.h +2
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number What is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
include/uapi/drm/i915_drm.h +11
-0+* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 +/* Must be kept compact -- no holes and well documented */ /**
Quoted 8 lines · Tvrtko Ursulin
Quoted 7 lines · Jose
Quoted 6 lines · Tvrtko Ursulin
Quoted 4 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.IMO Joonas version brings less burden to be maintained(no new struct).
But both versions works, please just get into some agreement so we can move this forward.So I would really prefer the query. Simplified version would do like the compile tested only:
Vivaik's patch is definitely preferred. It is much cleaner to make one single call than having to make four separate calls. It is also extensible to other firmwares if required. The only blockage against it was whether it was a good thing to report at all. If that blockage is no longer valid then we should just merge the patch that has already been discussed, polished, fixed, etc. rather than starting the whole process from scratch.
And note that it is four calls not three. The code below is missing the branch version number.
John.
Quoted 179 lines
drivers/gpu/drm/i915/i915_query.c +31
-0@@ -551,6 +551,37 @@ static int query_hwconfig_blob(struct drm_i915_private *i915, return hwconfig->size; } +static int +query_guc_submission_version (struct drm_i915_private *i915, + struct drm_i915_query_item *query) +{ + struct drm_i915_query_guc_submission_version __user *query_ptr = +u64_to_user_ptr (query->data_ptr); + struct drm_i915_query_guc_submission_version ver; + struct intel_guc *guc = &to_gt(i915)->uc.guc; + const size_t size = sizeof(ver); + int ret; + + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + + ret = copy_query_item(&ver, size, size, query); + if (ret != 0) + return ret; + + if (ver.major || ver.minor || ver.patch) + return -EINVAL; + + ver.major = guc->submission_version.major; + ver.minor = guc->submission_version.minor; + ver.patch = guc->submission_version.patch; + + if (copy_to_user(query_ptr, &ver, size)) + return -EFAULT; + + return 0; +} + static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv, struct drm_i915_query_item *query_item) = {
query_topology_info,drivers/gpu/drm/i915/i915_query.c +1
-0@@ -559,6 +590,7 @@ static int (* const i915_query_funcs[])(structdrm_i915_private *dev_priv, query_memregion_info, query_hwconfig_blob, query_geometry_subslices, + query_guc_submission_version, };int
i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)include/uapi/drm/i915_drm.h +1
-0@@ -3038,6 +3038,7 @@ struct drm_i915_query_item {* - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions) * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`) * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info) +* - %DRM_I915_QUERY_GUC_SUBMISSION_VERSION (see struct drm_i915_query_guc_submission_version) */ __u64 query_id;#define DRM_I915_QUERY_TOPOLOGY_INFO 1
include/uapi/drm/i915_drm.h +3
-0@@ -3046,6 +3047,7 @@ struct drm_i915_query_item { #define DRM_I915_QUERY_MEMORY_REGIONS 4 #define DRM_I915_QUERY_HWCONFIG_BLOB 5 #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +#define DRM_I915_QUERY_GUC_SUBMISSION_VERSION 7 /* Must be kept compact -- no holes and well documented */ /**@@ -3591,6 +3593,15 @@ struct drm_i915_query_memory_regions { struct drm_i915_memory_region_info regions[]; }; +/** +* struct drm_i915_query_guc_submission_version - query GuC submission interface version
include/uapi/drm/i915_drm.h +7
-0+*/ +struct drm_i915_query_guc_submission_version { + __u64 major; + __u64 minor; + __u64 patch; +}; +/**
* DOC: GuC HWCONFIG blob uAPI
*It is not that much bigger that the triple get param and IMO nicer.
But if there is no motivation to do it properly then feel free to proceed with this, I will not block it.
Regards,
Tvrtko
P.S.
Probably still make sure to remove the reference to SR-IOV.Quoted 76 lines
Quoted 75 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 46 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>---
drivers/gpu/drm/i915/i915_getparam.c| 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, if (value < 0) return value; break; + case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH: + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR) + value = to_gt(i915)->uc.guc.submission_version.major; + else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value = to_gt(i915)->uc.guc.submission_version.minor; + else + value = to_gt(i915)->uc.guc.submission_version.patch; + break;case
I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined asinclude/uapi/drm/i915_drm.h +0
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58Quoted 2 lines
+/*
+ * Query for the GuC submission/VF interface version numberWhat is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
+ *
+ *-ENODEVis returned if GuC submission is not used
+ *
+ * On success, returns the respective GuC submission/VF interface major,
+ * minor or patch version as per the requested parameter.
+ *
+ */include/uapi/drm/i915_drm.h +4
-0+#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 +/* Must be kept compact -- no holes and well documented */ /**
Quoted 19 lines · John Harrison
Quoted 12 lines · Tvrtko Ursulin
Quoted 11 lines · Jose
Quoted 9 lines · Tvrtko Ursulin
Quoted 4 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.Quoted 6 lines
Quoted 3 lines
IMO Joonas version brings less burden to be maintained(no new struct). But both versions works, please just get into some agreement so we can move this forward.
So I would really prefer the query. Simplified version would do like the compile tested only:
Quoted 7 lines
Vivaik's patch is definitely preferred. It is much cleaner to make one single call than having to make four separate calls. It is also extensible to other firmwares if required. The only blockage against it was whether it was a good thing to report at all. If that blockage is no longer valid then we should just merge the patch that has already been discussed, polished, fixed, etc. rather than starting the whole process from scratch.
Agreed.
Vivaik can you please rebase and send it again?
Quoted 197 lines
And note that it is four calls not three. The code below is missing the branch version number.
John.
Quoted 190 lines
drivers/gpu/drm/i915/i915_query.c +31
-0@@ -551,6 +551,37 @@ static int query_hwconfig_blob(struct drm_i915_private *i915, return hwconfig->size; } +static int +query_guc_submission_version (struct drm_i915_private *i915, + struct drm_i915_query_item *query) +{ + struct drm_i915_query_guc_submission_version __user *query_ptr = +u64_to_user_ptr (query->data_ptr); + struct drm_i915_query_guc_submission_version ver; + struct intel_guc *guc = &to_gt(i915)->uc.guc; + const size_t size = sizeof(ver); + int ret; + + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + + ret = copy_query_item(&ver, size, size, query); + if (ret != 0) + return ret; + + if (ver.major || ver.minor || ver.patch) + return -EINVAL; + + ver.major = guc->submission_version.major; + ver.minor = guc->submission_version.minor; + ver.patch = guc->submission_version.patch; + + if (copy_to_user(query_ptr, &ver, size)) + return -EFAULT; + + return 0; +} +static int (* const i915_query_funcs[])(struct
drm_i915_private*dev_priv,
structdrm_i915_query_item*query_item) = {
query_topology_info,drivers/gpu/drm/i915/i915_query.c +1
-0@@ -559,6 +590,7 @@ static int (* const i915_query_funcs[])(structdrm_i915_private *dev_priv, query_memregion_info, query_hwconfig_blob, query_geometry_subslices, + query_guc_submission_version, };int
i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)include/uapi/drm/i915_drm.h +1
-0@@ -3038,6 +3038,7 @@ struct drm_i915_query_item { * - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions) * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`) * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info) + * - %DRM_I915_QUERY_GUC_SUBMISSION_VERSION (see struct
drm_i915_query_guc_submission_version)
*/
__u64query_id;
#define DRM_I915_QUERY_TOPOLOGY_INFO 1include/uapi/drm/i915_drm.h +3
-0@@ -3046,6 +3047,7 @@ struct drm_i915_query_item { #define DRM_I915_QUERY_MEMORY_REGIONS 4 #define DRM_I915_QUERY_HWCONFIG_BLOB 5 #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +#define DRM_I915_QUERY_GUC_SUBMISSION_VERSION 7 /* Must be kept compact -- no holes and well documented */ /**@@ -3591,6 +3593,15 @@ struct drm_i915_query_memory_regions { struct drm_i915_memory_region_info regions[]; }; +/** +* struct drm_i915_query_guc_submission_version - query GuC submission interface version
include/uapi/drm/i915_drm.h +7
-0+*/ +struct drm_i915_query_guc_submission_version { + __u64 major; + __u64 minor; + __u64 patch; +}; +/**
* DOC: GuC HWCONFIG blob uAPI
*It is not that much bigger that the triple get param and IMO nicer.
But if there is no motivation to do it properly then feel free to proceed with this, I will not block it.
Regards,
Tvrtko
P.S.
Probably still make sure to remove the reference to SR-IOV.Quoted 79 lines
Quoted 78 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 49 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>---
drivers/gpu/drm/i915/i915_getparam.c| 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, if (value < 0) return value; break; + case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH: + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR) + value = to_gt(i915)->uc.guc.submission_version.major; + else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value = to_gt(i915)->uc.guc.submission_version.minor; + else + value = to_gt(i915)->uc.guc.submission_version.patch; + break;case
I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined asinclude/uapi/drm/i915_drm.h +0
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58Quoted 2 lines
+/*
+ * Query for the GuC submission/VF interface version numberWhat is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
+ *
+ *-ENODEVis returned if GuC submission is not used
+ *
+ * On success, returns the respective GuC submission/VF interface major,
+ * minor or patch version as per the requested parameter.
+ *
+ */include/uapi/drm/i915_drm.h +4
-0+#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 +/* Must be kept compact -- no holes and well documented */ /**
Quoted 28 lines · Jose
Quoted 19 lines · John Harrison
Quoted 12 lines · Tvrtko Ursulin
Quoted 11 lines · Jose
Quoted 9 lines · Tvrtko Ursulin
Quoted 4 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.Quoted 6 lines
Quoted 3 lines
IMO Joonas version brings less burden to be maintained(no new struct). But both versions works, please just get into some agreement so we can move this forward.
So I would really prefer the query. Simplified version would do like the compile tested only:
Quoted 7 lines
Vivaik's patch is definitely preferred. It is much cleaner to make one single call than having to make four separate calls. It is also extensible to other firmwares if required. The only blockage against it was whether it was a good thing to report at all. If that blockage is no longer valid then we should just merge the patch that has already been discussed, polished, fixed, etc. rather than starting the whole process from scratch.
Quoted 3 lines
Agreed.
Vivaik can you please rebase and send it again?
Note there was review feedback not addressed so do that too please. AFAIR incorrect usage of copy item, pad/rsvd/mbz checking and questions about padding in general. Last is why I proposed a simplified version which is not future extensible and avoids the need for padding.
Regards,
Tvrtko
Quoted 200 lines
Quoted 199 lines
And note that it is four calls not three. The code below is missing the branch version number.
John.
Quoted 190 lines
drivers/gpu/drm/i915/i915_query.c +31
-0@@ -551,6 +551,37 @@ static int query_hwconfig_blob(struct drm_i915_private *i915, return hwconfig->size; } +static int +query_guc_submission_version (struct drm_i915_private *i915, + struct drm_i915_query_item *query) +{ + struct drm_i915_query_guc_submission_version __user *query_ptr = +u64_to_user_ptr (query->data_ptr); + struct drm_i915_query_guc_submission_version ver; + struct intel_guc *guc = &to_gt(i915)->uc.guc; + const size_t size = sizeof(ver); + int ret; + + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + + ret = copy_query_item(&ver, size, size, query); + if (ret != 0) + return ret; + + if (ver.major || ver.minor || ver.patch) + return -EINVAL; + + ver.major = guc->submission_version.major; + ver.minor = guc->submission_version.minor; + ver.patch = guc->submission_version.patch; + + if (copy_to_user(query_ptr, &ver, size)) + return -EFAULT; + + return 0; +} + static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,struct
drm_i915_query_item*query_item) = {
query_topology_info,drivers/gpu/drm/i915/i915_query.c +1
-0@@ -559,6 +590,7 @@ static int (* const i915_query_funcs[])(structdrm_i915_private *dev_priv, query_memregion_info, query_hwconfig_blob, query_geometry_subslices, + query_guc_submission_version, };int i915_query_ioctl(struct
drm_device*dev, void *data, structdrm_file*file)include/uapi/drm/i915_drm.h +1
-0@@ -3038,6 +3038,7 @@ struct drm_i915_query_item { * - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions) * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`) * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info) + * - %DRM_I915_QUERY_GUC_SUBMISSION_VERSION (see struct
drm_i915_query_guc_submission_version)
*/
__u64query_id;
#define DRM_I915_QUERY_TOPOLOGY_INFO 1include/uapi/drm/i915_drm.h +3
-0@@ -3046,6 +3047,7 @@ struct drm_i915_query_item { #define DRM_I915_QUERY_MEMORY_REGIONS 4 #define DRM_I915_QUERY_HWCONFIG_BLOB 5 #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +#define DRM_I915_QUERY_GUC_SUBMISSION_VERSION 7 /* Must be kept compact -- no holes and well documented */ /**@@ -3591,6 +3593,15 @@ struct drm_i915_query_memory_regions { struct drm_i915_memory_region_info regions[]; }; +/** +* struct drm_i915_query_guc_submission_version - query GuC submission interface version
include/uapi/drm/i915_drm.h +7
-0+*/ +struct drm_i915_query_guc_submission_version { + __u64 major; + __u64 minor; + __u64 patch; +}; + /*** DOC: GuC HWCONFIG blob uAPI * It is not that much bigger that the triple get param and IMO nicer.
But if there is no motivation to do it properly then feel free to proceed with this, I will not block it.
Regards,
Tvrtko
P.S.
Probably still make sure to remove the reference to SR-IOV.Quoted 79 lines
Quoted 78 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 47 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, if (value < 0) return value; break; + case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH: + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR) + value = to_gt(i915)->uc.guc.submission_version.major; + else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value = to_gt(i915)->uc.guc.submission_version.minor; + else + value = to_gt(i915)->uc.guc.submission_version.patch; + break; case I915_PARAM_MMAP_GTT_VERSION:/* Though we've started our numbering from 1, and so
class all
* earlier versions as 0, in effect their value is
undefined asinclude/uapi/drm/i915_drm.h +0
-0include/uapi/drm/i915_drm.h typedef struct drm_i915_irq_wait { · line 809
Quoted 4 lines
include/uapi/drm/i915_drm.h +1
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number What is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
include/uapi/drm/i915_drm.h +11
-0+* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 + /* Must be kept compact -- no holes and well documented */ /**
Joonas Lahtinen
maintainerQuoting Tvrtko Ursulin (2024-02-07 10:44:01)
Quoted 30 lines · Jose
Quoted 28 lines · John Harrison
Quoted 26 lines · Tvrtko Ursulin
Quoted 12 lines · Jose
Quoted 11 lines · Tvrtko Ursulin
Quoted 9 lines · Joonas Lahtinen
Quoted 4 lines
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.Quoted 6 lines
Quoted 3 lines
IMO Joonas version brings less burden to be maintained(no new struct). But both versions works, please just get into some agreement so we can move this forward.
So I would really prefer the query. Simplified version would do like the compile tested only:
Vivaik's patch is definitely preferred. It is much cleaner to make one single call than having to make four separate calls. It is also extensible to other firmwares if required. The only blockage against it was whether it was a good thing to report at all. If that blockage is no longer valid then we should just merge the patch that has already been discussed, polished, fixed, etc. rather than starting the whole process from scratch.
Quoted 8 lines
Quoted 3 lines
Agreed.
Vivaik can you please rebase and send it again?
Note there was review feedback not addressed so do that too please. AFAIR incorrect usage of copy item, pad/rsvd/mbz checking and questions about padding in general. Last is why I proposed a simplified version which is not future extensible and avoids the need for padding.
Yeah, I don't think there is point an adding an extensible interface as we're not going to add further FW version queries. This only the submission interface version we're going to expose:
* Note that the spec for the CSS header defines this version number
* as 'vf_version' as it was originally intended for virtualisation.
* However, it is applicable to native submission as well.
If somebody wants to work on the simplified version like Tvrtko suggested below, I have no objection. We can also remove the reference to the VF version even if that's used by the header definition.
But if there are just suggestions but no actual patches floated, then we should be merging the GETPARAM version with the "VF" word removed.
We've already discussed on the topic for some months so doing the minimal changes to fulfill Mesa requirements should be considered a priority to avoid further delays.
Quoted 10 lines
Regards,
Tvrtko
Quoted 5 lines
Quoted 5 lines
And note that it is four calls not three. The code below is missing the branch version number.
Not even kernel uses the 'build' version anywhere. I don't see how there could be 'build' version for the VF interface version? It's not supposed to version a concrete firmware build but the API contract implemented by the build where patch version should already be incremented for each fix.
So adding the build does not seem appropriate as there is no plan to extend this API any further.
Regards, Joonas
Quoted 195 lines
Quoted 195 lines
Quoted 194 lines
John.
Quoted 190 lines
drivers/gpu/drm/i915/i915_query.c +31
-0@@ -551,6 +551,37 @@ static int query_hwconfig_blob(struct drm_i915_private *i915, return hwconfig->size; } +static int +query_guc_submission_version (struct drm_i915_private *i915, + struct drm_i915_query_item *query) +{ + struct drm_i915_query_guc_submission_version __user *query_ptr = +u64_to_user_ptr (query->data_ptr); + struct drm_i915_query_guc_submission_version ver; + struct intel_guc *guc = &to_gt(i915)->uc.guc; + const size_t size = sizeof(ver); + int ret; + + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + + ret = copy_query_item(&ver, size, size, query); + if (ret != 0) + return ret; + + if (ver.major || ver.minor || ver.patch) + return -EINVAL; + + ver.major = guc->submission_version.major; + ver.minor = guc->submission_version.minor; + ver.patch = guc->submission_version.patch; + + if (copy_to_user(query_ptr, &ver, size)) + return -EFAULT; + + return 0; +} + static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,struct
drm_i915_query_item*query_item) = {
query_topology_info,drivers/gpu/drm/i915/i915_query.c +1
-0@@ -559,6 +590,7 @@ static int (* const i915_query_funcs[])(structdrm_i915_private *dev_priv, query_memregion_info, query_hwconfig_blob, query_geometry_subslices, + query_guc_submission_version, };int i915_query_ioctl(struct
drm_device*dev, void *data, structdrm_file*file)include/uapi/drm/i915_drm.h +1
-0@@ -3038,6 +3038,7 @@ struct drm_i915_query_item { * - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions) * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`) * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info) + * - %DRM_I915_QUERY_GUC_SUBMISSION_VERSION (see struct
drm_i915_query_guc_submission_version)
*/
__u64query_id;
#define DRM_I915_QUERY_TOPOLOGY_INFO 1include/uapi/drm/i915_drm.h +3
-0@@ -3046,6 +3047,7 @@ struct drm_i915_query_item { #define DRM_I915_QUERY_MEMORY_REGIONS 4 #define DRM_I915_QUERY_HWCONFIG_BLOB 5 #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +#define DRM_I915_QUERY_GUC_SUBMISSION_VERSION 7 /* Must be kept compact -- no holes and well documented */ /**@@ -3591,6 +3593,15 @@ struct drm_i915_query_memory_regions { struct drm_i915_memory_region_info regions[]; }; +/** +* struct drm_i915_query_guc_submission_version - query GuC submission interface version
include/uapi/drm/i915_drm.h +7
-0+*/ +struct drm_i915_query_guc_submission_version { + __u64 major; + __u64 minor; + __u64 patch; +}; + /*** DOC: GuC HWCONFIG blob uAPI * It is not that much bigger that the triple get param and IMO nicer.
But if there is no motivation to do it properly then feel free to proceed with this, I will not block it.
Regards,
Tvrtko
P.S.
Probably still make sure to remove the reference to SR-IOV.Quoted 79 lines
Quoted 78 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 47 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, if (value < 0) return value; break; + case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH: + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR) + value = to_gt(i915)->uc.guc.submission_version.major; + else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value = to_gt(i915)->uc.guc.submission_version.minor; + else + value = to_gt(i915)->uc.guc.submission_version.patch; + break; case I915_PARAM_MMAP_GTT_VERSION:/* Though we've started our numbering from 1, and so
class all
* earlier versions as 0, in effect their value is
undefined asinclude/uapi/drm/i915_drm.h +0
-0include/uapi/drm/i915_drm.h typedef struct drm_i915_irq_wait { · line 809
Quoted 4 lines
include/uapi/drm/i915_drm.h +1
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number What is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
include/uapi/drm/i915_drm.h +11
-0+* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 + /* Must be kept compact -- no holes and well documented */ /**
Quoted 28 lines · Joonas Lahtinen
Quoting Tvrtko Ursulin (2024-02-07 10:44:01)
Quoted 27 lines · Jose
Quoted 26 lines · John Harrison
Quoted 16 lines · Tvrtko Ursulin
Quoted 7 lines · Jose
Quoted 6 lines · Tvrtko Ursulin
Quoted 5 lines · Joonas Lahtinen
Quoted 4 lines
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.IMO Joonas version brings less burden to be maintained(no new struct). But both versions works, please just get into some agreement so we can move this forward.
So I would really prefer the query. Simplified version would do like the compile tested only:
Quoted 7 lines
Vivaik's patch is definitely preferred. It is much cleaner to make one single call than having to make four separate calls. It is also extensible to other firmwares if required. The only blockage against it was whether it was a good thing to report at all. If that blockage is no longer valid then we should just merge the patch that has already been discussed, polished, fixed, etc. rather than starting the whole process from scratch.
Agreed.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Vivaik can you please rebase and send it again?
Note there was review feedback not addressed so do that too please. AFAIR incorrect usage of copy item, pad/rsvd/mbz checking and questions about padding in general. Last is why I proposed a simplified version which is not future extensible and avoids the need for padding.
Yeah, I don't think there is point an adding an extensible interface as we're not going to add further FW version queries. This only the submission interface version we're going to expose:
The media team have flip flopped multiple times about whether they need a HuC version query.
Quoted 11 lines
* Note that the spec for the CSS header defines this version number
* as 'vf_version' as it was originally intended for virtualisation.
* However, it is applicable to native submission as well.If somebody wants to work on the simplified version like Tvrtko suggested below, I have no objection. We can also remove the reference to the VF version even if that's used by the header definition.
But if there are just suggestions but no actual patches floated, then we should be merging the GETPARAM version with the "VF" word removed.
The original patch was posted to the mailing list many months ago. Why do you say 'just suggestions but no patches floated'?
Quoted 12 lines
We've already discussed on the topic for some months so doing the minimal changes to fulfill Mesa requirements should be considered a priority to avoid further delays.
Quoted 7 lines
Regards,
Tvrtko
Quoted 3 lines
Quoted 3 lines
And note that it is four calls not three. The code below is missing the branch version number.
Quoted 8 lines
Not even kernel uses the 'build' version anywhere. I don't see how there could be 'build' version for the VF interface version? It's not supposed to version a concrete firmware build but the API contract implemented by the build where patch version should already be incremented for each fix.
So adding the build does not seem appropriate as there is no plan to extend this API any further.
I did not say "build" version. There is no build version. I said "branch" version. And the branch version absolute becomes important if we ever have to release a bug fix to an LTS branch. So it needs to be part of the interface from the beginning and the UMDs need to be using it from the beginning.
John.
Quoted 190 lines
Regards, Joonas
Quoted 187 lines
Quoted 187 lines
Quoted 187 lines
John.
Quoted 185 lines
drivers/gpu/drm/i915/i915_query.c +31
-0@@ -551,6 +551,37 @@ static int query_hwconfig_blob(struct drm_i915_private *i915, return hwconfig->size; } +static int +query_guc_submission_version (struct drm_i915_private *i915, + struct drm_i915_query_item *query) +{ + struct drm_i915_query_guc_submission_version __user *query_ptr = +u64_to_user_ptr (query->data_ptr); + struct drm_i915_query_guc_submission_version ver; + struct intel_guc *guc = &to_gt(i915)->uc.guc; + const size_t size = sizeof(ver); + int ret; + + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + + ret = copy_query_item(&ver, size, size, query); + if (ret != 0) + return ret; + + if (ver.major || ver.minor || ver.patch) + return -EINVAL; + + ver.major = guc->submission_version.major; + ver.minor = guc->submission_version.minor; + ver.patch = guc->submission_version.patch; + + if (copy_to_user(query_ptr, &ver, size)) + return -EFAULT; + + return 0; +} + static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,struct
drm_i915_query_item*query_item) = {
query_topology_info,drivers/gpu/drm/i915/i915_query.c +1
-0@@ -559,6 +590,7 @@ static int (* const i915_query_funcs[])(structdrm_i915_private *dev_priv, query_memregion_info, query_hwconfig_blob, query_geometry_subslices, + query_guc_submission_version, };int i915_query_ioctl(struct
drm_device*dev, void *data, structdrm_file*file)include/uapi/drm/i915_drm.h +1
-0@@ -3038,6 +3038,7 @@ struct drm_i915_query_item { * - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions) * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`) * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info) + * - %DRM_I915_QUERY_GUC_SUBMISSION_VERSION (see struct
drm_i915_query_guc_submission_version)
*/
__u64query_id;
#define DRM_I915_QUERY_TOPOLOGY_INFO 1include/uapi/drm/i915_drm.h +3
-0@@ -3046,6 +3047,7 @@ struct drm_i915_query_item { #define DRM_I915_QUERY_MEMORY_REGIONS 4 #define DRM_I915_QUERY_HWCONFIG_BLOB 5 #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +#define DRM_I915_QUERY_GUC_SUBMISSION_VERSION 7 /* Must be kept compact -- no holes and well documented */ /**@@ -3591,6 +3593,15 @@ struct drm_i915_query_memory_regions { struct drm_i915_memory_region_info regions[]; }; +/** +* struct drm_i915_query_guc_submission_version - query GuC submission interface version
include/uapi/drm/i915_drm.h +7
-0+*/ +struct drm_i915_query_guc_submission_version { + __u64 major; + __u64 minor; + __u64 patch; +}; + /*** DOC: GuC HWCONFIG blob uAPI * It is not that much bigger that the triple get param and IMO nicer.
But if there is no motivation to do it properly then feel free to proceed with this, I will not block it.
Regards,
Tvrtko
P.S.
Probably still make sure to remove the reference to SR-IOV.Quoted 75 lines
Quoted 75 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 47 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, if (value < 0) return value; break; + case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH: + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR) + value = to_gt(i915)->uc.guc.submission_version.major; + else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value = to_gt(i915)->uc.guc.submission_version.minor; + else + value = to_gt(i915)->uc.guc.submission_version.patch; + break; case I915_PARAM_MMAP_GTT_VERSION:/* Though we've started our numbering from 1, and so
class all
* earlier versions as 0, in effect their value is
undefined asinclude/uapi/drm/i915_drm.h +0
-0include/uapi/drm/i915_drm.h typedef struct drm_i915_irq_wait { · line 809
Quoted 4 lines
include/uapi/drm/i915_drm.h +1
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number What is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
include/uapi/drm/i915_drm.h +11
-0+* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 + /* Must be kept compact -- no holes and well documented */ /**
Quoted 52 lines · Joonas Lahtinen
Quoting Tvrtko Ursulin (2024-02-07 10:44:01)
Quoted 30 lines · Jose
Quoted 28 lines · John Harrison
Quoted 26 lines · Tvrtko Ursulin
Quoted 12 lines · Jose
Quoted 11 lines · Tvrtko Ursulin
Quoted 9 lines · Joonas Lahtinen
Quoted 4 lines
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
There was
https://patchwork.freedesktop.org/patch/560704/?series=124592&rev=1
which does everything in one go so would be my preference.Quoted 6 lines
Quoted 3 lines
IMO Joonas version brings less burden to be maintained(no new struct). But both versions works, please just get into some agreement so we can move this forward.
So I would really prefer the query. Simplified version would do like the compile tested only:
Vivaik's patch is definitely preferred. It is much cleaner to make one single call than having to make four separate calls. It is also extensible to other firmwares if required. The only blockage against it was whether it was a good thing to report at all. If that blockage is no longer valid then we should just merge the patch that has already been discussed, polished, fixed, etc. rather than starting the whole process from scratch.
Quoted 8 lines
Quoted 3 lines
Agreed.
Vivaik can you please rebase and send it again?
Note there was review feedback not addressed so do that too please. AFAIR incorrect usage of copy item, pad/rsvd/mbz checking and questions about padding in general. Last is why I proposed a simplified version which is not future extensible and avoids the need for padding.
Yeah, I don't think there is point an adding an extensible interface as we're not going to add further FW version queries. This only the submission interface version we're going to expose:
* Note that the spec for the CSS header defines this version number
* as 'vf_version' as it was originally intended for virtualisation.
* However, it is applicable to native submission as well.If somebody wants to work on the simplified version like Tvrtko suggested below, I have no objection. We can also remove the reference to the VF version even if that's used by the header definition.
Quoted 6 lines
But if there are just suggestions but no actual patches floated, then we should be merging the GETPARAM version with the "VF" word removed.
We've already discussed on the topic for some months so doing the minimal changes to fulfill Mesa requirements should be considered a priority to avoid further delays.
This is
Here the user-space usage: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25233
Quoted 218 lines
Quoted 11 lines
Regards,
Tvrtko
Quoted 5 lines
Quoted 5 lines
And note that it is four calls not three. The code below is missing the branch version number.
Not even kernel uses the 'build' version anywhere. I don't see how there could be 'build' version for the VF interface version? It's not supposed to version a concrete firmware build but the API contract implemented by the build where patch version should already be incremented for each fix.
So adding the build does not seem appropriate as there is no plan to extend this API any further.
Regards, Joonas
Quoted 195 lines
Quoted 195 lines
Quoted 194 lines
John.
Quoted 190 lines
drivers/gpu/drm/i915/i915_query.c +31
-0@@ -551,6 +551,37 @@ static int query_hwconfig_blob(struct drm_i915_private *i915, return hwconfig->size; } +static int +query_guc_submission_version (struct drm_i915_private *i915, + struct drm_i915_query_item *query) +{ + struct drm_i915_query_guc_submission_version __user *query_ptr = +u64_to_user_ptr (query->data_ptr); + struct drm_i915_query_guc_submission_version ver; + struct intel_guc *guc = &to_gt(i915)->uc.guc; + const size_t size = sizeof(ver); + int ret; + + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + + ret = copy_query_item(&ver, size, size, query); + if (ret != 0) + return ret; + + if (ver.major || ver.minor || ver.patch) + return -EINVAL; + + ver.major = guc->submission_version.major; + ver.minor = guc->submission_version.minor; + ver.patch = guc->submission_version.patch; + + if (copy_to_user(query_ptr, &ver, size)) + return -EFAULT; + + return 0; +} + static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,struct
drm_i915_query_item*query_item) = {
query_topology_info,drivers/gpu/drm/i915/i915_query.c +1
-0@@ -559,6 +590,7 @@ static int (* const i915_query_funcs[])(structdrm_i915_private *dev_priv, query_memregion_info, query_hwconfig_blob, query_geometry_subslices, + query_guc_submission_version, };int i915_query_ioctl(struct
drm_device*dev, void *data, structdrm_file*file)include/uapi/drm/i915_drm.h +1
-0@@ -3038,6 +3038,7 @@ struct drm_i915_query_item { * - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions) * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`) * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info) + * - %DRM_I915_QUERY_GUC_SUBMISSION_VERSION (see struct
drm_i915_query_guc_submission_version)
*/
__u64query_id;
#define DRM_I915_QUERY_TOPOLOGY_INFO 1include/uapi/drm/i915_drm.h +3
-0@@ -3046,6 +3047,7 @@ struct drm_i915_query_item { #define DRM_I915_QUERY_MEMORY_REGIONS 4 #define DRM_I915_QUERY_HWCONFIG_BLOB 5 #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +#define DRM_I915_QUERY_GUC_SUBMISSION_VERSION 7 /* Must be kept compact -- no holes and well documented */ /**@@ -3591,6 +3593,15 @@ struct drm_i915_query_memory_regions { struct drm_i915_memory_region_info regions[]; }; +/** +* struct drm_i915_query_guc_submission_version - query GuC submission interface version
include/uapi/drm/i915_drm.h +7
-0+*/ +struct drm_i915_query_guc_submission_version { + __u64 major; + __u64 minor; + __u64 patch; +}; + /*** DOC: GuC HWCONFIG blob uAPI * It is not that much bigger that the triple get param and IMO nicer.
But if there is no motivation to do it properly then feel free to proceed with this, I will not block it.
Regards,
Tvrtko
P.S.
Probably still make sure to remove the reference to SR-IOV.Quoted 79 lines
Quoted 78 lines
During the time of that patch there was discussion whether firmware version or submission version was better. I vaguely remember someone raised an issue with the latter. Adding John in case he remembers.
Quoted 47 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, if (value < 0) return value; break; + case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR: + case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH: + if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc)) + return -ENODEV; + if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR) + value = to_gt(i915)->uc.guc.submission_version.major; + else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value = to_gt(i915)->uc.guc.submission_version.minor; + else + value = to_gt(i915)->uc.guc.submission_version.patch; + break; case I915_PARAM_MMAP_GTT_VERSION:/* Though we've started our numbering from 1, and so
class all
* earlier versions as 0, in effect their value is
undefined asinclude/uapi/drm/i915_drm.h +0
-0include/uapi/drm/i915_drm.h typedef struct drm_i915_irq_wait { · line 809
Quoted 4 lines
include/uapi/drm/i915_drm.h +1
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number What is this VF you speak of? :/
Regards,
Tvrtko
Quoted 14 lines
include/uapi/drm/i915_drm.h +11
-0+* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 + /* Must be kept compact -- no holes and well documented */ /**
Quoted 5 lines · Joonas Lahtinen
Add reporting of the GuC submissio/VF interface version via GETPARAM properties. Mesa intends to use this information to check for old firmware versions with known bugs before enabling features like async compute.
Quoted 61 lines
Signed-off-by Joonas Lahtinen <[email protected]>Cc Kenneth Graunke <[email protected]>Cc Jose Souza <[email protected]>Cc Sagar Ghuge <[email protected]>Cc Paulo Zanoni <[email protected]>Cc John Harrison <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Jani Nikula <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++ include/uapi/drm/i915_drm.h | 13 +++++++++++++ 2 files changed, 25 insertions(+)drivers/gpu/drm/i915/i915_getparam.c +12
-0@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,if (value <0 )return value;break ; +case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR : +case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH : +if (!intel_uc_uses_guc_submission (&to_gt (i915)->uc)) +return -ENODEV ; +if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR ) + value =to_gt (i915)->uc.guc.submission_version.major; +else if (param->param ==I915_PARAM_GUC_SUBMISSION_VERSION_MINOR ) + value =to_gt (i915)->uc.guc.submission_version.minor; +else + value =to_gt (i915)->uc.guc.submission_version.patch; +break ;case I915_PARAM_MMAP_GTT_VERSION :/* Though we've started our numbering from 1, and so class all * earlier versions as 0, in effect their value is undefined as include/uapi/drm/i915_drm.h +13
-0@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_PXP_STATUS 58 +/* +* Query for the GuC submission/VF interface version number +* +* -ENODEV is returned if GuC submission is not used +* +* On success, returns the respective GuC submission/VF interface major, +* minor or patch version as per the requested parameter. +* +*/ +#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59 +#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60 +#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61 +/* Must be kept compact -- no holes and well documented */ /**