Re: [PATCH xserver] randr: Adjust master's last set time with slaves
On 05/27/2016 01:40 AM, Hans de Goede wrote: Hi, On 26-05-16 18:20, Nikhil Mahale wrote: In prime configurations master's last set time may not be latest and greatest, adjust it with slaves last set time, pick up greatest one. Otherwise xserver may end with events which has lastSetTime < lastConfigTime even if that's not the case and confuse xrandr client. Thanks, looks good to me now: Acked-by: Hans de GoedeSorry, I did forgot to add signoff line. Please let me add signoff line in commit msg. Regards, Hans --- randr/randr.c | 9 + 1 file changed, 9 insertions(+) diff --git a/randr/randr.c b/randr/randr.c index 3aabb19..549f26c 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -584,6 +584,15 @@ RRTellChanged(ScreenPtr pScreen) mastersp = pScrPriv; } +xorg_list_for_each_entry(iter, >output_slave_list, output_head) { +pSlaveScrPriv = rrGetScrPriv(iter); + +if (CompareTimeStamps(mastersp->lastSetTime, + pSlaveScrPriv->lastSetTime) == EARLIER) { +mastersp->lastSetTime = pSlaveScrPriv->lastSetTime; +} +} + if (mastersp->changed) { UpdateCurrentTimeIf(); if (mastersp->configChanged) { ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] randr: Adjust master's last set time with slaves
Hi, On 26-05-16 18:20, Nikhil Mahale wrote: In prime configurations master's last set time may not be latest and greatest, adjust it with slaves last set time, pick up greatest one. Otherwise xserver may end with events which has lastSetTime < lastConfigTime even if that's not the case and confuse xrandr client. Thanks, looks good to me now: Acked-by: Hans de GoedeRegards, Hans --- randr/randr.c | 9 + 1 file changed, 9 insertions(+) diff --git a/randr/randr.c b/randr/randr.c index 3aabb19..549f26c 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -584,6 +584,15 @@ RRTellChanged(ScreenPtr pScreen) mastersp = pScrPriv; } +xorg_list_for_each_entry(iter, >output_slave_list, output_head) { +pSlaveScrPriv = rrGetScrPriv(iter); + +if (CompareTimeStamps(mastersp->lastSetTime, + pSlaveScrPriv->lastSetTime) == EARLIER) { +mastersp->lastSetTime = pSlaveScrPriv->lastSetTime; +} +} + if (mastersp->changed) { UpdateCurrentTimeIf(); if (mastersp->configChanged) { ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] randr: Adjust master's last set time with slaves
Hi, On 20-05-16 07:01, Nikhil Mahale wrote: In prime configurations master's last set time may not be latest and greatest, adjust it with slaves last set time, pick up greatest one. Otherwise xserver may end with events which has lastSetTime < lastConfigTime even if that's not the case and confuse xrandr client. Signed-off-by: Nikhil Mahale--- randr/randr.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/randr/randr.c b/randr/randr.c index 3aabb19..c07def1 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -568,6 +568,7 @@ RRSetChanged(ScreenPtr pScreen) void RRTellChanged(ScreenPtr pScreen) { +ScreenPtr slave; We already declare a "ScreenPtr iter" which is used in other parts of this function to iterate over the output_slave_list, please use that instead. Regards, Hans ScreenPtr master; rrScrPriv(pScreen); rrScrPrivPtr mastersp; @@ -584,6 +585,15 @@ RRTellChanged(ScreenPtr pScreen) mastersp = pScrPriv; } +xorg_list_for_each_entry(slave, >output_slave_list, output_head) { +pSlaveScrPriv = rrGetScrPriv(slave); + +if (CompareTimeStamps(mastersp->lastSetTime, + pSlaveScrPriv->lastSetTime) == EARLIER) { +mastersp->lastSetTime = pSlaveScrPriv->lastSetTime; +} +} + if (mastersp->changed) { UpdateCurrentTimeIf(); if (mastersp->configChanged) { ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel