[PATCH 3/7] etnaviv: implement handling for large number of clip rects in vr_op

Russell King rmk at armlinux.org.uk
Tue Nov 22 19:22:44 UTC 2016


On Tue, Nov 22, 2016 at 02:31:42PM +0000, Russell King wrote:
> On Tue, Nov 22, 2016 at 12:44:16PM +0100, Lucas Stach wrote:
> > Unlike de_op, vr_op had no way to deal with a large number of clip rects
> > which would make the draw operation overflow a single command stream
> > buffer.
> > 
> > Implement splitting the draw operation into multiple chunks, to be able
> > to submit them to the kernel in several pieces.
> > 
> > Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> > ---
> >  etnaviv/etnaviv_op.c | 13 ++++++++++---
> >  1 file changed, 10 insertions(+), 3 deletions(-)
> > 
> > diff --git a/etnaviv/etnaviv_op.c b/etnaviv/etnaviv_op.c
> > index 838438a7c740..e8f87ef73e81 100644
> > --- a/etnaviv/etnaviv_op.c
> > +++ b/etnaviv/etnaviv_op.c
> > @@ -419,7 +419,7 @@ void etnaviv_vr_op(struct etnaviv *etnaviv, struct etnaviv_vr_op *op,
> >  
> >  	etnaviv_set_dest_bo(etnaviv, &op->dst, op->cmd);
> >  
> > -	EL_START(etnaviv, 10 + 8 * n);
> > +	EL_START(etnaviv, 10);
> >  	EL(LOADSTATE(VIVS_DE_ALPHA_CONTROL, 1));
> >  	EL(VIVS_DE_ALPHA_CONTROL_ENABLE_OFF);
> >  
> > @@ -433,9 +433,15 @@ void etnaviv_vr_op(struct etnaviv *etnaviv, struct etnaviv_vr_op *op,
> >  	   VIVS_DE_VR_SOURCE_IMAGE_LOW_TOP(op->src_bounds.y1));
> >  	EL(VIVS_DE_VR_SOURCE_IMAGE_HIGH_RIGHT(op->src_bounds.x2) |
> >  	   VIVS_DE_VR_SOURCE_IMAGE_HIGH_BOTTOM(op->src_bounds.y2));
> > -	EL_ALIGN();
> > +	EL_END();
> > +	BATCH_SETUP_END(etnaviv);
> >  
> >  	while (n--) {
> > +		unsigned int high_wm = etnaviv->batch_de_high_watermark;
> > +		if (8 > high_wm - etnaviv->batch_size) {
> > +			etnaviv_emit(etnaviv);
> > +			BATCH_OP_START(etnaviv);
> > +		}
> 
> The high watermark doesn't apply here - that's there for the extra
> states which etnaviv_de_end() adds after the DE operation, which is
> not necessary after a VR operation.  So, you should be using:
> 
> 		if (8 > MAX_BATCH_SIZE - etnaviv->batch_size) {
> 
> here.

In addition, this patch causes:

../../etnaviv/etnaviv_op.c: In function 'etnaviv_vr_op':
../../etnaviv/etnaviv_op.c:445:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   BoxRec box = *boxes++;
   ^

Please rework to avoid the warning as well.

-- 
Russell King


More information about the etnaviv mailing list