public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/6] drm/i915: dynamically allocate forcewake domains
Date: Tue, 18 Jun 2019 16:37:47 -0700	[thread overview]
Message-ID: <137a8fa6-4a03-56f3-475a-e45c6d920698@intel.com> (raw)
In-Reply-To: <156090018238.6388.4975670636065726873@skylake-alporthouse-com>



On 6/18/19 4:23 PM, Chris Wilson wrote:
> Quoting Daniele Ceraolo Spurio (2019-06-19 00:06:39)
>>
>>
>> On 6/18/19 2:23 AM, Tvrtko Ursulin wrote:
>>>
>>> On 17/06/2019 19:09, Daniele Ceraolo Spurio wrote:
>>>> -static void intel_uncore_fw_domains_init(struct intel_uncore *uncore)
>>>> +static int intel_uncore_fw_domains_init(struct intel_uncore *uncore)
>>>>    {
>>>>        struct drm_i915_private *i915 = uncore->i915;
>>>> +    int ret;
>>>>        GEM_BUG_ON(!intel_uncore_has_forcewake(uncore));
>>>> +#define __fw_domain_init(id__, set__, ack__) \
>>>> +    ret = fw_domain_init(uncore, (id__), (set__), (ack__)); \
>>>> +    if (ret) \
>>>> +        goto out_clean;
>>>
>>> Hidden control flow is slightly objectionable but I don't offer any nice
>>> alternatives so I guess will have to pass. Or maybe accumulate the error
>>> (err |= fw_domain_init(..)) as you go and then cleanup at the end if any
>>> failed?
>>
>> I'd prefer to avoid accumulating the error since it'd just cause us to
>> having to unroll more domains when we could've stopped early.
>>
>>>
>>> On the other hand the idea slightly conflicts with my other suggestion
>>> to rename existing fw_domain_init to __fw_domain_init and call the macro
>>> fw_domain_init and avoid all the churn below.
>>>
>>
>> I'll pick this suggestion among the 2, unless there is another
>> suggestion on how to avoid the hidden goto.
> 
> Be careful, or you'll give Tvrtko the chance to suggest table driven
> setup. Maybe?
> -Chris
> 

I did consider using a table myself, but the differences between the 
domains are not easy to put in a table since some of them are per-gen 
and other per-platform. We could combine a table with information in the 
device_info struct like we do for the engines, but that felt a bit like 
overkill to me.

Daniele
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-06-18 23:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 18:09 [PATCH 0/6] Display uncore prep patches Daniele Ceraolo Spurio
2019-06-17 18:09 ` [PATCH 1/6] drm/i915: use vfuncs for reg_read/write_fw_domains Daniele Ceraolo Spurio
2019-06-18  8:31   ` Tvrtko Ursulin
2019-06-17 18:09 ` [PATCH 2/6] drm/i915: kill uncore_sanitize Daniele Ceraolo Spurio
2019-06-17 18:09 ` [PATCH 3/6] drm/i915: kill uncore_to_i915 Daniele Ceraolo Spurio
2019-06-18  8:34   ` Tvrtko Ursulin
2019-06-17 18:09 ` [PATCH 4/6] drm/i915: skip forcewake actions on forcewake-less uncore Daniele Ceraolo Spurio
2019-06-18  9:00   ` Tvrtko Ursulin
2019-06-18 21:12     ` Daniele Ceraolo Spurio
2019-06-19 22:05       ` Daniele Ceraolo Spurio
2019-06-18 10:22   ` Chris Wilson
2019-06-18 18:40     ` Daniele Ceraolo Spurio
2019-06-18 18:57       ` Chris Wilson
2019-06-17 18:09 ` [PATCH 5/6] drm/i915: dynamically allocate forcewake domains Daniele Ceraolo Spurio
2019-06-18  9:23   ` Tvrtko Ursulin
2019-06-18 23:06     ` Daniele Ceraolo Spurio
2019-06-18 23:23       ` Chris Wilson
2019-06-18 23:37         ` Daniele Ceraolo Spurio [this message]
2019-06-19 14:22       ` Tvrtko Ursulin
2019-06-17 18:09 ` [PATCH 6/6] drm/i915/gvt: decouple check_vgpu() from uncore_init() Daniele Ceraolo Spurio
2019-06-18 10:49   ` Chris Wilson
2019-06-17 18:53 ` ✗ Fi.CI.CHECKPATCH: warning for Display uncore prep patches Patchwork
2019-06-17 19:09 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-18  9:15 ` ✓ Fi.CI.IGT: " Patchwork

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=137a8fa6-4a03-56f3-475a-e45c6d920698@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox