[xserver] xfree86/modes: Set RandR primary output from CreateScreenResources

Submitted by Michel Dänzer on Jan. 14, 2016, 9:09 a.m.

Details

Message ID 1452762584-5120-1-git-send-email-michel@daenzer.net
State Accepted
Commit 5b9f3ea2501a886fb74e5248e82a95e76443f1e8
Headers show
Series "xfree86/modes: Set RandR primary output from CreateScreenResources" ( rev: 1 ) in X.org (DEPRECATED - USE GITLAB)

Not browsing as part of any series.

Commit Message

Michel Dänzer Jan. 14, 2016, 9:09 a.m.
From: Michel Dänzer <michel.daenzer@amd.com>

Fixes XRRGetOutputPrimary and xrandr not reporting a primary output after
startup. This was especially confusing when an output was explicitly
marked as primary using Option "Primary" in Section "Monitor".

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 hw/xfree86/modes/xf86RandR12.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch hide | download patch | download mbox

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index eae7016..ac02b30 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -1626,6 +1626,7 @@  xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
 {
     int c;
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+    rrScrPrivPtr rp = rrGetScrPriv(pScreen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 
     if (xf86RandR12Key == NULL)
@@ -1638,6 +1639,13 @@  xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
                          config->maxWidth, config->maxHeight);
 
     xf86RandR12CreateMonitors(pScreen);
+
+    if (!pScreen->isGPU) {
+        rp->primaryOutput = config->output[0]->randr_output;
+        RROutputChanged(rp->primaryOutput, FALSE);
+        rp->layoutChanged = TRUE;
+    }
+
     return TRUE;
 }
 

Comments

On Thu, Jan 14, 2016 at 4:09 AM, Michel Dänzer <michel@daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> Fixes XRRGetOutputPrimary and xrandr not reporting a primary output after
> startup. This was especially confusing when an output was explicitly
> marked as primary using Option "Primary" in Section "Monitor".
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>


> ---
>  hw/xfree86/modes/xf86RandR12.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
> index eae7016..ac02b30 100644
> --- a/hw/xfree86/modes/xf86RandR12.c
> +++ b/hw/xfree86/modes/xf86RandR12.c
> @@ -1626,6 +1626,7 @@ xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
>  {
>      int c;
>      ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
> +    rrScrPrivPtr rp = rrGetScrPriv(pScreen);
>      xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
>
>      if (xf86RandR12Key == NULL)
> @@ -1638,6 +1639,13 @@ xf86RandR12CreateScreenResources12(ScreenPtr pScreen)
>                           config->maxWidth, config->maxHeight);
>
>      xf86RandR12CreateMonitors(pScreen);
> +
> +    if (!pScreen->isGPU) {
> +        rp->primaryOutput = config->output[0]->randr_output;
> +        RROutputChanged(rp->primaryOutput, FALSE);
> +        rp->layoutChanged = TRUE;
> +    }
> +
>      return TRUE;
>  }
>
> --
> 2.6.2
>
> _______________________________________________
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Merged.
   bd8ecd9..5b9f3ea  master -> master