X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fvc4%2Fvc4_job.c;h=e71f6f4cf9105ba7db8a7924e7776662f8c2c569;hb=774a556b6dc0d49f9f29c438349a66e69062e6e4;hp=41660f6ac4daffef78ecddb32dc2be651a7ab6ff;hpb=3fba517bdd03551f7c7ff21dfe1896c677cbccda;p=mesa.git diff --git a/src/gallium/drivers/vc4/vc4_job.c b/src/gallium/drivers/vc4/vc4_job.c index 41660f6ac4d..e71f6f4cf91 100644 --- a/src/gallium/drivers/vc4/vc4_job.c +++ b/src/gallium/drivers/vc4/vc4_job.c @@ -170,11 +170,37 @@ vc4_submit_setup_rcl_msaa_surface(struct vc4_context *vc4, void vc4_job_submit(struct vc4_context *vc4) { + if (!vc4->needs_flush) + return; + + /* The RCL setup would choke if the draw bounds cause no drawing, so + * just drop the drawing if that's the case. + */ + if (vc4->draw_max_x <= vc4->draw_min_x || + vc4->draw_max_y <= vc4->draw_min_y) { + vc4_job_reset(vc4); + return; + } + if (vc4_debug & VC4_DEBUG_CL) { fprintf(stderr, "BCL:\n"); vc4_dump_cl(vc4->bcl.base, cl_offset(&vc4->bcl), false); } + if (cl_offset(&vc4->bcl) > 0) { + /* Increment the semaphore indicating that binning is done and + * unblocking the render thread. Note that this doesn't act + * until the FLUSH completes. + */ + cl_ensure_space(&vc4->bcl, 8); + struct vc4_cl_out *bcl = cl_start(&vc4->bcl); + cl_u8(&bcl, VC4_PACKET_INCREMENT_SEMAPHORE); + /* The FLUSH caps all of our bin lists with a + * VC4_PACKET_RETURN. + */ + cl_u8(&bcl, VC4_PACKET_FLUSH); + cl_end(&vc4->bcl, bcl); + } struct drm_vc4_submit_cl submit; memset(&submit, 0, sizeof(submit));