[Intel-gfx] [PATCH v4 1/7] drm/i915: Implement a framework for batch buffer pools

2014-11-07 Thread bradley . d . volkin
From: Brad Volkin This adds a small module for managing a pool of batch buffers. The only current use case is for the command parser, as described in the kerneldoc in the patch. The code is simple, but separating it out makes it easier to change the underlying algorithms and to extend to future u

[Intel-gfx] [PATCH v4 5/7] drm/i915: Use batch length instead of object size in command parser

2014-11-07 Thread bradley . d . volkin
From: Brad Volkin Previously we couldn't trust the user-supplied batch length because it came directly from userspace (i.e. untrusted code). It would have affected what commands software parsed without regard to what hardware would actually execute, leaving a potential hole. With the parser now

[Intel-gfx] [PATCH v4 7/7] drm/i915: Tidy up execbuffer command parsing code

2014-11-07 Thread bradley . d . volkin
From: Brad Volkin Move it to a separate function since the main do_execbuffer function already has so much going on. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 136 + 1 file changed, 79 insertions(+), 57 deletions(-) diff --git a/dr

[Intel-gfx] [PATCH v4 6/7] drm/i915: Mark shadow batch buffers as purgeable

2014-11-07 Thread bradley . d . volkin
From: Brad Volkin By adding a new exec_entry flag, we cleanly mark the shadow objects as purgeable after they are on the active list. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/driver

[Intel-gfx] [PATCH v4 0/7] Command parser batch buffer copy

2014-11-07 Thread bradley . d . volkin
From: Brad Volkin This is v4 of the series I sent here: http://lists.freedesktop.org/archives/intel-gfx/2014-November/054733.html This version incorporates most of the feedback from v3. The couple of things that I missed (mostly for timing reasons) are: * Move 'pending_read_domains |= I915_GEM_D

[Intel-gfx] [PATCH v4 2/7] drm/i915: Use batch pools with the command parser

2014-11-07 Thread bradley . d . volkin
From: Brad Volkin This patch sets up all of the tracking and copying necessary to use batch pools with the command parser and dispatches the copied (shadow) batch to the hardware. After this patch, the parser is in 'enabling' mode. Note that performance takes a hit from the copy in some cases a

[Intel-gfx] [PATCH v4 4/7] drm/i915: Add batch pool details to i915_gem_objects debugfs

2014-11-07 Thread bradley . d . volkin
From: Brad Volkin To better account for the potentially large memory consumption of the batch pool. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_debugfs.c | 45 + 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v4 3/7] drm/i915: Add a batch pool debugfs file

2014-11-07 Thread bradley . d . volkin
From: Brad Volkin It provides some useful information about the buffers in the global command parser batch pool. v2: rebase on global pool instead of per-ring pools v3: rebase Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_debugfs.c | 41 + 1 fil

[Intel-gfx] [PATCH] tests/drv_hangman: skip a few asserts when using the cmd parser

2014-11-04 Thread bradley . d . volkin
From: Brad Volkin This test has a few checks that batch buffer addresses in the error state match the expected address for the userspace supplied batch. But the batch buffer copy piece of the command parser means that the logged addresses are actually _supposed_ to be different. So skip just th

[Intel-gfx] [PATCH 1/2] tests/gem_exec_parse: fix batch_len setting for cmd-crossing-page

2014-11-03 Thread bradley . d . volkin
From: Brad Volkin The size of the batch buffer passed to the kernel is significantly larger than the size of the batch buffer passed to the function. A proposed optimization as part of the batch copy kernel series is to use batch_len for the copy and parse operations, which leads to a false "batc

[Intel-gfx] [PATCH 2/2] tests/gem_madvise: set execbuf.batch_len before doing an execbuf

2014-11-03 Thread bradley . d . volkin
From: Brad Volkin The command parser's batch_len optimization causes the parser to reject this batch as not having an MI_BATCH_BUFFER_END because the length was not set correctly. Signed-off-by: Brad Volkin --- tests/gem_madvise.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/gem_m

