gpu-kms: assert on invalid flip attempts

drmModePageFlip() is guaranteed to fail for the invalid FB id 0.
Therefore it never makes sense to call this function with such argument.
Disabling a CRTC must be done with SetCrtc instead, for example.

Trying to flip to FB 0 not only fails, but it also causes Mutter to
never try page flip on this output again, using drmModeSetCrtc()
instead.
This commit is contained in:
Pekka Paalanen 2018-10-03 12:25:27 +03:00 committed by Ray Strode
parent 85e9784a22
commit 4282067e24

View File

@ -2,6 +2,7 @@
/* /*
* Copyright (C) 2017 Red Hat * Copyright (C) 2017 Red Hat
* Copyright (c) 2018 DisplayLink (UK) Ltd.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
@ -257,6 +258,8 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
g_assert (n_connectors > 0); g_assert (n_connectors > 0);
g_free (connectors); g_free (connectors);
g_assert (fb_id != 0);
if (!gpu_kms->page_flips_not_supported) if (!gpu_kms->page_flips_not_supported)
{ {
MetaGpuKmsFlipClosureContainer *closure_container; MetaGpuKmsFlipClosureContainer *closure_container;