Merge branch 'universal-planes2' of git://github.com/jsarha/kmsxx
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 21 Mar 2017 13:04:24 +0000 (15:04 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 21 Mar 2017 13:04:24 +0000 (15:04 +0200)
kms++util/inc/kms++util/kms++util.h
utils/kmstest.cpp

index 3745a3181446131f80cdc9ccef7d93bd400330f0..c1e3c8c90963b0a9624e023b3d6df2ffdfa4601f 100644 (file)
@@ -63,3 +63,9 @@ void draw_test_pattern(IMappedFramebuffer &fb);
                fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
                exit(-1); \
        } while(0)
+
+#define EXIT_IF(x, fmt, ...) \
+       if (unlikely(x)) { \
+               fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
+               exit(-1); \
+       }
index 32dcb69c00cecc39d765062462d1a8156d57f352..e412f90869529a9c39ab915ab28421fc01e5bd56 100644 (file)
@@ -497,7 +497,9 @@ static vector<OutputInfo> setups_to_outputs(Card& card, ResourceManager& resman,
 
                        OutputInfo output = { };
                        output.connector = resman.reserve_connector(conn);
+                       EXIT_IF(!output.connector, "Failed to reserve connector %s", conn->fullname().c_str());
                        output.crtc = resman.reserve_crtc(conn);
+                       EXIT_IF(!output.crtc, "Failed to reserve crtc for %s", conn->fullname().c_str());
                        output.mode = output.connector->get_default_mode();
 
                        output.fbs = get_default_fb(card, output.mode.hdisplay, output.mode.vdisplay);