Commit e2fd447e authored by Dave Airlie's avatar Dave Airlie

xf86: add callback for offloak sink setting support.

This adds support for setting the offload sink to the xf86 ddx.
Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 22f02120
......@@ -741,7 +741,11 @@ xf86CrtcCloseScreen(ScreenPtr screen)
}
/* detach any providers */
if (config->randr_provider) {
if (config->randr_provider->output_source) {
if (config->randr_provider->offload_sink) {
DetachOffloadGPU(screen);
config->randr_provider->offload_sink = NULL;
}
else if (config->randr_provider->output_source) {
DetachOutputGPU(screen);
config->randr_provider->output_source = NULL;
}
......
......@@ -1788,6 +1788,32 @@ xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen,
return TRUE;
}
static Bool
xf86RandR14ProviderSetOffloadSink(ScreenPtr pScreen,
RRProviderPtr provider,
RRProviderPtr sink_provider)
{
if (!sink_provider) {
if (provider->offload_sink) {
ScreenPtr cmScreen = pScreen->current_master;
DetachOutputGPU(pScreen);
AttachUnboundGPU(cmScreen, pScreen);
}
provider->offload_sink = NULL;
return TRUE;
}
if (provider->offload_sink == sink_provider)
return TRUE;
DetachUnboundGPU(pScreen);
AttachOffloadGPU(sink_provider->pScreen, pScreen);
provider->offload_sink = sink_provider;
return TRUE;
}
static Bool
xf86RandR14ProviderSetProperty(ScreenPtr pScreen,
RRProviderPtr randr_provider,
......@@ -1857,6 +1883,7 @@ xf86RandR12Init12(ScreenPtr pScreen)
rp->rrSetConfig = NULL;
rp->rrProviderSetOutputSource = xf86RandR14ProviderSetOutputSource;
rp->rrProviderSetOffloadSink = xf86RandR14ProviderSetOffloadSink;
rp->rrProviderSetProperty = xf86RandR14ProviderSetProperty;
rp->rrProviderGetProperty = xf86RandR14ProviderGetProperty;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment