drm/msm: Reject fb creation from _NO_SHARE objs

It would be an error to map these into kms->vm.  So reject this as early
as possible, when creating an fb.

Fixes: b58e12a66e ("drm/msm: Add _NO_SHARE flag")
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/714264/
Message-ID: <20260325185926.1265661-1-robin.clark@oss.qualcomm.com>
This commit is contained in:
Rob Clark 2026-03-25 11:59:26 -07:00
parent d4ef6d77bb
commit cf50ccdb76

View File

@ -219,7 +219,12 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
+ mode_cmd->offsets[i];
if (bos[i]->size < min_size) {
ret = -EINVAL;
ret = UERR(EINVAL, dev, "plane %d too small", i);
goto fail;
}
if (to_msm_bo(bos[i])->flags & MSM_BO_NO_SHARE) {
ret = UERR(EINVAL, dev, "Cannot map _NO_SHARE to kms vm");
goto fail;
}