From: Deepak S <deepak.s@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v5 3/4] drm/i915/bdw: Pin the context backing objects to GGTT on-demand
Date: Tue, 18 Nov 2014 19:57:26 +0530 [thread overview]
Message-ID: <546B574E.2030407@intel.com> (raw)
In-Reply-To: <20141117142335.GT25711@phenom.ffwll.local>
On Monday 17 November 2014 07:53 PM, Daniel Vetter wrote:
> On Tue, Nov 18, 2014 at 12:10:51PM +0530, Deepak S wrote:
>> On Thursday 13 November 2014 03:58 PM, Thomas Daniel wrote:
>>> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
>>> index 906b985..f7fa0f7 100644
>>> --- a/drivers/gpu/drm/i915/intel_lrc.c
>>> +++ b/drivers/gpu/drm/i915/intel_lrc.c
>>> @@ -139,8 +139,6 @@
>>> #define GEN8_LR_CONTEXT_RENDER_SIZE (20 * PAGE_SIZE)
>>> #define GEN8_LR_CONTEXT_OTHER_SIZE (2 * PAGE_SIZE)
>>> -#define GEN8_LR_CONTEXT_ALIGN 4096
>>> -
>>> #define RING_EXECLIST_QFULL (1 << 0x2)
>>> #define RING_EXECLIST1_VALID (1 << 0x3)
>>> #define RING_EXECLIST0_VALID (1 << 0x4)
>>> @@ -801,9 +799,40 @@ void intel_logical_ring_advance_and_submit(struct intel_ringbuffer *ringbuf)
>>> execlists_context_queue(ring, ctx, ringbuf->tail);
>>> }
>>> +static int intel_lr_context_pin(struct intel_engine_cs *ring,
>>> + struct intel_context *ctx)
>>> +{
>>> + struct drm_i915_gem_object *ctx_obj = ctx->engine[ring->id].state;
>>> + int ret = 0;
>>> +
>>> + WARN_ON(!mutex_is_locked(&ring->dev->struct_mutex));
>> With pin specific mutex from previous patch set removed.
> Pardon my ignorance but I'm completely lost on this review comment here.
> Deepak, can you please elaborate what kind of lock on which exact version
> of the previous patch you mean? I didn't find any locking at all in the
> preceeding patch here ...
>
> Thanks, Daniel
Hi Daniel,
+static int intel_lr_context_pin(struct intel_engine_cs *ring,
+ struct intel_context *ctx)
+{
+ struct drm_i915_gem_object *ctx_obj = ctx->engine[ring->id].state;
+ int ret = 0;
+
+ mutex_lock(&ctx->engine[ring->id].unpin_lock);
+ if (ctx->engine[ring->id].unpin_count++ == 0) {
+ ret = i915_gem_obj_ggtt_pin(ctx_obj,
+ GEN8_LR_CONTEXT_ALIGN, 0);
+ if (ret)
+ ctx->engine[ring->id].unpin_count = 0;
+ }
+ mutex_unlock(&ctx->engine[ring->id].unpin_lock);
+
+ return ret;
+}
In Previous patch set we had a "mutex_lock(&ctx->engine[ring->id].unpin_lock);"
Since we "intel_lr_context_pin" is already under struct mutex, So we dont need unpin_lock. This was the change in latest patch set :)
Thanks
Deepak
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-17 14:30 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 9:52 [PATCH 1/4] drm/i915/bdw: Clean up execlist queue items in retire_work Thomas Daniel
2014-10-29 9:52 ` [PATCH 2/4] drm/i915/bdw: Setup global hardware status page in execlists mode Thomas Daniel
2014-11-03 15:47 ` Daniel Vetter
2014-10-29 9:52 ` [PATCH 3/4] drm/i915/bdw: Pin the context backing objects to GGTT on-demand Thomas Daniel
2014-11-03 16:54 ` Daniel Vetter
2014-11-03 17:00 ` Daniel, Thomas
2014-11-03 17:11 ` Daniel Vetter
2014-11-03 21:04 ` Chris Wilson
2014-11-13 10:28 ` [PATCH v5 " Thomas Daniel
2014-11-17 14:38 ` akash goel
2014-11-17 14:55 ` Daniel, Thomas
2014-11-19 17:59 ` Daniel, Thomas
2014-11-17 18:09 ` Daniel Vetter
2014-11-18 9:27 ` Daniel, Thomas
2014-11-18 10:48 ` Daniel, Thomas
2014-11-18 14:33 ` Daniel Vetter
2014-11-18 14:51 ` Daniel, Thomas
2014-11-18 15:11 ` Daniel Vetter
2014-11-18 15:32 ` Daniel, Thomas
2014-11-19 9:53 ` Daniel Vetter
2014-11-18 6:40 ` Deepak S
2014-11-17 14:23 ` Daniel Vetter
2014-11-18 14:27 ` Deepak S [this message]
2014-11-24 14:24 ` Daniel Vetter
2014-11-24 17:14 ` Daniel, Thomas
2014-11-24 20:15 ` Daniel Vetter
2014-10-29 9:52 ` [PATCH 4/4] drm/i915/bdw: Pin the ringbuffer backing object " Thomas Daniel
2014-10-29 14:38 ` [PATCH 4/4] drm/i915/bdw: Pin the ringbuffer backing shuang.he
2014-11-13 10:28 ` [PATCH v5 4/4] drm/i915/bdw: Pin the ringbuffer backing object to GGTT on-demand Thomas Daniel
2014-11-18 5:18 ` akash goel
2014-11-18 6:37 ` Deepak S
2014-11-18 6:39 ` Deepak S
2014-11-17 14:29 ` Daniel Vetter
2014-11-18 14:30 ` Deepak S
2014-11-03 15:33 ` [PATCH 1/4] drm/i915/bdw: Clean up execlist queue items in retire_work Daniel Vetter
2014-11-03 16:05 ` Daniel, Thomas
2014-11-03 16:17 ` Daniel Vetter
2014-11-04 9:11 ` Chris Wilson
2014-11-07 14:55 ` [PATCH v4 " Thomas Daniel
2014-11-13 10:27 ` [PATCH v5 " Thomas Daniel
2014-11-18 6:29 ` Deepak S
2014-11-17 14:41 ` akash goel
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=546B574E.2030407@intel.com \
--to=deepak.s@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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.