On Tue, Mar 07, 2017 at 10:39:46AM +0000, Chris Wilson wrote: > On Tue, Mar 07, 2017 at 10:29:35AM +0000, Michal Wajdeczko wrote: > > Manual pointer manipulation is error prone. Let compiler calculate > > right offsets for us in case we need to change ads layout. > > > > Signed-off-by: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx> > > Cc: Oscar Mateo <oscar.mateo@xxxxxxxxx> > > Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> > > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@xxxxxxxxx> > > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > > --- > > drivers/gpu/drm/i915/i915_guc_submission.c | 49 ++++++++++++++---------------- > > 1 file changed, 23 insertions(+), 26 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c > > index beb38e3..f87649b 100644 > > --- a/drivers/gpu/drm/i915/i915_guc_submission.c > > +++ b/drivers/gpu/drm/i915/i915_guc_submission.c > > @@ -810,22 +810,21 @@ static void guc_addon_create(struct intel_guc *guc) > > { > > struct drm_i915_private *dev_priv = guc_to_i915(guc); > > struct i915_vma *vma; > > - struct guc_ads *ads; > > - struct guc_policies *policies; > > - struct guc_mmio_reg_state *reg_state; > > - struct intel_engine_cs *engine; > > - enum intel_engine_id id; > > struct page *page; > > - u32 size; > > - > > /* The ads obj includes the struct itself and buffers passed to GuC */ > > - size = sizeof(struct guc_ads) + sizeof(struct guc_policies) + > > - sizeof(struct guc_mmio_reg_state) + > > - GUC_S3_SAVE_SPACE_PAGES * PAGE_SIZE; > > + struct __guc_ads_object { > > + struct guc_ads ads; > > + struct guc_policies policies; > > + struct guc_mmio_reg_state reg_state; > > + u8 reg_state_buffer[GUC_S3_SAVE_SPACE_PAGES * PAGE_SIZE]; > > + } __packed *obj; > > A humble request not to call this obj. I was confused later and worrying > about what you were adding to drm_i915_gem_object. Agree, but I just followed the name used in existing comment. What about: struct __guc_ads_blob { ... } __packed *blob; -Michal _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx