From 69dcd23c6091420d42ec2ed021c2e6f379217a25 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 14 Nov 2019 15:23:42 +0200 Subject: [PATCH] libweston: drop a misleading dmabuf comment This comment was added in 230f3b1bf896fcf3fa76b4d7093122b3361f7e36 with the intent that if we had an information table about pixel formats (which we do have today), we could implement more sanity checks like ensuring that width pixels fit into stride. Daniel Vetter said on #dri-devel IRC recently: < danvet> since userspace shouldn't look at stride for buffers with modifiers, only pass it around unchanged I asked for clarification. It was expected that userspace would not do any kind of sanity checks as modifiers could change everything. Let's remove the misleading code comment so that people don't get the idea of adding more well-intended but ill-advised sanity checks. If more checks are added, they must take the modifier into account, which the existing checks do not do. After 5 years, it is far too late to remove our existing sanity checks, but we can attempt to not cause any more damage that would restrict what people can do in the kernel. Signed-off-by: Pekka Paalanen --- libweston/linux-dmabuf.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libweston/linux-dmabuf.c b/libweston/linux-dmabuf.c index d63f109b..48b16e16 100644 --- a/libweston/linux-dmabuf.c +++ b/libweston/linux-dmabuf.c @@ -259,12 +259,6 @@ params_create_common(struct wl_client *client, } } - /* XXX: Some additional sanity checks could be done with respect - * to the fourcc format. A centralized collection (kernel or - * libdrm) would be useful to avoid code duplication for these - * checks (e.g. drm_format_num_planes). - */ - if (!weston_compositor_import_dmabuf(buffer->compositor, buffer)) goto err_failed;