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

2014-05-12 Thread Daniel Vetter
On Mon, May 12, 2014 at 09:41:02AM -0700, Volkin, Bradley D wrote: > On Mon, May 12, 2014 at 09:24:06AM -0700, Daniel Vetter wrote: > > On Thu, May 08, 2014 at 09:02:18AM -0700, Volkin, Bradley D wrote: > > > On Thu, May 08, 2014 at 08:45:07AM -0700, Ville Syrjälä wrote: > > > > On Thu, May 08, 201

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

2014-05-12 Thread Daniel Vetter
On Mon, May 12, 2014 at 03:49:02PM +0100, Tvrtko Ursulin wrote: > > On 05/10/2014 10:10 PM, bradley.d.vol...@intel.com wrote: > >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 > >

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

2014-05-12 Thread Volkin, Bradley D
On Mon, May 12, 2014 at 09:24:06AM -0700, Daniel Vetter wrote: > On Thu, May 08, 2014 at 09:02:18AM -0700, Volkin, Bradley D wrote: > > On Thu, May 08, 2014 at 08:45:07AM -0700, Ville Syrjälä wrote: > > > On Thu, May 08, 2014 at 08:27:16AM -0700, Volkin, Bradley D wrote: > > > > On Thu, May 08, 201

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

2014-05-12 Thread Daniel Vetter
On Thu, May 08, 2014 at 09:02:18AM -0700, Volkin, Bradley D wrote: > On Thu, May 08, 2014 at 08:45:07AM -0700, Ville Syrjälä wrote: > > On Thu, May 08, 2014 at 08:27:16AM -0700, Volkin, Bradley D wrote: > > > On Thu, May 08, 2014 at 02:56:05AM -0700, Tvrtko Ursulin wrote: > > > > > > > > Hi Brad,

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

2014-05-12 Thread Tvrtko Ursulin
On 05/10/2014 10:10 PM, bradley.d.vol...@intel.com wrote: 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 loo

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

2014-05-12 Thread Damien Lespiau
On Sat, May 10, 2014 at 02:10:43PM -0700, bradley.d.vol...@intel.com wrote: > 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

