From 076f7ea22e8577ff5049c33952d655ac3b388d06 Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 15 Feb 2013 10:26:45 +0100 Subject: [PATCH] Add more basic debugging to KMS/EGL. --- gfx/context/drm_egl_ctx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gfx/context/drm_egl_ctx.c b/gfx/context/drm_egl_ctx.c index 41fb4c041f..5097428b7f 100644 --- a/gfx/context/drm_egl_ctx.c +++ b/gfx/context/drm_egl_ctx.c @@ -288,7 +288,7 @@ static bool gfx_ctx_init(void) g_connector = NULL; } - // TODO: Figure out what index for crtcs to use ... + // TODO: Figure out what index for crtcs to use for orig_crtc ... g_orig_crtc = drmModeGetCrtc(g_drm_fd, g_resources->crtcs[0]); if (!g_orig_crtc) RARCH_WARN("[KMS/EGL]: Cannot find original CRTC.\n"); @@ -302,6 +302,7 @@ static bool gfx_ctx_init(void) for (int i = 0, area = 0; i < g_connector->count_modes; i++) { drmModeModeInfo *current_mode = &g_connector->modes[i]; + //RARCH_ERR("[KMS/EGL]: Found mode: \"%s\".\n", current_mode->name); int current_area = current_mode->hdisplay * current_mode->vdisplay; if (current_area > area) { @@ -310,6 +311,7 @@ static bool gfx_ctx_init(void) } } + if (!g_drm_mode) { RARCH_ERR("[KMS/EGL]: Couldn't find DRM mode.\n"); @@ -381,6 +383,8 @@ static struct drm_fb *drm_fb_get_from_bo(struct gbm_bo *bo) unsigned stride = gbm_bo_get_stride(bo); unsigned handle = gbm_bo_get_handle(bo).u32; + RARCH_LOG("[KMS/EGL]: New FB: %ux%u (stride: %u).\n", width, height, stride); + int ret = drmModeAddFB(g_drm_fd, width, height, 24, 32, stride, handle, &fb->fb_id); if (ret < 0) {