kmscube: use drmModeAddFB2 version of ExtFB
[android/external-libkmsxx.git] / kmscube / cube-gbm.cpp
index 022c7618e23ca2ca12656fb3242b0b68b9affbc0..993434b186370429553e049efcc819b8cdf341f3 100644 (file)
@@ -9,8 +9,8 @@
 #include <xf86drmMode.h>
 #include <gbm.h>
 
-#include <kms++.h>
-#include "test.h"
+#include <kms++/kms++.h>
+#include <kms++util/kms++util.h>
 #include "cube-egl.h"
 #include "cube-gles2.h"
 
@@ -132,8 +132,13 @@ public:
                uint32_t height = gbm_bo_get_height(bo);
                uint32_t stride = gbm_bo_get_stride(bo);
                uint32_t handle = gbm_bo_get_handle(bo).u32;
+               PixelFormat format = (PixelFormat)gbm_bo_get_format(bo);
 
-               fb = new ExtFramebuffer(card, width, height, 24, 32, stride, handle);
+               uint32_t handles[4] { handle };
+               uint32_t strides[4] { stride };
+               uint32_t offsets[4] { 0 };
+
+               fb = new ExtFramebuffer(card, width, height, format, handles, strides, offsets);
 
                gbm_bo_set_user_data(bo, fb, drm_fb_destroy_callback);