[PATCH weston] clients: Add a weston-autorotater client and rotater protocol

Emmanuel Gil Peyrot emmanuel.peyrot at collabora.com
Mon Aug 8 15:36:36 UTC 2016


On Mon, May 23, 2016 at 12:00:13PM +0300, Pekka Paalanen wrote:
> On Sat, 21 May 2016 03:43:04 +0100
> Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com> wrote:
> 
> > This client uses libiio to retrieve accelerometer values from the iio
> > subsystem on Linux (and maybe some other kernels), and automatically
> > rotate the output whenever orientation changed.
> > 
> > I tested it with a mma8453 accelerometer, but everything needed should
> > be available in the configuration to make it work with any other iio
> > device.
> > 
> > Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com>
> > ---
> >  Makefile.am                 |  24 +++
> >  clients/autorotater.c       | 472 ++++++++++++++++++++++++++++++++++++++++++++
> >  configure.ac                |  15 ++
> >  desktop-shell/shell.c       |   1 +
> >  protocol/weston-rotater.xml |  26 +++
> >  src/compositor.h            |   3 +
> >  src/rotater.c               | 150 ++++++++++++++
> >  7 files changed, 691 insertions(+)
> >  create mode 100644 clients/autorotater.c
> >  create mode 100644 protocol/weston-rotater.xml
> >  create mode 100644 src/rotater.c
> 
> Hi Emmanuel,

Hi Pekka,

> 
> why is there a new client for this? Could it not be a plugin?
> 
> Is IIO potentially so slow and blocking we cannot use it in the server
> process?
> 
> Why the polling approach, cannot IIO deliver events?

The actual issue here is driver support for event-based IIO is spotty
at best, as I found out while trying to implement that method.  I
haven’t been able to find out programatically whether a driver will
behave as expected in the event-based API (which IIO people call “the
high-speed mode”), and implementing both methods with a blacklist
doesn’t seem sensible.  Having a method working with every driver seems
to be the most sensible and generic way.

> 
> Should there be a way to set which outputs get rotated by a specific
> IIO device, rather than assuming there is just one device rotating all
> outputs at once?

This has been added to the v2, an arbitrary number of autorotators can
now be used to drive an arbitrary number of weston_outputs.

> 
> Any reason why this is limited to desktop-shell rather than being a
> shell-agnostic feature?

In the v2 I made it a Weston module, it now won’t be used without being
listed in the modules option of the [core] section.

> 
> 
> Thanks,
> pq
> 
[snip]

Thanks for the review,

-- 
Emmanuel Gil Peyrot
Collabora Ltd.


More information about the wayland-devel mailing list