[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

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

2014-05-08 Thread Volkin, Bradley D
On Thu, May 08, 2014 at 08:50:40AM -0700, Tvrtko Ursulin wrote: > > On 05/08/2014 04:27 PM, Volkin, Bradley D wrote: > > On Thu, May 08, 2014 at 02:56:05AM -0700, Tvrtko Ursulin wrote: > >> > >> Hi Brad, > >> > >> On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: > >> [snip] > >>> - BUG_ON

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

2014-05-08 Thread Volkin, Bradley D
On Thu, May 08, 2014 at 08:45:07AM -0700, Ville Syrjälä wrote: > On Thu, May 08, 2014 at 08:27:16AM -0700, Volkin, Bradley D wrote: > > On Thu, May 08, 2014 at 02:56:05AM -0700, Tvrtko Ursulin wrote: > > > > > > Hi Brad, > > > > > > On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: > > >

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

2014-05-08 Thread Damien Lespiau
On Thu, May 08, 2014 at 08:53:38AM -0700, Volkin, Bradley D wrote: > On Thu, May 08, 2014 at 06:15:44AM -0700, Lespiau, Damien wrote: > > On Thu, May 08, 2014 at 02:05:07PM +0100, Damien Lespiau wrote: > > > On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com > > > wrote: > > > >

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

2014-05-08 Thread Volkin, Bradley D
On Thu, May 08, 2014 at 06:15:44AM -0700, Lespiau, Damien wrote: > On Thu, May 08, 2014 at 02:05:07PM +0100, Damien Lespiau wrote: > > On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com wrote: > > > From: Brad Volkin > > > +/* > > > + * Different command ranges have different num

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

2014-05-08 Thread Tvrtko Ursulin
On 05/08/2014 04:27 PM, Volkin, Bradley D wrote: On Thu, May 08, 2014 at 02:56:05AM -0700, Tvrtko Ursulin wrote: Hi Brad, On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: [snip] - BUG_ON(!validate_cmds_sorted(ring)); + BUG_ON(!validate_cmds_sorted(ring, cmd_tables, cmd_t

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

2014-05-08 Thread Ville Syrjälä
On Thu, May 08, 2014 at 08:27:16AM -0700, Volkin, Bradley D wrote: > On Thu, May 08, 2014 at 02:56:05AM -0700, Tvrtko Ursulin wrote: > > > > Hi Brad, > > > > On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: > > [snip] > > > - BUG_ON(!validate_cmds_sorted(ring)); > > > + BUG_ON(!validate_

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

2014-05-08 Thread Volkin, Bradley D
On Thu, May 08, 2014 at 06:42:16AM -0700, Tvrtko Ursulin wrote: > > On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: > > 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

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

2014-05-08 Thread Volkin, Bradley D
On Thu, May 08, 2014 at 02:56:05AM -0700, Tvrtko Ursulin wrote: > > Hi Brad, > > On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: > [snip] > > - BUG_ON(!validate_cmds_sorted(ring)); > > + BUG_ON(!validate_cmds_sorted(ring, cmd_tables, cmd_table_count)); > > BUG_ON(!validate_regs_

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

2014-05-08 Thread Damien Lespiau
On Thu, May 08, 2014 at 12:44:57PM +0100, Damien Lespiau wrote: > I was hoping we could compute a (near) minimal perfect hash function > though. Let me try to dig a bit. So, I went a bit further here and we can actually generate a minimal perfect hash function. I took the 44 HSW render opcodes and

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

2014-05-08 Thread Tvrtko Ursulin
On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: 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 loo

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

2014-05-08 Thread Tvrtko Ursulin
On 05/08/2014 02:02 PM, Damien Lespiau wrote: On Thu, May 08, 2014 at 01:25:33PM +0100, Tvrtko Ursulin wrote: On 05/08/2014 12:44 PM, Damien Lespiau wrote: On Thu, May 08, 2014 at 10:56:05AM +0100, Tvrtko Ursulin wrote: Hi Brad, On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: [sn

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

2014-05-08 Thread Damien Lespiau
On Thu, May 08, 2014 at 02:05:07PM +0100, Damien Lespiau wrote: > On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com wrote: > > From: Brad Volkin > > +/* > > + * Different command ranges have different numbers of bits for the opcode. > > + * In order to use the opcode bits, and o

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

2014-05-08 Thread Damien Lespiau
On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com wrote: > From: Brad Volkin > +/* > + * Different command ranges have different numbers of bits for the opcode. > + * In order to use the opcode bits, and only the opcode bits, for the hash > key > + * we should use the MI_* comm

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

2014-05-08 Thread Damien Lespiau
On Thu, May 08, 2014 at 01:25:33PM +0100, Tvrtko Ursulin wrote: > > On 05/08/2014 12:44 PM, Damien Lespiau wrote: > >On Thu, May 08, 2014 at 10:56:05AM +0100, Tvrtko Ursulin wrote: > >> > >>Hi Brad, > >> > >>On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: > >>[snip] > >>>- BUG_ON(!valid

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

2014-05-08 Thread Tvrtko Ursulin
On 05/08/2014 12:44 PM, Damien Lespiau wrote: On Thu, May 08, 2014 at 10:56:05AM +0100, Tvrtko Ursulin wrote: Hi Brad, On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: [snip] - BUG_ON(!validate_cmds_sorted(ring)); + BUG_ON(!validate_cmds_sorted(ring, cmd_tables, cmd_tabl

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

2014-05-08 Thread Damien Lespiau
On Thu, May 08, 2014 at 10:56:05AM +0100, Tvrtko Ursulin wrote: > > Hi Brad, > > On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: > [snip] > >-BUG_ON(!validate_cmds_sorted(ring)); > >+BUG_ON(!validate_cmds_sorted(ring, cmd_tables, cmd_table_count)); > > BUG_ON(!validate_regs_

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

2014-05-08 Thread Tvrtko Ursulin
Hi Brad, On 04/28/2014 04:22 PM, bradley.d.vol...@intel.com wrote: [snip] - BUG_ON(!validate_cmds_sorted(ring)); + BUG_ON(!validate_cmds_sorted(ring, cmd_tables, cmd_table_count)); BUG_ON(!validate_regs_sorted(ring)); + + BUG_ON(init_hash_table(ring, cmd_tables, cmd_ta

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

2014-05-07 Thread Volkin, Bradley D
Could someone help to review this patch please? It provides a nice improvement to the command parser's performance, so I'd like to get this one in. Thanks, Brad On Mon, Apr 28, 2014 at 08:22:08AM -0700, Volkin, Bradley D wrote: > From: Brad Volkin > > For clients that submit large batch buffers

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

2014-04-28 Thread Daniel Vetter
On Mon, Apr 28, 2014 at 6:07 PM, Volkin, Bradley D wrote: > On Mon, Apr 28, 2014 at 08:53:30AM -0700, Daniel Vetter wrote: >> On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com wrote: >> > From: Brad Volkin >> > >> > For clients that submit large batch buffers the command parser

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

2014-04-28 Thread Volkin, Bradley D
On Mon, Apr 28, 2014 at 08:53:30AM -0700, Daniel Vetter wrote: > On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com wrote: > > From: Brad Volkin > > > > For clients that submit large batch buffers the command parser has > > a substantial impact on performance. On my HSW ULT syst

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

2014-04-28 Thread Volkin, Bradley D
On Mon, Apr 28, 2014 at 08:42:56AM -0700, Daniel Vetter wrote: > On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com wrote: > > From: Brad Volkin > > > > For clients that submit large batch buffers the command parser has > > a substantial impact on performance. On my HSW ULT syst

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

2014-04-28 Thread Daniel Vetter
On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com wrote: > 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

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

2014-04-28 Thread Volkin, Bradley D
On Mon, Apr 28, 2014 at 08:22:08AM -0700, Volkin, Bradley D wrote: > 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

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

2014-04-28 Thread Daniel Vetter
On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.vol...@intel.com wrote: > 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

[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