[Intel-gfx] [PATCH v3 2/5] drm/i915: Use batch pools with the command parser

2014-11-03 Thread bradley . d . volkin
From: Brad Volkin This patch sets up all of the tracking and copying necessary to use batch pools with the command parser and dispatches the copied (shadow) batch to the hardware. After this patch, the parser is in 'enabling' mode. Note that performance takes a hit from the copy in some cases a

[Intel-gfx] [PATCH v3 1/5] drm/i915: Implement a framework for batch buffer pools

2014-11-03 Thread bradley . d . volkin
From: Brad Volkin This adds a small module for managing a pool of batch buffers. The only current use case is for the command parser, as described in the kerneldoc in the patch. The code is simple, but separating it out makes it easier to change the underlying algorithms and to extend to future u

[Intel-gfx] [PATCH v3 0/5] Command parser batch buffer copy

2014-11-03 Thread bradley . d . volkin
From: Brad Volkin This is v3 of the series I sent here: http://lists.freedesktop.org/archives/intel-gfx/2014-July/048705.html Most of the previous commentary still applies. We've fixed the secure dispatch regression though, so the series now puts the parser into enabling mode in patch 2. There

[Intel-gfx] [PATCH v3 5/5] drm/i915: Use batch length instead of object size in command parser

2014-11-03 Thread bradley . d . volkin
From: Brad Volkin Previously we couldn't trust the user-supplied batch length because it came directly from userspace (i.e. untrusted code). It would have affected what commands software parsed without regard to what hardware would actually execute, leaving a potential hole. With the parser now

[Intel-gfx] [PATCH v3 3/5] drm/i915: Add a batch pool debugfs file

2014-11-03 Thread bradley . d . volkin
From: Brad Volkin It provides some useful information about the buffers in the global command parser batch pool. v2: rebase on global pool instead of per-ring pools v3: rebase Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_debugfs.c | 41 + 1 fil

[Intel-gfx] [PATCH v3 4/5] drm/i915: Add batch pool details to i915_gem_objects debugfs

2014-11-03 Thread bradley . d . volkin
From: Brad Volkin To better account for the potentially large memory consumption of the batch pool. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_debugfs.c | 45 + 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] [PATCH] drm/i915: Abort command parsing for chained batches

2014-10-16 Thread bradley . d . volkin
From: Brad Volkin libva uses chained batch buffers in a way that the command parser can't generally handle. Fortunately, libva doesn't need to write registers from batch buffers in the way that mesa does, so this patch causes the driver to fall back to non-secure dispatch if the parser detects a

[Intel-gfx] [PATCH 1/2] tests/gem_exec_parse: fix batch_len setting for cmd-crossing-page

2014-10-15 Thread bradley . d . volkin
From: Brad Volkin The size of the batch buffer passed to the kernel is significantly larger than the size of the batch buffer passed to the function. A proposed optimization as part of the batch copy kernel series is to use batch_len for the copy and parse operations, which leads to a false "batc

[Intel-gfx] [PATCH 2/2] tests/gem_exec_parse: test for chained batch buffers

2014-10-15 Thread bradley . d . volkin
From: Brad Volkin libva makes extensive use of chained batch buffers. The batch buffer copy portion of the command parser has the potential to break chained batches, so add a simple test to make sure that doesn't happen. Signed-off-by: Brad Volkin --- lib/intel_reg.h| 1 + tests/gem_

[Intel-gfx] [PATCH] drm/i915: Don't leak command parser tables on suspend/resume

2014-09-22 Thread bradley . d . volkin
From: Brad Volkin Ring init and cleanup are not balanced because we re-init the rings on resume without having cleaned them up on suspend. This leads to the driver leaking the parser's hash tables with a kmemleak signature such as this: unreferenced object 0x880405960980 (size 32): comm "s

[Intel-gfx] [PATCH 1/2] drm/i915: Re-enable the command parser when using PPGTT

2014-09-18 Thread bradley . d . volkin
From: Brad Volkin In commit commit 896ab1a5d54269b463a24194c2e4a369103b46d8 Author: Daniel Vetter Date: Wed Aug 6 15:04:51 2014 +0200 drm/i915: Fix up checks for aliasing ppgtt it looks like we accidentally inverted the check that the command parser should only run when the driver enabl

