2012-06-13 15:03:04 +02:00
|
|
|
/*
|
|
|
|
* Copyright © 2012 Red Hat Inc.
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
* documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
* the above copyright notice appear in all copies and that both that copyright
|
|
|
|
* notice and this permission notice appear in supporting documentation, and
|
|
|
|
* that the name of the copyright holders not be used in advertising or
|
|
|
|
* publicity pertaining to distribution of the software without specific,
|
|
|
|
* written prior permission. The copyright holders make no representations
|
|
|
|
* about the suitability of this software for any purpose. It is provided "as
|
|
|
|
* is" without express or implied warranty.
|
|
|
|
*
|
|
|
|
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
|
|
|
* OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* Authors: Dave Airlie
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "randrstr.h"
|
|
|
|
#include "swaprep.h"
|
|
|
|
|
randr: Add ability to turn PRIME sync off
Adds an output parameter to disable PRIME synchronization.
Output parameter is created when the user calls 'xrandr
--setprovideroutputsource <sink> <source>' to prevent polluting output
parameters of non-PRIME configurations.
Defaults to on, so if the user wants PRIME synchronization they don't need
to do anything.
If the user wishes to disable PRIME synchronization when they first set up
PRIME, they can run 'xrandr --output <output> --set "PRIME Synchronization"
0' after running 'xrandr --setprovideroutputsource <sink> <source>', but
before 'xrandr --auto'.
If the user wishes to enable or disable PRIME synchronization after PRIME has
already been set up, they can run 'xrandr --output <output> --set "PRIME
Synchronization" <0 or 1>' at any time, xrandr will trigger a modeset, which
will tear down and setup PRIME in the configuration they requested on CRTCs
associated with that output.
randrstr.h:
Add central definition of the output property name.
rrcrtc.c:
Add function rrGetPixmapSharingSyncProp() to query the status of the
output property.
Add function rrSetPixmapSharingSyncProp() to set the output property.
Add 'sync' parameter to rrSetupPixmapSharing(), which when false will
use single buffering even if the required ABI functions are supported.
Changes rrSetupPixmapSharing() to only report an error if falling back
to single buffering when the user requested synchronization.
Change RRCrtcSet() to use rrPixmapSharingSyncProp() to query the status
of the output property and feed it into rrSetupPixmapSharing() using
the 'sync' parameter.
rrprovider.c:
Add RR(Init/Fini)PrimeSyncProps(), functions to create and destroy the
PRIME synchronization output property.
Add a call to RRInitPrimeSyncProps() in
ProcRRSetProviderOutputSource(), such that the output property is
created when the user requests PRIME.
Add a call to RRFiniPrimeSyncProps() in RRProviderDestroy().
v1: Initial commit
v2: Unchanged
v3: Add /* TODO */ for handling different sources with different outputs
Make rrSetupPixmapSharing() set the output property to 0 if it has to fall
back, to avoid user confusion.
Make rr(Get)PixmapSharingSyncProp() check the current value if there isn't a
pending value
v4: Unchanged
v5: Unchanged
v6: Rebase onto ToT
v7: Unchanged
Signed-off-by: Alex Goins <agoins@nvidia.com>
2016-06-17 05:06:48 +02:00
|
|
|
#include <X11/Xatom.h>
|
|
|
|
|
2012-06-13 15:03:04 +02:00
|
|
|
RESTYPE RRProviderType;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize provider type error value
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
RRProviderInitErrorValue(void)
|
|
|
|
{
|
|
|
|
SetResourceTypeErrorValue(RRProviderType, RRErrorBase + BadRRProvider);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ADD_PROVIDER(_pScreen) do { \
|
|
|
|
pScrPriv = rrGetScrPriv((_pScreen)); \
|
|
|
|
if (pScrPriv->provider) { \
|
|
|
|
providers[count_providers] = pScrPriv->provider->id; \
|
|
|
|
if (client->swapped) \
|
|
|
|
swapl(&providers[count_providers]); \
|
|
|
|
count_providers++; \
|
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcRRGetProviders (ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xRRGetProvidersReq);
|
|
|
|
xRRGetProvidersReply rep;
|
|
|
|
WindowPtr pWin;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
rrScrPrivPtr pScrPriv;
|
|
|
|
int rc;
|
|
|
|
CARD8 *extra;
|
|
|
|
unsigned int extraLen;
|
|
|
|
RRProvider *providers;
|
|
|
|
int total_providers = 0, count_providers = 0;
|
2012-06-13 15:35:49 +02:00
|
|
|
ScreenPtr iter;
|
2012-06-13 15:03:04 +02:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRGetProvidersReq);
|
|
|
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
|
|
|
if (rc != Success)
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
pScreen = pWin->drawable.pScreen;
|
|
|
|
|
|
|
|
pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
|
|
|
|
if (pScrPriv->provider)
|
|
|
|
total_providers++;
|
xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.
This commit fixes this by unifying all 3 lists into a single slaves list.
Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-13 15:58:10 +02:00
|
|
|
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) {
|
2012-06-13 15:35:49 +02:00
|
|
|
pScrPriv = rrGetScrPriv(iter);
|
|
|
|
total_providers += pScrPriv->provider ? 1 : 0;
|
|
|
|
}
|
2012-06-13 15:03:04 +02:00
|
|
|
|
|
|
|
pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
|
|
|
|
if (!pScrPriv)
|
|
|
|
{
|
2012-07-14 19:45:29 +02:00
|
|
|
rep = (xRRGetProvidersReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.timestamp = currentTime.milliseconds,
|
|
|
|
.nProviders = 0
|
|
|
|
};
|
2012-06-13 15:03:04 +02:00
|
|
|
extra = NULL;
|
|
|
|
extraLen = 0;
|
|
|
|
} else {
|
2012-07-14 19:45:29 +02:00
|
|
|
rep = (xRRGetProvidersReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.timestamp = pScrPriv->lastSetTime.milliseconds,
|
|
|
|
.nProviders = total_providers,
|
|
|
|
.length = total_providers
|
|
|
|
};
|
2012-06-13 15:03:04 +02:00
|
|
|
extraLen = rep.length << 2;
|
|
|
|
if (extraLen) {
|
|
|
|
extra = malloc(extraLen);
|
|
|
|
if (!extra)
|
|
|
|
return BadAlloc;
|
|
|
|
} else
|
|
|
|
extra = NULL;
|
|
|
|
|
|
|
|
providers = (RRProvider *)extra;
|
|
|
|
ADD_PROVIDER(pScreen);
|
xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.
This commit fixes this by unifying all 3 lists into a single slaves list.
Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-13 15:58:10 +02:00
|
|
|
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) {
|
2012-06-13 15:35:49 +02:00
|
|
|
ADD_PROVIDER(iter);
|
|
|
|
}
|
2012-06-13 15:03:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.timestamp);
|
|
|
|
swaps(&rep.nProviders);
|
|
|
|
}
|
|
|
|
WriteToClient(client, sizeof(xRRGetProvidersReply), (char *)&rep);
|
|
|
|
if (extraLen)
|
|
|
|
{
|
|
|
|
WriteToClient (client, extraLen, (char *) extra);
|
|
|
|
free(extra);
|
|
|
|
}
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcRRGetProviderInfo (ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xRRGetProviderInfoReq);
|
|
|
|
xRRGetProviderInfoReply rep;
|
2012-07-05 16:41:22 +02:00
|
|
|
rrScrPrivPtr pScrPriv, pScrProvPriv;
|
2012-06-13 15:03:04 +02:00
|
|
|
RRProviderPtr provider;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
CARD8 *extra;
|
|
|
|
unsigned int extraLen = 0;
|
|
|
|
RRCrtc *crtcs;
|
|
|
|
RROutput *outputs;
|
|
|
|
int i;
|
|
|
|
char *name;
|
|
|
|
ScreenPtr provscreen;
|
|
|
|
RRProvider *providers;
|
|
|
|
uint32_t *prov_cap;
|
2014-10-31 00:45:12 +01:00
|
|
|
|
2012-06-13 15:03:04 +02:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetProviderInfoReq);
|
|
|
|
VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
|
|
|
|
|
|
|
|
pScreen = provider->pScreen;
|
|
|
|
pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
|
2012-07-14 19:45:29 +02:00
|
|
|
rep = (xRRGetProviderInfoReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.status = RRSetConfigSuccess,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.capabilities = provider->capabilities,
|
|
|
|
.nameLength = provider->nameLength,
|
|
|
|
.timestamp = pScrPriv->lastSetTime.milliseconds,
|
|
|
|
.nCrtcs = pScrPriv->numCrtcs,
|
|
|
|
.nOutputs = pScrPriv->numOutputs,
|
|
|
|
.nAssociatedProviders = 0
|
|
|
|
};
|
2012-06-13 15:03:04 +02:00
|
|
|
|
|
|
|
/* count associated providers */
|
2012-07-05 16:41:38 +02:00
|
|
|
if (provider->offload_sink)
|
|
|
|
rep.nAssociatedProviders++;
|
xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.
This commit fixes this by unifying all 3 lists into a single slaves list.
Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-13 15:58:10 +02:00
|
|
|
if (provider->output_source &&
|
|
|
|
provider->output_source != provider->offload_sink)
|
2012-07-05 16:41:38 +02:00
|
|
|
rep.nAssociatedProviders++;
|
xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.
This commit fixes this by unifying all 3 lists into a single slaves list.
Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-13 15:58:10 +02:00
|
|
|
xorg_list_for_each_entry(provscreen, &pScreen->slave_list, slave_head) {
|
|
|
|
if (provscreen->is_output_slave || provscreen->is_offload_slave)
|
|
|
|
rep.nAssociatedProviders++;
|
|
|
|
}
|
2012-07-05 16:41:38 +02:00
|
|
|
|
2012-06-13 15:03:04 +02:00
|
|
|
rep.length = (pScrPriv->numCrtcs + pScrPriv->numOutputs +
|
|
|
|
(rep.nAssociatedProviders * 2) + bytes_to_int32(rep.nameLength));
|
|
|
|
|
|
|
|
extraLen = rep.length << 2;
|
|
|
|
if (extraLen) {
|
|
|
|
extra = malloc(extraLen);
|
|
|
|
if (!extra)
|
|
|
|
return BadAlloc;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
extra = NULL;
|
|
|
|
|
|
|
|
crtcs = (RRCrtc *)extra;
|
|
|
|
outputs = (RROutput *)(crtcs + rep.nCrtcs);
|
|
|
|
providers = (RRProvider *)(outputs + rep.nOutputs);
|
|
|
|
prov_cap = (unsigned int *)(providers + rep.nAssociatedProviders);
|
|
|
|
name = (char *)(prov_cap + rep.nAssociatedProviders);
|
|
|
|
|
|
|
|
for (i = 0; i < pScrPriv->numCrtcs; i++) {
|
|
|
|
crtcs[i] = pScrPriv->crtcs[i]->id;
|
|
|
|
if (client->swapped)
|
|
|
|
swapl(&crtcs[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < pScrPriv->numOutputs; i++) {
|
|
|
|
outputs[i] = pScrPriv->outputs[i]->id;
|
|
|
|
if (client->swapped)
|
|
|
|
swapl(&outputs[i]);
|
|
|
|
}
|
|
|
|
|
2012-07-05 16:41:22 +02:00
|
|
|
i = 0;
|
2012-07-05 16:41:38 +02:00
|
|
|
if (provider->offload_sink) {
|
|
|
|
providers[i] = provider->offload_sink->id;
|
|
|
|
if (client->swapped)
|
|
|
|
swapl(&providers[i]);
|
|
|
|
prov_cap[i] = RR_Capability_SinkOffload;
|
|
|
|
if (client->swapped)
|
|
|
|
swapl(&prov_cap[i]);
|
|
|
|
i++;
|
|
|
|
}
|
2012-07-05 16:41:22 +02:00
|
|
|
if (provider->output_source) {
|
|
|
|
providers[i] = provider->output_source->id;
|
|
|
|
if (client->swapped)
|
|
|
|
swapl(&providers[i]);
|
|
|
|
prov_cap[i] = RR_Capability_SourceOutput;
|
|
|
|
swapl(&prov_cap[i]);
|
|
|
|
i++;
|
|
|
|
}
|
xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.
This commit fixes this by unifying all 3 lists into a single slaves list.
Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-13 15:58:10 +02:00
|
|
|
xorg_list_for_each_entry(provscreen, &pScreen->slave_list, slave_head) {
|
|
|
|
if (!provscreen->is_output_slave && !provscreen->is_offload_slave)
|
|
|
|
continue;
|
2012-07-05 16:41:22 +02:00
|
|
|
pScrProvPriv = rrGetScrPriv(provscreen);
|
|
|
|
providers[i] = pScrProvPriv->provider->id;
|
|
|
|
if (client->swapped)
|
|
|
|
swapl(&providers[i]);
|
xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.
This commit fixes this by unifying all 3 lists into a single slaves list.
Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-13 15:58:10 +02:00
|
|
|
prov_cap[i] = 0;
|
|
|
|
if (provscreen->is_output_slave)
|
|
|
|
prov_cap[i] |= RR_Capability_SinkOutput;
|
|
|
|
if (provscreen->is_offload_slave)
|
|
|
|
prov_cap[i] |= RR_Capability_SourceOffload;
|
2012-07-05 16:41:22 +02:00
|
|
|
if (client->swapped)
|
|
|
|
swapl(&prov_cap[i]);
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
2012-06-13 15:03:04 +02:00
|
|
|
memcpy(name, provider->name, rep.nameLength);
|
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.capabilities);
|
|
|
|
swaps(&rep.nCrtcs);
|
|
|
|
swaps(&rep.nOutputs);
|
|
|
|
swaps(&rep.nameLength);
|
|
|
|
}
|
|
|
|
WriteToClient(client, sizeof(xRRGetProviderInfoReply), (char *)&rep);
|
|
|
|
if (extraLen)
|
|
|
|
{
|
|
|
|
WriteToClient (client, extraLen, (char *) extra);
|
|
|
|
free(extra);
|
|
|
|
}
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
randr: Add ability to turn PRIME sync off
Adds an output parameter to disable PRIME synchronization.
Output parameter is created when the user calls 'xrandr
--setprovideroutputsource <sink> <source>' to prevent polluting output
parameters of non-PRIME configurations.
Defaults to on, so if the user wants PRIME synchronization they don't need
to do anything.
If the user wishes to disable PRIME synchronization when they first set up
PRIME, they can run 'xrandr --output <output> --set "PRIME Synchronization"
0' after running 'xrandr --setprovideroutputsource <sink> <source>', but
before 'xrandr --auto'.
If the user wishes to enable or disable PRIME synchronization after PRIME has
already been set up, they can run 'xrandr --output <output> --set "PRIME
Synchronization" <0 or 1>' at any time, xrandr will trigger a modeset, which
will tear down and setup PRIME in the configuration they requested on CRTCs
associated with that output.
randrstr.h:
Add central definition of the output property name.
rrcrtc.c:
Add function rrGetPixmapSharingSyncProp() to query the status of the
output property.
Add function rrSetPixmapSharingSyncProp() to set the output property.
Add 'sync' parameter to rrSetupPixmapSharing(), which when false will
use single buffering even if the required ABI functions are supported.
Changes rrSetupPixmapSharing() to only report an error if falling back
to single buffering when the user requested synchronization.
Change RRCrtcSet() to use rrPixmapSharingSyncProp() to query the status
of the output property and feed it into rrSetupPixmapSharing() using
the 'sync' parameter.
rrprovider.c:
Add RR(Init/Fini)PrimeSyncProps(), functions to create and destroy the
PRIME synchronization output property.
Add a call to RRInitPrimeSyncProps() in
ProcRRSetProviderOutputSource(), such that the output property is
created when the user requests PRIME.
Add a call to RRFiniPrimeSyncProps() in RRProviderDestroy().
v1: Initial commit
v2: Unchanged
v3: Add /* TODO */ for handling different sources with different outputs
Make rrSetupPixmapSharing() set the output property to 0 if it has to fall
back, to avoid user confusion.
Make rr(Get)PixmapSharingSyncProp() check the current value if there isn't a
pending value
v4: Unchanged
v5: Unchanged
v6: Rebase onto ToT
v7: Unchanged
Signed-off-by: Alex Goins <agoins@nvidia.com>
2016-06-17 05:06:48 +02:00
|
|
|
static void
|
|
|
|
RRInitPrimeSyncProps(ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* TODO: When adding support for different sources for different outputs,
|
|
|
|
* make sure this sets up the output properties only on outputs associated
|
|
|
|
* with the correct source provider.
|
|
|
|
*/
|
|
|
|
|
|
|
|
rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
|
|
|
|
const char *syncStr = PRIME_SYNC_PROP;
|
|
|
|
Atom syncProp = MakeAtom(syncStr, strlen(syncStr), TRUE);
|
|
|
|
|
|
|
|
int defaultVal = TRUE;
|
2018-05-08 01:46:16 +02:00
|
|
|
INT32 validVals[2] = {FALSE, TRUE};
|
randr: Add ability to turn PRIME sync off
Adds an output parameter to disable PRIME synchronization.
Output parameter is created when the user calls 'xrandr
--setprovideroutputsource <sink> <source>' to prevent polluting output
parameters of non-PRIME configurations.
Defaults to on, so if the user wants PRIME synchronization they don't need
to do anything.
If the user wishes to disable PRIME synchronization when they first set up
PRIME, they can run 'xrandr --output <output> --set "PRIME Synchronization"
0' after running 'xrandr --setprovideroutputsource <sink> <source>', but
before 'xrandr --auto'.
If the user wishes to enable or disable PRIME synchronization after PRIME has
already been set up, they can run 'xrandr --output <output> --set "PRIME
Synchronization" <0 or 1>' at any time, xrandr will trigger a modeset, which
will tear down and setup PRIME in the configuration they requested on CRTCs
associated with that output.
randrstr.h:
Add central definition of the output property name.
rrcrtc.c:
Add function rrGetPixmapSharingSyncProp() to query the status of the
output property.
Add function rrSetPixmapSharingSyncProp() to set the output property.
Add 'sync' parameter to rrSetupPixmapSharing(), which when false will
use single buffering even if the required ABI functions are supported.
Changes rrSetupPixmapSharing() to only report an error if falling back
to single buffering when the user requested synchronization.
Change RRCrtcSet() to use rrPixmapSharingSyncProp() to query the status
of the output property and feed it into rrSetupPixmapSharing() using
the 'sync' parameter.
rrprovider.c:
Add RR(Init/Fini)PrimeSyncProps(), functions to create and destroy the
PRIME synchronization output property.
Add a call to RRInitPrimeSyncProps() in
ProcRRSetProviderOutputSource(), such that the output property is
created when the user requests PRIME.
Add a call to RRFiniPrimeSyncProps() in RRProviderDestroy().
v1: Initial commit
v2: Unchanged
v3: Add /* TODO */ for handling different sources with different outputs
Make rrSetupPixmapSharing() set the output property to 0 if it has to fall
back, to avoid user confusion.
Make rr(Get)PixmapSharingSyncProp() check the current value if there isn't a
pending value
v4: Unchanged
v5: Unchanged
v6: Rebase onto ToT
v7: Unchanged
Signed-off-by: Alex Goins <agoins@nvidia.com>
2016-06-17 05:06:48 +02:00
|
|
|
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < pScrPriv->numOutputs; i++) {
|
|
|
|
if (!RRQueryOutputProperty(pScrPriv->outputs[i], syncProp)) {
|
|
|
|
RRConfigureOutputProperty(pScrPriv->outputs[i], syncProp,
|
|
|
|
TRUE, FALSE, FALSE,
|
|
|
|
2, &validVals[0]);
|
|
|
|
RRChangeOutputProperty(pScrPriv->outputs[i], syncProp, XA_INTEGER,
|
|
|
|
8, PropModeReplace, 1, &defaultVal,
|
|
|
|
FALSE, FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
RRFiniPrimeSyncProps(ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* TODO: When adding support for different sources for different outputs,
|
|
|
|
* make sure this tears down the output properties only on outputs
|
|
|
|
* associated with the correct source provider.
|
|
|
|
*/
|
|
|
|
|
|
|
|
rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
int i;
|
|
|
|
|
|
|
|
const char *syncStr = PRIME_SYNC_PROP;
|
|
|
|
Atom syncProp = MakeAtom(syncStr, strlen(syncStr), FALSE);
|
|
|
|
if (syncProp == None)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < pScrPriv->numOutputs; i++) {
|
|
|
|
RRDeleteOutputProperty(pScrPriv->outputs[i], syncProp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-05 16:41:22 +02:00
|
|
|
int
|
|
|
|
ProcRRSetProviderOutputSource(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xRRSetProviderOutputSourceReq);
|
|
|
|
rrScrPrivPtr pScrPriv;
|
|
|
|
RRProviderPtr provider, source_provider = NULL;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
|
2014-04-19 03:29:43 +02:00
|
|
|
REQUEST_SIZE_MATCH(xRRSetProviderOutputSourceReq);
|
2012-07-05 16:41:22 +02:00
|
|
|
|
|
|
|
VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
|
|
|
|
|
|
|
|
if (!(provider->capabilities & RR_Capability_SinkOutput))
|
|
|
|
return BadValue;
|
|
|
|
|
|
|
|
if (stuff->source_provider) {
|
|
|
|
VERIFY_RR_PROVIDER(stuff->source_provider, source_provider, DixReadAccess);
|
|
|
|
|
|
|
|
if (!(source_provider->capabilities & RR_Capability_SourceOutput))
|
|
|
|
return BadValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
pScreen = provider->pScreen;
|
|
|
|
pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
|
2017-01-10 11:51:55 +01:00
|
|
|
if (!pScreen->isGPU)
|
|
|
|
return BadValue;
|
|
|
|
|
2012-07-05 16:41:22 +02:00
|
|
|
pScrPriv->rrProviderSetOutputSource(pScreen, provider, source_provider);
|
|
|
|
|
randr: Add ability to turn PRIME sync off
Adds an output parameter to disable PRIME synchronization.
Output parameter is created when the user calls 'xrandr
--setprovideroutputsource <sink> <source>' to prevent polluting output
parameters of non-PRIME configurations.
Defaults to on, so if the user wants PRIME synchronization they don't need
to do anything.
If the user wishes to disable PRIME synchronization when they first set up
PRIME, they can run 'xrandr --output <output> --set "PRIME Synchronization"
0' after running 'xrandr --setprovideroutputsource <sink> <source>', but
before 'xrandr --auto'.
If the user wishes to enable or disable PRIME synchronization after PRIME has
already been set up, they can run 'xrandr --output <output> --set "PRIME
Synchronization" <0 or 1>' at any time, xrandr will trigger a modeset, which
will tear down and setup PRIME in the configuration they requested on CRTCs
associated with that output.
randrstr.h:
Add central definition of the output property name.
rrcrtc.c:
Add function rrGetPixmapSharingSyncProp() to query the status of the
output property.
Add function rrSetPixmapSharingSyncProp() to set the output property.
Add 'sync' parameter to rrSetupPixmapSharing(), which when false will
use single buffering even if the required ABI functions are supported.
Changes rrSetupPixmapSharing() to only report an error if falling back
to single buffering when the user requested synchronization.
Change RRCrtcSet() to use rrPixmapSharingSyncProp() to query the status
of the output property and feed it into rrSetupPixmapSharing() using
the 'sync' parameter.
rrprovider.c:
Add RR(Init/Fini)PrimeSyncProps(), functions to create and destroy the
PRIME synchronization output property.
Add a call to RRInitPrimeSyncProps() in
ProcRRSetProviderOutputSource(), such that the output property is
created when the user requests PRIME.
Add a call to RRFiniPrimeSyncProps() in RRProviderDestroy().
v1: Initial commit
v2: Unchanged
v3: Add /* TODO */ for handling different sources with different outputs
Make rrSetupPixmapSharing() set the output property to 0 if it has to fall
back, to avoid user confusion.
Make rr(Get)PixmapSharingSyncProp() check the current value if there isn't a
pending value
v4: Unchanged
v5: Unchanged
v6: Rebase onto ToT
v7: Unchanged
Signed-off-by: Alex Goins <agoins@nvidia.com>
2016-06-17 05:06:48 +02:00
|
|
|
RRInitPrimeSyncProps(pScreen);
|
|
|
|
|
2013-10-30 12:33:49 +01:00
|
|
|
provider->changed = TRUE;
|
|
|
|
RRSetChanged(pScreen);
|
|
|
|
|
2012-07-05 16:41:22 +02:00
|
|
|
RRTellChanged (pScreen);
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2012-07-05 16:41:38 +02:00
|
|
|
int
|
|
|
|
ProcRRSetProviderOffloadSink(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xRRSetProviderOffloadSinkReq);
|
|
|
|
rrScrPrivPtr pScrPriv;
|
|
|
|
RRProviderPtr provider, sink_provider = NULL;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
|
2014-04-19 03:29:43 +02:00
|
|
|
REQUEST_SIZE_MATCH(xRRSetProviderOffloadSinkReq);
|
2012-07-05 16:41:38 +02:00
|
|
|
|
|
|
|
VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
|
|
|
|
if (!(provider->capabilities & RR_Capability_SourceOffload))
|
|
|
|
return BadValue;
|
2016-04-29 06:01:30 +02:00
|
|
|
if (!provider->pScreen->isGPU)
|
|
|
|
return BadValue;
|
2012-07-05 16:41:38 +02:00
|
|
|
|
|
|
|
if (stuff->sink_provider) {
|
|
|
|
VERIFY_RR_PROVIDER(stuff->sink_provider, sink_provider, DixReadAccess);
|
|
|
|
if (!(sink_provider->capabilities & RR_Capability_SinkOffload))
|
|
|
|
return BadValue;
|
|
|
|
}
|
|
|
|
pScreen = provider->pScreen;
|
|
|
|
pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
|
|
|
|
pScrPriv->rrProviderSetOffloadSink(pScreen, provider, sink_provider);
|
|
|
|
|
2013-10-30 12:33:49 +01:00
|
|
|
provider->changed = TRUE;
|
|
|
|
RRSetChanged(pScreen);
|
|
|
|
|
2012-07-05 16:41:38 +02:00
|
|
|
RRTellChanged (pScreen);
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2012-06-13 15:03:04 +02:00
|
|
|
RRProviderPtr
|
|
|
|
RRProviderCreate(ScreenPtr pScreen, const char *name,
|
|
|
|
int nameLength)
|
|
|
|
{
|
|
|
|
RRProviderPtr provider;
|
|
|
|
rrScrPrivPtr pScrPriv;
|
|
|
|
|
|
|
|
pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
|
|
|
|
provider = calloc(1, sizeof(RRProviderRec) + nameLength + 1);
|
|
|
|
if (!provider)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
provider->id = FakeClientID(0);
|
|
|
|
provider->pScreen = pScreen;
|
|
|
|
provider->name = (char *) (provider + 1);
|
|
|
|
provider->nameLength = nameLength;
|
|
|
|
memcpy(provider->name, name, nameLength);
|
|
|
|
provider->name[nameLength] = '\0';
|
2013-10-30 12:33:49 +01:00
|
|
|
provider->changed = FALSE;
|
2012-06-13 15:03:04 +02:00
|
|
|
|
2013-12-15 10:05:51 +01:00
|
|
|
if (!AddResource (provider->id, RRProviderType, (void *) provider))
|
2012-06-13 15:03:04 +02:00
|
|
|
return NULL;
|
|
|
|
pScrPriv->provider = provider;
|
|
|
|
return provider;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Destroy a provider at shutdown
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
RRProviderDestroy (RRProviderPtr provider)
|
|
|
|
{
|
randr: Add ability to turn PRIME sync off
Adds an output parameter to disable PRIME synchronization.
Output parameter is created when the user calls 'xrandr
--setprovideroutputsource <sink> <source>' to prevent polluting output
parameters of non-PRIME configurations.
Defaults to on, so if the user wants PRIME synchronization they don't need
to do anything.
If the user wishes to disable PRIME synchronization when they first set up
PRIME, they can run 'xrandr --output <output> --set "PRIME Synchronization"
0' after running 'xrandr --setprovideroutputsource <sink> <source>', but
before 'xrandr --auto'.
If the user wishes to enable or disable PRIME synchronization after PRIME has
already been set up, they can run 'xrandr --output <output> --set "PRIME
Synchronization" <0 or 1>' at any time, xrandr will trigger a modeset, which
will tear down and setup PRIME in the configuration they requested on CRTCs
associated with that output.
randrstr.h:
Add central definition of the output property name.
rrcrtc.c:
Add function rrGetPixmapSharingSyncProp() to query the status of the
output property.
Add function rrSetPixmapSharingSyncProp() to set the output property.
Add 'sync' parameter to rrSetupPixmapSharing(), which when false will
use single buffering even if the required ABI functions are supported.
Changes rrSetupPixmapSharing() to only report an error if falling back
to single buffering when the user requested synchronization.
Change RRCrtcSet() to use rrPixmapSharingSyncProp() to query the status
of the output property and feed it into rrSetupPixmapSharing() using
the 'sync' parameter.
rrprovider.c:
Add RR(Init/Fini)PrimeSyncProps(), functions to create and destroy the
PRIME synchronization output property.
Add a call to RRInitPrimeSyncProps() in
ProcRRSetProviderOutputSource(), such that the output property is
created when the user requests PRIME.
Add a call to RRFiniPrimeSyncProps() in RRProviderDestroy().
v1: Initial commit
v2: Unchanged
v3: Add /* TODO */ for handling different sources with different outputs
Make rrSetupPixmapSharing() set the output property to 0 if it has to fall
back, to avoid user confusion.
Make rr(Get)PixmapSharingSyncProp() check the current value if there isn't a
pending value
v4: Unchanged
v5: Unchanged
v6: Rebase onto ToT
v7: Unchanged
Signed-off-by: Alex Goins <agoins@nvidia.com>
2016-06-17 05:06:48 +02:00
|
|
|
RRFiniPrimeSyncProps(provider->pScreen);
|
2012-06-13 15:03:04 +02:00
|
|
|
FreeResource (provider->id, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
RRProviderSetCapabilities(RRProviderPtr provider, uint32_t capabilities)
|
|
|
|
{
|
|
|
|
provider->capabilities = capabilities;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-12-15 10:05:51 +01:00
|
|
|
RRProviderDestroyResource (void *value, XID pid)
|
2012-06-13 15:03:04 +02:00
|
|
|
{
|
|
|
|
RRProviderPtr provider = (RRProviderPtr)value;
|
|
|
|
ScreenPtr pScreen = provider->pScreen;
|
|
|
|
|
|
|
|
if (pScreen)
|
|
|
|
{
|
|
|
|
rrScrPriv(pScreen);
|
|
|
|
|
2013-01-09 03:58:28 +01:00
|
|
|
if (pScrPriv->rrProviderDestroy)
|
|
|
|
(*pScrPriv->rrProviderDestroy)(pScreen, provider);
|
2012-06-13 15:03:04 +02:00
|
|
|
pScrPriv->provider = NULL;
|
|
|
|
}
|
|
|
|
free(provider);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
Bool
|
|
|
|
RRProviderInit(void)
|
|
|
|
{
|
|
|
|
RRProviderType = CreateNewResourceType(RRProviderDestroyResource, "Provider");
|
|
|
|
if (!RRProviderType)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool
|
|
|
|
RRProviderLookup(XID id, RRProviderPtr *provider_p)
|
|
|
|
{
|
|
|
|
int rc = dixLookupResourceByType((void **)provider_p, id,
|
|
|
|
RRProviderType, NullClient, DixReadAccess);
|
|
|
|
if (rc == Success)
|
|
|
|
return TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
2013-10-30 12:33:49 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|