diff options
author | Dave Airlie <airlied@redhat.com> | 2012-07-05 15:50:56 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-07-07 10:39:03 +0100 |
commit | e2fd447e76c4a1233374c9d8fa9cae54a55dad50 (patch) | |
tree | 771d3e9e4a8e75de1c5d8993655af4b9815f4316 /hw | |
parent | 22f02120eb4092e1c283f81c8040f178693ff0a4 (diff) |
xf86: add callback for offloak sink setting support.
This adds support for setting the offload sink to the xf86 ddx.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 6 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 27 |
2 files changed, 32 insertions, 1 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index c5c7cb7a5..d20152ce6 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -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; } diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 9548333c6..b4ed46aeb 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -1789,6 +1789,32 @@ xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen, } 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, Atom property, RRPropertyValuePtr value) @@ -1857,6 +1883,7 @@ xf86RandR12Init12(ScreenPtr pScreen) rp->rrSetConfig = NULL; rp->rrProviderSetOutputSource = xf86RandR14ProviderSetOutputSource; + rp->rrProviderSetOffloadSink = xf86RandR14ProviderSetOffloadSink; rp->rrProviderSetProperty = xf86RandR14ProviderSetProperty; rp->rrProviderGetProperty = xf86RandR14ProviderGetProperty; |