From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
Date: Fri, 18 May 2018 15:26:57 +0100 [thread overview]
Message-ID: <20180518142657.29064-1-lionel.g.landwerlin@intel.com> (raw)
On Gen8+ this register is not priviledged and we want to use it in
Mesa to implement a feature required by GPA called Null Hardware. The
idea is to have the command parser turn 3DPRIMITIVE/GPGPU_WALKER into
NOOPs.
This patch just whitelists the bits that we need and that are
currently not used by the kernel.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
drivers/gpu/drm/i915/i915_cmd_parser.c | 8 ++++++++
drivers/gpu/drm/i915/i915_reg.h | 3 +++
2 files changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index 95478db9998b..1db6447460eb 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -534,6 +534,14 @@ struct drm_i915_reg_descriptor {
{ .addr = _reg ## _UDW(idx) }
static const struct drm_i915_reg_descriptor gen7_render_regs[] = {
+ REG32(INSTPM,
+ .mask = ~((INSTPM_3D_STATE_INSTRUCTION_DISABLE |
+ INSTPM_3D_RENDERING_INSTRUCTION_DISABLE |
+ INSTPM_3D_MEDIA_INSTRUCTION_DISABLE) << 16 |
+ (INSTPM_3D_STATE_INSTRUCTION_DISABLE |
+ INSTPM_3D_RENDERING_INSTRUCTION_DISABLE |
+ INSTPM_3D_MEDIA_INSTRUCTION_DISABLE)),
+ .value = 0),
REG64(GPGPU_THREADS_DISPATCHED),
REG64(HS_INVOCATION_COUNT),
REG64(DS_INVOCATION_COUNT),
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 196a0eb79272..2db9b6a177d9 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2531,6 +2531,9 @@ enum i915_power_well_id {
#define INSTPM_FORCE_ORDERING (1<<7) /* GEN6+ */
#define INSTPM_TLB_INVALIDATE (1<<9)
#define INSTPM_SYNC_FLUSH (1<<5)
+#define INSTPM_3D_MEDIA_INSTRUCTION_DISABLE (1<<3) /* GEN6+ */
+#define INSTPM_3D_RENDERING_INSTRUCTION_DISABLE (1<<2) /* GEN6+ */
+#define INSTPM_3D_STATE_INSTRUCTION_DISABLE (1<<1) /* GEN6+ */
#define ACTHD _MMIO(0x20c8)
#define MEM_MODE _MMIO(0x20cc)
#define MEM_DISPLAY_B_TRICKLE_FEED_DISABLE (1<<3) /* 830 only */
--
2.17.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2018-05-18 14:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 14:26 Lionel Landwerlin [this message]
2018-05-18 14:29 ` [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits Lionel Landwerlin
2018-05-18 14:40 ` Chris Wilson
2018-05-18 15:39 ` Lionel Landwerlin
2018-05-18 14:54 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-05-18 15:09 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-18 21:11 ` ✓ 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=20180518142657.29064-1-lionel.g.landwerlin@intel.com \
--to=lionel.g.landwerlin@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.