xserver: Branch 'server-1.14-branch' - 10 commits

Matt Dew marcoz at osource.org
Sun Nov 3 03:44:47 CET 2013


Hi Aaron,
  Ugh.  Unacceptable for a stable branch.

How do I fix this?
Should I revert that whole merge?


thanks,
Matt

On 11/01/2013 09:33 AM, Aaron Plattner wrote:
> On 10/31/2013 11:03 PM, Matt Dew wrote:
>>   hw/xfree86/common/xf86platformBus.c |    6 +
>>   hw/xfree86/modes/xf86RandR12.c      |   21 +++++-
>>   randr/randr.c                       |  120
>> +++++++++++++++++++++++++++++++++++-
>>   randr/randrstr.h                    |   12 +++
> 
> These structures are part of the ABI, so these changes are going to fork
> the ABI in an incompatible way from master.
> 
>>   randr/rrcrtc.c                      |    6 +
>>   randr/rrinfo.c                      |    2
>>   randr/rroutput.c                    |    7 +-
>>   randr/rrpointer.c                   |    2
>>   randr/rrprovider.c                  |   25 +++++++
>>   randr/rrscreen.c                    |    2
>>   10 files changed, 194 insertions(+), 9 deletions(-)
>>
>> New commits:
>> commit ad2fa50b5371f6e71a66d47e73304599c90f9118
>> Merge: bab4908 f98d6cf
>> Author: Matt Dew <marcoz at osource.org>
>> Date:   Thu Oct 31 23:53:04 2013 -0600
>>
>>      Merge commit 'f98d6cfa0de41cf33e7555342753897c07af84ef' into
>> server-1.14-branch
>>
>> commit f98d6cfa0de41cf33e7555342753897c07af84ef
>> Author: Michal Srb <msrb at suse.com>
>> Date:   Wed Oct 30 13:33:51 2013 +0200
>>
>>      randr: deliver Output and Crtc events of attached output providers.
>>
>>      Consider all attached output providers when looking for changed
>> outputs and
>>      crtcs.
>>
>>      Reviewed-by: Dave Airlie <airlied at redhat.com>
>>      Signed-off-by: Michal Srb <msrb at suse.com>
>>      Signed-off-by: Keith Packard <keithp at keithp.com>
>>
>> diff --git a/randr/randr.c b/randr/randr.c
>> index 9cec6f6..3c51427 100644
>> --- a/randr/randr.c
>> +++ b/randr/randr.c
>> @@ -478,6 +478,16 @@ TellChanged(WindowPtr pWin, pointer value)
>>                   if (crtc->changed)
>>                       RRDeliverCrtcEvent(client, pWin, crtc);
>>               }
>> +
>> +            xorg_list_for_each_entry(iter,
>> &pScreen->output_slave_list, output_head) {
>> +                pSlaveScrPriv = rrGetScrPriv(iter);
>> +                for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) {
>> +                    RRCrtcPtr crtc = pSlaveScrPriv->crtcs[i];
>> +
>> +                    if (crtc->changed)
>> +                        RRDeliverCrtcEvent(client, pWin, crtc);
>> +                }
>> +            }
>>           }
>>
>>           if (pRREvent->mask & RROutputChangeNotifyMask) {
>> @@ -487,6 +497,16 @@ TellChanged(WindowPtr pWin, pointer value)
>>                   if (output->changed)
>>                       RRDeliverOutputEvent(client, pWin, output);
>>               }
>> +
>> +            xorg_list_for_each_entry(iter,
>> &pScreen->output_slave_list, output_head) {
>> +                pSlaveScrPriv = rrGetScrPriv(iter);
>> +                for (i = 0; i < pSlaveScrPriv->numOutputs; i++) {
>> +                    RROutputPtr output = pSlaveScrPriv->outputs[i];
>> +
>> +                    if (output->changed)
>> +                        RRDeliverOutputEvent(client, pWin, output);
>> +                }
>> +            }
>>           }
>>
>>           if (pRREvent->mask & RRProviderChangeNotifyMask) {
>> @@ -581,6 +601,10 @@ RRTellChanged(ScreenPtr pScreen)
>>           xorg_list_for_each_entry(iter, &master->output_slave_list,
>> output_head) {
>>               pSlaveScrPriv = rrGetScrPriv(iter);
>>               pSlaveScrPriv->provider->changed = FALSE;
>> +            for (i = 0; i < pSlaveScrPriv->numOutputs; i++)
>> +                pSlaveScrPriv->outputs[i]->changed = FALSE;
>> +            for (i = 0; i < pSlaveScrPriv->numCrtcs; i++)
>> +                pSlaveScrPriv->crtcs[i]->changed = FALSE;
>>           }
>>           xorg_list_for_each_entry(iter, &master->offload_slave_list,
>> offload_head) {
>>               pSlaveScrPriv = rrGetScrPriv(iter);
>> commit 14f89fb291f058a39e45cef012607a43edc5c9fe
>> Author: Michal Srb <msrb at suse.com>
>> Date:   Wed Oct 30 13:33:50 2013 +0200
>>
>>      randr: send RRResourceChangeNotify event
>>
>>      Send RRResourceChangeNotify event when provider, output or crtc
>> was created or
>>      destroyed. I.e. when the list of resources returned by
>> RRGetScreenResources and
>>      RRGetProviders changes.
>>
>>      Reviewed-by: Dave Airlie <airlied at redhat.com>
>>      Signed-off-by: Michal Srb <msrb at suse.com>
>>      Signed-off-by: Keith Packard <keithp at keithp.com>
>>
>> diff --git a/hw/xfree86/common/xf86platformBus.c
>> b/hw/xfree86/common/xf86platformBus.c
>> index e368dee..33b2b7d 100644
>> --- a/hw/xfree86/common/xf86platformBus.c
>> +++ b/hw/xfree86/common/xf86platformBus.c
>> @@ -466,6 +466,9 @@ xf86platformAddDevice(int index)
>>      /* attach unbound to 0 protocol screen */
>>      AttachUnboundGPU(xf86Screens[0]->pScreen,
>> xf86GPUScreens[i]->pScreen);
>>
>> +   RRResourcesChanged(xf86Screens[0]->pScreen);
>> +   RRTellChanged(xf86Screens[0]->pScreen);
>> +
>>      return 0;
>>   }
>>
>> @@ -508,6 +511,8 @@ xf86platformRemoveDevice(int index)
>>       xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
>>
>>       xf86_remove_platform_device(index);
>> +
>> +    RRResourcesChanged(xf86Screens[0]->pScreen);
>>       RRTellChanged(xf86Screens[0]->pScreen);
>>    out:
>>       return;
>> diff --git a/randr/randr.c b/randr/randr.c
>> index fa0a4da..9cec6f6 100644
>> --- a/randr/randr.c
>> +++ b/randr/randr.c
>> @@ -420,6 +420,32 @@ RRExtensionInit(void)
>>   #endif
>>   }
>>
>> +void
>> +RRResourcesChanged(ScreenPtr pScreen)
>> +{
>> +    rrScrPriv(pScreen);
>> +    pScrPriv->resourcesChanged = TRUE;
>> +
>> +    RRSetChanged(pScreen);
>> +}
>> +
>> +static void
>> +RRDeliverResourceEvent(ClientPtr client, WindowPtr pWin)
>> +{
>> +    ScreenPtr pScreen = pWin->drawable.pScreen;
>> +
>> +    rrScrPriv(pScreen);
>> +
>> +    xRRResourceChangeNotifyEvent re = {
>> +        .type = RRNotify + RREventBase,
>> +        .subCode = RRNotify_ResourceChange,
>> +        .timestamp = pScrPriv->lastSetTime.milliseconds,
>> +        .window = pWin->drawable.id
>> +    };
>> +
>> +    WriteEventsToClient(client, 1, (xEvent *) &re);
>> +}
>> +
>>   static int
>>   TellChanged(WindowPtr pWin, pointer value)
>>   {
>> @@ -480,6 +506,12 @@ TellChanged(WindowPtr pWin, pointer value)
>>                       RRDeliverProviderEvent(client, pWin,
>> pSlaveScrPriv->provider);
>>               }
>>           }
>> +
>> +        if (pRREvent->mask & RRResourceChangeNotifyMask) {
>> +            if (pScrPriv->resourcesChanged) {
>> +                RRDeliverResourceEvent(client, pWin);
>> +            }
>> +        }
>>       }
>>       return WT_WALKCHILDREN;
>>   }
>> @@ -536,7 +568,11 @@ RRTellChanged(ScreenPtr pScreen)
>>           }
>>           pScrPriv->changed = FALSE;
>>           mastersp->changed = FALSE;
>> +
>>           WalkTree(master, TellChanged, (pointer) master);
>> +
>> +        mastersp->resourcesChanged = FALSE;
>> +
>>           for (i = 0; i < pScrPriv->numOutputs; i++)
>>               pScrPriv->outputs[i]->changed = FALSE;
>>           for (i = 0; i < pScrPriv->numCrtcs; i++)
>> diff --git a/randr/randrstr.h b/randr/randrstr.h
>> index c933349..15299fd 100644
>> --- a/randr/randrstr.h
>> +++ b/randr/randrstr.h
>> @@ -301,6 +301,7 @@ typedef struct _rrScrPriv {
>>       Bool changed;               /* some config changed */
>>       Bool configChanged;         /* configuration changed */
>>       Bool layoutChanged;         /* screen layout changed */
>> +    Bool resourcesChanged;      /* screen resources change */
>>
>>       CARD16 minWidth, minHeight;
>>       CARD16 maxWidth, maxHeight;
>> @@ -486,6 +487,9 @@ extern _X_EXPORT int
>>   extern _X_EXPORT void
>>    RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr
>> pScreen);
>>
>> +extern _X_EXPORT void
>> + RRResourcesChanged(ScreenPtr pScreen);
>> +
>>   /* randr.c */
>>   /* set a screen change on the primary screen */
>>   extern _X_EXPORT void
>> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
>> index b3fb5bd..5cdfd05 100644
>> --- a/randr/rrcrtc.c
>> +++ b/randr/rrcrtc.c
>> @@ -102,6 +102,8 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate)
>>       crtc->pScreen = pScreen;
>>       pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc;
>>
>> +    RRResourcesChanged(pScreen);
>> +
>>       return crtc;
>>   }
>>
>> @@ -672,6 +674,8 @@ RRCrtcDestroyResource(pointer value, XID pid)
>>                   break;
>>               }
>>           }
>> +
>> +        RRResourcesChanged(pScreen);
>>       }
>>
>>       if (crtc->scanout_pixmap)
>> diff --git a/randr/rroutput.c b/randr/rroutput.c
>> index 922d61f..2b0b82f 100644
>> --- a/randr/rroutput.c
>> +++ b/randr/rroutput.c
>> @@ -101,6 +101,9 @@ RROutputCreate(ScreenPtr pScreen,
>>           return NULL;
>>
>>       pScrPriv->outputs[pScrPriv->numOutputs++] = output;
>> +
>> +    RRResourcesChanged(pScreen);
>> +
>>       return output;
>>   }
>>
>> @@ -355,6 +358,8 @@ RROutputDestroyResource(pointer value, XID pid)
>>                   break;
>>               }
>>           }
>> +
>> +        RRResourcesChanged(pScreen);
>>       }
>>       if (output->modes) {
>>           for (m = 0; m < output->numModes; m++)
>> commit 4c79ea71a11c705a654a49f3edc2f01b4cdc61e2
>> Author: Michal Srb <msrb at suse.com>
>> Date:   Wed Oct 30 13:33:49 2013 +0200
>>
>>      randr: send RRProviderChangeNotify event
>>
>>      Send RRProviderChangeNotify event when a provider becomes output
>> source or
>>      offload sink.
>>
>>      Reviewed-by: Dave Airlie <airlied at redhat.com>
>>      Signed-off-by: Michal Srb <msrb at suse.com>
>>      Signed-off-by: Keith Packard <keithp at keithp.com>
>>
>> diff --git a/randr/randr.c b/randr/randr.c
>> index cb6fce7..fa0a4da 100644
>> --- a/randr/randr.c
>> +++ b/randr/randr.c
>> @@ -426,6 +426,8 @@ TellChanged(WindowPtr pWin, pointer value)
>>       RREventPtr *pHead, pRREvent;
>>       ClientPtr client;
>>       ScreenPtr pScreen = pWin->drawable.pScreen;
>> +    ScreenPtr iter;
>> +    rrScrPrivPtr pSlaveScrPriv;
>>
>>       rrScrPriv(pScreen);
>>       int i;
>> @@ -460,6 +462,24 @@ TellChanged(WindowPtr pWin, pointer value)
>>                       RRDeliverOutputEvent(client, pWin, output);
>>               }
>>           }
>> +
>> +        if (pRREvent->mask & RRProviderChangeNotifyMask) {
>> +            xorg_list_for_each_entry(iter,
>> &pScreen->output_slave_list, output_head) {
>> +                pSlaveScrPriv = rrGetScrPriv(iter);
>> +                if (pSlaveScrPriv->provider->changed)
>> +                    RRDeliverProviderEvent(client, pWin,
>> pSlaveScrPriv->provider);
>> +            }
>> +            xorg_list_for_each_entry(iter,
>> &pScreen->offload_slave_list, offload_head) {
>> +                pSlaveScrPriv = rrGetScrPriv(iter);
>> +                if (pSlaveScrPriv->provider->changed)
>> +                    RRDeliverProviderEvent(client, pWin,
>> pSlaveScrPriv->provider);
>> +            }
>> +            xorg_list_for_each_entry(iter, &pScreen->unattached_list,
>> unattached_head) {
>> +                pSlaveScrPriv = rrGetScrPriv(iter);
>> +                if (pSlaveScrPriv->provider->changed)
>> +                    RRDeliverProviderEvent(client, pWin,
>> pSlaveScrPriv->provider);
>> +            }
>> +        }
>>       }
>>       return WT_WALKCHILDREN;
>>   }
>> @@ -496,6 +516,8 @@ RRTellChanged(ScreenPtr pScreen)
>>       rrScrPriv(pScreen);
>>       rrScrPrivPtr mastersp;
>>       int i;
>> +    ScreenPtr iter;
>> +    rrScrPrivPtr pSlaveScrPriv;
>>
>>       if (pScreen->isGPU) {
>>           master = pScreen->current_master;
>> @@ -519,6 +541,20 @@ RRTellChanged(ScreenPtr pScreen)
>>               pScrPriv->outputs[i]->changed = FALSE;
>>           for (i = 0; i < pScrPriv->numCrtcs; i++)
>>               pScrPriv->crtcs[i]->changed = FALSE;
>> +
>> +        xorg_list_for_each_entry(iter, &master->output_slave_list,
>> output_head) {
>> +            pSlaveScrPriv = rrGetScrPriv(iter);
>> +            pSlaveScrPriv->provider->changed = FALSE;
>> +        }
>> +        xorg_list_for_each_entry(iter, &master->offload_slave_list,
>> offload_head) {
>> +            pSlaveScrPriv = rrGetScrPriv(iter);
>> +            pSlaveScrPriv->provider->changed = FALSE;
>> +        }
>> +        xorg_list_for_each_entry(iter, &master->unattached_list,
>> unattached_head) {
>> +            pSlaveScrPriv = rrGetScrPriv(iter);
>> +            pSlaveScrPriv->provider->changed = FALSE;
>> +        }
>> +
>>           if (mastersp->layoutChanged) {
>>               pScrPriv->layoutChanged = FALSE;
>>               RRPointerScreenConfigured(master);
>> diff --git a/randr/randrstr.h b/randr/randrstr.h
>> index 2babfed..c933349 100644
>> --- a/randr/randrstr.h
>> +++ b/randr/randrstr.h
>> @@ -164,6 +164,7 @@ struct _rrProvider {
>>       int nameLength;
>>       RRPropertyPtr properties;
>>       Bool pendingProperties;
>> +    Bool changed;
>>       struct _rrProvider *offload_sink;
>>       struct _rrProvider *output_source;
>>   };
>> @@ -923,6 +924,9 @@ RRProviderSetCapabilities(RRProviderPtr provider,
>> uint32_t capabilities);
>>   extern _X_EXPORT Bool
>>   RRProviderLookup(XID id, RRProviderPtr *provider_p);
>>
>> +extern _X_EXPORT void
>> +RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin,
>> RRProviderPtr provider);
>> +
>>   /* rrproviderproperty.c */
>>
>>   extern _X_EXPORT void
>> diff --git a/randr/rrprovider.c b/randr/rrprovider.c
>> index b321e62..2334ad2 100644
>> --- a/randr/rrprovider.c
>> +++ b/randr/rrprovider.c
>> @@ -304,6 +304,9 @@ ProcRRSetProviderOutputSource(ClientPtr client)
>>
>>       pScrPriv->rrProviderSetOutputSource(pScreen, provider,
>> source_provider);
>>
>> +    provider->changed = TRUE;
>> +    RRSetChanged(pScreen);
>> +
>>       RRTellChanged (pScreen);
>>
>>       return Success;
>> @@ -333,6 +336,9 @@ ProcRRSetProviderOffloadSink(ClientPtr client)
>>
>>       pScrPriv->rrProviderSetOffloadSink(pScreen, provider,
>> sink_provider);
>>
>> +    provider->changed = TRUE;
>> +    RRSetChanged(pScreen);
>> +
>>       RRTellChanged (pScreen);
>>
>>       return Success;
>> @@ -357,6 +363,7 @@ RRProviderCreate(ScreenPtr pScreen, const char *name,
>>       provider->nameLength = nameLength;
>>       memcpy(provider->name, name, nameLength);
>>       provider->name[nameLength] = '\0';
>> +    provider->changed = FALSE;
>>
>>       if (!AddResource (provider->id, RRProviderType, (pointer)
>> provider))
>>           return NULL;
>> @@ -416,3 +423,21 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p)
>>           return TRUE;
>>       return FALSE;
>>   }
>> +
>> +void
>> +RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin,
>> RRProviderPtr provider)
>> +{
>> +    ScreenPtr pScreen = pWin->drawable.pScreen;
>> +
>> +    rrScrPriv(pScreen);
>> +
>> +    xRRProviderChangeNotifyEvent pe = {
>> +        .type = RRNotify + RREventBase,
>> +        .subCode = RRNotify_ProviderChange,
>> +        .timestamp = pScrPriv->lastSetTime.milliseconds,
>> +        .window = pWin->drawable.id,
>> +        .provider = provider->id
>> +    };
>> +
>> +    WriteEventsToClient(client, 1, (xEvent *) &pe);
>> +}
>> commit d94e40f0498b998c89e396a024d9a7bdc326cc41
>> Author: Dave Airlie <airlied at redhat.com>
>> Date:   Wed Jan 9 14:26:35 2013 +1000
>>
>>      randr: report changes when we disconnect a GPU slave
>>
>>      When we disconnect an output/offload slave set the changed bits,
>>      so a later TellChanged can do something.
>>
>>      Then when we remove a GPU slave device, sent change notification
>>      to the protocol screen.
>>
>>      This allows hot unplugged USB devices to disappear in clients.
>>
>>      Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
>>      Signed-off-by: Dave Airlie <airlied at redhat.com>
>>
>> diff --git a/hw/xfree86/common/xf86platformBus.c
>> b/hw/xfree86/common/xf86platformBus.c
>> index db831a8..e368dee 100644
>> --- a/hw/xfree86/common/xf86platformBus.c
>> +++ b/hw/xfree86/common/xf86platformBus.c
>> @@ -47,6 +47,7 @@
>>   #include "Pci.h"
>>   #include "xf86platformBus.h"
>>
>> +#include "randrstr.h"
>>   int platformSlotClaimed;
>>
>>   int xf86_num_platform_devices;
>> @@ -507,7 +508,7 @@ xf86platformRemoveDevice(int index)
>>       xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
>>
>>       xf86_remove_platform_device(index);
>> -
>> +    RRTellChanged(xf86Screens[0]->pScreen);
>>    out:
>>       return;
>>   }
>> diff --git a/hw/xfree86/modes/xf86RandR12.c
>> b/hw/xfree86/modes/xf86RandR12.c
>> index 8a4bad7..db31432 100644
>> --- a/hw/xfree86/modes/xf86RandR12.c
>> +++ b/hw/xfree86/modes/xf86RandR12.c
>> @@ -1908,10 +1908,12 @@ xf86RandR14ProviderDestroy(ScreenPtr screen,
>> RRProviderPtr provider)
>>           if (config->randr_provider->offload_sink) {
>>               DetachOffloadGPU(screen);
>>               config->randr_provider->offload_sink = NULL;
>> +            RRSetChanged(screen);
>>           }
>>           else if (config->randr_provider->output_source) {
>>               xf86DetachOutputGPU(screen);
>>               config->randr_provider->output_source = NULL;
>> +            RRSetChanged(screen);
>>           }
>>           else if (screen->current_master)
>>               DetachUnboundGPU(screen);
>> commit e233bda3e7c68234b34a8b7ad04b27c6e2009a8f
>> Author: Dave Airlie <airlied at redhat.com>
>> Date:   Wed Jan 9 14:25:43 2013 +1000
>>
>>      randr: only respected changed on the protocol screen
>>
>>      We don't want to know about changes on the non-protocol screen,
>>      we will fix up setchanged to make sure non-protocol screens update
>>      the protocol screens when they have a change.
>>
>>      Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
>>      Signed-off-by: Dave Airlie <airlied at redhat.com>
>>
>> diff --git a/randr/randr.c b/randr/randr.c
>> index fb0895d..cb6fce7 100644
>> --- a/randr/randr.c
>> +++ b/randr/randr.c
>> @@ -506,7 +506,7 @@ RRTellChanged(ScreenPtr pScreen)
>>           mastersp = pScrPriv;
>>       }
>>
>> -    if (pScrPriv->changed) {
>> +    if (mastersp->changed) {
>>           UpdateCurrentTimeIf();
>>           if (mastersp->configChanged) {
>>               mastersp->lastConfigTime = currentTime;
>> commit 61df3350d000e32ea60f6b1cd222c5adc2e35617
>> Author: Dave Airlie <airlied at redhat.com>
>> Date:   Wed Jan 9 14:29:47 2013 +1000
>>
>>      randr: make SetChanged modify the main protocol screen not the
>> gpu screen
>>
>>      When SetChanged is called we now modify the main protocol screen,
>>      not the the gpu screen. Since changed stuff should work at the
>> protocol level.
>>
>>      Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
>>      Signed-off-by: Dave Airlie <airlied at redhat.com>
>>
>> diff --git a/randr/randr.c b/randr/randr.c
>> index 11f88b2..fb0895d 100644
>> --- a/randr/randr.c
>> +++ b/randr/randr.c
>> @@ -467,9 +467,23 @@ TellChanged(WindowPtr pWin, pointer value)
>>   void
>>   RRSetChanged(ScreenPtr pScreen)
>>   {
>> +    /* set changed bits on the master screen only */
>> +    ScreenPtr master;
>>       rrScrPriv(pScreen);
>> +    rrScrPrivPtr mastersp;
>> +
>> +    if (pScreen->isGPU) {
>> +        master = pScreen->current_master;
>> +        if (!master)
>> +            return;
>> +        mastersp = rrGetScrPriv(master);
>> +    }
>> +    else {
>> +        master = pScreen;
>> +        mastersp = pScrPriv;
>> +    }
>>
>> -    pScrPriv->changed = TRUE;
>> +    mastersp->changed = TRUE;
>>   }
>>
>>   /*
>> commit 0454e4485186953195dc48d7b403eb610102d0a5
>> Author: Dave Airlie <airlied at redhat.com>
>> Date:   Wed Jan 9 14:23:57 2013 +1000
>>
>>      randr: don't directly set changed bits in randr screen
>>
>>      Introduce a wrapper interface so we can fix things up for multi-gpu
>>      situations later.
>>
>>      This just introduces the API for now.
>>
>>      Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
>>      Signed-off-by: Dave Airlie <airlied at redhat.com>
>>
>> diff --git a/randr/randr.c b/randr/randr.c
>> index f0decfc..11f88b2 100644
>> --- a/randr/randr.c
>> +++ b/randr/randr.c
>> @@ -464,6 +464,14 @@ TellChanged(WindowPtr pWin, pointer value)
>>       return WT_WALKCHILDREN;
>>   }
>>
>> +void
>> +RRSetChanged(ScreenPtr pScreen)
>> +{
>> +    rrScrPriv(pScreen);
>> +
>> +    pScrPriv->changed = TRUE;
>> +}
>> +
>>   /*
>>    * Something changed; send events and adjust pointer position
>>    */
>> diff --git a/randr/randrstr.h b/randr/randrstr.h
>> index 2517479..2babfed 100644
>> --- a/randr/randrstr.h
>> +++ b/randr/randrstr.h
>> @@ -486,6 +486,10 @@ extern _X_EXPORT void
>>    RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr
>> pScreen);
>>
>>   /* randr.c */
>> +/* set a screen change on the primary screen */
>> +extern _X_EXPORT void
>> +RRSetChanged(ScreenPtr pScreen);
>> +
>>   /*
>>    * Send all pending events
>>    */
>> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
>> index 6e2eca5..b3fb5bd 100644
>> --- a/randr/rrcrtc.c
>> +++ b/randr/rrcrtc.c
>> @@ -39,7 +39,7 @@ RRCrtcChanged(RRCrtcPtr crtc, Bool layoutChanged)
>>       if (pScreen) {
>>           rrScrPriv(pScreen);
>>
>> -        pScrPriv->changed = TRUE;
>> +        RRSetChanged(pScreen);
>>           /*
>>            * Send ConfigureNotify on any layout change
>>            */
>> diff --git a/randr/rrinfo.c b/randr/rrinfo.c
>> index 1408d6f..fc57bd4 100644
>> --- a/randr/rrinfo.c
>> +++ b/randr/rrinfo.c
>> @@ -225,7 +225,7 @@ RRScreenSetSizeRange(ScreenPtr pScreen,
>>       pScrPriv->minHeight = minHeight;
>>       pScrPriv->maxWidth = maxWidth;
>>       pScrPriv->maxHeight = maxHeight;
>> -    pScrPriv->changed = TRUE;
>> +    RRSetChanged(pScreen);
>>       pScrPriv->configChanged = TRUE;
>>   }
>>
>> diff --git a/randr/rroutput.c b/randr/rroutput.c
>> index 88781ba..922d61f 100644
>> --- a/randr/rroutput.c
>> +++ b/randr/rroutput.c
>> @@ -36,7 +36,7 @@ RROutputChanged(RROutputPtr output, Bool configChanged)
>>       output->changed = TRUE;
>>       if (pScreen) {
>>           rrScrPriv(pScreen);
>> -        pScrPriv->changed = TRUE;
>> +        RRSetChanged(pScreen);
>>           if (configChanged)
>>               pScrPriv->configChanged = TRUE;
>>       }
>> diff --git a/randr/rrscreen.c b/randr/rrscreen.c
>> index 39340cc..36179ae 100644
>> --- a/randr/rrscreen.c
>> +++ b/randr/rrscreen.c
>> @@ -143,7 +143,7 @@ RRScreenSizeNotify(ScreenPtr pScreen)
>>       pScrPriv->height = pScreen->height;
>>       pScrPriv->mmWidth = pScreen->mmWidth;
>>       pScrPriv->mmHeight = pScreen->mmHeight;
>> -    pScrPriv->changed = TRUE;
>> +    RRSetChanged(pScreen);
>>   /*    pScrPriv->sizeChanged = TRUE; */
>>
>>       RRTellChanged(pScreen);
>> commit c635df3a7dcc1eaa0dbd3c3e1b02adcfcfb74e0a
>> Author: Adam Jackson <ajax at redhat.com>
>> Date:   Wed Aug 21 14:12:52 2013 -0400
>>
>>      randr: Fix a copypasta bug in CRTC confinement
>>
>>      Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
>>      Signed-off-by: Adam Jackson <ajax at redhat.com>
>>
>> diff --git a/randr/rrpointer.c b/randr/rrpointer.c
>> index ec803e9..eb6b677 100644
>> --- a/randr/rrpointer.c
>> +++ b/randr/rrpointer.c
>> @@ -82,7 +82,7 @@ RRPointerToNearestCrtc(DeviceIntPtr pDev, ScreenPtr
>> pScreen, int x, int y,
>>           else
>>               dx = 0;
>>           if (y < crtc->y)
>> -            dy = crtc->y - x;
>> +            dy = crtc->y - y;
>>           else if (y > crtc->y + scan_height)
>>               dy = y - (crtc->y + scan_height);
>>           else
>> commit c856013cd2ca361dfa1b808071b7869c81224ec5
>> Author: Aaron Plattner <aplattner at nvidia.com>
>> Date:   Tue Apr 30 14:14:23 2013 -0700
>>
>>      xfree86: detach scanout pixmaps when detaching output GPUs
>>
>>      Commit 8f4640bdb9d3988148e09a08d2c7e3bab1d538d6 fixed a bit of a
>>      chicken-and-egg problem by detaching GPU screens when their
>> providers
>>      are destroyed, which happens before CloseScreen is called.  However,
>>      this created a new problem: the GPU screen tears down its RandR crtc
>>      objects during CloseScreen and if one of them is active, it tries to
>>      detach the scanout pixmap then.  This crashes because
>>      RRCrtcDetachScanoutPixmap tries to get the master screen's screen
>>      pixmap, but crtc->pScreen->current_master is already NULL at that
>>      point.
>>
>>      It doesn't make sense for an unbound GPU screen to still be scanning
>>      out its former master screen's pixmap, so detach them first when the
>>      provider is destroyed.
>>
>>      Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
>>      Reviewed-by: Dave Airlie <airlied at redhat.com>
>>      Signed-off-by: Keith Packard <keithp at keithp.com>
>>
>> diff --git a/hw/xfree86/modes/xf86RandR12.c
>> b/hw/xfree86/modes/xf86RandR12.c
>> index 01fc9c5..8a4bad7 100644
>> --- a/hw/xfree86/modes/xf86RandR12.c
>> +++ b/hw/xfree86/modes/xf86RandR12.c
>> @@ -1770,6 +1770,19 @@ xf86RandR12EnterVT(ScrnInfoPtr pScrn)
>>       return RRGetInfo(pScreen, TRUE);    /* force a re-probe of
>> outputs and notify clients about changes */
>>   }
>>
>> +static void
>> +xf86DetachOutputGPU(ScreenPtr pScreen)
>> +{
>> +    rrScrPrivPtr rp = rrGetScrPriv(pScreen);
>> +    int i;
>> +
>> +    /* make sure there are no attached shared scanout pixmaps first */
>> +    for (i = 0; i < rp->numCrtcs; i++)
>> +        RRCrtcDetachScanoutPixmap(rp->crtcs[i]);
>> +
>> +    DetachOutputGPU(pScreen);
>> +}
>> +
>>   static Bool
>>   xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen,
>>                                      RRProviderPtr provider,
>> @@ -1779,7 +1792,7 @@ xf86RandR14ProviderSetOutputSource(ScreenPtr
>> pScreen,
>>           if (provider->output_source) {
>>               ScreenPtr cmScreen = pScreen->current_master;
>>
>> -            DetachOutputGPU(pScreen);
>> +            xf86DetachOutputGPU(pScreen);
>>               AttachUnboundGPU(cmScreen, pScreen);
>>           }
>>           provider->output_source = NULL;
>> @@ -1807,7 +1820,7 @@ xf86RandR14ProviderSetOffloadSink(ScreenPtr
>> pScreen,
>>       if (!sink_provider) {
>>           if (provider->offload_sink) {
>>               ScreenPtr cmScreen = pScreen->current_master;
>> -            DetachOutputGPU(pScreen);
>> +            xf86DetachOutputGPU(pScreen);
>>               AttachUnboundGPU(cmScreen, pScreen);
>>           }
>>
>> @@ -1897,7 +1910,7 @@ xf86RandR14ProviderDestroy(ScreenPtr screen,
>> RRProviderPtr provider)
>>               config->randr_provider->offload_sink = NULL;
>>           }
>>           else if (config->randr_provider->output_source) {
>> -            DetachOutputGPU(screen);
>> +            xf86DetachOutputGPU(screen);
>>               config->randr_provider->output_source = NULL;
>>           }
>>           else if (screen->current_master)
> 


-- 
Matt Dew <marcoz at osource.org>       Key signature: 0xF7C3 BEC3
Fingerprint: FDB1 9D94 C573 DC29 BCCB 2F9F A6BF 3771 F7C3 BEC3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 555 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20131102/9efc53fa/attachment-0001.pgp>


More information about the xorg-devel mailing list