[mutter] gpu-kms: assert on invalid flip attempts



commit 4282067e2475485a69bd0d0fa46dc1162124c5ec
Author: Pekka Paalanen <pekka paalanen collabora co uk>
Date:   Wed Oct 3 12:25:27 2018 +0300

    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.

 src/backends/native/meta-gpu-kms.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index c3c5d0d68..53a540b84 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -2,6 +2,7 @@
 
 /*
  * Copyright (C) 2017 Red Hat
+ * Copyright (c) 2018 DisplayLink (UK) Ltd.
  *
  * This program is free software; you can redistribute it and/or
  * 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_free (connectors);
 
+  g_assert (fb_id != 0);
+
   if (!gpu_kms->page_flips_not_supported)
     {
       MetaGpuKmsFlipClosureContainer *closure_container;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]