mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 22:52:20 +00:00
wlr_linux_dmabuf_v1: use enum_is_valid functions
Signed-off-by: xurui <xurui@kylinos.cn>
This commit is contained in:
parent
cda6fdffac
commit
81fa6c4b96
@ -266,10 +266,8 @@ static void params_create_common(struct wl_resource *params_resource,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* reject unknown flags */
|
/* reject unknown flags */
|
||||||
uint32_t all_flags = ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT |
|
uint32_t version = wl_resource_get_version(params_resource);
|
||||||
ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED |
|
if (!zwp_linux_buffer_params_v1_flags_is_valid(flags, version)) {
|
||||||
ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST;
|
|
||||||
if (flags & ~all_flags) {
|
|
||||||
wl_resource_post_error(params_resource,
|
wl_resource_post_error(params_resource,
|
||||||
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT,
|
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT,
|
||||||
"Unknown dmabuf flags %"PRIu32, flags);
|
"Unknown dmabuf flags %"PRIu32, flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user