summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-04-09 17:54:42 -0700
committerEric Anholt <eric@anholt.net>2015-06-04 14:15:33 -0700
commitb774b5bdd312250829d8cf2b0f0224368a059949 (patch)
treed2a3e7f2c4efd7c11d46e3c053385dc2937f4ccc
parent527817b1970f00b0179b045012b762579b2fc859 (diff)
downloadlinux-b774b5bdd312250829d8cf2b0f0224368a059949.tar.gz
drm/vc4: Add support for jobs without a bin CL.
This is useful for doing blit operations using the render engine, which can perform reads from raster textures into a tiled output, when the texture fetch engine has proved incapable of fetching correctly. Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/vc4/vc4_drv.h1
-rw-r--r--drivers/gpu/drm/vc4/vc4_gem.c5
-rw-r--r--drivers/gpu/drm/vc4/vc4_validate.c9
3 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
index 28f9f58c4dd9..aa6592dd1fc9 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.h
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
@@ -428,6 +428,7 @@ vc4_validate_cl(struct drm_device *dev,
void *unvalidated,
uint32_t len,
bool is_bin,
+ bool has_bin,
struct vc4_exec_info *exec);
int
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index 8843c4cf9948..a6e5be04697b 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -210,7 +210,8 @@ vc4_submit_next_job(struct drm_device *dev)
V3D_WRITE(V3D_BPOA, 0);
V3D_WRITE(V3D_BPOS, 0);
- submit_cl(dev, 0, exec->ct0ca, exec->ct0ea);
+ if (exec->ct0ca != exec->ct0ea)
+ submit_cl(dev, 0, exec->ct0ca, exec->ct0ea);
submit_cl(dev, 1, exec->ct1ca, exec->ct1ea);
}
@@ -434,6 +435,7 @@ vc4_cl_validate(struct drm_device *dev, struct vc4_exec_info *exec)
bin,
args->bin_cl_size,
true,
+ args->bin_cl_size != 0,
exec);
if (ret)
goto fail;
@@ -443,6 +445,7 @@ vc4_cl_validate(struct drm_device *dev, struct vc4_exec_info *exec)
render,
args->render_cl_size,
false,
+ args->bin_cl_size != 0,
exec);
if (ret)
goto fail;
diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c
index 02eac4f0b5e7..79657939dcf2 100644
--- a/drivers/gpu/drm/vc4/vc4_validate.c
+++ b/drivers/gpu/drm/vc4/vc4_validate.c
@@ -702,6 +702,7 @@ vc4_validate_cl(struct drm_device *dev,
void *unvalidated,
uint32_t len,
bool is_bin,
+ bool has_bin,
struct vc4_exec_info *exec)
{
uint32_t dst_offset = 0;
@@ -772,7 +773,7 @@ vc4_validate_cl(struct drm_device *dev,
if (is_bin) {
exec->ct0ea = exec->ct0ca + dst_offset;
- if (!exec->found_start_tile_binning_packet) {
+ if (has_bin && !exec->found_start_tile_binning_packet) {
DRM_ERROR("Bin CL missing VC4_PACKET_START_TILE_BINNING\n");
return -EINVAL;
}
@@ -786,8 +787,10 @@ vc4_validate_cl(struct drm_device *dev,
* increment from the bin CL. Otherwise a later submit would
* have render execute immediately.
*/
- if (!exec->found_wait_on_semaphore_packet) {
- DRM_ERROR("Render CL missing VC4_PACKET_WAIT_ON_SEMAPHORE\n");
+ if (exec->found_wait_on_semaphore_packet != has_bin) {
+ DRM_ERROR("Render CL %s VC4_PACKET_WAIT_ON_SEMAPHORE\n",
+ exec->found_wait_on_semaphore_packet ?
+ "has" : "missing");
return -EINVAL;
}
exec->ct1ea = exec->ct1ca + dst_offset;