feat: add layer debugging via libliftoff log

Activate libliftoff's internal log when layers are enabled and the parameter
'd' is provided.

Note: this needs some patches to libliftoff to make the debug readable that I
have proposed upstream.
This commit is contained in:
Roman Gilg 2020-02-26 00:38:57 +01:00
parent d17f234738
commit 8833e07618
3 changed files with 12 additions and 3 deletions

View file

@ -27,6 +27,7 @@ uint32_t g_nDRMFormat;
bool g_bRotated;
bool g_bUseLayers;
bool g_bDebugLayers;
static int s_drm_log = 0;
@ -459,6 +460,10 @@ int init_drm(struct drm_t *drm, const char *device, const char *mode_str, unsign
g_nOutputHeight = drm->mode->hdisplay;
}
if (g_bUseLayers) {
liftoff_log_init(g_bDebugLayers ? LIFTOFF_DEBUG : LIFTOFF_ERROR, NULL);
}
drm->lo_device = liftoff_device_create( drm->fd );
drm->lo_output = liftoff_output_create( drm->lo_device, drm->crtc_id );
@ -702,7 +707,7 @@ bool drm_can_avoid_composite( struct drm_t *drm, struct Composite_t *pComposite,
liftoff_layer_set_property( drm->lo_layers[ i ], "rotation", DRM_MODE_ROTATE_270);
}
if ( pPipeline->layerBindings[ i ].fbid == 0 )
if ( pPipeline->layerBindings[ i ].fbid != 0 )
{
return false;
}

View file

@ -86,6 +86,7 @@ extern uint32_t g_nDRMFormat;
extern bool g_bUseLayers;
extern bool g_bRotated;
extern bool g_bDebugLayers;
int init_drm(struct drm_t *drm, const char *device, const char *mode_str, unsigned int vrefresh);
int drm_atomic_commit(struct drm_t *drm, struct Composite_t *pComposite, struct VulkanPipeline_t *pPipeline );

View file

@ -59,7 +59,7 @@ int main(int argc, char **argv)
bool bSleepAtStartup = false;
while ((o = getopt (argc, argv, ":R:T:w:h:W:H:r:NSvVecslnb")) != -1)
while ((o = getopt (argc, argv, ":R:T:w:h:W:H:r:NSvVecsdlnb")) != -1)
{
switch (o) {
case 'w':
@ -83,6 +83,9 @@ int main(int argc, char **argv)
case 'l':
g_bUseLayers = true;
break;
case 'd':
g_bDebugLayers = true;
break;
case 'n':
g_bFilterGameWindow = false;
break;