From: Jesse Barnes Subject: Re: [PATCH 3/8] drm/i915: Rename ctx->is_initialized to ctx->rcs_is_initialized Date: Mon, 30 Jun 2014 13:50:01 -0700 Message-ID: <20140630135001.72fb9ed0@jbarnes-desktop> References: <1403789059-5692-1-git-send-email-oscar.mateo@intel.com> <1403789059-5692-4-git-send-email-oscar.mateo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by gabe.freedesktop.org (Postfix) with ESMTP id BF1DC6E215 for ; Mon, 30 Jun 2014 13:49:19 -0700 (PDT) Received: by mail-pd0-f182.google.com with SMTP id y13so8802298pdi.41 for ; Mon, 30 Jun 2014 13:49:19 -0700 (PDT) In-Reply-To: <1403789059-5692-4-git-send-email-oscar.mateo@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: oscar.mateo@intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, 26 Jun 2014 14:24:14 +0100 oscar.mateo@intel.com wrote: > From: Oscar Mateo > > We only use this flag to signify that the render state (a.k.a. golden > context, a.k.a. null context) has been initialized. It doesn't mean > anything for the other engines, so make that distinction obvious. > This renaming was suggested by Daniel Vetter. > > Implemented with this cocci script (plus manual changes to the struct > declaration): > > @ > struct intel_context c; > @@ > - (c).is_initialized > + c.rcs_is_initialized > > @@ > struct intel_context *c; > @@ > - (c)->is_initialized > + c->rcs_is_initialized > > No functional changes. > > Signed-off-by: Oscar Mateo > --- > drivers/gpu/drm/i915/i915_debugfs.c | 2 +- > drivers/gpu/drm/i915/i915_drv.h | 2 +- > drivers/gpu/drm/i915/i915_gem_context.c | 6 +++--- > 3 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c > index b7bcfd5..d4b8391 100644 > --- a/drivers/gpu/drm/i915/i915_debugfs.c > +++ b/drivers/gpu/drm/i915/i915_debugfs.c > @@ -176,7 +176,7 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) > > static void describe_ctx(struct seq_file *m, struct intel_context *ctx) > { > - seq_putc(m, ctx->is_initialized ? 'I' : 'i'); > + seq_putc(m, ctx->rcs_is_initialized ? 'I' : 'i'); > seq_putc(m, ctx->remap_slice ? 'R' : 'r'); > seq_putc(m, ' '); > } > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h > index b7c6388..122e942 100644 > --- a/drivers/gpu/drm/i915/i915_drv.h > +++ b/drivers/gpu/drm/i915/i915_drv.h > @@ -588,7 +588,7 @@ struct i915_ctx_hang_stats { > struct intel_context { > struct kref ref; > int id; > - bool is_initialized; > + bool rcs_is_initialized; > uint8_t remap_slice; > struct drm_i915_file_private *file_priv; > struct drm_i915_gem_object *rcs_state; > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c > index 9cc31c6..b8b9859 100644 > --- a/drivers/gpu/drm/i915/i915_gem_context.c > +++ b/drivers/gpu/drm/i915/i915_gem_context.c > @@ -669,7 +669,7 @@ static int do_switch(struct intel_engine_cs *ring, > vma->bind_vma(vma, to->rcs_state->cache_level, GLOBAL_BIND); > } > > - if (!to->is_initialized || i915_gem_context_is_default(to)) > + if (!to->rcs_is_initialized || i915_gem_context_is_default(to)) > hw_flags |= MI_RESTORE_INHIBIT; > > ret = mi_set_context(ring, to, hw_flags); > @@ -716,13 +716,13 @@ done: > i915_gem_context_reference(to); > ring->last_context = to; > > - if (ring->id == RCS && !to->is_initialized && from == NULL) { > + if (ring->id == RCS && !to->rcs_is_initialized && from == NULL) { > ret = i915_gem_render_state_init(ring); > if (ret) > DRM_ERROR("init render state: %d\n", ret); > } > > - to->is_initialized = true; > + to->rcs_is_initialized = true; > > return 0; > Reviewed-by: Jesse Barnes -- Jesse Barnes, Intel Open Source Technology Center