drm/radeon: don't allow RADEON_GEM_DOMAIN_CPU for command submission
[cascardo/linux.git] / drivers / gpu / drm / radeon / radeon_cs.c
index 4b6f5b8..41ecf8a 100644 (file)
@@ -152,6 +152,12 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
                        uint32_t domain = r->write_domain ?
                                r->write_domain : r->read_domains;
 
+                       if (domain & RADEON_GEM_DOMAIN_CPU) {
+                               DRM_ERROR("RADEON_GEM_DOMAIN_CPU is not valid "
+                                         "for command submission\n");
+                               return -EINVAL;
+                       }
+
                        p->relocs[i].domain = domain;
                        if (domain == RADEON_GEM_DOMAIN_VRAM)
                                domain |= RADEON_GEM_DOMAIN_GTT;