[Intel-gfx] [PATCH 2/2] drm/i915: Log a message when rejecting LRM to OACONTROL

2014-09-18 Thread bradley . d . volkin
From: Brad Volkin The other paths in the command parser that reject a batch all log a message indicating the reason. We simply missed this one. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/g

[Intel-gfx] [PATCH 6/5] drm/i915: Add batch pool details to i915_gem_objects debugfs

2014-07-09 Thread bradley . d . volkin
From: Brad Volkin To better account for the potentially large memory consumption of the batch pool. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_debugfs.c | 45 + 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v3 1/5] drm/i915: Implement a framework for batch buffer pools

2014-07-09 Thread bradley . d . volkin
From: Brad Volkin This adds a small module for managing a pool of batch buffers. The only current use case is for the command parser, as described in the kerneldoc in the patch. The code is simple, but separating it out makes it easier to change the underlying algorithms and to extend to future u

[Intel-gfx] [PATCH v2 2/5] drm/i915: Use batch pools with the command parser

2014-07-08 Thread bradley . d . volkin
From: Brad Volkin This patch sets up all of the tracking and copying necessary to use batch pools with the command parser, but does not actually dispatch the copied (shadow) batch to the hardware yet. We still aren't quite ready to set the secure bit during dispatch. Note that performance takes

[Intel-gfx] [PATCH v2 5/5] drm/i915: Use batch length instead of object size in command parser

2014-07-08 Thread bradley . d . volkin
From: Brad Volkin Previously we couldn't trust the user-supplied batch length because it came directly from userspace (i.e. untrusted code). It would have affected what commands software parsed without regard to what hardware would actually execute, leaving a potential hole. With the parser now

[Intel-gfx] [PATCH v2 3/5] drm/i915: Add a batch pool debugfs file

2014-07-08 Thread bradley . d . volkin
From: Brad Volkin It provides some useful information about the buffers in the global command parser batch pool. v2: rebase on global pool instead of per-ring pools Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_debugfs.c | 41 + 1 file changed, 4

[Intel-gfx] [PATCH v2 1/5] drm/i915: Implement a framework for batch buffer pools

2014-07-08 Thread bradley . d . volkin
From: Brad Volkin This adds a small module for managing a pool of batch buffers. The only current use case is for the command parser, as described in the kerneldoc in the patch. The code is simple, but separating it out makes it easier to change the underlying algorithms and to extend to future u

[Intel-gfx] [PATCH v2 0/5] Command parser batch buffer copy

2014-07-08 Thread bradley . d . volkin
From: Brad Volkin This is v2 of the series I sent here: http://lists.freedesktop.org/archives/intel-gfx/2014-June/047609.html I believe that I've addressed all of the feedback except * I didn't move the allocation of the shadow batch buffer into parse_cmds(). It didn't seem like it added much

[Intel-gfx] [PATCH v2 4/5] drm/i915: Dispatch the shadow batch buffer

2014-07-08 Thread bradley . d . volkin
From: Brad Volkin This is useful for testing the batch pool code with aliasing PPGTT. It doesn't work with full PPGTT though; the GPU hangs and the whole UI is corrupted. We need fixes for the secure dispatch path to enable this for real. v2: rebase on shadow_batch_obj replacing batch_obj Signe

[Intel-gfx] [RFC 4/4] drm/i915: Dispatch the shadow batch buffer

2014-06-18 Thread bradley . d . volkin
From: Brad Volkin This is useful for testing the batch pool code with aliasing PPGTT. It doesn't work with full PPGTT though; the GPU hangs and the whole UI is corrupted. We need fixes for the secure dispatch path to enable this for real. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i91

[Intel-gfx] [RFC 2/4] drm/i915: Use batch pools with the command parser

2014-06-18 Thread bradley . d . volkin
From: Brad Volkin This patch sets up all of the tracking and copying necessary to use batch pools with the command parser, but does not actually dispatch the copied (shadow) batch to the hardware yet. We still aren't quite ready to set the secure bit during dispatch. Note that performance takes

[Intel-gfx] [RFC 1/4] drm/i915: Implement a framework for batch buffer pools

2014-06-18 Thread bradley . d . volkin
From: Brad Volkin This adds a small module for managing a pool of batch buffers. The only current use case is for the command parser, as described in the kerneldoc in the patch. The code is simple, but separating it out makes it easier to change the underlying algorithms and to extend to future u

[Intel-gfx] [RFC 3/4] drm/i915: Add a batch pool debugfs file

2014-06-18 Thread bradley . d . volkin
From: Brad Volkin It provides some useful information about the buffers in the per-ring command parser batch pools. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_debugfs.c | 48 + 1 file changed, 48 insertions(+) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] [RFC 0/4] Command parser batch buffer copy

2014-06-18 Thread bradley . d . volkin
From: Brad Volkin This series is what I have so far on the batch copy aspect of the command parser. The individual patches and kerneldoc have details. It doesn't work with full ppgtt at the moment, so isn't ready for merge. But I'd like to get feedback on the direction and particularly whether I'

[Intel-gfx] [PATCH] drm/i915: Add some L3 registers to the parser whitelist

2014-06-17 Thread bradley . d . volkin
From: Brad Volkin Beignet needs these in order to program the L3 cache config for OpenCL workloads, particularly when using SLM. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 3 +++ drivers/gpu/drm/i915/i915_reg.h| 2 ++ 2 files changed, 5 insertions(+) diff

[Intel-gfx] [PATCH] drm/i915: Only check PPGTT bits when using PPGTT

2014-05-28 Thread bradley . d . volkin
From: Brad Volkin This extends use of the command parser to VLV. Note that the patch checks that the PPGTT bit is set appropriately when PPGTT is enabled but ignores it when PPGTT is disabled. It would be awkward to correctly invert the expected value to check that the bit is set appropriately i

[Intel-gfx] [PATCH] tests/gen7_forcewake_mt: Don't set the GGTT bit in SRM command

2014-05-10 Thread bradley . d . volkin
From: Brad Volkin The command parser in newer kernels will reject it and setting this bit is not required for the actual test case. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76670 Signed-off-by: Brad Volkin --- This is a resend of http://lists.freedesktop.org/archives/intel-gfx/20

[Intel-gfx] [PATCH] drm/i915: Use hash tables for the command parser

2014-05-10 Thread bradley . d . volkin
From: Brad Volkin For clients that submit large batch buffers the command parser has a substantial impact on performance. On my HSW ULT system performance drops as much as ~20% on some tests. Most of the time is spent in the command lookup code. Converting that from the current naive search to a

[Intel-gfx] [PATCH] drm/i915: Use hash tables for the command parser

2014-04-28 Thread bradley . d . volkin
From: Brad Volkin For clients that submit large batch buffers the command parser has a substantial impact on performance. On my HSW ULT system performance drops as much as ~20% on some tests. Most of the time is spent in the command lookup code. Converting that from the current naive search to a

[Intel-gfx] [PATCH] SQUASH: drm/i915: One more register for mesa

2014-04-09 Thread bradley . d . volkin
From: Brad Volkin Originally left out because it wasn't used. But it may be needed and doesn't pose any risk, so add to the whitelist. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 1 + drivers/gpu/drm/i915/i915_reg.h| 1 + 2 files changed, 2 insertions(+) di

[Intel-gfx] [PATCH] drm/i915: Add more registers to the whitelist for mesa

2014-04-08 Thread bradley . d . volkin
From: Brad Volkin These are additional registers needed for performance monitoring and ARB_draw_indirect extensions in mesa. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76719 Cc: Kenneth Graunke Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 9 + dr

[Intel-gfx] [PATCH] tests/gen7_forcewake_mt: Don't set the GGTT bit in SRM command

2014-04-08 Thread bradley . d . volkin
From: Brad Volkin The command parser in newer kernels will reject it and setting this bit is not required for the actual test case. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76670 Signed-off-by: Brad Volkin --- tests/gen7_forcewake_mt.c | 55 +--

