All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Tomasz Lis <tomasz.lis@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v6] drm/i915: Add IOCTL Param to control data port coherency.
Date: Wed, 18 Jul 2018 15:42:13 +0100	[thread overview]
Message-ID: <78cfbef9-36c1-44db-2136-9fe00d1197a7@linux.intel.com> (raw)
In-Reply-To: <153192029093.24153.5970219688365307340@jlahtine-desk.ger.corp.intel.com>


On 18/07/2018 14:24, Joonas Lahtinen wrote:
> Quoting Tomasz Lis (2018-07-16 16:07:16)
>> +static int emit_set_data_port_coherency(struct i915_request *rq, bool enable)
>> +{
>> +       u32 *cs;
>> +       i915_reg_t reg;
>> +
>> +       GEM_BUG_ON(rq->engine->class != RENDER_CLASS);
>> +       GEM_BUG_ON(INTEL_GEN(rq->i915) < 9);
>> +
>> +       cs = intel_ring_begin(rq, 4);
>> +       if (IS_ERR(cs))
>> +               return PTR_ERR(cs);
>> +
>> +       if (INTEL_GEN(rq->i915) >= 11)
>> +               reg = ICL_HDC_MODE;
>> +       else if (INTEL_GEN(rq->i915) >= 10)
>> +               reg = CNL_HDC_CHICKEN0;
>> +       else
>> +               reg = HDC_CHICKEN0;
>> +
>> +       *cs++ = MI_LOAD_REGISTER_IMM(1);
>> +       *cs++ = i915_mmio_reg_offset(reg);
>> +       /* Enabling coherency means disabling the bit which forces it off */
> 
> This comment is still spurious, please get rid of the habit of writing
> comments about "what" the code is doing, useful comments should be
> limited to "why", which is quite self explanatory here, that's the way
> the register is.
> 
>> +static int
>> +intel_lr_context_update_data_port_coherency(struct i915_request *rq)
>> +{
>> +       struct i915_gem_context *ctx = rq->gem_context;
>> +       bool enable = test_bit(CONTEXT_DATA_PORT_COHERENT_REQUESTED, &ctx->flags);
>> +       int ret;
>> +
>> +       lockdep_assert_held(&rq->i915->drm.struct_mutex);
>> +
>> +       if (test_bit(CONTEXT_DATA_PORT_COHERENT_ACTIVE, &ctx->flags) == enable)
>> +               return 0;
>> +
>> +       ret = emit_set_data_port_coherency(rq, enable);
>> +
>> +       if (!ret) {
>> +               if (enable)
>> +                       __set_bit(CONTEXT_DATA_PORT_COHERENT_ACTIVE, &ctx->flags);
>> +               else
>> +                       __clear_bit(CONTEXT_DATA_PORT_COHERENT_ACTIVE, &ctx->flags);
>> +       }
> 
> Do we have indication that the hardware feature will be unreliable in
> responding to the requests? I don't think you need the differentiation
> of requested vs. active. If there is an error, we can just report back to
> the user as a failed IOCTL. Now it adds unnecessary complication for no benefit.

Requested vs active is for implementing the lazy emit.

AFAIR it does propagate the error out of execbuf (although we never ever 
expect it to happen), and this is just to keep the internal 
house-keeping in sync.

Regards,

Tvrtko

>> @@ -2164,6 +2221,13 @@ static int gen8_emit_flush_render(struct i915_request *request,
>>                  /* WaForGAMHang:kbl */
>>                  if (IS_KBL_REVID(request->i915, 0, KBL_REVID_B0))
>>                          dc_flush_wa = true;
>> +
>> +               /* Emit the switch of data port coherency state if needed */
> 
> Ditto for spurious comment, just about what the code does.
> 
>> +++ b/include/uapi/drm/i915_drm.h
>> @@ -1456,6 +1456,13 @@ struct drm_i915_gem_context_param {
>>   #define   I915_CONTEXT_MAX_USER_PRIORITY       1023 /* inclusive */
>>   #define   I915_CONTEXT_DEFAULT_PRIORITY                0
>>   #define   I915_CONTEXT_MIN_USER_PRIORITY       -1023 /* inclusive */
>> +/*
>> + * When data port level coherency is enabled, the GPU will update memory
>> + * buffers shared with CPU, by forcing internal cache units to send memory
>> + * writes to higher level caches faster. Enabling data port coherency has
>> + * a performance cost.
>> + */
> 
> I was under impression this is enabled by default and it can be disabled
> for a performance optimization?
> 
> Regards, Joonas
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-07-18 14:42 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 15:17 [PATCH v1] drm/i915/gen11: Preempt-to-idle support in execlists Tomasz Lis
2018-03-27 15:40 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-03-27 15:56 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-27 20:50 ` ✓ Fi.CI.IGT: " Patchwork
2018-03-27 23:27 ` [PATCH v1] " Chris Wilson
2018-03-28 16:06   ` Lis, Tomasz
2018-03-28 22:28     ` Chris Wilson
2018-03-30 15:42       ` Lis, Tomasz
2018-03-30 19:45         ` Daniele Ceraolo Spurio
2018-04-26 14:02           ` Lis, Tomasz
2018-03-30 18:23   ` Daniele Ceraolo Spurio
2018-04-12 17:15     ` Lis, Tomasz
2018-04-19 11:44 ` [PATCH v2] " Tomasz Lis
2018-04-19 12:00   ` Chris Wilson
2018-04-19 22:23     ` Daniele Ceraolo Spurio
2018-04-19 11:58 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gen11: Preempt-to-idle support in execlists. (rev2) Patchwork
2018-04-19 11:59 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-19 12:13 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-19 16:08 ` ✓ Fi.CI.IGT: " Patchwork
2018-05-11 15:45 ` [PATCH v3] drm/i915/gen11: Preempt-to-idle support in execlists - v3 notes Tomasz Lis
2018-05-11 15:45   ` [PATCH v3] drm/i915/gen11: Preempt-to-idle support in execlists Tomasz Lis
2018-05-18 21:08     ` Daniele Ceraolo Spurio
2018-05-21 10:16       ` Lis, Tomasz
2018-05-22 14:39         ` Ceraolo Spurio, Daniele
2018-05-22 14:54           ` Lis, Tomasz
2018-05-11 16:15 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gen11: Preempt-to-idle support in execlists. (rev3) Patchwork
2018-05-11 16:16 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-05-11 16:33 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-11 17:46 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-05-25 18:26 ` [PATCH v4] drm/i915/gen11: Preempt-to-idle support in execlists Tomasz Lis
2018-06-11 16:37   ` Daniele Ceraolo Spurio
2018-06-29 16:50     ` Lis, Tomasz
2018-07-02 17:36       ` Daniele Ceraolo Spurio
2018-05-25 18:51 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gen11: Preempt-to-idle support in execlists. (rev4) Patchwork
2018-05-25 18:52 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-05-25 19:08 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-26  5:18 ` ✓ Fi.CI.IGT: " Patchwork
2018-07-06 15:52 ` [PATCH v5] drm/i915/gen11: Preempt-to-idle support in execlists Tomasz Lis
2018-07-06 16:08 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gen11: Preempt-to-idle support in execlists. (rev5) Patchwork
2018-07-06 16:08 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-06 16:25 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-07 14:09 ` ✓ Fi.CI.IGT: " Patchwork
2018-07-16 13:07 ` [PATCH v6] drm/i915: Add IOCTL Param to control data port coherency Tomasz Lis
2018-07-16 13:35   ` Tvrtko Ursulin
2018-07-18 13:24   ` Joonas Lahtinen
2018-07-18 14:42     ` Tvrtko Ursulin [this message]
2018-07-18 15:28       ` Lis, Tomasz
2018-07-19  7:12         ` Joonas Lahtinen
2018-07-19 15:10           ` Lis, Tomasz
2018-07-16 14:36 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gen11: Preempt-to-idle support in execlists. (rev6) Patchwork
2018-07-16 14:37 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-16 14:58 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-16 19:26 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-10-15 17:29 ` [PATCH v5] drm/i915/icl: Preempt-to-idle support in execlists Tomasz Lis
2018-10-16 10:53   ` Joonas Lahtinen
2018-10-19 16:00     ` Lis, Tomasz
2018-10-23  9:13       ` Joonas Lahtinen
2018-10-23  9:24         ` Lis, Tomasz
2018-10-15 17:44 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gen11: Preempt-to-idle support in execlists. (rev7) Patchwork
2018-10-15 17:45 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-15 18:07 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-15 23:55 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-11-09 17:18 ` [PATCH v6] drm/i915/icl: Preempt-to-idle support in execlists Tomasz Lis
2018-12-10 15:40   ` Tvrtko Ursulin
2018-12-14 11:10     ` Joonas Lahtinen
2018-12-17 15:21       ` Lis, Tomasz
2018-11-09 18:17 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gen11: Preempt-to-idle support in execlists. (rev8) Patchwork
2018-11-09 18:18 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-11-09 18:33 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-10  3:29 ` ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2018-03-19 12:37 [RFC v1] drm/i915: Add Exec param to control data port coherency Tomasz Lis
2018-10-09 18:06 ` [PATCH v6] drm/i915: Add IOCTL Param " Tomasz Lis
2018-10-10  7:29   ` Tvrtko Ursulin

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=78cfbef9-36c1-44db-2136-9fe00d1197a7@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=tomasz.lis@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: link
Be 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.