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

Pekka Paalanen ppaalanen at gmail.com
Wed Aug 10 08:21:45 UTC 2016


On Mon, 8 Aug 2016 16:36:36 +0100
Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com> wrote:

> 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.

Hi,

ok, that's an important design choice worth mentioning.

> > 
> > 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.

Sounds good!


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160810/7cc7cd9d/attachment.sig>


More information about the wayland-devel mailing list