[Intel-gfx] [PATCH v2 3/3] drm/i915: Track OACONTROL register enable/disable during parsing

2014-03-28 Thread bradley . d . volkin
From: Brad Volkin There is some thought that the data from the performance counters enabled via OACONTROL should only be available to the process that enabled counting. To limit snooping, require that any batch buffer which sets OACONTROL to a non-zero value also sets it back to 0 before the end

[Intel-gfx] [PATCH] tests/gem_exec_parse: Test for OACONTROL tracking

2014-03-27 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 48 1 file changed, 48 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index 34d097d..853eb57 100644 --- a/tests/gem_exec_parse.c +++ b/tests/ge

[Intel-gfx] [PATCH 1/3] drm/i915: BUG_ON() when cmd/reg tables are not sorted

2014-03-27 Thread bradley . d . volkin
From: Brad Volkin As suggested during review, this makes it much more obvious when the tables are not sorted. Cc: Jani Nikula Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --g

[Intel-gfx] [PATCH 0/3] Fix up cmd parser OACONTROL handling + refactorings

2014-03-27 Thread bradley . d . volkin
From: Brad Volkin Patches 1 and 2 do some cleanups suggested as part of the review process. Patch 3 continues the OACONTROL handling fixes from the other day. I think patches 1 and 2 are valuable on their own. I think the need/benefit for the tracking provided by patch 3 is somewhat unclear. Per

[Intel-gfx] [PATCH 3/3] drm/i915: Track OACONTROL register enable/disable during parsing

2014-03-27 Thread bradley . d . volkin
From: Brad Volkin There is some thought that the data from the performance counters enabled via OACONTROL should only be available to the process that enabled counting. To limit snooping, require that any batch buffer which sets OACONTROL to a non-zero value also sets it back to 0 before the end

[Intel-gfx] [PATCH 2/3] drm/i915: Refactor cmd parser checks into a function

2014-03-27 Thread bradley . d . volkin
From: Brad Volkin This brings the code a little more in line with kernel coding style. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 136 + 1 file changed, 71 insertions(+), 65 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_cmd_pa

[Intel-gfx] [PATCH 5/6] tests/gem_exec_parse: Test for batches w/o MI_BATCH_BUFFER_END

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 9 + 1 file changed, 9 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index 9e90408..004c3bf 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -257,6 +257,15 @@ igt_m

[Intel-gfx] [PATCH 04/13] drm/i915: Reject privileged commands

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin The spec defines most of these commands as privileged. A few others, like the semaphore mbox command and some display commands, are also reserved for the driver's use. Subsequent patches relax some of these restrictions. v2: Rebased Signed-off-by: Brad Volkin --- drivers/gpu

[Intel-gfx] [PATCH 11/13] drm/i915: Reject commands that would store to global HWS page

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin PIPE_CONTROL and MI_FLUSH_DW have bits that would write to the hardware status page. The driver stores request tracking info there, so don't let userspace overwrite it. v2: trailing comma fix, rebased Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 24

[Intel-gfx] [PATCH 12/13] drm/i915: Add a CMD_PARSER_VERSION getparam

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin So userspace can query the kernel for command parser support. v2: Add i915_cmd_parser_get_version(), history log, and kerneldoc OTC-Tracker: AXIA-4631 Change-Id: I58af650db9f6753c2dcac9c54ab432fd31db302f Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c |

[Intel-gfx] [PATCH 08/13] drm/i915: Enable register whitelist checks

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin MI_STORE_REGISTER_MEM, MI_LOAD_REGISTER_MEM, and MI_LOAD_REGISTER_IMM commands allow userspace access to registers. Only certain registers should be allowed for such access, so enable checking for those commands. Each ring gets its own register whitelist. MI_LOAD_REGISTER_REG o

[Intel-gfx] [PATCH 01/13] drm/i915: Refactor shmem pread setup

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin The command parser is going to need the same synchronization and setup logic, so factor it out for reuse. v2: Add a check that the object is backed by shmem Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_drv.h | 3 +++ drivers/gpu/drm/i915/i915_gem.c | 51

