Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/gem: Demote userspace errors to DRM_UT_DRIVER

Error messages resulting from incorrect usage of the kernel uabi should
not spam dmesg by default. But it is useful to enable them to debug
userspace. So demote to DRM_UT_DRIVER.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/564189/

+24 -18
+3 -3
drivers/gpu/drm/msm/msm_gem.c
··· 226 226 227 227 msm_gem_assert_locked(obj); 228 228 229 - if (GEM_WARN_ON(msm_obj->madv > madv)) { 230 - DRM_DEV_ERROR(obj->dev->dev, "Invalid madv state: %u vs %u\n", 231 - msm_obj->madv, madv); 229 + if (msm_obj->madv > madv) { 230 + DRM_DEV_DEBUG_DRIVER(obj->dev->dev, "Invalid madv state: %u vs %u\n", 231 + msm_obj->madv, madv); 232 232 return ERR_PTR(-EBUSY); 233 233 } 234 234
+21 -15
drivers/gpu/drm/msm/msm_gem_submit.c
··· 17 17 #include "msm_gem.h" 18 18 #include "msm_gpu_trace.h" 19 19 20 + /* For userspace errors, use DRM_UT_DRIVER.. so that userspace can enable 21 + * error msgs for debugging, but we don't spam dmesg by default 22 + */ 23 + #define SUBMIT_ERROR(submit, fmt, ...) \ 24 + DRM_DEV_DEBUG_DRIVER((submit)->dev->dev, fmt, ##__VA_ARGS__) 25 + 20 26 /* 21 27 * Cmdstream submission: 22 28 */ ··· 142 136 143 137 if ((submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) || 144 138 !(submit_bo.flags & MANDATORY_FLAGS)) { 145 - DRM_ERROR("invalid flags: %x\n", submit_bo.flags); 139 + SUBMIT_ERROR(submit, "invalid flags: %x\n", submit_bo.flags); 146 140 ret = -EINVAL; 147 141 i = 0; 148 142 goto out; ··· 164 158 */ 165 159 obj = idr_find(&file->object_idr, submit->bos[i].handle); 166 160 if (!obj) { 167 - DRM_ERROR("invalid handle %u at index %u\n", submit->bos[i].handle, i); 161 + SUBMIT_ERROR(submit, "invalid handle %u at index %u\n", submit->bos[i].handle, i); 168 162 ret = -EINVAL; 169 163 goto out_unlock; 170 164 } ··· 208 202 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF: 209 203 break; 210 204 default: 211 - DRM_ERROR("invalid type: %08x\n", submit_cmd.type); 205 + SUBMIT_ERROR(submit, "invalid type: %08x\n", submit_cmd.type); 212 206 return -EINVAL; 213 207 } 214 208 215 209 if (submit_cmd.size % 4) { 216 - DRM_ERROR("non-aligned cmdstream buffer size: %u\n", 217 - submit_cmd.size); 210 + SUBMIT_ERROR(submit, "non-aligned cmdstream buffer size: %u\n", 211 + submit_cmd.size); 218 212 ret = -EINVAL; 219 213 goto out; 220 214 } ··· 312 306 313 307 fail: 314 308 if (ret == -EALREADY) { 315 - DRM_ERROR("handle %u at index %u already on submit list\n", 316 - submit->bos[i].handle, i); 309 + SUBMIT_ERROR(submit, "handle %u at index %u already on submit list\n", 310 + submit->bos[i].handle, i); 317 311 ret = -EINVAL; 318 312 } 319 313 ··· 454 448 struct drm_gem_object **obj, uint64_t *iova, bool *valid) 455 449 { 456 450 if (idx >= submit->nr_bos) { 457 - DRM_ERROR("invalid buffer index: %u (out of %u)\n", 458 - idx, submit->nr_bos); 451 + SUBMIT_ERROR(submit, "invalid buffer index: %u (out of %u)\n", 452 + idx, submit->nr_bos); 459 453 return -EINVAL; 460 454 } 461 455 ··· 481 475 return 0; 482 476 483 477 if (offset % 4) { 484 - DRM_ERROR("non-aligned cmdstream buffer: %u\n", offset); 478 + SUBMIT_ERROR(submit, "non-aligned cmdstream buffer: %u\n", offset); 485 479 return -EINVAL; 486 480 } 487 481 ··· 503 497 bool valid; 504 498 505 499 if (submit_reloc.submit_offset % 4) { 506 - DRM_ERROR("non-aligned reloc offset: %u\n", 507 - submit_reloc.submit_offset); 500 + SUBMIT_ERROR(submit, "non-aligned reloc offset: %u\n", 501 + submit_reloc.submit_offset); 508 502 ret = -EINVAL; 509 503 goto out; 510 504 } ··· 514 508 515 509 if ((off >= (obj->size / 4)) || 516 510 (off < last_offset)) { 517 - DRM_ERROR("invalid offset %u at reloc %u\n", off, i); 511 + SUBMIT_ERROR(submit, "invalid offset %u at reloc %u\n", off, i); 518 512 ret = -EINVAL; 519 513 goto out; 520 514 } ··· 887 881 if (!submit->cmd[i].size || 888 882 ((submit->cmd[i].size + submit->cmd[i].offset) > 889 883 obj->size / 4)) { 890 - DRM_ERROR("invalid cmdstream size: %u\n", submit->cmd[i].size * 4); 884 + SUBMIT_ERROR(submit, "invalid cmdstream size: %u\n", submit->cmd[i].size * 4); 891 885 ret = -EINVAL; 892 886 goto out; 893 887 } ··· 899 893 900 894 if (!gpu->allow_relocs) { 901 895 if (submit->cmd[i].nr_relocs) { 902 - DRM_ERROR("relocs not allowed\n"); 896 + SUBMIT_ERROR(submit, "relocs not allowed\n"); 903 897 ret = -EINVAL; 904 898 goto out; 905 899 }