From: Michal Wajdeczko <michal.wajdeczko@intel.com> To: Vinay Belgaumkar <vinay.belgaumkar@intel.com>, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH 05/14] drm/i915/guc/slpc: Allocate, initialize and release SLPC Date: Wed, 21 Jul 2021 19:26:39 +0200 [thread overview] Message-ID: <fa6e3691-d43b-1b42-f031-f3d533298eae@intel.com> (raw) In-Reply-To: <20210721161120.24610-6-vinay.belgaumkar@intel.com> On 21.07.2021 18:11, Vinay Belgaumkar wrote: > Allocate data structures for SLPC and functions for > initializing on host side. > > v2: Address review comments (Michal W) > > Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> > Signed-off-by: Sundaresan Sujaritha <sujaritha.sundaresan@intel.com> > --- > drivers/gpu/drm/i915/gt/uc/intel_guc.c | 11 ++++++ > drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c | 36 ++++++++++++++++++- > drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h | 1 + > .../gpu/drm/i915/gt/uc/intel_guc_slpc_types.h | 3 ++ > 4 files changed, 50 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c > index fcccb103a21a..686cb978662d 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c > @@ -337,6 +337,12 @@ int intel_guc_init(struct intel_guc *guc) > goto err_ct; > } > > + if (intel_guc_slpc_is_used(guc)) { > + ret = intel_guc_slpc_init(&guc->slpc); > + if (ret) > + goto err_submission; > + } > + > /* now that everything is perma-pinned, initialize the parameters */ > guc_init_params(guc); > > @@ -347,6 +353,8 @@ int intel_guc_init(struct intel_guc *guc) > > return 0; > > +err_submission: > + intel_guc_submission_fini(guc); > err_ct: > intel_guc_ct_fini(&guc->ct); > err_ads: > @@ -369,6 +377,9 @@ void intel_guc_fini(struct intel_guc *guc) > > i915_ggtt_disable_guc(gt->ggtt); > > + if (intel_guc_slpc_is_used(guc)) > + intel_guc_slpc_fini(&guc->slpc); > + > if (intel_guc_submission_is_used(guc)) > intel_guc_submission_fini(guc); > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c > index d9feb430ce35..a99d727b5bf0 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c > @@ -12,6 +12,16 @@ static inline struct intel_guc *slpc_to_guc(struct intel_guc_slpc *slpc) > return container_of(slpc, struct intel_guc, slpc); > } > > +static inline struct intel_gt *slpc_to_gt(struct intel_guc_slpc *slpc) > +{ > + return guc_to_gt(slpc_to_guc(slpc)); > +} > + > +static inline struct drm_i915_private *slpc_to_i915(struct intel_guc_slpc *slpc) > +{ > + return (slpc_to_gt(slpc))->i915; redundant ( ) > +} > + > static bool __detect_slpc_supported(struct intel_guc *guc) > { > /* GuC SLPC is unavailable for pre-Gen12 */ > @@ -35,9 +45,29 @@ void intel_guc_slpc_init_early(struct intel_guc_slpc *slpc) > guc->slpc_selected = __guc_slpc_selected(guc); > } > > +static int slpc_shared_data_init(struct intel_guc_slpc *slpc) > +{ > + struct intel_guc *guc = slpc_to_guc(slpc); > + struct drm_i915_private *i915 = slpc_to_i915(slpc); > + u32 size = PAGE_ALIGN(sizeof(struct slpc_shared_data)); > + int err; > + > + err = intel_guc_allocate_and_map_vma(guc, size, &slpc->vma, (void **)&slpc->vaddr); > + if (unlikely(err)) { > + drm_err(&i915->drm, > + "Failed to allocate SLPC struct (err=%pe)\n", > + ERR_PTR(err)); > + return err; > + } > + > + return err; > +} > + > int intel_guc_slpc_init(struct intel_guc_slpc *slpc) > { > - return 0; > + GEM_BUG_ON(slpc->vma); > + > + return slpc_shared_data_init(slpc); > } > > /* > @@ -60,4 +90,8 @@ int intel_guc_slpc_enable(struct intel_guc_slpc *slpc) > > void intel_guc_slpc_fini(struct intel_guc_slpc *slpc) > { > + if (!slpc->vma) > + return; > + > + i915_vma_unpin_and_release(&slpc->vma, I915_VMA_RELEASE_MAP); > } > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h > index c3b0ad7f0f93..f02249ff5f1b 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h > @@ -8,6 +8,7 @@ > > #include "intel_guc_submission.h" > #include "intel_guc_slpc_types.h" > +#include "abi/guc_actions_slpc_abi.h" is this is needed here ? maybe abi.h could be included only in slcp.c ? > > static inline bool intel_guc_slpc_is_supported(struct intel_guc *guc) > { > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h > index b85148265b1f..214a449e78f2 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h > @@ -7,9 +7,12 @@ > #define _INTEL_GUC_SLPC_TYPES_H_ > > #include <linux/types.h> > +#include "abi/guc_actions_slpc_abi.h" for below pointers you don't need this header(s) to be included Michal > > struct intel_guc_slpc { > > + struct i915_vma *vma; > + struct slpc_shared_data *vaddr; > }; > > #endif > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Michal Wajdeczko <michal.wajdeczko@intel.com> To: Vinay Belgaumkar <vinay.belgaumkar@intel.com>, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH 05/14] drm/i915/guc/slpc: Allocate, initialize and release SLPC Date: Wed, 21 Jul 2021 19:26:39 +0200 [thread overview] Message-ID: <fa6e3691-d43b-1b42-f031-f3d533298eae@intel.com> (raw) In-Reply-To: <20210721161120.24610-6-vinay.belgaumkar@intel.com> On 21.07.2021 18:11, Vinay Belgaumkar wrote: > Allocate data structures for SLPC and functions for > initializing on host side. > > v2: Address review comments (Michal W) > > Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> > Signed-off-by: Sundaresan Sujaritha <sujaritha.sundaresan@intel.com> > --- > drivers/gpu/drm/i915/gt/uc/intel_guc.c | 11 ++++++ > drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c | 36 ++++++++++++++++++- > drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h | 1 + > .../gpu/drm/i915/gt/uc/intel_guc_slpc_types.h | 3 ++ > 4 files changed, 50 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c > index fcccb103a21a..686cb978662d 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c > @@ -337,6 +337,12 @@ int intel_guc_init(struct intel_guc *guc) > goto err_ct; > } > > + if (intel_guc_slpc_is_used(guc)) { > + ret = intel_guc_slpc_init(&guc->slpc); > + if (ret) > + goto err_submission; > + } > + > /* now that everything is perma-pinned, initialize the parameters */ > guc_init_params(guc); > > @@ -347,6 +353,8 @@ int intel_guc_init(struct intel_guc *guc) > > return 0; > > +err_submission: > + intel_guc_submission_fini(guc); > err_ct: > intel_guc_ct_fini(&guc->ct); > err_ads: > @@ -369,6 +377,9 @@ void intel_guc_fini(struct intel_guc *guc) > > i915_ggtt_disable_guc(gt->ggtt); > > + if (intel_guc_slpc_is_used(guc)) > + intel_guc_slpc_fini(&guc->slpc); > + > if (intel_guc_submission_is_used(guc)) > intel_guc_submission_fini(guc); > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c > index d9feb430ce35..a99d727b5bf0 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c > @@ -12,6 +12,16 @@ static inline struct intel_guc *slpc_to_guc(struct intel_guc_slpc *slpc) > return container_of(slpc, struct intel_guc, slpc); > } > > +static inline struct intel_gt *slpc_to_gt(struct intel_guc_slpc *slpc) > +{ > + return guc_to_gt(slpc_to_guc(slpc)); > +} > + > +static inline struct drm_i915_private *slpc_to_i915(struct intel_guc_slpc *slpc) > +{ > + return (slpc_to_gt(slpc))->i915; redundant ( ) > +} > + > static bool __detect_slpc_supported(struct intel_guc *guc) > { > /* GuC SLPC is unavailable for pre-Gen12 */ > @@ -35,9 +45,29 @@ void intel_guc_slpc_init_early(struct intel_guc_slpc *slpc) > guc->slpc_selected = __guc_slpc_selected(guc); > } > > +static int slpc_shared_data_init(struct intel_guc_slpc *slpc) > +{ > + struct intel_guc *guc = slpc_to_guc(slpc); > + struct drm_i915_private *i915 = slpc_to_i915(slpc); > + u32 size = PAGE_ALIGN(sizeof(struct slpc_shared_data)); > + int err; > + > + err = intel_guc_allocate_and_map_vma(guc, size, &slpc->vma, (void **)&slpc->vaddr); > + if (unlikely(err)) { > + drm_err(&i915->drm, > + "Failed to allocate SLPC struct (err=%pe)\n", > + ERR_PTR(err)); > + return err; > + } > + > + return err; > +} > + > int intel_guc_slpc_init(struct intel_guc_slpc *slpc) > { > - return 0; > + GEM_BUG_ON(slpc->vma); > + > + return slpc_shared_data_init(slpc); > } > > /* > @@ -60,4 +90,8 @@ int intel_guc_slpc_enable(struct intel_guc_slpc *slpc) > > void intel_guc_slpc_fini(struct intel_guc_slpc *slpc) > { > + if (!slpc->vma) > + return; > + > + i915_vma_unpin_and_release(&slpc->vma, I915_VMA_RELEASE_MAP); > } > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h > index c3b0ad7f0f93..f02249ff5f1b 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h > @@ -8,6 +8,7 @@ > > #include "intel_guc_submission.h" > #include "intel_guc_slpc_types.h" > +#include "abi/guc_actions_slpc_abi.h" is this is needed here ? maybe abi.h could be included only in slcp.c ? > > static inline bool intel_guc_slpc_is_supported(struct intel_guc *guc) > { > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h > index b85148265b1f..214a449e78f2 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h > @@ -7,9 +7,12 @@ > #define _INTEL_GUC_SLPC_TYPES_H_ > > #include <linux/types.h> > +#include "abi/guc_actions_slpc_abi.h" for below pointers you don't need this header(s) to be included Michal > > struct intel_guc_slpc { > > + struct i915_vma *vma; > + struct slpc_shared_data *vaddr; > }; > > #endif >
next prev parent reply other threads:[~2021-07-21 17:29 UTC|newest] Thread overview: 104+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-21 16:11 [PATCH v2 00/14] drm/i915/guc: Enable GuC based power management features Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] [PATCH 01/14] drm/i915/guc: SQUASHED PATCH - DO NOT REVIEW Vinay Belgaumkar 2021-07-21 16:11 ` Vinay Belgaumkar 2021-07-21 16:11 ` [PATCH 02/14] drm/i915/guc/slpc: Initial definitions for SLPC Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 17:24 ` Michal Wajdeczko 2021-07-21 17:24 ` Michal Wajdeczko 2021-07-22 0:56 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-22 0:56 ` Belgaumkar, Vinay 2021-07-21 16:11 ` [PATCH 03/14] drm/i915/guc/slpc: Gate Host RPS when SLPC is enabled Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 16:11 ` [PATCH 04/14] drm/i915/guc/slpc: Adding SLPC communication interfaces Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 17:25 ` Michal Wajdeczko 2021-07-21 17:25 ` Michal Wajdeczko 2021-07-23 19:26 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-23 19:26 ` Belgaumkar, Vinay 2021-07-21 16:11 ` [PATCH 05/14] drm/i915/guc/slpc: Allocate, initialize and release SLPC Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 17:26 ` Michal Wajdeczko [this message] 2021-07-21 17:26 ` Michal Wajdeczko 2021-07-23 19:30 ` Belgaumkar, Vinay 2021-07-23 19:30 ` Belgaumkar, Vinay 2021-07-21 16:11 ` [PATCH 06/14] drm/i915/guc/slpc: Enable SLPC and add related H2G events Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 17:38 ` Michal Wajdeczko 2021-07-21 17:38 ` Michal Wajdeczko 2021-07-23 19:28 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-23 19:28 ` Belgaumkar, Vinay 2021-07-21 23:44 ` [Intel-gfx] " kernel test robot 2021-07-21 23:44 ` kernel test robot 2021-07-21 23:44 ` kernel test robot 2021-07-22 2:36 ` [Intel-gfx] " kernel test robot 2021-07-22 2:36 ` kernel test robot 2021-07-22 2:36 ` kernel test robot 2021-07-22 18:07 ` [Intel-gfx] " kernel test robot 2021-07-22 18:07 ` kernel test robot 2021-07-22 18:07 ` kernel test robot 2021-07-22 18:07 ` [Intel-gfx] [RFC PATCH] drm/i915/guc/slpc: slpc_decode_min_freq() can be static kernel test robot 2021-07-22 18:07 ` kernel test robot 2021-07-22 18:07 ` kernel test robot 2021-07-23 13:04 ` [Intel-gfx] [PATCH 06/14] drm/i915/guc/slpc: Enable SLPC and add related H2G events kernel test robot 2021-07-23 13:04 ` kernel test robot 2021-07-23 13:04 ` kernel test robot 2021-07-24 16:30 ` [Intel-gfx] " kernel test robot 2021-07-24 16:30 ` kernel test robot 2021-07-24 16:30 ` kernel test robot 2021-07-21 16:11 ` [PATCH 07/14] drm/i915/guc/slpc: Add methods to set min/max frequency Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 17:42 ` Michal Wajdeczko 2021-07-21 17:42 ` Michal Wajdeczko 2021-07-23 19:35 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-23 19:35 ` Belgaumkar, Vinay 2021-07-21 16:11 ` [PATCH 08/14] drm/i915/guc/slpc: Add get max/min freq hooks Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 18:00 ` Michal Wajdeczko 2021-07-21 18:00 ` Michal Wajdeczko 2021-07-23 19:43 ` Belgaumkar, Vinay 2021-07-23 19:43 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-21 16:11 ` [PATCH 09/14] drm/i915/guc/slpc: Add debugfs for SLPC info Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 18:05 ` Michal Wajdeczko 2021-07-21 18:05 ` Michal Wajdeczko 2021-07-23 19:49 ` Belgaumkar, Vinay 2021-07-23 19:49 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-22 1:29 ` kernel test robot 2021-07-22 1:29 ` kernel test robot 2021-07-22 1:29 ` kernel test robot 2021-07-24 0:31 ` [Intel-gfx] " kernel test robot 2021-07-24 0:31 ` kernel test robot 2021-07-24 0:31 ` kernel test robot 2021-07-24 0:31 ` [Intel-gfx] [RFC PATCH] drm/i915/guc/slpc: intel_eval_slpc_support() can be static kernel test robot 2021-07-24 0:31 ` kernel test robot 2021-07-24 0:31 ` kernel test robot 2021-07-25 2:57 ` [Intel-gfx] [PATCH 09/14] drm/i915/guc/slpc: Add debugfs for SLPC info kernel test robot 2021-07-25 2:57 ` kernel test robot 2021-07-25 2:57 ` kernel test robot 2021-07-21 16:11 ` [PATCH 10/14] drm/i915/guc/slpc: Enable ARAT timer interrupt Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 16:11 ` [PATCH 11/14] drm/i915/guc/slpc: Cache platform frequency limits Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 18:09 ` Michal Wajdeczko 2021-07-21 18:09 ` Michal Wajdeczko 2021-07-23 22:25 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-23 22:25 ` Belgaumkar, Vinay 2021-07-21 16:11 ` [PATCH 12/14] drm/i915/guc/slpc: Sysfs hooks for SLPC Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] " Vinay Belgaumkar 2021-07-21 18:13 ` Michal Wajdeczko 2021-07-21 18:13 ` Michal Wajdeczko 2021-07-23 22:28 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-23 22:28 ` Belgaumkar, Vinay 2021-07-21 16:11 ` [Intel-gfx] [PATCH 13/14] drm/i915/guc/slpc: Add SLPC selftest Vinay Belgaumkar 2021-07-21 16:11 ` Vinay Belgaumkar 2021-07-21 16:11 ` [Intel-gfx] [PATCH 14/14] drm/i915/guc/rc: Setup and enable GUCRC feature Vinay Belgaumkar 2021-07-21 16:11 ` Vinay Belgaumkar 2021-07-21 18:21 ` [Intel-gfx] " Michal Wajdeczko 2021-07-21 18:21 ` Michal Wajdeczko 2021-07-23 22:29 ` [Intel-gfx] " Belgaumkar, Vinay 2021-07-23 22:29 ` Belgaumkar, Vinay 2021-07-21 20:12 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc: Enable GuC based power management features Patchwork 2021-07-21 20:14 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork 2021-07-21 20:42 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork 2021-07-22 1:37 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=fa6e3691-d43b-1b42-f031-f3d533298eae@intel.com \ --to=michal.wajdeczko@intel.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ --cc=vinay.belgaumkar@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.