Commit 98686512 authored by Dave Airlie's avatar Dave Airlie

xf86: add output source setting callback (v2)

This adds support for the randr callback for setting the output source
for a device.

v2: drop root clip change on detach
Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 4c92eb00
......@@ -741,7 +741,11 @@ xf86CrtcCloseScreen(ScreenPtr screen)
}
/* detach any providers */
if (config->randr_provider) {
if (screen->current_master)
if (config->randr_provider->output_source) {
DetachOutputGPU(screen);
config->randr_provider->output_source = NULL;
}
else if (screen->current_master)
DetachUnboundGPU(screen);
}
xf86RandR12CloseScreen(screen);
......
......@@ -1753,6 +1753,37 @@ xf86RandR12EnterVT(ScrnInfoPtr pScrn)
return RRGetInfo(pScreen, TRUE); /* force a re-probe of outputs and notify clients about changes */
}
static Bool
xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen,
RRProviderPtr provider,
RRProviderPtr source_provider)
{
if (!source_provider) {
if (provider->output_source) {
ScreenPtr cmScreen = pScreen->current_master;
DetachOutputGPU(pScreen);
AttachUnboundGPU(cmScreen, pScreen);
}
provider->output_source = NULL;
return TRUE;
}
if (provider->output_source == source_provider)
return TRUE;
SetRootClip(source_provider->pScreen, FALSE);
DetachUnboundGPU(pScreen);
AttachOutputGPU(source_provider->pScreen, pScreen);
provider->output_source = source_provider;
SetRootClip(source_provider->pScreen, TRUE);
return TRUE;
}
static Bool
xf86RandR14ProviderSetProperty(ScreenPtr pScreen,
RRProviderPtr randr_provider,
......@@ -1821,6 +1852,8 @@ xf86RandR12Init12(ScreenPtr pScreen)
rp->rrModeDestroy = xf86RandR12ModeDestroy;
rp->rrSetConfig = NULL;
rp->rrProviderSetOutputSource = xf86RandR14ProviderSetOutputSource;
rp->rrProviderSetProperty = xf86RandR14ProviderSetProperty;
rp->rrProviderGetProperty = xf86RandR14ProviderGetProperty;
rp->rrCrtcSetScanoutPixmap = xf86CrtcSetScanoutPixmap;
......
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