[PATCH] Mirroing mode

Pekka Paalanen ppaalanen at gmail.com
Tue Apr 14 00:04:23 PDT 2015


On Tue, 14 Apr 2015 12:23:03 +0800
Leslie Zhai <xiang.zhai at i-soft.com.cn> wrote:

> Hi Pekka,
> 
> Thanks for your reply!
> 
> It is not easy to use Google "thanks to" G.F.W. blocked it ;-(
> Could you paste the URL links for me please? thanks a lot!

About mirror/clone mode:
http://lists.freedesktop.org/archives/wayland-devel/2013-September/011134.html
http://lists.freedesktop.org/archives/wayland-devel/2013-September/011161.html
http://lists.freedesktop.org/archives/wayland-devel/2013-October/011438.html
http://lists.freedesktop.org/archives/wayland-devel/2014-February/013247.html
http://lists.freedesktop.org/archives/wayland-devel/2014-March/013566.html
http://lists.freedesktop.org/archives/wayland-devel/2014-October/017719.html

About weston-randr:
http://lists.freedesktop.org/archives/wayland-devel/2014-February/013480.html
http://lists.freedesktop.org/archives/wayland-devel/2014-March/013511.html
http://lists.freedesktop.org/archives/wayland-devel/2014-March/013691.html
http://lists.freedesktop.org/archives/wayland-devel/2014-March/013843.html
http://lists.freedesktop.org/archives/wayland-devel/2014-April/014091.html
http://lists.freedesktop.org/archives/wayland-devel/2014-May/014586.html

These are all beginnings of threads, as seen in the archives, so
usually the important comments are in the replies, not in the linked
email itself.

That is likely not an exhaustive list, it's just what I gathered
quickly.

> It is not the issue - whether or not able to do partial (or full 
> repaint) updates, but owing to:
> 1. different mode such as different width x height resolution
> 2. different scale, maybe output VGA1 is often called "HiDPI" or 
> "retina" display

Yes, those are just issues in addition to what I listed. Those are easy
to implement once the more fundamental problems of what I listed are
solved.

> The screenshot 
> https://twitter.com/xiangzhai/status/587827576665587713/photo/1
> The overlap of outputs (LVDS1 and VGA1) is not in the SAME coordinate 
> system: different X and Y axes, so even do a full repaint, it is not 
> able to fix the issue!

What coordinate systems are you talking about? Weston has many.

That is not the kind of glitch I was talking about. What you see there
is simply wrong logic in the code. It's not a transient random glitch,
so it's relatively easy to fix, because you can reliably test it.

The glitch is about not repainting sub-regions that should have been
painted, leading to corrupted output. E.g. a window missing a piece of
it, or showing a piece of outdated content.

> But what about Xinerama http://en.wikipedia.org/wiki/Xinerama like the 
> father of Xrandr.
> I am learning how Xinerama do the coordinate matrix transform for the 
> X11, hope to inspire me for weston ;-)

I don't think you can learn anything useful for Weston from there.

> On 2015年04月10日 21:05, Pekka Paalanen wrote:
> > On Fri, 10 Apr 2015 15:36:36 +0800
> > Leslie Zhai <xiang.zhai at i-soft.com.cn> wrote:
> >
> >> Hi Pekka,
> >>
> >> I am reading src/compositor-drm.c in create_outputs(...) function, it
> >> uses drmModeGetResources to get count_connectors,
> >> then update the X position in a for loop shown as below:
> >>
> >> ```
> >> x += container_of(ec->base.output_list.prev,
> >>                         struct weston_output,
> >>                         link)->width;
> >> ```
> >>
> >> so it is absolutely extend mode by default, "draw" count_connectors`
> >> create_output_for_connector(...) rectangles with DIFFERENT X position,
> >> if take a screenshot, it should be
> >> https://twitter.com/xiangzhai/status/586061869279883266/photo/1
> >>
> >> But if add mirror to drm_options (shown as below patch) it is able to
> >> run weston --mirror with the SAME X position,
> >> the screenshot
> >> https://twitter.com/xiangzhai/status/586428721533288449/photo/1
> >>
> > I have a huge deja vu experience here. I warmly suggest you dig up the
> > previous discussions from the mailing list archives when this kind of
> > simple (too stupid to work for more than 2 outputs) mirroring was
> > proposed.
> >
> >> diff --git a/src/compositor-drm.c b/src/compositor-drm.c

...

> >> It is a monkey patch ;-) there are a lot of things I have to fix or
> >> learn, such as:
> >> 1. how to "draw" the SAME "rectangle" to different outputs, what do I
> >> need to hack for recent weston`s architecture?
> >> 2. xrandr utility will choose the SAME mode for different outputs, for
> >> example, 1024x768, I have not implemented it for mirroring mode!
> > Like I said, a simple test does not guarantee that weston's damage
> > tracking can cope with it. You have to ensure the renderer/backend can
> > do partial updates, and then watch for glitches when causing partial
> > repaints.
> >
> > The answer to your question about rectangles involves understanding the
> > damage tracking system and making sure it works also for overlapping
> > outputs. After that, it should just work. I cannot explain it off-hand,
> > it is so complex that it would take a good while for me to study and
> > understand again how it works.
> >
> > Screenshooting forces a full repaint IIRC, so that would immediately
> > hide any glitches you might see.

Thanks,
pq


More information about the wayland-devel mailing list