Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v6 4/7] drm/i915/perf: reuse intel_lrc ctx regs macro
Date: Thu, 24 May 2018 11:33:35 +0100	[thread overview]
Message-ID: <d5d1d192-a1dd-b5a7-b640-bea06d463bea@linux.intel.com> (raw)
In-Reply-To: <3d0262ca-40a8-b332-8963-51d2450a975b@intel.com>


On 23/05/2018 16:54, Lionel Landwerlin wrote:
> On 23/05/18 15:57, Tvrtko Ursulin wrote:
>>
>> On 22/05/2018 18:59, Lionel Landwerlin wrote:
>>> Abstract the context image access a bit.
>>>
>>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/i915_perf.c | 34 +++++++++++++++-----------------
>>>   1 file changed, 16 insertions(+), 18 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_perf.c 
>>> b/drivers/gpu/drm/i915/i915_perf.c
>>> index 805dfc732bba..a5d98bda5c2e 100644
>>> --- a/drivers/gpu/drm/i915/i915_perf.c
>>> +++ b/drivers/gpu/drm/i915/i915_perf.c
>>> @@ -210,6 +210,7 @@
>>>   #include "i915_oa_cflgt3.h"
>>>   #include "i915_oa_cnl.h"
>>>   #include "i915_oa_icl.h"
>>> +#include "intel_lrc_reg.h"
>>>     /* HW requires this to be a power of two, between 128k and 16M, 
>>> though driver
>>>    * is currently generally designed assuming the largest 16M size is 
>>> used such
>>> @@ -1579,27 +1580,25 @@ static void 
>>> gen8_update_reg_state_unlocked(struct i915_gem_context *ctx,
>>>       u32 ctx_oactxctrl = dev_priv->perf.oa.ctx_oactxctrl_offset;
>>>       u32 ctx_flexeu0 = dev_priv->perf.oa.ctx_flexeu0_offset;
>>>       /* The MMIO offsets for Flex EU registers aren't contiguous */
>>> -    u32 flex_mmio[] = {
>>> -        i915_mmio_reg_offset(EU_PERF_CNTL0),
>>> -        i915_mmio_reg_offset(EU_PERF_CNTL1),
>>> -        i915_mmio_reg_offset(EU_PERF_CNTL2),
>>> -        i915_mmio_reg_offset(EU_PERF_CNTL3),
>>> -        i915_mmio_reg_offset(EU_PERF_CNTL4),
>>> -        i915_mmio_reg_offset(EU_PERF_CNTL5),
>>> -        i915_mmio_reg_offset(EU_PERF_CNTL6),
>>> +    i915_reg_t flex_regs[] = {
>>> +        EU_PERF_CNTL0,
>>> +        EU_PERF_CNTL1,
>>> +        EU_PERF_CNTL2,
>>> +        EU_PERF_CNTL3,
>>> +        EU_PERF_CNTL4,
>>> +        EU_PERF_CNTL5,
>>> +        EU_PERF_CNTL6,
>>>       };
>>>       int i;
>>>   -    reg_state[ctx_oactxctrl] = 
>>> i915_mmio_reg_offset(GEN8_OACTXCONTROL);
>>> -    reg_state[ctx_oactxctrl+1] = (dev_priv->perf.oa.period_exponent <<
>>> -                      GEN8_OA_TIMER_PERIOD_SHIFT) |
>>> -                     (dev_priv->perf.oa.periodic ?
>>> -                      GEN8_OA_TIMER_ENABLE : 0) |
>>> -                     GEN8_OA_COUNTER_RESUME;
>>> +    CTX_REG(reg_state, ctx_oactxctrl, GEN8_OACTXCONTROL,
>>> +        (dev_priv->perf.oa.period_exponent << 
>>> GEN8_OA_TIMER_PERIOD_SHIFT) |
>>> +        (dev_priv->perf.oa.periodic ? GEN8_OA_TIMER_ENABLE : 0) |
>>> +        GEN8_OA_COUNTER_RESUME);
>>>   -    for (i = 0; i < ARRAY_SIZE(flex_mmio); i++) {
>>> +    for (i = 0; i < ARRAY_SIZE(flex_regs); i++) {
>>>           u32 state_offset = ctx_flexeu0 + i * 2;
>>> -        u32 mmio = flex_mmio[i];
>>> +        u32 mmio = i915_mmio_reg_offset(flex_regs[i]);
>>>             /*
>>>            * This arbitrary default will select the 'EU FPU0 Pipeline
>>> @@ -1619,8 +1618,7 @@ static void 
>>> gen8_update_reg_state_unlocked(struct i915_gem_context *ctx,
>>>               }
>>>           }
>>>   -        reg_state[state_offset] = mmio;
>>> -        reg_state[state_offset+1] = value;
>>> +        CTX_REG(reg_state, state_offset, flex_regs[i], value);
>>
>> Does flex_regs[i] needs to be mmio?
> 
> Yeah, the macro uses i915_mmio_reg_offset().

In that case:

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

  reply	other threads:[~2018-05-24 10:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 17:59 [PATCH v6 0/7] drm/i915: per context slice/subslice powergating Lionel Landwerlin
2018-05-22 17:59 ` [PATCH v6 1/7] drm/i915: Program RPCS for Broadwell Lionel Landwerlin
2018-05-22 17:59 ` [PATCH v6 2/7] drm/i915: Record the sseu configuration per-context & engine Lionel Landwerlin
2018-05-23 14:54   ` Tvrtko Ursulin
2018-05-23 14:58     ` Chris Wilson
2018-05-23 15:52     ` Lionel Landwerlin
2018-05-22 17:59 ` [PATCH v6 3/7] drm/i915/perf: simplify configure all context function Lionel Landwerlin
2018-05-23 14:54   ` Tvrtko Ursulin
2018-05-22 17:59 ` [PATCH v6 4/7] drm/i915/perf: reuse intel_lrc ctx regs macro Lionel Landwerlin
2018-05-23 14:57   ` Tvrtko Ursulin
2018-05-23 15:54     ` Lionel Landwerlin
2018-05-24 10:33       ` Tvrtko Ursulin [this message]
2018-05-22 18:00 ` [PATCH v6 5/7] drm/i915/perf: lock powergating configuration to default when active Lionel Landwerlin
2018-05-23 15:04   ` Tvrtko Ursulin
2018-05-22 18:00 ` [PATCH v6 6/7] drm/i915: Expose RPCS (SSEU) configuration to userspace Lionel Landwerlin
2018-05-23 15:13   ` Tvrtko Ursulin
2018-05-23 15:18     ` Chris Wilson
2018-05-23 17:12     ` Lionel Landwerlin
2018-05-24 10:43       ` Tvrtko Ursulin
2018-05-24 11:01         ` Lionel Landwerlin
2018-05-22 18:00 ` [PATCH v6 7/7] drm/i915: add a sysfs entry to let users set sseu configs Lionel Landwerlin
2018-05-23 15:30   ` Tvrtko Ursulin
2018-05-23 17:33     ` Lionel Landwerlin
2018-05-24 10:39       ` Tvrtko Ursulin
2018-05-24 10:45         ` Lionel Landwerlin
2018-05-25 15:42         ` Lionel Landwerlin
2018-05-23 17:37     ` Lionel Landwerlin
2018-05-22 18:55 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: per context slice/subslice powergating (rev5) Patchwork
2018-05-22 18:58 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-05-22 19:16 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-23  0:10 ` ✗ Fi.CI.IGT: failure " 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=d5d1d192-a1dd-b5a7-b640-bea06d463bea@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lionel.g.landwerlin@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