Can kmssink run with x11 or wayland which is based on drm/kms also?

Jacob Chen jacobchen110 at gmail.com
Fri Jul 14 01:02:44 UTC 2017


Hi Nicolas,

2017-07-13 22:23 GMT+08:00 Nicolas Dufresne <nicolas at ndufresne.ca>:
> Le jeudi 13 juillet 2017 à 14:48 +0800, Jacob Chen a écrit :
>> Hi,
>>
>>
>> 2017-07-13 9:23 GMT+08:00 Jacob Chen <jacob-chen at iotwrt.com>:
>> > Hi,
>> >
>> > 2017-07-13 1:34 GMT+08:00 Nicolas Dufresne <nicolas at ndufresne.ca>:
>> > > Le mardi 11 juillet 2017 à 23:17 -0700, jared Hu a écrit :
>> > > > Hi,
>> > > >
>> > > > I met a problem, if I run kmssink on wayland or x11 backend. Kmssink will
>> > > > report Permission denied. Because xserver and wayland will hold DRM-Master.
>> > > > I wonder if there is a way to run kmssink with wayland and x11?
>> > >
>> > > No, kmssink need to be DRM master.
>> >
>> > kmssink can use normal plane, but it should change some codes.
>> >
>> > "self->ctrl_fd = open ("/dev/dri/controlD64", O_RDWR); "
>> > "
>> > ret =
>> > drmModeSetPlane (self->ctrl_fd, self->plane_id,
>> > self->crtc_id, fb_id, 0, result.x, result.y, result.w, result.h,
>> > /* source/cropping coordinates are given in Q16 */
>> > src.x << 16, src.y << 16, src.w << 16, src.h << 16);
>> > "
>> >
>> > On rockchip platform, it works, thought it will have vsync problem
>> > because of legacy drm api.
>> >
>>
>> = = It seems it didn't work with the latest mainline kernel now.
>> So the only way to run kmssink on wayland or x11 is kernel hack.
>>
>> comment this funciton.
>> http://elixir.free-electrons.com/linux/latest/source/drivers/gpu/drm/drm_ioctl.c#L497
>
> Which I think make sense, DRM is not really designed for this. As
> already mention, you can get a much better experience using waylandsink
> instead. The compositor should be responsible for distributing the
> rendering across the HW planes and optimizing this.
>
> If you're goal was to use kmssink inside a compositor, that would be
> different, but still, I'd be curious in which case an equivalent
> application could not be made of waylandsink. So far, the only real use
> case I've had for kmssink was for fullscreen playback (security
> monitor) and for displaying backup camera while the car infotainment is
> being booted.
>

Waylandsink is great, but there still are some issues for people to use.

1.Patches for supporting atomic mode-setting by Wayland's Weston are
not yet merged, so Weston still can't use drm overlay render.
2.If somethings cover the video window, weston will back to GPU
Render, which lead to lag(especially the TV Box targeted SOC that
usually have a weak GPU).
3.It can't work with qt multimedia.

With some simple kernel hack + kmssink
we can use kmssink on wayland/x11/qt eglfs.
We get the idea form Kodi and Plex, they already use this way in
amlogic platform(though fb + ffmpeg, not drm + gstreamer).  ; )

1. I can use "transparent UI + bottom video layer" to show items
overlay the vdieo layer.
2. It work well with qt multimedia.
3. No system environmental dependency

> regards,
> Nicolas
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>


More information about the gstreamer-devel mailing list