From: Damien Lespiau <damien.lespiau@intel.com>
To: Arun Siluvery <arun.siluvery@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/4] drm/i915: Rework workaround data exporting to debugfs
Date: Mon, 1 Sep 2014 15:06:57 +0100 [thread overview]
Message-ID: <20140901140657.GD1118@strange.amr.corp.intel.com> (raw)
In-Reply-To: <1409578133-2800-5-git-send-email-arun.siluvery@linux.intel.com>
On Mon, Sep 01, 2014 at 02:28:53PM +0100, Arun Siluvery wrote:
> Now w/a are organized in an array so we know exactly how many of them
> are applied; use the same array while exporting data to debugfs and
> remove the temporary array we currently have in driver priv structure.
>
> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 41 +++++++++++++++++++++++----------
> drivers/gpu/drm/i915/i915_drv.h | 14 -----------
> drivers/gpu/drm/i915/intel_ringbuffer.c | 15 ++++++++++++
> drivers/gpu/drm/i915/intel_ringbuffer.h | 8 +++++++
> 4 files changed, 52 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 2727bda..bab0408 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2465,6 +2465,14 @@ static int i915_wa_registers(struct seq_file *m, void *unused)
> struct drm_info_node *node = (struct drm_info_node *) m->private;
> struct drm_device *dev = node->minor->dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> + struct intel_ring_context_rodata ro_data;
> +
> + ret = ring_context_rodata(dev, &ro_data);
> + if (ret) {
> + seq_printf(m, "Workarounds applied: 0\n");
seq_puts()
> + DRM_DEBUG_DRIVER("Workaround table not available !!\n");
> + return -EINVAL;
> + }
>
> ret = mutex_lock_interruptible(&dev->struct_mutex);
> if (ret)
> @@ -2472,18 +2480,27 @@ static int i915_wa_registers(struct seq_file *m, void *unused)
>
> intel_runtime_pm_get(dev_priv);
>
> - seq_printf(m, "Workarounds applied: %d\n", dev_priv->num_wa_regs);
> - for (i = 0; i < dev_priv->num_wa_regs; ++i) {
> - u32 addr, mask;
> -
> - addr = dev_priv->intel_wa_regs[i].addr;
> - mask = dev_priv->intel_wa_regs[i].mask;
> - dev_priv->intel_wa_regs[i].value = I915_READ(addr) | mask;
> - if (dev_priv->intel_wa_regs[i].addr)
> - seq_printf(m, "0x%X: 0x%08X, mask: 0x%08X\n",
> - dev_priv->intel_wa_regs[i].addr,
> - dev_priv->intel_wa_regs[i].value,
> - dev_priv->intel_wa_regs[i].mask);
> + seq_printf(m, "Workarounds applied: %d\n", ro_data.num_items/2);
> + for (i = 0; i < ro_data.num_items; i += 2) {
> + u32 addr, mask, value;
> +
> + addr = ro_data.init_context[i];
> + /*
> + * Most of workarounds are masked registers;
> + * to set a bit in lower 16-bits we set a mask bit in
> + * upper 16-bits so we can take either of them as mask but
> + * it doesn't work if the w/a is about clearing a bit so
> + * use upper 16-bits to cover both cases.
> + */
> + mask = ro_data.init_context[i+1] >> 16;
"Most" doesn't seem good here. Either it's "all" and we're happy, or we
need a generic way to describe the W/A (masked register or not). value +
mask is generic enough to code for both cases.
> +
> + /*
> + * value represents the status of other bits in the
> + * register besides w/a bits
> + */
> + value = I915_READ(addr) | mask;
> + seq_printf(m, "0x%X: 0x%08X, mask: 0x%08X\n",
> + addr, value, mask);
> }
I still don't get it. 'value' is supposed to be the reference value for
the W/A, but you're or'ing the mask here, so you treat the mask as if it
were the reference value. This won't work if the W/A is about setting
multi-bits fields or about clearing a bit.
The comment is still not clear enough. You're saying "other bits besides
the w/a bits", but or'ing the mask doesn't do that.
Why do we care about the "other bits" in the reference value? they don't
matter. Why use something else than (ro_data.init_context[i+1] & 0xffff)
for the value here (as long we're talking about masked registers)?
--
Damien
next prev parent reply other threads:[~2014-09-01 14:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-01 13:28 [PATCH 0/4] Rework workaround init fn for BDW and CHV Arun Siluvery
2014-09-01 13:28 ` [PATCH 1/4] drm/i915: Rework workaround init functions " Arun Siluvery
2014-09-02 9:14 ` [PATCH v2] " Arun Siluvery
2014-09-02 9:45 ` Damien Lespiau
2014-09-02 9:49 ` Damien Lespiau
2014-09-02 9:51 ` Chris Wilson
2014-09-01 13:28 ` [PATCH 2/4] drm/i915: Rename intel_wa_registers with a i915_ prefix Arun Siluvery
2014-09-01 13:28 ` [PATCH 3/4] drm/i915: Don't restrict i915_wa_registers to BDW Arun Siluvery
2014-09-01 13:28 ` [PATCH 4/4] drm/i915: Rework workaround data exporting to debugfs Arun Siluvery
2014-09-01 14:06 ` Damien Lespiau [this message]
2014-09-01 14:45 ` Siluvery, Arun
2014-09-01 15:04 ` Damien Lespiau
2014-09-02 9:15 ` [PATCH v2] " Arun Siluvery
2014-09-02 9:56 ` Daniel Vetter
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=20140901140657.GD1118@strange.amr.corp.intel.com \
--to=damien.lespiau@intel.com \
--cc=arun.siluvery@linux.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.