[PATCH 20/36] xf86: add ability to do a role change
Keith Packard
keithp at keithp.com
Mon Jul 2 12:15:47 PDT 2012
Dave Airlie <airlied at gmail.com> writes:
> From: Dave Airlie <airlied at redhat.com>
>
> This just hooks up a simple role change to go from unattached
> to slave output and back.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> hw/xfree86/modes/xf86RandR12.c | 27 ++++++++++++++++++++++++++-
> 1 file changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
> index 78cad63..5a85ed1 100644
> --- a/hw/xfree86/modes/xf86RandR12.c
> +++ b/hw/xfree86/modes/xf86RandR12.c
> @@ -1763,7 +1763,32 @@ xf86RandR15ProviderSetRole(ScreenPtr pScreen,
> RRProviderPtr provider,
> uint32_t new_role)
> {
> - /* do nothing so far */
> + ScreenPtr master;
> + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
> +
> + master = pScreen->current_master;
> +
> + assert(!master->isGPU);
> + SetRootClip(master, FALSE);
> +
> + if (new_role == RR_Role_Slave_Output) {
> + if (provider->current_role == 0)
> + DetachUnboundGPU(pScreen);
> + AttachOutputGPU(master, pScreen);
Perhaps what's needed is for there to be a generic DetachGPU
function which pulls the provider out of whatever screen list it's
currently in. Otherwise, switching a slave from one master to another
will break stuff badly.
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20120702/8237068b/attachment.pgp>
More information about the xorg-devel
mailing list