Bug 238944 - multimedia/mpv: support DRM console output
Summary: multimedia/mpv: support DRM console output
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Carlos J. Puga Medina
Keywords: patch, patch-ready
Depends on:
Reported: 2019-07-02 20:03 UTC by sigsys
Modified: 2020-04-22 12:27 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cpm)


Note You need to log in before you can comment on or make changes to this bug.
Description sigsys 2019-07-02 20:03:55 UTC
Seems like FreeBSD supports the VT management API that mpv expects but with declarations in the sys/consio.h header instead of sys/vt.h.

With this patch playing videos directly on the console (when DRM/KMS is supported) works on my computer.

$ mpv -vo gpu --gpu-context=drm <video-file>

Switching VT while it's running (even if paused) unfortunately doesn't work very well (and crashes the X server if you switch to it). Still pretty neat that it does play the video though.


--- wscript.orig	2018-10-02 19:03:41 UTC
+++ wscript
@@ -273,7 +273,7 @@ iconv support use --disable-iconv.",
     }, {
         'name': 'vt.h',
         'desc': 'vt.h',
-        'func': check_statement(['sys/vt.h', 'sys/ioctl.h'],
+        'func': check_statement(['sys/consio.h', 'sys/ioctl.h'],
                                 'int m; ioctl(0, VT_GETMODE, &m)'),
     }, {
         'name': 'gbm.h',

--- video/out/drm_common.c.orig	2018-10-02 19:03:41 UTC
+++ video/out/drm_common.c
@@ -21,7 +21,7 @@
 #include <sys/ioctl.h>
 #include <poll.h>
 #include <sys/stat.h>
-#include <sys/vt.h>
+#include <sys/consio.h>
 #include <unistd.h>
 #include "drm_common.h"
Comment 1 commit-hook freebsd_committer 2019-07-08 14:24:36 UTC
A commit references this bug:

Author: cpm
Date: Mon Jul  8 14:24:23 UTC 2019
New revision: 506228
URL: https://svnweb.freebsd.org/changeset/ports/506228

  multimedia/mpv: enable DRM console output support

  Allow Mpv to play videos directly on the console when DRM/KMS is supported (e.g., mpv -vo gpu --gpu-context=drm <video-file>)

  PR:		238944
  Submitted by:	sigsys@gmail.com

Comment 2 Carlos J. Puga Medina freebsd_committer 2019-07-08 14:25:40 UTC
Committed, thanks!