Lines Matching +full:m +full:- +full:class
1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright (c) 2010-2020 NVIDIA Corporation */
14 u32 class; member
19 if (fw->pos == fw->end) in fw_next()
20 return -EINVAL; in fw_next()
22 *word = fw->data[fw->pos++]; in fw_next()
31 for (i = 0; i < fw->submit->num_used_mappings; i++) { in fw_check_addr_valid()
32 struct tegra_drm_mapping *m = fw->submit->used_mappings[i].mapping; in fw_check_addr_valid() local
34 if (offset >= m->iova && offset <= m->iova_end) in fw_check_addr_valid()
51 if (!fw->client->ops->is_addr_reg) in fw_check_reg()
54 is_addr = fw->client->ops->is_addr_reg(fw->client->base.dev, fw->class, in fw_check_reg()
61 return -EINVAL; in fw_check_reg()
73 return -EINVAL; in fw_check_regs_seq()
90 return -EINVAL; in fw_check_regs_mask()
100 if (!fw->client->ops->is_addr_reg) in fw_check_regs_imm()
103 is_addr = fw->client->ops->is_addr_reg(fw->client->base.dev, fw->class, in fw_check_regs_imm()
106 return -EINVAL; in fw_check_regs_imm()
111 static int fw_check_class(struct tegra_drm_firewall *fw, u32 class) in fw_check_class() argument
113 if (!fw->client->ops->is_valid_class) { in fw_check_class()
114 if (class == fw->client->base.class) in fw_check_class()
117 return -EINVAL; in fw_check_class()
120 if (!fw->client->ops->is_valid_class(class)) in fw_check_class()
121 return -EINVAL; in fw_check_class()
154 .class = *job_class, in tegra_drm_fw_validate()
161 u32 word, opcode, offset, count, mask, class; in tegra_drm_fw_validate() local
173 class = (word >> 6) & 0x3ff; in tegra_drm_fw_validate()
174 err = fw_check_class(&fw, class); in tegra_drm_fw_validate()
175 fw.class = class; in tegra_drm_fw_validate()
176 *job_class = class; in tegra_drm_fw_validate()
180 dev_warn(client->base.dev, in tegra_drm_fw_validate()
181 "illegal SETCLASS(offset=0x%x, mask=0x%x, class=0x%x) at word %u", in tegra_drm_fw_validate()
182 offset, mask, class, fw.pos-1); in tegra_drm_fw_validate()
189 dev_warn(client->base.dev, in tegra_drm_fw_validate()
190 "illegal INCR(offset=0x%x, count=%u) in class 0x%x at word %u", in tegra_drm_fw_validate()
191 offset, count, fw.class, fw.pos-1); in tegra_drm_fw_validate()
198 dev_warn(client->base.dev, in tegra_drm_fw_validate()
199 "illegal NONINCR(offset=0x%x, count=%u) in class 0x%x at word %u", in tegra_drm_fw_validate()
200 offset, count, fw.class, fw.pos-1); in tegra_drm_fw_validate()
207 dev_warn(client->base.dev, in tegra_drm_fw_validate()
208 "illegal MASK(offset=0x%x, mask=0x%x) in class 0x%x at word %u", in tegra_drm_fw_validate()
209 offset, mask, fw.class, fw.pos-1); in tegra_drm_fw_validate()
216 dev_warn(client->base.dev, in tegra_drm_fw_validate()
217 "illegal IMM(offset=0x%x) in class 0x%x at word %u", in tegra_drm_fw_validate()
218 offset, fw.class, fw.pos-1); in tegra_drm_fw_validate()
226 return -EINVAL; in tegra_drm_fw_validate()
231 dev_warn(client->base.dev, in tegra_drm_fw_validate()
232 "illegal INCR_W(offset=0x%x) in class 0x%x at word %u", in tegra_drm_fw_validate()
233 offset, fw.class, fw.pos-1); in tegra_drm_fw_validate()
237 return -EINVAL; in tegra_drm_fw_validate()
242 dev_warn(client->base.dev, in tegra_drm_fw_validate()
243 "illegal NONINCR(offset=0x%x) in class 0x%x at word %u", in tegra_drm_fw_validate()
244 offset, fw.class, fw.pos-1); in tegra_drm_fw_validate()
247 dev_warn(client->base.dev, "illegal opcode at word %u", in tegra_drm_fw_validate()
248 fw.pos-1); in tegra_drm_fw_validate()
249 return -EINVAL; in tegra_drm_fw_validate()