[Intel-gfx] [PATCH] intel: Merge i915_drm.h with cmd parser define

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- include/drm/i915_drm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 2f4eb8c..ba863c4 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -27,7 +27,7

[Intel-gfx] [PATCH 10/13] drm/i915: Enable PPGTT command parser checks

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Various commands that access memory have a bit to determine whether the graphics address specified in the command should use the GGTT or PPGTT for translation. These checks ensure that the bit indicates PPGTT translation. Most of these checks use the existing bit-checking infra

[Intel-gfx] [PATCH 6/6] tests/gem_exec_parse: Test a command crossing a page boundary

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin This is a speculative test in that it's not particularly relevant today, but is important if we switch the parser implementation to use kmap_atomic instead of vmap. Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 68 ++

[Intel-gfx] [PATCH 2/6] tests/gem_exec_parse: Add tests for rejected commands

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 81 ++ 1 file changed, 81 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index c71e478..ebf7116 100644 --- a/tests/gem_exec_parse.c +++ b/tests/

[Intel-gfx] [PATCH 02/13] drm/i915: Implement command buffer parsing logic

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin The command parser scans batch buffers submitted via execbuffer ioctls before the driver submits them to hardware. At a high level, it looks for several things: 1) Commands which are explicitly defined as privileged or which should only be used by the kernel driver. The pars

[Intel-gfx] [PATCH 1/6] tests: Add a test for the command parser

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Start with a simple testcase that should pass. v2: Switch to I915_PARAM_CMD_PARSER_VERSION Signed-off-by: Brad Volkin --- tests/.gitignore | 1 + tests/Makefile.sources | 1 + tests/gem_exec_parse.c | 140 + 3 files c

[Intel-gfx] [PATCH 4/6] tests/gem_exec_parse: Add tests for bitmask checks

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index 48fde25..9e90408 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -145,6 +145,

[Intel-gfx] [PATCH 03/13] drm/i915: Initial command parser table definitions

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Add command tables defining irregular length commands for each ring. This requires a few new command opcode definitions. v2: Whitespace adjustment in command definitions, sparse fix for !F OTC-Tracker: AXIA-4631 Change-Id: I064bceb457e15f46928058352afe76d918c58ef5 Signed-off-b

[Intel-gfx] [PATCH 3/6] tests/gem_exec_parse: Add tests for register whitelist

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index ebf7116..48fde25 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -141

[Intel-gfx] [PATCH 05/13] drm/i915: Allow some privileged commands from master

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin The Intel DDX uses these to implement scanline waits in the X server. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH 00/13] Gen7 batch buffer command parser

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin Certain OpenGL features (e.g. transform feedback, performance monitoring) require userspace code to submit batches containing commands such as MI_LOAD_REGISTER_IMM to access various registers. Unfortunately, some generations of the hardware will noop these commands in "unsecure"

[Intel-gfx] [PATCH 13/13] drm/i915: Enable command parsing by default

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin v2: rebased OTC-Tracker: AXIA-4631 Change-Id: I6747457e1fe7494bd42787af51198fcba398ad78 Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/

[Intel-gfx] [PATCH 09/13] drm/i915: Reject commands that explicitly generate interrupts

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin The driver leaves most interrupts masked during normal operation, so there would have to be additional work to enable userspace to safely request/receive an interrupt. v2: trailing commas, rebased Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 22 +++

[Intel-gfx] [PATCH 06/13] drm/i915: Add register whitelists for mesa

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin These registers are currently used by mesa for blitting, transform feedback extensions, and performance monitoring extensions. v2: REG64 macro Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 45 ++ drivers/gpu/drm/i915/

[Intel-gfx] [PATCH 07/13] drm/i915: Add register whitelist for DRM master

2014-02-18 Thread bradley . d . volkin
From: Brad Volkin These are used to implement scanline waits in the X server. v2: Use #defines instead of magic numbers Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 29 + drivers/gpu/drm/i915/i915_reg.h| 6 ++ 2 files changed

