<div dir="ltr">Hi Barry<div><br></div><div>May I ask if the overlay path is considered for the views between cloned outputs? For example, one view in this output could go through overlay, but in other</div><div>cloned output, it can't. Or only using gpu composition for all cloned outputs?</div><div><br></div><div>Thank you!<br></div><div><br></div><div>Best Regards</div><div>Nancy</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Barry Song <<a href="mailto:21cnbao@gmail.com" target="_blank">21cnbao@gmail.com</a>> 于2019年7月31日周三 上午5:48写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> 于2019年7月27日周六 下午8:20写道:<br>
><br>
> On Fri, 26 Jul 2019 08:58:42 +1200<br>
> Barry Song <<a href="mailto:21cnbao@gmail.com" target="_blank">21cnbao@gmail.com</a>> wrote:<br>
><br>
> > Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> 于2019年7月26日周五 上午3:30写道:<br>
> > ><br>
> > > On Thu, 25 Jul 2019 13:00:55 +1200<br>
> > > Barry Song <<a href="mailto:21cnbao@gmail.com" target="_blank">21cnbao@gmail.com</a>> wrote:<br>
> > ><br>
> > > > Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> 于2019年7月24日周三 下午8:10写道:<br>
> > > > ><br>
> > > > > On Wed, 24 Jul 2019 13:22:43 +0800<br>
> > > > > zou lan <<a href="mailto:nancy.lan.zou@gmail.com" target="_blank">nancy.lan.zou@gmail.com</a>> wrote:<br>
> > > > ><br>
> > > > > > Hi pekka<br>
> > > > > ><br>
> > > > > > I see the clone mode is supported from this commit message.<br>
> > > > > > <a href="https://patchwork.freedesktop.org/patch/227970/" rel="noreferrer" target="_blank">https://patchwork.freedesktop.org/patch/227970/</a><br>
> > > > > ><br>
> > > > > > I also see the message "Independent CRTC clone mode cannot be supported<br>
> > > > > > until output layout logic is moved from libweston into the frontend and<br>
> > > > > > libweston's damage tracking issues stemming from overlapping outputs are<br>
> > > > > > solved".<br>
> > > > > ><br>
> > > > > > I want to ask is independent CRTC clone mode already supported in Weston 6<br>
> > > > > > or 7? If not,<br>
> > > > > > is there a plan to support it?<br>
> > > > ><br>
> > > > > Hi,<br>
> > > > ><br>
> > > > > no, that commit message is still accurate. I don't know of any<br>
> > > > > plans to work on independent CRTC clone mode.<br>
> > > ><br>
> > > > Pekka,<br>
> > > > any possible workaround do you know to support independent crtc clone<br>
> > > > within weston? right now it is very important product feature.<br>
> > > > for example, force weston to identify only one screen, and sync copy<br>
> > > > the screen to 2nd screen and call the drm api of 2nd screen?<br>
> > ><br>
> > > Hi,<br>
> > ><br>
> > > you could hack it up to do that, but it would be in no way an<br>
> > > upstreamable solution. It would also hurt display timings because<br>
> > > every repaint would have to wait for both monitors to refresh. Or,<br>
> > > all but one monitor would tear.<br>
> > ><br>
> > > A simpler hack would be to create overlapping outputs and<br>
> > > force them repaint fully on every refresh instead of repainting<br>
> > > only the damage. That's not upstreamable either, but the damage<br>
> > > could be hacked with probably a one-liner.<br>
> ><br>
> > Hi Pekka,<br>
> > Thanks. even though i have seen many times that damage tracking of<br>
> > overlapping outputs is the main cause stopping weston from supporting<br>
> > full clone mode, i haven't fully understood what is overlapping<br>
> > outputs in weston and found the code related with overlapping output,<br>
> > would you like to point out some code path so that i can begin to do<br>
> > some work on it? pls forgive me if you think the question is just<br>
> > stupid.<br>
><br>
> Hi,<br>
><br>
<br>
<br>
i made a very great progress to hack weston to support clone mode in<br>
the direction you pointed out.<br>
<br>
it works very well without any tearing.<br>
<br>
> what I suggested is not about code for overlapping outputs at all.<br>
> I'm simply suggesting to hack e.g. weston_output_repaint() or<br>
> something to ignore the accumulated damage and use full damage<br>
> instead. I can't tell you exactly what and where without doing it<br>
> myself first, which I cannot do at the moment.<br>
<br>
hacked by:<br>
<br>
@@ -2406,13 +2406,20 @@ weston_output_repaint(struct weston_output<br>
*output, void *repaint_data)<br>
}<br>
}<br>
<br>
- compositor_accumulate_damage(ec);<br>
+ if (!output->external) {<br>
+ compositor_accumulate_damage(ec);<br>
<br>
- pixman_region32_init(&output_damage);<br>
- pixman_region32_intersect(&output_damage,<br>
- &ec->primary_plane.damage, &output->region);<br>
- pixman_region32_subtract(&output_damage,<br>
- &output_damage, &ec->primary_plane.clip);<br>
+ pixman_region32_init(&output_damage);<br>
+ pixman_region32_intersect(&output_damage,<br>
+ &ec->primary_plane.damage, &output->region);<br>
+ pixman_region32_subtract(&output_damage,<br>
+ &output_damage, &ec->primary_plane.clip);<br>
+ } else {<br>
+ /** From Pekka Paalanen: the damage could be hacked<br>
with probably<br>
+ * a one-liner, ignore the accumulated damage and use<br>
full damage<br>
+ */<br>
+ output_damage = output->region;<br>
+ }<br>
<br>
<br>
><br>
> The other catch is to actually configure two weston_outputs to<br>
> cover the same area of the desktop. I'm not sure if the existing<br>
> libweston API is sufficient for that, but it certainly has not been<br>
> designed for that. Again, I cannot tell you exactly, sorry.<br>
><br>
<br>
hacked simply by making the coordinates to 0:<br>
<br>
@@ -5706,8 +5713,9 @@ weston_output_enable(struct weston_output *output)<br>
iterator = container_of(c->output_list.prev,<br>
struct weston_output, link);<br>
<br>
+ /** For clone mode, the coordinates of all displays will overlap */<br>
if (!wl_list_empty(&c->output_list))<br>
- x = iterator->x + iterator->width;<br>
+ x = (c->clone_mode ? 0 : iterator->x + iterator->width);<br>
<br>
and weston_view_assign_output() will get right output_mask.<br>
<br>
static void<br>
weston_view_assign_output(struct weston_view *ev)<br>
{<br>
...<br>
wl_list_for_each(output, &ec->output_list, link) {<br>
pixman_region32_intersect(®ion,<br>
&ev->transform.boundingbox,<br>
&output->region);<br>
<br>
e = pixman_region32_extents(®ion);<br>
area = (e->x2 - e->x1) * (e->y2 - e->y1);<br>
<br>
if (area > 0)<br>
mask |= 1u << output->id;<br>
<br>
...<br>
}<br>
<br>
ev->output_mask = mask;<br>
}<br>
<br>
For example, suppose the extension mode is working, we have two 1080p displays.<br>
(10, 10) will make output_mask=1, and (1930, 10) will make output_mask=2;<br>
but in clone mode, (10, 10) will make output_mask=3, and (1930, 10) will make<br>
output_mask=0;<br>
<br>
> Maybe weston_output_move or such would be enough? I'm not sure.<br>
> Right now the layout code is hardcoded and hidden inside libweston,<br>
> and you need to overwrite its outcome.<br>
<br>
since so many people are asking for clone mode in weston. would this<br>
hacking version be accepted as an initial patch to support independent<br>
clone?<br>
if so, i will work on preparing a patch to send.<br>
<br>
><br>
><br>
> Thanks,<br>
> pq<br>
<br>
-barry<br>
</blockquote></div></div>