Skip to content
Snippets Groups Projects
Commit c78dc6f3 authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by François Cartegnie
Browse files

kms: abort early if drm is not available

This is not using drmAvailable() which only checks against minor=0,
since card0 might not be available or not support DRM while card1 might
support it and be selected by --kms-device.

In addition, print the debug information about the current underlying
DRM driver implementation used. Note that according to NVidia's DRM
documentation[^1]:

    DRM-NVDC does not populate the drmVersionPtr structure's date,
    major, minor, and patchlevel fields.

[^1]: https://docs.nvidia.com/jetson/l4t-graphics/group__direct__rendering__manager.html#gaabb52f28bfc81b9af64866f88131d513
parent 2a8106a8
No related branches found
No related tags found
1 merge request!893Split KMS into window module and fix current behaviour
......@@ -383,6 +383,25 @@ static int OpenWindow(vout_window_t *wnd)
free(psz_device);
goto error_end;
}
drmVersionPtr version;
if ((version = drmGetVersion(sys->drm_fd)) != NULL)
{
const char *date = version->date ? version->date : "unknown";
const char *desc = version->desc ? version->desc : "unknown";
msg_Dbg(wnd, "Using DRM driver %s version %d.%d.%d (build %s): %s",
version->name, version->version_major, version->version_minor,
version->version_patchlevel, date, desc);
drmFreeVersion(version);
}
else
{
msg_Err(wnd, "device %s doesn't support DRM", psz_device);
free(psz_device);
goto error_drm;
}
free(psz_device);
drmSetClientCap(sys->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment