mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-07-02 04:06:35 +00:00
kms_addfb_basic: Require fb modifiers for unused field tests
The drm core doesn't check unused fields of ADDFB2 for pre-FB_MODIFIERS userspace, so use igt_require_fb_modifiers(). Also, the size of the ioctl changed with the addition of the modifiers, so it is necessary to use the LOCAL_ version of it, otherwise some data may get truncated. v2: Improve commit message. (Thomas) Remove one spurious change to use LOCAL_DRM_IOCTL_ADDFB2. (Thomas) Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
parent
2269997cff
commit
6eed1b5eb4
@ -63,30 +63,40 @@ static void invalid_tests(int fd)
|
||||
f.fb_id = 0;
|
||||
}
|
||||
|
||||
f.flags = LOCAL_DRM_MODE_FB_MODIFIERS;
|
||||
|
||||
igt_subtest("unused-handle") {
|
||||
igt_require_fb_modifiers(fd);
|
||||
|
||||
f.handles[1] = gem_bo_small;
|
||||
igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
|
||||
igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
|
||||
errno == EINVAL);
|
||||
f.handles[1] = 0;
|
||||
}
|
||||
|
||||
igt_subtest("unused-pitches") {
|
||||
igt_require_fb_modifiers(fd);
|
||||
|
||||
f.pitches[1] = 512;
|
||||
igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
|
||||
igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
|
||||
errno == EINVAL);
|
||||
f.pitches[1] = 0;
|
||||
}
|
||||
|
||||
igt_subtest("unused-offsets") {
|
||||
igt_require_fb_modifiers(fd);
|
||||
|
||||
f.offsets[1] = 512;
|
||||
igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
|
||||
igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
|
||||
errno == EINVAL);
|
||||
f.offsets[1] = 0;
|
||||
}
|
||||
|
||||
igt_subtest("unused-modifier") {
|
||||
igt_require_fb_modifiers(fd);
|
||||
|
||||
f.modifier[1] = LOCAL_I915_FORMAT_MOD_X_TILED;
|
||||
igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
|
||||
igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
|
||||
errno == EINVAL);
|
||||
f.modifier[1] = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user