From: Nick Hoath <nicholas.hoath@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Clean up lrc context init
Date: Mon, 10 Aug 2015 08:51:58 +0100 [thread overview]
Message-ID: <55C8581E.8070902@intel.com> (raw)
In-Reply-To: <20150807101359.GC6924@nuc-i3427.alporthouse.com>
On 07/08/2015 11:13, Chris Wilson wrote:
> On Fri, Aug 07, 2015 at 11:05:24AM +0100, Nick Hoath wrote:
>> Clean up lrc context init by:
>> - Move context initialisation in to i915_gem_init_hw
>> - Move one off initialisation for render ring to
>> i915_gem_validate_context
>> - Move default context initialisation to logical_ring_init
>>
>> Rename intel_lr_context_deferred_create to
>> intel_lr_context_deferred_alloc, to reflect reduced functionality.
>>
>> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
>> index 923a3c4..37b440a 100644
>> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
>> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
>> @@ -994,6 +994,7 @@ i915_gem_validate_context(struct drm_device *dev, struct drm_file *file,
>> {
>> struct intel_context *ctx = NULL;
>> struct i915_ctx_hang_stats *hs;
>> + int ret;
>>
>> if (ring->id != RCS && ctx_id != DEFAULT_CONTEXT_HANDLE)
>> return ERR_PTR(-EINVAL);
>> @@ -1009,14 +1010,47 @@ i915_gem_validate_context(struct drm_device *dev, struct drm_file *file,
>> }
>>
>> if (i915.enable_execlists && !ctx->engine[ring->id].state) {
>> - int ret = intel_lr_context_deferred_create(ctx, ring);
>> + ret = intel_lr_context_deferred_alloc(ctx, ring);
>> if (ret) {
>> DRM_DEBUG("Could not create LRC %u: %d\n", ctx_id, ret);
>> return ERR_PTR(ret);
>> }
>> +
>> + if (ring->id == RCS && !ctx->rcs_initialized) {
>> + if (ring->init_context) {
>> + struct drm_i915_gem_request *req;
>> +
>> + ret = i915_gem_request_alloc(ring,
>> + ring->default_context, &req);
>> + if (ret) {
>> + DRM_ERROR("ring create req: %d\n",
>> + ret);
>> + i915_gem_request_cancel(req);
>> + goto validate_error;
>> + }
>> +
>> + ret = ring->init_context(req);
>> + if (ret) {
>> + DRM_ERROR("ring init context: %d\n",
>> + ret);
>> + i915_gem_request_cancel(req);
>> + goto validate_error;
>> + }
>> + i915_add_request_no_flush(req);
>> + }
>> +
>> + ctx->rcs_initialized = true;
>> + }
>> }
>
> Nak.
>
> "Clean up"?
Try reading 4798
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-08-10 7:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 10:05 [PATCH] drm/i915: Clean up lrc context init Nick Hoath
2015-08-07 10:13 ` Chris Wilson
2015-08-10 7:51 ` Nick Hoath [this message]
2015-08-11 12:53 ` Daniel Vetter
2015-08-13 4:38 ` shuang.he
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=55C8581E.8070902@intel.com \
--to=nicholas.hoath@intel.com \
--cc=chris@chris-wilson.co.uk \
--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.