All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kalamarz, Lukasz" <lukasz.kalamarz@intel.com>
To: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t v2 1/2] lib/rendercopy_gen7: Reorganizing batch allocations
Date: Tue, 17 Apr 2018 09:13:32 +0000	[thread overview]
Message-ID: <1523956410.3558.51.camel@intel.com> (raw)
In-Reply-To: <2285c0b3-c5ac-19d2-ec4b-fa4c7a71fdba@intel.com>

On Mon, 2018-04-16 at 13:50 -0700, Daniele Ceraolo Spurio wrote:
> 
> On 16/04/18 08:22, Lukasz Kalamarz wrote:
> > This lib was written in a different manner than all other libs,
> > which was causing some issues during refactoring. Previous
> > implementation was allocating data only in a state part of
> > batchbuffer.
> > New implementation take usage of splitting batch into two parts,
> > one for batch commands and second for various states.
> > 
> 
> This commit message is a bit unclear. There are no changes in how
> data 
> is allocated/written as both the old and the new implementations
> split 
> the batch; the difference is that the old style used 2 different 
> pointers (ptr and state) to access the 2 parts at the same time
> while 
> the new implementation re-uses the same pointer (ptr) and only
> access 
> one section at a time.
> 

Fixed that in new series

> Also, if I'm not missing anything after this patch there are no more 
> users of batch->state (grep only returns results in null_state_gen, 
> which has its own definition of intel_batchbuffer), so we can remove
> it 
> from the structure.
> 

Added new patch to remove state from intel_batchbuffer

> > Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
> > Cc: Katarzyna Dec <katarzyna.dec@intel.com>
> > Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> > ---
> 
> <snip>
> 
> > @@ -535,12 +531,27 @@ void gen7_render_copyfunc(struct
> > intel_batchbuffer *batch,
> >   			  unsigned width, unsigned height,
> >   			  struct igt_buf *dst, unsigned dst_x,
> > unsigned dst_y)
> >   {
> > +	uint32_t ps_binding_table, ps_sampler_off, ps_kernel_off;
> > +	uint32_t blend_state, cc_viewport;
> > +	uint32_t vertex_buffer;
> >   	uint32_t batch_end;
> >   
> >   	intel_batchbuffer_flush_with_context(batch, context);
> >   
> > -	batch->state = &batch->buffer[BATCH_STATE_SPLIT];
> > +	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
> >   
> > +
> > +	blend_state = gen7_create_blend_state(batch);
> > +	cc_viewport = gen7_create_cc_viewport(batch);
> > +	ps_sampler_off = gen7_create_sampler(batch);
> > +	ps_kernel_off = batch_copy(batch, ps_kernel,
> > sizeof(ps_kernel), 64);
> > +	vertex_buffer = gen7_create_vertex_buffer(batch,
> > +						  src_x, src_y,
> > +						  dst_x, dst_y,
> > +						  width, height);
> > +	ps_binding_table = gen7_bind_surfaces(batch, src, dst);
> > +
> 
> igt_assert(batch->ptr < &batch->buffer[4095]);
> 

Missed that. Fixed in new version

> > +	batch->ptr = batch->buffer;
> >   	OUT_BATCH(GEN7_PIPELINE_SELECT | PIPELINE_SELECT_3D);
> >   
> >   	gen7_emit_state_base_address(batch);
> > @@ -556,18 +567,18 @@ void gen7_render_copyfunc(struct
> > intel_batchbuffer *batch,
> >   	gen7_emit_wm(batch);
> >   	gen7_emit_streamout(batch);
> >   	gen7_emit_null_depth_buffer(batch);
> > -
> > -	gen7_emit_cc(batch);
> > -        gen7_emit_sampler(batch);
> > +	gen7_emit_cc(batch, blend_state, cc_viewport);
> > +	gen7_emit_sampler(batch, ps_sampler_off);
> >           gen7_emit_sbe(batch);
> > -        gen7_emit_ps(batch);
> > +	gen7_emit_ps(batch, ps_kernel_off);
> >           gen7_emit_vertex_elements(batch);
> > -        gen7_emit_vertex_buffer(batch,
> > -				src_x, src_y, dst_x, dst_y, width,
> > height);
> > -	gen7_emit_binding_table(batch, src, dst);
> > +	gen7_emit_vertex_buffer(batch, src_x, src_y,
> > +				dst_x, dst_y, width,
> > +				height, vertex_buffer);
> > +	gen7_emit_binding_table(batch, src, dst,
> > ps_binding_table);
> >   	gen7_emit_drawing_rectangle(batch, dst);
> >   
> > -        OUT_BATCH(GEN7_3DPRIMITIVE | (7- 2));
> > +	OUT_BATCH(GEN7_3DPRIMITIVE | (7 - 2));
> >           OUT_BATCH(GEN7_3DPRIMITIVE_VERTEX_SEQUENTIAL |
> > _3DPRIM_RECTLIST);
> >           OUT_BATCH(3);
> >           OUT_BATCH(0);
> > 
> 
> It might be worth adding a patch to change the spaces to tabs before 
> this one to have cleaner result. Not a blocker since it isn't
> strictly 
> related to this change.
> Daniele

Created a new patch to fix that.
---
Lukasz
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      reply	other threads:[~2018-04-17  9:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13 15:13 [igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Move batch functions from media/render/gpgpu libs Lukasz Kalamarz
2018-04-13 15:33 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2018-04-16  8:13 ` [igt-dev] [PATCH i-g-t] " Katarzyna Dec
2018-04-16 15:22 ` [igt-dev] [PATCH i-g-t v2 1/2] lib/rendercopy_gen7: Reorganizing batch allocations Lukasz Kalamarz
2018-04-16 15:22   ` [igt-dev] [PATCH i-g-t v2 2/2] lib/intel_batchbuffer: Move batch functions from media/render/gpgpu libs Lukasz Kalamarz
2018-04-16 20:50   ` [igt-dev] [PATCH i-g-t v2 1/2] lib/rendercopy_gen7: Reorganizing batch allocations Daniele Ceraolo Spurio
2018-04-17  9:13     ` Kalamarz, Lukasz [this message]

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=1523956410.3558.51.camel@intel.com \
    --to=lukasz.kalamarz@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=igt-dev@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.