summaryrefslogtreecommitdiffstats
path: root/video/out/drm_common.c
Commit message (Collapse)AuthorAgeFilesLines
* drm_common: Be smarter when deciding on which CRTC and Encoder to useAnton Kindestam2018-05-011-1/+27
| | | | | | | | | | | | | | | | | Inspired by kmscube, first try to pick the Encoder and CRTC already associated with the selected Connector, if any. Otherwise try to find the first matching encoder & CRTC like before. The previous behavior had problems when using atomic modesetting (crtc_setup_atomic) when we picked an Encoder & CRTC that was currently being used by the fbcon together with another Encoder. drmModeSetCrtc was able to "steal" the CRTC in this case, but using atomic modesetting we do not seem to get this behavior automatically. This should also improve behavior somewhat when run on a multi screen setup with regards to deinit and VT switching (still sometimes you end up with a blank screen where you previously had a cloned display of your fbcon)
* drm/atomic: refactor planes namesLongChair2018-05-011-3/+8
| | | | | | | | We are currently using primary / overlay planes drm objects, assuming that primary plane is osd and overlay plane is video. This commit is doing two things : - replace the primary / overlay planes members with osd and video planes member without the assumption - Add two more options to determine which one of the primary / overlay is associated to osd / video. - It will default osd to overlay and video to primary if unspecified
* drm/atomic: add connector to atomic contextLongChair2018-05-011-1/+2
| | | | | | | | | | This patch adds - DRM connector object to atomic context. - fd property to the drm atomic object as well as a method to read blob type properties. This allows to ensure that the proper connector is picked up, especially when specifying it from the commandline, and also allows to make sure we're using the right one when embedding with interop into an application.
* drm/atomic: refactor hwdec_drmprime_drm with native resourcesLongChair2018-05-011-0/+1
| | | | | | | | | | | | | | | | | That new API was introduced and allows to have several native resources. Thisuses that mechanisma for drm resources rather than the deprecated opengl-cb structs. This patch therefore add two structs that can be used with the drm atomic interop. - mpv_opengl_drm_params : which will hold all the drm handles - mpv_opengl_drm_osd_size : which will hold osd layer size This commit adds a drm-osd-size=WxH parameter to commandline which allows to define the OSD plane dimension. OSD can be upscaled to screen resolution when having OSD at video resolution is too heavy. This is especially useful for UHD modes on embedded devices where the GPU cannot handle UHD modes at a decent framerate.
* drm_common: Improve VT switching signal handling somewhatAnton Kindestam2018-02-261-1/+15
| | | | | | | | By blocking the VT switcher signal in the VO thread we get less races and other oddities. This gets rid of tearing (at least for me) when VT switching with --gpu-context=drm.
* context_drm_egl: Introduce 30bpp supportAnton Kindestam2018-02-261-0/+3
| | | | | | | | | | | | | This introduces the option --drm-format (currently used only by context_drm_egl, vo_drm implementation is pending) which allows you to pick between a xrgb8888 or a xrgb2101010 visual for --gpu-context=drm. Requires a recent mesa (18.0.0_rc4 or later) to work. This also fixes a bug when using --gpu-context=drm on a 30bpp-enabled mesa (allow_rgb10_configs set to true). Previously it would've set up an XRGB8888 format at the DRM/GBM level, while a 30bpp EGLConfig would be picked, resulting in a garbled image.
* video : Move drm options to substruct.Lionel CHAZALLON2017-10-231-0/+12
| | | | | This allows to group them and most of all query the group config when needed and when we don't have the access to vo.
* Add DRM_PRIME Format Handling and Display for RockChip MPP decodersLionel CHAZALLON2017-10-231-1/+22
| | | | | | | | | | | This commit allows to use the AV_PIX_FMT_DRM_PRIME newly introduced format in ffmpeg that allows decoders to provide an AVDRMFrameDescriptor struct. That struct holds dmabuf fds and information allowing zerocopy rendering using KMS / DRM Atomic. This has been tested on RockChip ROCK64 device.
* vo_drm: nake drm mode help output also output refresh rateAnton Kindestam2017-06-181-3/+9
| | | | | | | | | The printout of available modes that you can get with --drm-mode=-1 (with -vo drm or --opengl-backend=drm) does not include the refresh rate in the printout, which is quite useful to know, if one is to choose for instance 23.98, or 24 Hz for film material. Signed-off-by: wm4 <wm4@nowhere>
* drm: include <poll.h> instead of <sys/poll.h>wm42017-01-091-1/+1
| | | | | | | I'm not sure what systems have <sys/poll.h> (maybe there are historical reasons why some would), but POSIX defines <poll.h>. Although this code is full of highly OS specific calls (like ioctl()), there's no reason not to use the more standard include path.
* vo_drm: change CLI options + refactorsrr-2016-10-071-76/+214
| | | | | | | | | | - Change connector selection to accept human readable names (such as eDP-1, HDMI-A-2) rather than arbitrary numbers. - Change GPU selection to accept GPU number rather than device paths. - Merge connector and GPU selection into one --drm-connector. - Add support for --drm-connector=help. - Add support for --drm-* in EGL backend. - Refactor KMS; reduce state sharing across drm_common.
* vo_drm: fix tiny memory leakrr-2016-10-041-3/+8
|
* vo_drm: refactor getting display fpsrr-2016-10-041-0/+5
| | | | | | | | Reduces code duplication between OpenGL backend and DRM VO. (The control() for OpenGL backend isn't sufficiently similar to the VO's control() to consider merging it as a whole - I extracted only the FPS code.)
* build: silence -Wunused-resultNiklas Haas2016-06-071-2/+2
| | | | | | | | For clang, it's enough to just put (void) around usages we are intentionally ignoring the result of. Since GCC does not seem to want to respect this decision, we are forced to disable the warning globally.
* Change GPL/LGPL dual-licensed files to LGPLwm42016-01-191-12/+7
| | | | | | | | | | | Do this to make the license situation less confusing. This change should be of no consequence, since LGPL is compatible with GPL anyway, and making it LGPL-only does not restrict the use with GPL code. Additionally, the wording implies that this is allowed, and that we can just remove the GPL part.
* vo_drm: fix CRTC usagerr-2016-01-181-1/+1
|
* drm: fix setting up connectorsrr-2015-11-111-1/+1
| | | | Fixes regression from 67caea357c23443cf583ad401a38bbaae19e3df8.
* vo_drm: relicense to LGPLrr-2015-11-081-2/+5
| | | | | Also removed authorship information (as per convention seen in other files)
* vo_drm: use bool rather than integer return valuesrr-2015-11-081-37/+32
| | | | | Since the errors weren't used for anything other than simple success/fail checks, I simplified things a bit.
* vo_drm: move initialization to drm_commonrr-2015-11-081-0/+187
| | | | | Makes KMS initialization procedures reusable so that they can be used by the upcoming DRM EGL adapter.
* vo_drm: uninstall signal handlers after quittingrr-2015-10-301-0/+2
|
* vo_drm: handle possible errors from sigactionrr-2015-10-301-6/+17
|
* vo_drm: check if signal already usedrr-2015-10-301-5/+23
|
* vo_drm: fix missing newlines in error messagesrr-2015-06-281-4/+4
|
* vo_drm: fix coding style to adhere to guidelinesMarcin Kurczewski2015-04-211-4/+2
|
* vo_drm: extract vt_switcher to drm_commonMarcin Kurczewski2015-04-191-0/+151