[Intel-gfx] [PATCH 6/6] tests/gem_exec_parse: Test a command crossing a page boundary

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin This is a speculative test in that it's not particularly relevant today, but is important if we switch the parser implementation to use kmap_atomic instead of vmap. Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 68 ++

[Intel-gfx] [PATCH 2/6] tests/gem_exec_parse: Add tests for rejected commands

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 81 ++ 1 file changed, 81 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index c71e478..ebf7116 100644 --- a/tests/gem_exec_parse.c +++ b/tests/

[Intel-gfx] [PATCH 08/13] drm/i915: Enable register whitelist checks

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin MI_STORE_REGISTER_MEM, MI_LOAD_REGISTER_MEM, and MI_LOAD_REGISTER_IMM commands allow userspace access to registers. Only certain registers should be allowed for such access, so enable checking for those commands. Each ring gets its own register whitelist. MI_LOAD_REGISTER_REG o

[Intel-gfx] [PATCH 3/6] tests/gem_exec_parse: Add tests for register whitelist

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index ebf7116..48fde25 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -141

[Intel-gfx] [PATCH] intel: Merge i915_drm.h with cmd parser define

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- include/drm/i915_drm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 2f4eb8c..ba863c4 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -27,7 +27,7

[Intel-gfx] [PATCH 5/6] tests/gem_exec_parse: Test for batches w/o MI_BATCH_BUFFER_END

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 9 + 1 file changed, 9 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index 9e90408..004c3bf 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -257,6 +257,15 @@ igt_m

[Intel-gfx] [PATCH 4/6] tests/gem_exec_parse: Add tests for bitmask checks

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index 48fde25..9e90408 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -145,6 +145,

[Intel-gfx] [PATCH 1/6] tests: Add a test for the command parser

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Start with a simple testcase that should pass. v2: Switch to I915_PARAM_CMD_PARSER_VERSION Signed-off-by: Brad Volkin --- tests/.gitignore | 1 + tests/Makefile.sources | 1 + tests/gem_exec_parse.c | 140 + 3 files c

[Intel-gfx] [PATCH 11/13] drm/i915: Reject commands that would store to global HWS page

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin PIPE_CONTROL and MI_FLUSH_DW have bits that would write to the hardware status page. The driver stores request tracking info there, so don't let userspace overwrite it. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 30 ++

[Intel-gfx] [PATCH 10/13] drm/i915: Enable PPGTT command parser checks

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Various commands that access memory have a bit to determine whether the graphics address specified in the command should use the GGTT or PPGTT for translation. These checks ensure that the bit indicates PPGTT translation. Most of these checks use the existing bit-checking infra

[Intel-gfx] [PATCH 05/13] drm/i915: Allow some privileged commands from master

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin The Intel DDX uses these to implement scanline waits in the X server. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH 03/13] drm/i915: Initial command parser table definitions

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Add command tables defining irregular length commands for each ring. This requires a few new command opcode definitions. OTC-Tracker: AXIA-4631 Change-Id: I064bceb457e15f46928058352afe76d918c58ef5 Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 157 +++

[Intel-gfx] [PATCH 02/13] drm/i915: Implement command buffer parsing logic

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin The command parser scans batch buffers submitted via execbuffer ioctls before the driver submits them to hardware. At a high level, it looks for several things: 1) Commands which are explicitly defined as privileged or which should only be used by the kernel driver. The pars

[Intel-gfx] [PATCH 12/13] drm/i915: Add a CMD_PARSER_VERSION getparam

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin So userspace can query the kernel for command parser support. OTC-Tracker: AXIA-4631 Change-Id: I58af650db9f6753c2dcac9c54ab432fd31db302f Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_dma.c | 4 include/uapi/drm/i915_drm.h | 1 + 2 files changed, 5 inserti

[Intel-gfx] [PATCH 01/13] drm/i915: Refactor shmem pread setup

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin The command parser is going to need the same synchronization and setup logic, so factor it out for reuse. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_drv.h | 3 +++ drivers/gpu/drm/i915/i915_gem.c | 48 + 2 files changed,

[Intel-gfx] [PATCH 13/13] drm/i915: Enable command parsing by default

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin OTC-Tracker: AXIA-4631 Change-Id: I6747457e1fe7494bd42787af51198fcba398ad78 Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915

[Intel-gfx] [PATCH 09/13] drm/i915: Reject commands that explicitly generate interrupts

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin The driver leaves most interrupts masked during normal operation, so there would have to be additional work to enable userspace to safely request/receive an interrupt. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 25 +++-- driver

[Intel-gfx] [PATCH 04/13] drm/i915: Reject privileged commands

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin The spec defines most of these commands as privileged. A few others, like the semaphore mbox command and some display commands, are also reserved for the driver's use. Subsequent patches relax some of these restrictions. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i91

[Intel-gfx] [PATCH 00/13] Gen7 batch buffer command parser

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin Certain OpenGL features (e.g. transform feedback, performance monitoring) require userspace code to submit batches containing commands such as MI_LOAD_REGISTER_IMM to access various registers. Unfortunately, some generations of the hardware will noop these commands in "unsecure"

[Intel-gfx] [PATCH 07/13] drm/i915: Add register whitelist for DRM master

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin These are used to implement scanline waits in the X server. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH 06/13] drm/i915: Add register whitelists for mesa

2014-01-29 Thread bradley . d . volkin
From: Brad Volkin These registers are currently used by mesa for blitting, transform feedback extensions, and performance monitoring extensions. Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 55 ++ drivers/gpu/drm/i915/i915_reg.h

[Intel-gfx] [PATCH 3/4] tests/gem_exec_parse: Add tests for register whitelist

2013-11-26 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index b34fe1b..d4136db 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -141

[Intel-gfx] [RFC 19/22] drm/i915: Fix length handling for MFX_WAIT

2013-11-26 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c index 5593740..adc7d94 100644 --- a/drivers/gpu/drm/i

[Intel-gfx] [PATCH 2/4] tests/gem_exec_parse: Add tests for rejected commands

2013-11-26 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 81 ++ 1 file changed, 81 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index a17929f..b34fe1b 100644 --- a/tests/gem_exec_parse.c +++ b/tests/

[Intel-gfx] [PATCH] intel: Add HAS_CMD_PARSER parameter definition

2013-11-26 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- include/drm/i915_drm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index c1914d6..525dc27 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -306,6 +306,7 @@ typedef struct

[Intel-gfx] [PATCH 1/4] tests: Add a test for the command parser

2013-11-26 Thread bradley . d . volkin
From: Brad Volkin Start with a simple testcase that should pass. Signed-off-by: Brad Volkin --- tests/.gitignore | 1 + tests/Makefile.sources | 1 + tests/gem_exec_parse.c | 140 + 3 files changed, 142 insertions(+) create mode 100644

[Intel-gfx] [PATCH 4/4] tests/gem_exec_parse: Add tests for bitmask checks

2013-11-26 Thread bradley . d . volkin
From: Brad Volkin Signed-off-by: Brad Volkin --- tests/gem_exec_parse.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index d4136db..0eb328c 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -145,6 +145,

[Intel-gfx] [RFC 03/22] drm/i915: Hook command parser tables up to rings

2013-11-26 Thread bradley . d . volkin
From: Brad Volkin OTC-Tracker: AXIA-4631 Change-Id: Id178f67338d00c23ca4e8fc9499313dba93d2c5c Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 34 + drivers/gpu/drm/i915/i915_drv.h | 3 +++ drivers/gpu/drm/i915/intel_ringbuffer.c

[Intel-gfx] [RFC 13/22] drm/i915: Enable bit checking for some commands

2013-11-26 Thread bradley . d . volkin
From: Brad Volkin These checks prevent userspace from using certain commands to access registers or generate interrupts. OTC-Tracker: AXIA-4631 Change-Id: Ic6367ae98272495ba874c22abd4824fbced0abca Signed-off-by: Brad Volkin --- drivers/gpu/drm/i915/i915_cmd_parser.c | 41 ++

  1   2   >