diff options
author | Eric Anholt <eric@anholt.net> | 2015-07-28 10:11:08 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2015-07-28 19:35:26 -0700 |
commit | 044f7bbda077ea7029fb1004183b29127307bd84 (patch) | |
tree | 93a1002a8907fcf8d372d01d48ff2586f4e50d93 /src/gallium/drivers/vc4/vc4_simulator.c | |
parent | 22954db71cd1d8d9ef6e5a16f568e4b3c7845777 (diff) |
vc4: Keep the validated shader around for the simulator execution.
This more closely matches the kernel behavior on shader validation now.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_simulator.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_simulator.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_simulator.c b/src/gallium/drivers/vc4/vc4_simulator.c index b58013dd2ee..4097dce28a7 100644 --- a/src/gallium/drivers/vc4/vc4_simulator.c +++ b/src/gallium/drivers/vc4/vc4_simulator.c @@ -79,6 +79,7 @@ vc4_simulator_pin_bos(struct drm_device *dev, struct vc4_exec_info *exec) struct vc4_bo *bo = bos[i]; struct drm_gem_cma_object *obj = vc4_wrap_bo_with_cma(dev, bo); + struct drm_vc4_bo *drm_bo = to_vc4_bo(&obj->base); #if 0 fprintf(stderr, "bo hindex %d: %s\n", i, bo->name); #endif @@ -87,6 +88,15 @@ vc4_simulator_pin_bos(struct drm_device *dev, struct vc4_exec_info *exec) memcpy(obj->vaddr, bo->map, bo->size); exec->bo[i].bo = obj; + + /* The kernel does this validation at shader create ioctl + * time. + */ + if (strcmp(bo->name, "code") == 0) { + drm_bo->validated_shader = vc4_validate_shader(obj); + if (!drm_bo->validated_shader) + abort(); + } } return 0; } |