freedreno: Add layout_resource_for_modifier screen vfunc
[mesa.git] / src / gallium / drivers / vc4 / kernel / vc4_validate.c
index a9dce1fa3796c79d6cebb002702fdcb36aa09b5f..bd193b993b321e460760e5da6a66ddd20d89e1a8 100644 (file)
@@ -780,11 +780,6 @@ validate_gl_shader_rec(struct drm_device *dev,
        exec->shader_rec_v += roundup(packet_size, 16);
        exec->shader_rec_size -= packet_size;
 
-       if (!(*(uint16_t *)pkt_u & VC4_SHADER_FLAG_FS_SINGLE_THREAD)) {
-               DRM_ERROR("Multi-threaded fragment shaders not supported.\n");
-               return -EINVAL;
-       }
-
        for (i = 0; i < shader_reloc_count; i++) {
                if (src_handles[i] > exec->bo_count) {
                        DRM_ERROR("Shader handle %d too big\n", src_handles[i]);
@@ -801,6 +796,18 @@ validate_gl_shader_rec(struct drm_device *dev,
                        return -EINVAL;
        }
 
+       if (((*(uint16_t *)pkt_u & VC4_SHADER_FLAG_FS_SINGLE_THREAD) == 0) !=
+           to_vc4_bo(&bo[0]->base)->validated_shader->is_threaded) {
+               DRM_ERROR("Thread mode of CL and FS do not match\n");
+               return -EINVAL;
+       }
+
+       if (to_vc4_bo(&bo[1]->base)->validated_shader->is_threaded ||
+           to_vc4_bo(&bo[2]->base)->validated_shader->is_threaded) {
+               DRM_ERROR("cs and vs cannot be threaded\n");
+               return -EINVAL;
+       }
+
        for (i = 0; i < shader_reloc_count; i++) {
                struct vc4_validated_shader_info *validated_shader;
                uint32_t o = shader_reloc_offsets[i];