diff options
Diffstat (limited to 'randr')
-rw-r--r-- | randr/rrprovider.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/randr/rrprovider.c b/randr/rrprovider.c index 217aead56..617185cf7 100644 --- a/randr/rrprovider.c +++ b/randr/rrprovider.c @@ -490,10 +490,20 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) void RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr primaryScreen) { - rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); - rrScrPrivPtr primaryPriv = rrGetScrPriv(primaryScreen); - RRProviderPtr provider = pScrPriv->provider; - RRProviderPtr primary_provider = primaryPriv->provider; + rrScrPrivPtr pScrPriv; + rrScrPrivPtr primaryPriv; + RRProviderPtr provider; + RRProviderPtr primary_provider; + + /* Bail out if RandR wasn't initialized. */ + if (!dixPrivateKeyRegistered(rrPrivKey)) + return; + + pScrPriv = rrGetScrPriv(pScreen); + primaryPriv = rrGetScrPriv(primaryScreen); + + provider = pScrPriv->provider; + primary_provider = primaryPriv->provider; if (!provider || !primary_provider) return; |