Refactor GVT-g MMIO tracking table and handlers
Zhi Wang
reviewerv9 cover Refactor GVT-g MMIO tracking table and handlers
To support the new mdev interfaces and the re-factor patches from Christoph, which moves the GVT-g code into a dedicated module, the GVT-g initialization path has to be separated into two phases:
a) Early initialization.
The early initialization of GVT requires to be done when loading i915. Mostly it's because the initial clean HW state needs to be saved before i915 touches the HW.
b) Late initalization.
This phases of initalization will setup the rest components of GVT-g, which can be done later when the dedicated module is being loaded.
To initialize the GVT-g MMIO tracking table in the early initalization stage, which will be done in i915, the GVT-g MMIO tracking table needs to be sperated accordingly and moved into i915.
v9:
- Fix a problem might casue kernel panic.
v8:
- Use SPDX header in the intel_gvt_mmio_table.c
- Reference the gvt.h with path. (Jani)
- Add a missing fix on mmio emulation path during my debug.
- Fix a building problem on refreshed gvt-staging branch. (Christoph)
v7:
- Keep the marcos of device generation in GVT-g. (Christoph, Jani)
v6:
- Move the mmio_table.c into i915. (Christoph)
- Keep init_device_info and related structures in GVT-g. (Christoph)
- Refine the callbacks of the iterator. (Christoph)
- Move the flags of MMIO register defination to GVT-g. (Chrsitoph)
- Move the mmio block handling to GVT-g.
v5:
- Re-design the mmio table framework. (Christoph)
v4:
- Fix the errors of patch checking scripts.
v3:
- Fix the errors when CONFIG_DRM_I915_WERROR is turned on. (Jani)
v2:
- Implement a mmio table instead of generating it by marco in i915. (Jani)
Zhi Wang (3):
i915/gvt: Separate the MMIO tracking table from GVT-g i915/gvt: Save the initial HW state snapshot in i915 i915/gvt: Use the initial HW state snapshot saved in i915
drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gvt/firmware.c | 25 +- drivers/gpu/drm/i915/gvt/gvt.h | 3 +- drivers/gpu/drm/i915/gvt/handlers.c | 1033 ++------------- drivers/gpu/drm/i915/gvt/mmio.h | 1 - drivers/gpu/drm/i915/gvt/reg.h | 9 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/intel_gvt.c | 92 +- drivers/gpu/drm/i915/intel_gvt.h | 21 + drivers/gpu/drm/i915/intel_gvt_mmio_table.c | 1290 +++++++++++++++++++ 10 files changed, 1561 insertions(+), 917 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_gvt_mmio_table.c
Signature · 1 line
2.25.1
Zhi Wang
reviewerPATCH v9 1/3 i915/gvt: Separate the MMIO tracking table from GVT-g
From: Zhi Wang <[email protected]>
To support the new mdev interfaces and the re-factor patches from Christoph, which moves the GVT-g code into a dedicated module, the GVT-g MMIO tracking table needs to be separated from GVT-g.
v9:
- Fix a problem might cause kernel panic.
v8:
- Use SPDX header in the intel_gvt_mmio_table.c
- Reference the gvt.h with path. (Jani)
- Add a missing fix on mmio emulation path during the debug.
- Fix a building problem on refreshed gvt-staging branch. (Christoph)
v7:
- Keep the marcos of device generation in GVT-g. (Christoph, Jani)
v6:
- Move the mmio_table.c into i915. (Christoph)
- Keep init_device_info and related structures in GVT-g. (Christoph)
- Refine the callbacks of the iterator. (Christoph)
- Move the flags of MMIO register defination to GVT-g. (Chrsitoph)
- Move the mmio block handling to GVT-g.
v5:
- Re-design the mmio table framework. (Christoph)
v4:
- Fix the errors of patch checking scripts.
v3:
- Fix the errors when CONFIG_DRM_I915_WERROR is turned on. (Jani)
v2:
- Implement a mmio table instead of generating it by marco in i915. (Jani)
--- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gvt/gvt.h | 3 +- drivers/gpu/drm/i915/gvt/handlers.c | 1033 ++------------- drivers/gpu/drm/i915/gvt/mmio.h | 1 - drivers/gpu/drm/i915/gvt/reg.h | 9 +- drivers/gpu/drm/i915/intel_gvt.h | 21 + drivers/gpu/drm/i915/intel_gvt_mmio_table.c | 1290 +++++++++++++++++++ 7 files changed, 1460 insertions(+), 899 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_gvt_mmio_table.c
drivers/gpu/drm/i915/Makefile +1 -1
@@ -321,7 +321,7 @@ i915-$(CONFIG_DRM_I915_SELFTEST) += \ i915-y += i915_vgpu.o ifeq ($(CONFIG_DRM_I915_GVT),y) -i915-y += intel_gvt.o +i915-y += intel_gvt.o intel_gvt_mmio_table.o include $(src)/gvt/Makefile endif
drivers/gpu/drm/i915/gvt/gvt.h +2 -1
@@ -36,6 +36,7 @@#include <uapi/linux/pci_regs.h> #include "i915_drv.h" +#include "intel_gvt.h" #include "debug.h" #include "hypercall.h"
@@ -272,7 +273,7 @@ struct intel_gvt_mmio {/* Value of command write of this reg needs to be patched */ #define F_CMD_WRITE_PATCH (1 << 8) -const struct gvt_mmio_block *mmio_block; +struct gvt_mmio_block *mmio_block;unsigned int num_mmio_block;DECLARE_HASHTABLE (mmio_info_table,INTEL_GVT_MMIO_HASH_BITS );
drivers/gpu/drm/i915/gvt/handlers.c +138 -895
1,378 lines not on this page · raw message
drivers/gpu/drm/i915/gvt/mmio.h +0 -1
@@ -72,7 +72,6 @@ struct intel_gvt_mmio_info {const struct intel_engine_cs *intel_gvt_render_mmio_to_engine (struct intel_gvt *gvt,unsigned int reg);unsigned long intel_gvt_get_device_type (struct intel_gvt *gvt); -bool intel_gvt_match_device (struct intel_gvt *gvt,unsigned long device);int intel_gvt_setup_mmio_info (struct intel_gvt *gvt);void intel_gvt_clean_mmio_info (struct intel_gvt *gvt);
drivers/gpu/drm/i915/gvt/reg.h +8 -1
@@ -132,6 +132,13 @@#define RING_GFX_MODE (base) _MMIO((base) + 0x29c)#define VF_GUARDBAND _MMIO(0x83a4) -#define BCS_TILE_REGISTER_VAL_OFFSET (0x43*4) + +/* XXX FIXME i915 has changed PP_XXX definition */ +#define PCH_PP_STATUS _MMIO(0xc7200) +#define PCH_PP_CONTROL _MMIO(0xc7204) +#define PCH_PP_ON_DELAYS _MMIO(0xc7208) +#define PCH_PP_OFF_DELAYS _MMIO(0xc720c) +#define PCH_PP_DIVISOR _MMIO(0xc7210) +#endif
drivers/gpu/drm/i915/intel_gvt.h +21 -0
@@ -26,7 +26,17 @@struct drm_i915_private ; +#include <linux/kernel.h> +#ifdef CONFIG_DRM_I915_GVT + +struct intel_gvt_mmio_table_iter { +struct drm_i915_private *i915; +void *data; +int (*handle_mmio_cb)(struct intel_gvt_mmio_table_iter *iter, +u32 offset,u32 size); +}; +int intel_gvt_init (struct drm_i915_private *dev_priv);void intel_gvt_driver_remove (struct drm_i915_private *dev_priv);int intel_gvt_init_device (struct drm_i915_private *dev_priv);
@@ -34,6 +44,7 @@ void intel_gvt_clean_device(struct drm_i915_private *dev_priv);int intel_gvt_init_host (void );void intel_gvt_sanitize_options (struct drm_i915_private *dev_priv);void intel_gvt_resume (struct drm_i915_private *dev_priv); +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter);#else static inline int intel_gvt_init (struct drm_i915_private *dev_priv) {
@@ -51,6 +62,16 @@ static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)static inline void intel_gvt_resume (struct drm_i915_private *dev_priv) { } + +unsigned long intel_gvt_get_device_type (struct drm_i915_private *i915) +{ +return 0 ; +} + +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter) +{ +return 0 ; +}#endif #endif /* _INTEL_GVT_H_ */
drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +1290 -0
1,290 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
The whole series looks good and works fine on by Kaby Lake Thinkpad:
Re: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
Thanks so much!
Jani and Joonas, it would be better to have one rb from i915 maintainers as this patches also modify i915 code.
Thanks,
Zhi.
Quoted 5 lines · Christoph Hellwig
The whole series looks good and works fine on by Kaby Lake Thinkpad:
Reviewed-by Christoph Hellwig <[email protected]>Tested-by Christoph Hellwig <[email protected]>
Re: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
In reply to Zhi WangQuoted 6 lines · Zhi Wang
From: Zhi Wang <[email protected]>
To support the new mdev interfaces and the re-factor patches from Christoph, which moves the GVT-g code into a dedicated module, the GVT-g MMIO tracking table needs to be separated from GVT-g.
Looks fine to me. Thanks!
Re: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
In reply to Zhi Wangdrivers/gpu/drm/i915/intel_gvt.h line 29
Quoted 9 lines · Zhi Wang
drivers/gpu/drm/i915/intel_gvt.h +1
-0@@ -26,7 +26,17 @@struct drm_i915_private ; +#include <linux/kernel.h>
You only need <linux/types.h>. Please add it before the forward declaration above.
Quoted 22 lines
drivers/gpu/drm/i915/intel_gvt.h +10
-0+#ifdef CONFIG_DRM_I915_GVT + +struct intel_gvt_mmio_table_iter { +struct drm_i915_private *i915; +void *data; +int (*handle_mmio_cb)(struct intel_gvt_mmio_table_iter *iter, +u32 offset,u32 size); +}; +int intel_gvt_init (struct drm_i915_private *dev_priv);void intel_gvt_driver_remove (struct drm_i915_private *dev_priv);int intel_gvt_init_device (struct drm_i915_private *dev_priv);@@ -34,6 +44,7 @@ void intel_gvt_clean_device(struct drm_i915_private *dev_priv);int intel_gvt_init_host (void );void intel_gvt_sanitize_options (struct drm_i915_private *dev_priv);void intel_gvt_resume (struct drm_i915_private *dev_priv); +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter);#else static inline int intel_gvt_init (struct drm_i915_private *dev_priv) {
drivers/gpu/drm/i915/intel_gvt.h static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv) · line 69
Quoted 8 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0@@ -51,6 +62,16 @@ static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)static inline void intel_gvt_resume (struct drm_i915_private *dev_priv) { } + +unsigned long intel_gvt_get_device_type (struct drm_i915_private *i915) +{ +return 0 ; +}
The CONFIG_DRM_I915_GVT=y counterpart for this is in mmio.h. Should be both in the same header.
Quoted 17 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0+ +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter) +{ +return 0 ; +}#endif #endif /* _INTEL_GVT_H_ */ drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +3
-0@@ -0,0 +1,1290 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2020 Intel Corporation
drivers/gpu/drm/i915/intel_gvt_mmio_table.c line 13
Quoted 10 lines
drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +10
-0+*/ + +#include "i915_drv.h" +#include "i915_reg.h" +#include "display/vlv_dsi_pll_regs.h" +#include "gt/intel_gt_regs.h" +#include "intel_mchbar_regs.h" +#include "i915_pvinfo.h" +#include "intel_gvt.h" +#include "gvt/gvt.h"
Generally we have the include lists sorted.
Other than the nitpicks above, the series is
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Re: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
Hi Jani:
Thanks so much for the help. Can you generate a new tag on drm-intel-next? I noticed that there was one patch moving the DMC related registers into display/intel_dmc_regs.h, which is not included in the latest tag on drm-intel-next.
Guess it would be better that I can change this patch according to it when checking in. This would prevent a conflict in future.
Thanks,
Zhi.
Quoted 87 lines · Jani Nikula
drivers/gpu/drm/i915/intel_gvt.h line 29
Quoted 9 lines · Zhi Wang
drivers/gpu/drm/i915/intel_gvt.h +1
-0@@ -26,7 +26,17 @@struct drm_i915_private ; +#include <linux/kernel.h> You only need <
linux/types.h>. Please add it before the forward declaration above.Quoted 22 lines
drivers/gpu/drm/i915/intel_gvt.h +10
-0+#ifdef CONFIG_DRM_I915_GVT + +struct intel_gvt_mmio_table_iter { +struct drm_i915_private *i915; +void *data; +int (*handle_mmio_cb)(struct intel_gvt_mmio_table_iter *iter, +u32 offset,u32 size); +}; +int intel_gvt_init (struct drm_i915_private *dev_priv);void intel_gvt_driver_remove (struct drm_i915_private *dev_priv);int intel_gvt_init_device (struct drm_i915_private *dev_priv);@@ -34,6 +44,7 @@ void intel_gvt_clean_device(struct drm_i915_private *dev_priv);int intel_gvt_init_host (void );void intel_gvt_sanitize_options (struct drm_i915_private *dev_priv);void intel_gvt_resume (struct drm_i915_private *dev_priv); +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter);#else static inline int intel_gvt_init (struct drm_i915_private *dev_priv) {drivers/gpu/drm/i915/intel_gvt.h static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv) · line 69
Quoted 8 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0@@ -51,6 +62,16 @@ static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)static inline void intel_gvt_resume (struct drm_i915_private *dev_priv) { } + +unsigned long intel_gvt_get_device_type (struct drm_i915_private *i915) +{ +return 0 ; +}The
CONFIG_DRM_I915_GVT=ycounterpart for this is inmmio.h. Should be both in the same header.Quoted 17 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0+ +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter) +{ +return 0 ; +}#endif #endif /* _INTEL_GVT_H_ */ drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +3
-0@@ -0,0 +1,1290 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2020 Intel Corporation drivers/gpu/drm/i915/intel_gvt_mmio_table.c line 13
Quoted 10 lines
drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +10
-0+*/ + +#include "i915_drv.h" +#include "i915_reg.h" +#include "display/vlv_dsi_pll_regs.h" +#include "gt/intel_gt_regs.h" +#include "intel_mchbar_regs.h" +#include "i915_pvinfo.h" +#include "intel_gvt.h" +#include "gvt/gvt.h" Generally we have the include lists sorted.
Other than the nitpicks above, the series is
Acked-by Jani Nikula <[email protected]>BR,
Jani.
Re: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
Ping. :)
Quoted 98 lines · Zhi Wang
Hi Jani:
Thanks so much for the help. Can you generate a new tag on drm-intel-next? I noticed that there was one patch moving the DMC related registers into
display/intel_dmc_regs.h, which is not included in the latest tag on drm-intel-next.Guess it would be better that I can change this patch according to it when checking in. This would prevent a conflict in future.
Thanks,
Zhi.Quoted 87 lines · Jani Nikula
drivers/gpu/drm/i915/intel_gvt.h line 29
Quoted 9 lines · Zhi Wang
drivers/gpu/drm/i915/intel_gvt.h +1
-0@@ -26,7 +26,17 @@struct drm_i915_private ; +#include <linux/kernel.h> You only need <
linux/types.h>. Please add it before the forward declaration above.Quoted 22 lines
drivers/gpu/drm/i915/intel_gvt.h +10
-0+#ifdef CONFIG_DRM_I915_GVT + +struct intel_gvt_mmio_table_iter { +struct drm_i915_private *i915; +void *data; +int (*handle_mmio_cb)(struct intel_gvt_mmio_table_iter *iter, +u32 offset,u32 size); +}; +int intel_gvt_init (struct drm_i915_private *dev_priv);void intel_gvt_driver_remove (struct drm_i915_private *dev_priv);int intel_gvt_init_device (struct drm_i915_private *dev_priv);@@ -34,6 +44,7 @@ void intel_gvt_clean_device(struct drm_i915_private *dev_priv);int intel_gvt_init_host (void );void intel_gvt_sanitize_options (struct drm_i915_private *dev_priv);void intel_gvt_resume (struct drm_i915_private *dev_priv); +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter);#else static inline int intel_gvt_init (struct drm_i915_private *dev_priv) {drivers/gpu/drm/i915/intel_gvt.h static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv) · line 69
Quoted 8 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0@@ -51,6 +62,16 @@ static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)static inline void intel_gvt_resume (struct drm_i915_private *dev_priv) { } + +unsigned long intel_gvt_get_device_type (struct drm_i915_private *i915) +{ +return 0 ; +}The
CONFIG_DRM_I915_GVT=ycounterpart for this is inmmio.h. Should be both in the same header.Quoted 17 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0+ +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter) +{ +return 0 ; +}#endif #endif /* _INTEL_GVT_H_ */ drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +3
-0@@ -0,0 +1,1290 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2020 Intel Corporation drivers/gpu/drm/i915/intel_gvt_mmio_table.c line 13
Quoted 10 lines
drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +10
-0+*/ + +#include "i915_drv.h" +#include "i915_reg.h" +#include "display/vlv_dsi_pll_regs.h" +#include "gt/intel_gt_regs.h" +#include "intel_mchbar_regs.h" +#include "i915_pvinfo.h" +#include "intel_gvt.h" +#include "gvt/gvt.h" Generally we have the include lists sorted.
Other than the nitpicks above, the series is
Acked-by Jani Nikula <[email protected]>BR,
Jani.
Jani Nikula
maintainerRe: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
In reply to Wang, Zhi AQuoted 6 lines · Zhi A
Hi Jani:
Thanks so much for the help. Can you generate a new tag on drm-intel-next? I noticed that there was one patch moving the DMC related registers into
display/intel_dmc_regs.h, which is not included in the latest tag on drm-intel-next.
Sorry, I'm not sure what you're asking exactly. We do tags when we create pull requests for drm-next, but I don't see the connection to gvt.
BR,
Jani.
Quoted 96 lines
Guess it would be better that I can change this patch according to it when checking in. This would prevent a conflict in future.
Thanks,
Zhi.Quoted 87 lines · Jani Nikula
drivers/gpu/drm/i915/intel_gvt.h line 29
Quoted 9 lines · Zhi Wang
drivers/gpu/drm/i915/intel_gvt.h +1
-0@@ -26,7 +26,17 @@struct drm_i915_private ; +#include <linux/kernel.h> You only need <
linux/types.h>. Please add it before the forward declaration above.Quoted 22 lines
drivers/gpu/drm/i915/intel_gvt.h +10
-0+#ifdef CONFIG_DRM_I915_GVT + +struct intel_gvt_mmio_table_iter { +struct drm_i915_private *i915; +void *data; +int (*handle_mmio_cb)(struct intel_gvt_mmio_table_iter *iter, +u32 offset,u32 size); +}; +int intel_gvt_init (struct drm_i915_private *dev_priv);void intel_gvt_driver_remove (struct drm_i915_private *dev_priv);int intel_gvt_init_device (struct drm_i915_private *dev_priv);@@ -34,6 +44,7 @@ void intel_gvt_clean_device(struct drm_i915_private *dev_priv);int intel_gvt_init_host (void );void intel_gvt_sanitize_options (struct drm_i915_private *dev_priv);void intel_gvt_resume (struct drm_i915_private *dev_priv); +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter);#else static inline int intel_gvt_init (struct drm_i915_private *dev_priv) {drivers/gpu/drm/i915/intel_gvt.h static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv) · line 69
Quoted 8 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0@@ -51,6 +62,16 @@ static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)static inline void intel_gvt_resume (struct drm_i915_private *dev_priv) { } + +unsigned long intel_gvt_get_device_type (struct drm_i915_private *i915) +{ +return 0 ; +}The
CONFIG_DRM_I915_GVT=ycounterpart for this is inmmio.h. Should be both in the same header.Quoted 17 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0+ +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter) +{ +return 0 ; +}#endif #endif /* _INTEL_GVT_H_ */ drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +3
-0@@ -0,0 +1,1290 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2020 Intel Corporation drivers/gpu/drm/i915/intel_gvt_mmio_table.c line 13
Quoted 10 lines
drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +10
-0+*/ + +#include "i915_drv.h" +#include "i915_reg.h" +#include "display/vlv_dsi_pll_regs.h" +#include "gt/intel_gt_regs.h" +#include "intel_mchbar_regs.h" +#include "i915_pvinfo.h" +#include "intel_gvt.h" +#include "gvt/gvt.h" Generally we have the include lists sorted.
Other than the nitpicks above, the series is
Acked-by Jani Nikula <[email protected]>BR,
Jani.
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Wang, Zhi A
Reviewed-by Lucas De MarchiRe: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
Hi Jani:
Previously when I sent a pull request, it will be top of a tag in drm-intel-next. The following patches move the DMC related registers, which is used by GVT-g into intel_dmc_regs.h and it is not included in the latest tag.
commit 9c67d9e84c7d4a3a2371a54ee2dddc4699002000
Author: Jani Nikula <[email protected]> Date: Wed Mar 30 14:34:17 2022 +0300
drm/i915/dmc: split out dmc registers to a separate file
Clean up the massive i915_reg.h a bit with this isolated set of registers.
v2: Remove stale comment (Lucas)
If I still sent the pull request based on the latest tag, after the pull got merged, the compiling of the GVT-g module will be broken, as a new header needs to be included.
Can I sent my pull request not based on a tag in drm-intel-next, just the latest drm-intel-next?
Thanks,
Zhi.
Quoted 112 lines · Jani Nikula
Quoted 6 lines · Zhi A
Hi Jani:
Thanks so much for the help. Can you generate a new tag on drm-intel-next? I noticed that there was one patch moving the DMC related registers into
display/intel_dmc_regs.h, which is not included in the latest tag on drm-intel-next.Sorry, I'm not sure what you're asking exactly. We do tags when we create pull requests for drm-next, but I don't see the connection to gvt.
BR,
Jani.Quoted 96 lines
Guess it would be better that I can change this patch according to it when checking in. This would prevent a conflict in future.
Thanks,
Zhi.Quoted 87 lines · Jani Nikula
drivers/gpu/drm/i915/intel_gvt.h line 29
Quoted 9 lines · Zhi Wang
drivers/gpu/drm/i915/intel_gvt.h +1
-0@@ -26,7 +26,17 @@struct drm_i915_private ; +#include <linux/kernel.h> You only need <
linux/types.h>. Please add it before the forward declaration above.Quoted 22 lines
drivers/gpu/drm/i915/intel_gvt.h +10
-0+#ifdef CONFIG_DRM_I915_GVT + +struct intel_gvt_mmio_table_iter { +struct drm_i915_private *i915; +void *data; +int (*handle_mmio_cb)(struct intel_gvt_mmio_table_iter *iter, +u32 offset,u32 size); +}; +int intel_gvt_init (struct drm_i915_private *dev_priv);void intel_gvt_driver_remove (struct drm_i915_private *dev_priv);int intel_gvt_init_device (struct drm_i915_private *dev_priv);@@ -34,6 +44,7 @@ void intel_gvt_clean_device(struct drm_i915_private *dev_priv);int intel_gvt_init_host (void );void intel_gvt_sanitize_options (struct drm_i915_private *dev_priv);void intel_gvt_resume (struct drm_i915_private *dev_priv); +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter);#else static inline int intel_gvt_init (struct drm_i915_private *dev_priv) {drivers/gpu/drm/i915/intel_gvt.h static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv) · line 69
Quoted 8 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0@@ -51,6 +62,16 @@ static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)static inline void intel_gvt_resume (struct drm_i915_private *dev_priv) { } + +unsigned long intel_gvt_get_device_type (struct drm_i915_private *i915) +{ +return 0 ; +}The
CONFIG_DRM_I915_GVT=ycounterpart for this is inmmio.h. Should be both in the same header.Quoted 17 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0+ +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter) +{ +return 0 ; +}#endif #endif /* _INTEL_GVT_H_ */ drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +3
-0@@ -0,0 +1,1290 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2020 Intel Corporation drivers/gpu/drm/i915/intel_gvt_mmio_table.c line 13
Quoted 10 lines
drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +10
-0+*/ + +#include "i915_drv.h" +#include "i915_reg.h" +#include "display/vlv_dsi_pll_regs.h" +#include "gt/intel_gt_regs.h" +#include "intel_mchbar_regs.h" +#include "i915_pvinfo.h" +#include "intel_gvt.h" +#include "gvt/gvt.h" Generally we have the include lists sorted.
Other than the nitpicks above, the series is
Acked-by Jani Nikula <[email protected]>BR,
Jani.
Jani Nikula
maintainerRe: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
Quoted 15 lines · Zhi A
Hi Jani:
Previously when I sent a pull request, it will be top of a tag in drm-intel-next. The following patches move the DMC related registers, which is used by GVT-g into
intel_dmc_regs.hand it is not included in the latest tag.commit
9c67d9e84c7d4a3a2371a54ee2dddc4699002000Author: Jani Nikula <[email protected]> Date: Wed Mar 30 14:34:17 2022 +0300drm/i915/dmc: split out dmc registers to a separate file
Clean up the massive
i915_reg.ha bit with this isolated set of registers.v2: Remove stale comment (Lucas)
Quoted 7 lines
Signed-off-by Jani Nikula <[email protected]>Reviewed-by Lucas De Marchi <[email protected]>If I still sent the pull request based on the latest tag, after the pull got merged, the compiling of the GVT-g module will be broken, as a new header needs to be included.
Can I sent my pull request not based on a tag in drm-intel-next, just the latest drm-intel-next?
Yes.
I think you can also backmerge drm-intel-next to your branch whenever there's a dependency you need, or otherwise want to sync up. (Please do *not* backmerge drm-intel-gt-next or drm-next directly.)
BR,
Jani.
Quoted 118 lines
Thanks,
Zhi.Quoted 112 lines · Jani Nikula
Quoted 6 lines · Zhi A
Hi Jani:
Thanks so much for the help. Can you generate a new tag on drm-intel-next? I noticed that there was one patch moving the DMC related registers into
display/intel_dmc_regs.h, which is not included in the latest tag on drm-intel-next.Sorry, I'm not sure what you're asking exactly. We do tags when we create pull requests for drm-next, but I don't see the connection to gvt.
BR,
Jani.Quoted 96 lines
Guess it would be better that I can change this patch according to it when checking in. This would prevent a conflict in future.
Thanks,
Zhi.Quoted 87 lines · Jani Nikula
drivers/gpu/drm/i915/intel_gvt.h line 29
Quoted 9 lines · Zhi Wang
drivers/gpu/drm/i915/intel_gvt.h +1
-0@@ -26,7 +26,17 @@struct drm_i915_private ; +#include <linux/kernel.h> You only need <
linux/types.h>. Please add it before the forward declaration above.Quoted 22 lines
drivers/gpu/drm/i915/intel_gvt.h +10
-0+#ifdef CONFIG_DRM_I915_GVT + +struct intel_gvt_mmio_table_iter { +struct drm_i915_private *i915; +void *data; +int (*handle_mmio_cb)(struct intel_gvt_mmio_table_iter *iter, +u32 offset,u32 size); +}; +int intel_gvt_init (struct drm_i915_private *dev_priv);void intel_gvt_driver_remove (struct drm_i915_private *dev_priv);int intel_gvt_init_device (struct drm_i915_private *dev_priv);@@ -34,6 +44,7 @@ void intel_gvt_clean_device(struct drm_i915_private *dev_priv);int intel_gvt_init_host (void );void intel_gvt_sanitize_options (struct drm_i915_private *dev_priv);void intel_gvt_resume (struct drm_i915_private *dev_priv); +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter);#else static inline int intel_gvt_init (struct drm_i915_private *dev_priv) {drivers/gpu/drm/i915/intel_gvt.h static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv) · line 69
Quoted 8 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0@@ -51,6 +62,16 @@ static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)static inline void intel_gvt_resume (struct drm_i915_private *dev_priv) { } + +unsigned long intel_gvt_get_device_type (struct drm_i915_private *i915) +{ +return 0 ; +}The
CONFIG_DRM_I915_GVT=ycounterpart for this is inmmio.h. Should be both in the same header.Quoted 17 lines
drivers/gpu/drm/i915/intel_gvt.h +5
-0+ +int intel_gvt_iterate_mmio_table (struct intel_gvt_mmio_table_iter *iter) +{ +return 0 ; +}#endif #endif /* _INTEL_GVT_H_ */ drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +3
-0@@ -0,0 +1,1290 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2020 Intel Corporation drivers/gpu/drm/i915/intel_gvt_mmio_table.c line 13
Quoted 10 lines
drivers/gpu/drm/i915/intel_gvt_mmio_table.c new file +10
-0+*/ + +#include "i915_drv.h" +#include "i915_reg.h" +#include "display/vlv_dsi_pll_regs.h" +#include "gt/intel_gt_regs.h" +#include "intel_mchbar_regs.h" +#include "i915_pvinfo.h" +#include "intel_gvt.h" +#include "gvt/gvt.h" Generally we have the include lists sorted.
Other than the nitpicks above, the series is
Acked-by Jani Nikula <[email protected]>BR,
Jani.
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Re: [PATCH v9 1/3] i915/gvt: Separate the MMIO tracking table from GVT-g
In reply to Zhi WangQuoted 6 lines · On Thu, 7 Apr 2022 03:19:43 -0400 Zhi Wang <[email protected]> wrote:
From: Zhi Wang <[email protected]>
To support the new mdev interfaces and the re-factor patches from Christoph, which moves the GVT-g code into a dedicated module, the GVT-g MMIO tracking table needs to be separated from GVT-g.
Since this commit I'm unable to make use of GVT-g on a Xeon W-1290 IGD. The following in dmesg is the first sign of trouble:
------------[ cut here ]------------ assign a handler to a non-tracked mmio 4ab8 WARNING: CPU: 16 PID: 504 at drivers/gpu/drm/i915/gvt/handlers.c:123 setup_mmio_info.constprop.0+0xd1/0xf0 [i915] ixgbe 0000:02:00.0: 31.504 Gb/s available PCIe bandwidth (8.0 GT/s PCIe x4 link) Modules linked in: nouveau(+) i915(+) mdev vfio_iommu_type1 vfio prime_numbers intel_gtt ast drm_buddy mxm_wmi drm_dp_helper drm_vram_helper drm_ttm_helper drm_kms_helper sd_mod t10_pi syscopyarea sysfillrect sysimgblt sg fb_sys_fops cec ttm crct10dif_pclmul drm ixgbe(+) crc32_pclmul igb crc32c_intel ahci e1000e libahci mdio libata ghash_clmulni_intel i2c_algo_bit dca wmi video pinctrl_cannonlake rndis_host cdc_ether usbnet mii dm_mirror dm_region_hash dm_log dm_mod fuse ixgbe 0000:02:00.0: MAC: 4, PHY: 0, PBA No: 020C08-0F8 CPU: 16 PID: 504 Comm: systemd-udevd Not tainted 5.18.0-rc1+ #16 ixgbe 0000:02:00.0: 3c:ec:ef:27:ef:0e Hardware name: Supermicro Super Server/X12SCZ-F, BIOS 1.0 06/16/2020 RIP: 0010:setup_mmio_info.constprop.0+0xd1/0xf0 [i915] Code: 83 c6 04 81 ef e4 e6 dd 78 39 f5 77 a2 31 c0 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 48 c7 c7 d8 c1 07 c1 e8 fe 83 cc c9 <0f> 0b 48 83 c4 08 b8 ed ff ff ff 5b 5d 41 5c 41 5d 41 5e 41 5f c3 RSP: 0018:ffffa2014090fa28 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff934754a38000 RCX: 0000000000000000 RDX: ffff9346ce42c740 RSI: ffff9346ce41fca0 RDI: ffff9346ce41fca0 RBP: 0000000000004abc R08: 0000000000000000 R09: 00000000ffff7fff R10: ffffa2014090f868 R11: ffffffff8bfe65e8 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000008 R15: 0000000000000000 FS: 00007f345634d540(0000) GS:ffff9346ce400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000562eacfa8980 CR3: 0000002058ac0001 CR4: 00000000007706e0 PKRU: 55555554 Call Trace: <TASK> init_skl_mmio_info+0x1532/0x15a0 [i915] intel_gvt_setup_mmio_info+0x1aa/0x240 [i915] ? gen9_dbuf_ctl_mmio_write+0x40/0x40 [i915] intel_gvt_init_device+0x106/0x300 [i915] intel_gvt_init+0x41/0xa0 [i915] i915_driver_hw_probe+0x2b2/0x340 [i915] i915_driver_probe+0x1fd/0x570 [i915] ? drm_privacy_screen_get+0x15f/0x190 [drm] i915_pci_probe+0x56/0x1e0 [i915] local_pci_probe+0x42/0x80 pci_call_probe+0x56/0x160 pci_device_probe+0x75/0xf0 ? driver_sysfs_add+0x6f/0xd0 really_probe+0x199/0x380 ixgbe 0000:02:00.0: Intel(R) 10 Gigabit Network Connection __driver_probe_device+0xfe/0x180 driver_probe_device+0x1e/0x90 __driver_attach+0xc0/0x1c0 ? __device_attach_driver+0xe0/0xe0 ? __device_attach_driver+0xe0/0xe0 bus_for_each_dev+0x75/0xc0 bus_add_driver+0x149/0x1e0 driver_register+0x8f/0xe0 i915_init+0x1d/0x7c [i915] ? 0xffffffffc0768000 do_one_initcall+0x41/0x200 ? kmem_cache_alloc_trace+0x174/0x2f0 do_init_module+0x4c/0x250 __do_sys_finit_module+0xb4/0x120 do_syscall_64+0x59/0x80 ? syscall_exit_to_user_mode+0x12/0x30 ? do_syscall_64+0x69/0x80 ? do_syscall_64+0x69/0x80 ? do_syscall_64+0x69/0x80 ? sysvec_call_function+0x3c/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f3456e5a3ed Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 03 aa 1b 00 f7 d8 64 89 01 48 RSP: 002b:00007fff4df686b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 0000562eacf62920 RCX: 00007f3456e5a3ed RDX: 0000000000000000 RSI: 0000562eacf886b0 RDI: 000000000000001a RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000002 R10: 000000000000001a R11: 0000000000000246 R12: 0000562eacf886b0 R13: 0000562eacf627c0 R14: 0000000000000000 R15: 0000562eacf8d2d0 </TASK> ---[ end trace 0000000000000000 ]---
Quoted 4 lines
drivers/gpu/drm/i915/gvt/handlers.c +0
-0
...
drivers/gpu/drm/i915/gvt/handlers.c static int init_skl_mmio_info(struct intel_gvt *gvt) · line 2734
Quoted 8 lines
drivers/gpu/drm/i915/gvt/handlers.c +0
-1@@ -3440,7 +2729,6 @@ static int init_skl_mmio_info(struct intel_gvt *gvt) NULL, NULL);MMIO_DFH (GAMT_CHKN_BIT_REG ,D_KBL |D_CFL ,F_CMD_ACCESS ,NULL ,NULL ); -MMIO_D (GEN9_CTX_PREEMPT_REG ,D_SKL_PLUS & ~D_BXT );MMIO_DFH (_MMIO (0xe4cc ),D_BDW_PLUS ,F_CMD_ACCESS ,NULL ,NULL );return 0 ;
I tracked this to the above code segment, where the untouched line provides this mmio address:
#define GAMT_CHKN_BIT_REG _MMIO(0x4ab8)
If I comment out setup of this register, GVT-g appears to initialize and I can list available mdev types. I haven't tried assignment of the resulting device to a VM yet. I do however get lots of spew about unclaimed reads:
i915 0000:00:02.0: Unclaimed read from register 0x7257c i915 0000:00:02.0: Unclaimed read from register 0x60110 i915 0000:00:02.0: Unclaimed read from register 0x6f03c i915 0000:00:02.0: Unclaimed read from register 0x6003c i915 0000:00:02.0: Unclaimed read from register 0x61038 i915 0000:00:02.0: Unclaimed read from register 0x45104 i915 0000:00:02.0: Unclaimed read from register 0x70428 i915 0000:00:02.0: Unclaimed read from register 0x68884 i915 0000:00:02.0: Unclaimed read from register 0x7f040 i915 0000:00:02.0: Unclaimed read from register 0x4510c i915 0000:00:02.0: Unclaimed read from register 0x6203c i915 0000:00:02.0: Unclaimed read from register 0x70430 i915 0000:00:02.0: Unclaimed read from register 0x704c0 i915 0000:00:02.0: Unclaimed read from register 0x7142c i915 0000:00:02.0: Unclaimed read from register 0x72428 i915 0000:00:02.0: Unclaimed read from register 0x6f04c i915 0000:00:02.0: Unclaimed read from register 0x6004c i915 0000:00:02.0: Unclaimed read from register 0x61048 i915 0000:00:02.0: Unclaimed read from register 0x68070 i915 0000:00:02.0: Unclaimed read from register 0x71284 i915 0000:00:02.0: Unclaimed read from register 0x70438 i915 0000:00:02.0: Unclaimed read from register 0x71434 i915 0000:00:02.0: Unclaimed read from register 0x714c4 i915 0000:00:02.0: Unclaimed read from register 0x72430 i915 0000:00:02.0: Unclaimed read from register 0x724c0 i915 0000:00:02.0: Unclaimed read from register 0x6204c i915 0000:00:02.0: Unclaimed read from register 0x69074 i915 0000:00:02.0: Unclaimed read from register 0x64044 i915 0000:00:02.0: Unclaimed read from register 0x7143c i915 0000:00:02.0: Unclaimed read from register 0x72438 i915 0000:00:02.0: Unclaimed read from register 0x46508 i915 0000:00:02.0: Unclaimed read from register 0x69270 i915 0000:00:02.0: Unclaimed read from register 0x45124 i915 0000:00:02.0: Unclaimed read from register 0x68080 i915 0000:00:02.0: Unclaimed read from register 0x61208 i915 0000:00:02.0: Unclaimed read from register 0x45200 i915 0000:00:02.0: Unclaimed read from register 0x69084 i915 0000:00:02.0: Unclaimed read from register 0x6f020 i915 0000:00:02.0: Unclaimed read from register 0x60020 i915 0000:00:02.0: Unclaimed read from register 0x42020 i915 0000:00:02.0: Unclaimed read from register 0x69280 i915 0000:00:02.0: Unclaimed read from register 0x71184 i915 0000:00:02.0: Unclaimed read from register 0x68090 i915 0000:00:02.0: Unclaimed read from register 0x7f024 i915 0000:00:02.0: Unclaimed read from register 0x70024 i915 0000:00:02.0: Unclaimed read from register 0x70578 i915 0000:00:02.0: Unclaimed read from register 0x43218 i915 0000:00:02.0: Unclaimed read from register 0x62020 i915 0000:00:02.0: Unclaimed read from register 0x68870 i915 0000:00:02.0: Unclaimed read from register 0x7157c i915 0000:00:02.0: Unclaimed read from register 0x72024 i915 0000:00:02.0: Unclaimed read from register 0x72578 i915 0000:00:02.0: Unclaimed read from register 0x46020 i915 0000:00:02.0: Unclaimed read from register 0x6f038 i915 0000:00:02.0: Unclaimed read from register 0x60038 i915 0000:00:02.0: Unclaimed read from register 0x45100 i915 0000:00:02.0: Unclaimed read from register 0x44030 i915 0000:00:02.0: Unclaimed read from register 0x68880 i915 0000:00:02.0: Unclaimed read from register 0x61110 i915 0000:00:02.0: Unclaimed read from register 0x6103c i915 0000:00:02.0: Unclaimed read from register 0x45108 i915 0000:00:02.0: Unclaimed read from register 0x62038 i915 0000:00:02.0: Unclaimed read from register 0x6e554 i915 0000:00:02.0: Unclaimed read from register 0x7042c i915 0000:00:02.0: Unclaimed read from register 0x71428 i915 0000:00:02.0: Unclaimed read from register 0x48800 i915 0000:00:02.0: Unclaimed read from register 0x7f044 i915 0000:00:02.0: Unclaimed read from register 0x6f048 i915 0000:00:02.0: Unclaimed read from register 0x60048 i915 0000:00:02.0: Unclaimed read from register 0x48268 i915 0000:00:02.0: Unclaimed read from register 0x45110 i915 0000:00:02.0: Unclaimed read from register 0x70284 i915 0000:00:02.0: Unclaimed read from register 0x7f000 i915 0000:00:02.0: Unclaimed read from register 0x70434 i915 0000:00:02.0: Unclaimed read from register 0x704c4 i915 0000:00:02.0: Unclaimed read from register 0x71430 i915 0000:00:02.0: Unclaimed read from register 0x714c0 i915 0000:00:02.0: Unclaimed read from register 0x44040 i915 0000:00:02.0: Unclaimed read from register 0x7242c i915 0000:00:02.0: Unclaimed read from register 0x68890 i915 0000:00:02.0: Unclaimed read from register 0x42004 i915 0000:00:02.0: Unclaimed read from register 0x6104c i915 0000:00:02.0: Unclaimed read from register 0x62048 i915 0000:00:02.0: Unclaimed read from register 0x68074 i915 0000:00:02.0: Unclaimed read from register 0x69070 i915 0000:00:02.0: Unclaimed read from register 0x7043c i915 0000:00:02.0: Unclaimed read from register 0x72284 i915 0000:00:02.0: Unclaimed read from register 0x71438 i915 0000:00:02.0: Unclaimed read from register 0x72434 i915 0000:00:02.0: Unclaimed read from register 0x724c4 i915 0000:00:02.0: Unclaimed read from register 0x45120 i915 0000:00:02.0: Unclaimed read from register 0x7243c i915 0000:00:02.0: Unclaimed read from register 0x42014 i915 0000:00:02.0: Unclaimed read from register 0x69274 i915 0000:00:02.0: Unclaimed read from register 0x45128 i915 0000:00:02.0: Unclaimed read from register 0x68084 i915 0000:00:02.0: Unclaimed read from register 0x6120c i915 0000:00:02.0: Unclaimed read from register 0x69080 i915 0000:00:02.0: Unclaimed read from register 0x70184 i915 0000:00:02.0: Unclaimed read from register 0x43408 i915 0000:00:02.0: Unclaimed read from register 0x61020 i915 0000:00:02.0: Unclaimed read from register 0x72184 i915 0000:00:02.0: Unclaimed read from register 0x69090 i915 0000:00:02.0: Unclaimed read from register 0x7057c i915 0000:00:02.0: Unclaimed read from register 0x71024 i915 0000:00:02.0: Unclaimed read from register 0x71578 i915 0000:00:02.0: Unclaimed read from register 0x68874
This looks like a regression in v5.19 to me. Thanks,
Alex
Zhi Wang
reviewerPATCH v9 2/3 i915/gvt: Save the initial HW state snapshot in i915
In reply to Zhi WangSave the initial HW state snapshot in i915 so that the rest code of GVT-g can be moved into a dedicated module while it can still get a clean initial HW state saved at the correct time during the initialization of i915. The futhrer vGPU created by GVT-g will use this HW state as the initial HW state.
v6:
- Remove the reference of intel_gvt_device_info.(Christoph)
- Refine the save_mmio() function. (Christoph)
--- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/intel_gvt.c | 92 +++++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -421,6 +421,8 @@ struct i915_virtual_gpu {struct mutex lock;/* serialises sending of g2v_notify command pkts */ bool active;u32 caps; +u32 *initial_mmio; +u8 *initial_cfg_space; };struct i915_selftest_stash {
drivers/gpu/drm/i915/intel_gvt.c +90 -2
117 lines not on this page · raw message
Signature · 1 line
2.25.1
Zhi Wang
reviewerPATCH v9 3/3 i915/gvt: Use the initial HW state snapshot saved in i915
In reply to Zhi WangThe code of saving initial HW state snapshot has been moved into i915. Let the GVT-g core logic use that snapshot.
--- drivers/gpu/drm/i915/gvt/firmware.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/gvt/firmware.c +9 -16
@@ -66,22 +66,16 @@ static struct bin_attribute firmware_attr = { .mmap = NULL, }; -static int mmio_snapshot_handler (struct intel_gvt *gvt,u32 offset,void *data) -{ - *(u32 *)(data + offset) =intel_uncore_read_notrace (gvt->gt->uncore, -_MMIO (offset)); -return 0 ; -} -static int expose_firmware_sysfs (struct intel_gvt *gvt) {struct intel_gvt_device_info *info = &gvt->device_info; -struct pci_dev *pdev =to_pci_dev (gvt->gt->i915->drm.dev); +struct drm_i915_private *i915 = gvt->gt->i915; +struct pci_dev *pdev =to_pci_dev (i915->drm.dev);struct gvt_firmware_header *h;void *firmware;void *p;unsigned long size, crc32_start; -int i, ret; +int ret; size =sizeof (*h) + info->mmio_size + info->cfg_space_size; firmware =vzalloc (size);
@@ -99,17 +93,16 @@ static int expose_firmware_sysfs(struct intel_gvt *gvt) p = firmware + h->cfg_space_offset; -for (i =0 ; i < h->cfg_space_size; i +=4 ) -pci_read_config_dword (pdev, i, p + i); - -memcpy (gvt->firmware.cfg_space, p, info->cfg_space_size); +memcpy (gvt->firmware.cfg_space, i915->vgpu.initial_cfg_space, + info->cfg_space_size); +memcpy (p, gvt->firmware.cfg_space, info->cfg_space_size); p = firmware + h->mmio_offset; -/* Take a snapshot of hw mmio registers. */ -intel_gvt_for_each_tracked_mmio (gvt, mmio_snapshot_handler, p); +memcpy (gvt->firmware.mmio, i915->vgpu.initial_mmio, + info->mmio_size); -memcpy (gvt->firmware.mmio, p, info->mmio_size); +memcpy (p, gvt->firmware.mmio, info->mmio_size); crc32_start = offsetof(struct gvt_firmware_header , crc32) +4 ; h->crc32 =crc32_le (0 , firmware + crc32_start, size - crc32_start);
Signature · 1 line
2.25.1
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BUILD: failure for Refactor GVT-g MMIO tracking table and handlers (rev2)
In reply to Zhi Wang== Series Details ==
== Series Details ==
Series: Refactor GVT-g MMIO tracking table and handlers (rev2)
URL : https://patchwork.freedesktop.org/series/102073/
State : failure
== Summary ==
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CC [M] drivers/gpu/drm/i915/intel_gvt_mmio_table.odrivers/gpu/drm/i915/intel_gvt_mmio_table.c: In function ‘iterate_skl_plus_mmio’:drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1021:9: error: ‘DMC_SSP_BASE’ undeclared (first use in this function); did you mean ‘FBC_CFB_BASE’?
MMIO_D(DMC_SSP_BASE);
^~~~~~~~~~~~
drivers/gpu/drm/i915/intel_gvt_mmio_table.c:17:56: note: in definition of macro ‘MMIO_F’
ret = iter->handle_mmio_cb(iter, i915_mmio_reg_offset(reg), s); \
^~~drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1021:2: note: in expansion of macro ‘MMIO_D’
MMIO_D(DMC_SSP_BASE);
^~~~~~drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1021:9: note: each undeclared identifier is reported only once for each function it appears in
MMIO_D(DMC_SSP_BASE);
^~~~~~~~~~~~
drivers/gpu/drm/i915/intel_gvt_mmio_table.c:17:56: note: in definition of macro ‘MMIO_F’
ret = iter->handle_mmio_cb(iter, i915_mmio_reg_offset(reg), s); \
^~~drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1021:2: note: in expansion of macro ‘MMIO_D’
MMIO_D(DMC_SSP_BASE);
^~~~~~drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1022:9: error: ‘DMC_HTP_SKL’ undeclared (first use in this function); did you mean ‘D_PRE_SKL’?
MMIO_D(DMC_HTP_SKL);
^~~~~~~~~~~
drivers/gpu/drm/i915/intel_gvt_mmio_table.c:17:56: note: in definition of macro ‘MMIO_F’
ret = iter->handle_mmio_cb(iter, i915_mmio_reg_offset(reg), s); \
^~~drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1022:2: note: in expansion of macro ‘MMIO_D’
MMIO_D(DMC_HTP_SKL);
^~~~~~drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1023:9: error: ‘DMC_LAST_WRITE’ undeclared (first use in this function); did you mean ‘DRM_LIST_WAIT’?
MMIO_D(DMC_LAST_WRITE);
^~~~~~~~~~~~~~
drivers/gpu/drm/i915/intel_gvt_mmio_table.c:17:56: note: in definition of macro ‘MMIO_F’
ret = iter->handle_mmio_cb(iter, i915_mmio_reg_offset(reg), s); \
^~~drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1023:2: note: in expansion of macro ‘MMIO_D’
MMIO_D(DMC_LAST_WRITE);
^~~~~~drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1080:15: error: ‘DMC_MMIO_START_RANGE’ undeclared (first use in this function); did you mean ‘DRM_MM_INSERT_ONCE’?
MMIO_F(_MMIO(DMC_MMIO_START_RANGE), 0x3000);
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/intel_gvt_mmio_table.c:17:56: note: in definition of macro ‘MMIO_F’
ret = iter->handle_mmio_cb(iter, i915_mmio_reg_offset(reg), s); \
^~~
drivers/gpu/drm/i915/intel_gvt_mmio_table.c:1080:9: note: in expansion of macro ‘_MMIO’
MMIO_F(_MMIO(DMC_MMIO_START_RANGE), 0x3000);
^~~~~scripts/Makefile.build:288: recipe for target 'drivers/gpu/drm/i915/intel_gvt_mmio_table.o' failed make[4]: *** [drivers/gpu/drm/i915/intel_gvt_mmio_table.o] Error 1 scripts/Makefile.build:550: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2scripts/Makefile.build:550: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2scripts/Makefile.build:550: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1834: recipe for target 'drivers' failed
make: *** [drivers] Error 2