public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Goel, Akash" <akash.goel@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/11] drm/i915: Add low level set of routines for programming PM IER/IIR/IMR register set
Date: Tue, 28 Jun 2016 09:35:57 +0100	[thread overview]
Message-ID: <577236ED.1060900@linux.intel.com> (raw)
In-Reply-To: <b357f87b-f1f2-f738-0bb6-7c8cb5001817@intel.com>


On 27/06/16 17:35, Goel, Akash wrote:
> On 6/27/2016 9:16 PM, Tvrtko Ursulin wrote:
>>
>> On 27/06/16 13:16, akash.goel@intel.com wrote:
>>> From: Akash Goel <akash.goel@intel.com>
>>>
>>> So far PM IER/IIR/IMR registers were being used only for Turbo related
>>> interrupts. But interrupts coming from GuC also use the same set.
>>> As a precursor to supporting GuC interrupts, added new low level
>>> routines
>>> so as to allow sharing the programming of PM IER/IIR/IMR registers
>>> between
>>> Turbo & GuC.
>>> Also similar to PM IMR, maintaining a bitmask for PM IER register, to
>>> allow
>>> easy sharing of it between Turbo & GuC without involving a rmw
>>> operation.
>>>
>>> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Signed-off-by: Akash Goel <akash.goel@intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/i915_drv.h  |  1 +
>>>   drivers/gpu/drm/i915/i915_irq.c  | 55
>>> ++++++++++++++++++++++++++++++++--------
>>>   drivers/gpu/drm/i915/intel_drv.h |  6 +++++
>>>   3 files changed, 52 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_drv.h
>>> b/drivers/gpu/drm/i915/i915_drv.h
>>> index 9ef4919..85a7103 100644
>>> --- a/drivers/gpu/drm/i915/i915_drv.h
>>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>>> @@ -1806,6 +1806,7 @@ struct drm_i915_private {
>>>       };
>>>       u32 gt_irq_mask;
>>>       u32 pm_irq_mask;
>>> +    u32 pm_ier_mask;
>>>       u32 pm_rps_events;
>>>       u32 pipestat_irq_mask[I915_MAX_PIPES];
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_irq.c
>>> b/drivers/gpu/drm/i915/i915_irq.c
>>> index 4378a65..7316ab4 100644
>>> --- a/drivers/gpu/drm/i915/i915_irq.c
>>> +++ b/drivers/gpu/drm/i915/i915_irq.c
>>> @@ -336,14 +336,52 @@ void gen6_disable_pm_irq(struct drm_i915_private
>>> *dev_priv, uint32_t mask)
>>>       __gen6_disable_pm_irq(dev_priv, mask);
>>>   }
>>>
>>> -void gen6_reset_rps_interrupts(struct drm_i915_private *dev_priv)
>>> +void gen6_reset_pm_interrupts(struct drm_i915_private *dev_priv,
>>> +                   uint32_t reset_mask)
>>
>> Kernel prefers u32. It is not that overall i915 is clean in that
>> respect, but every time maintainers merge patches checkpatch shouts
>> about it, and more noise tougher it is to spot more important issues. I
>> would appreciate if u32 was used throughout.
>
> Fine, will use u32.

Thanks!

>>>   {
>>>       i915_reg_t reg = gen6_pm_iir(dev_priv);
>>>
>>> -    spin_lock_irq(&dev_priv->irq_lock);
>>> -    I915_WRITE(reg, dev_priv->pm_rps_events);
>>> -    I915_WRITE(reg, dev_priv->pm_rps_events);
>>> +    assert_spin_locked(&dev_priv->irq_lock);
>>> +
>>> +    I915_WRITE(reg, reset_mask);
>>> +    I915_WRITE(reg, reset_mask);
>>>       POSTING_READ(reg);
>>> +}
>>> +
>>> +void gen6_enable_pm_interrupts(struct drm_i915_private *dev_priv,
>>> +                   uint32_t enable_mask)
>>> +{
>>> +    uint32_t new_val;
>>> +
>>> +    assert_spin_locked(&dev_priv->irq_lock);
>>> +
>>> +    new_val = dev_priv->pm_ier_mask;
>>> +    new_val |= enable_mask;
>>> +
>>> +    dev_priv->pm_ier_mask = new_val;
>>> +    I915_WRITE(gen6_pm_ier(dev_priv), dev_priv->pm_ier_mask);
>>> +    gen6_enable_pm_irq(dev_priv, enable_mask);
>>
>> Hm, will this be confusing that we will have gen6_enable_pm_interrupts
>> and gen6_enable_pm_irq, so extremely similar names and same parameters,
>> but for different use?
> Sorry for using confusing, ambiguous names.
>>
>> Maybe rename the old one to gen6_unmask_pm_irq and name this one
>> gen6_enable_pm_irq ? If there is really need to have both. Or add some
>> kerneldoc explaining which one is used for what?
>
> Can I do like this, keep gen6_enable_pm_interrupts as is and rename
> gen6_enable_pm_irq to gen6_unmask_pm_irq.
> Similarly also rename gen6_disable_pm_irq to gen6_mask_pm_irq.

Yes for mask/unmask, but I think the suffix really needs to be the same 
since it is the same functional family.

Regards,

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

  reply	other threads:[~2016-06-28  8:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27 12:16 [PATCH v2 00/11] Support for sustained capturing of GuC firmware logs akash.goel
2016-06-27 12:16 ` [PATCH 01/11] drm/i915: Decouple GuC log setup from verbosity parameter akash.goel
2016-06-27 15:00   ` Tvrtko Ursulin
2016-06-27 15:32     ` Goel, Akash
2016-06-27 15:56       ` Tvrtko Ursulin
2016-06-27 16:25         ` Goel, Akash
2016-06-27 12:16 ` [PATCH 02/11] drm/i915: Add GuC ukernel logging related fields to fw interface file akash.goel
2016-06-27 15:09   ` Tvrtko Ursulin
2016-06-27 12:16 ` [PATCH 03/11] drm/i915: Add low level set of routines for programming PM IER/IIR/IMR register set akash.goel
2016-06-27 15:46   ` Tvrtko Ursulin
2016-06-27 16:35     ` Goel, Akash
2016-06-28  8:35       ` Tvrtko Ursulin [this message]
2016-06-28  9:21         ` Goel, Akash
2016-06-27 12:16 ` [PATCH 04/11] drm/i915: Support for GuC interrupts akash.goel
2016-06-28 10:03   ` Tvrtko Ursulin
2016-06-28 11:12     ` Goel, Akash
2016-06-28 13:44       ` Tvrtko Ursulin
2016-07-01  6:16         ` Goel, Akash
2016-07-01  8:47           ` Tvrtko Ursulin
2016-07-01  9:57             ` Goel, Akash
2016-06-27 12:16 ` [PATCH 05/11] drm/i915: Handle log buffer flush interrupt event from GuC akash.goel
2016-06-27 12:16 ` [PATCH 06/11] drm/i915: Add a relay backed debugfs interface for capturing GuC logs akash.goel
2016-06-27 14:23   ` kbuild test robot
2016-06-27 17:50   ` kbuild test robot
2016-06-28  9:47   ` Chris Wilson
2016-06-28 10:01     ` Goel, Akash
2016-06-27 12:16 ` [PATCH 07/11] drm/i915: Forcefully flush GuC log buffer on reset akash.goel
2016-06-27 12:16 ` [PATCH 08/11] drm/i915: Debugfs support for GuC logging control akash.goel
2016-06-27 12:16 ` [PATCH 09/11] drm/i915: New module param to control the size of buffer used for storing GuC firmware logs akash.goel
2016-06-27 13:31   ` Jani Nikula
2016-06-27 14:55     ` Goel, Akash
2016-06-27 12:16 ` [PATCH 10/11] drm/i915: Support to create write combined type vmaps akash.goel
2016-06-28  9:52   ` Chris Wilson
2016-06-28 10:25     ` Goel, Akash
2016-06-28 10:42       ` Chris Wilson
2016-06-27 12:16 ` [PATCH 11/11] drm/i915: Use uncached(WC) mapping for acessing the GuC log buffer akash.goel
2016-06-27 13:46 ` ✗ Ro.CI.BAT: failure for Support for sustained capturing of GuC firmware logs (rev3) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-06-10 13:36 [PATCH 00/11] Support for sustained capturing of GuC firmware logs akash.goel
2016-06-10 13:36 ` [PATCH 03/11] drm/i915: Add low level set of routines for programming PM IER/IIR/IMR register set 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=577236ED.1060900@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=akash.goel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox