[PATCH weston] launcher-util: pull in drm only for compositor-drm
Kristian Høgsberg
hoegsberg at gmail.com
Tue Oct 1 10:44:21 PDT 2013
On Tue, Oct 01, 2013 at 12:30:17PM +0200, Tomeu Vizoso wrote:
> With this patch plus the one I just sent about drop_privileges,
> weston-launch can be used on the rpi.
>
> Thanks!
Great, thanks for checking. Both patches are in master and will be in 1.3.
Kristian
> Tomeu
>
>
> On 27 September 2013 19:58, Adrian Negreanu <groleo at gmail.com> wrote:
>
> > From: Adrian Negreanu <adrian.m.negreanu at intel.com>
> >
> > Add drm_set_master and drm_drop_master
> > as wrappers for drm(Set|Drop)Master, when building compositor-drm
> > or as empty functions otherwise.
> >
> > Signed-off-by: Adrian Negreanu <adrian.m.negreanu at intel.com>
> > ---
> > src/launcher-util.c | 28 ++++++++++++++++++++++++----
> > 1 file changed, 24 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/launcher-util.c b/src/launcher-util.c
> > index a2ad0ec..bdddbb8 100644
> > --- a/src/launcher-util.c
> > +++ b/src/launcher-util.c
> > @@ -40,7 +40,9 @@
> > #include <linux/kd.h>
> > #include <linux/major.h>
> >
> > +#ifdef BUILD_DRM_COMPOSITOR
> > #include <xf86drm.h>
> > +#endif
> >
> > #include "compositor.h"
> > #include "launcher-util.h"
> > @@ -196,6 +198,26 @@ weston_launcher_data(int fd, uint32_t mask, void
> > *data)
> > return 1;
> > }
> >
> > +#ifdef BUILD_DRM_COMPOSITOR
> > +static int
> > +drm_drop_master(int drm_fd)
> > +{
> > + if (drm_fd != -1)
> > + return drmDropMaster(drm_fd);
> > + return -EBADF;
> > +}
> > +static int
> > +drm_set_master(int drm_fd)
> > +{
> > + if (drm_fd != -1)
> > + return drmSetMaster(drm_fd);
> > + return -EBADF;
> > +}
> > +#else
> > +static int drm_drop_master(int drm_fd) {return 0;}
> > +static int drm_set_master(int drm_fd) {return 0;}
> > +#endif
> > +
> > static int
> > vt_handler(int signal_number, void *data)
> > {
> > @@ -205,13 +227,11 @@ vt_handler(int signal_number, void *data)
> > if (compositor->session_active) {
> > compositor->session_active = 0;
> > wl_signal_emit(&compositor->session_signal, compositor);
> > - if (launcher->drm_fd != -1)
> > - drmDropMaster(launcher->drm_fd);
> > + drm_drop_master(launcher->drm_fd);
> > ioctl(launcher->tty, VT_RELDISP, 1);
> > } else {
> > ioctl(launcher->tty, VT_RELDISP, VT_ACKACQ);
> > - if (launcher->drm_fd != -1)
> > - drmSetMaster(launcher->drm_fd);
> > + drm_set_master(launcher->drm_fd);
> > compositor->session_active = 1;
> > wl_signal_emit(&compositor->session_signal, compositor);
> > }
> > --
> > 1.7.9.5
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> >
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list