[PATCH] Set the RandR primary output on startup if Xorg hasn't

Alex Deucher alexdeucher at gmail.com
Thu Jan 14 06:30:27 PST 2016


On Thu, Jan 14, 2016 at 3:43 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Fixes xrandr (XRRGetOutputPrimary) not reporting any output as primary
> after startup.
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

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

> ---
>  src/radeon_kms.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index d459740..971f11c 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -241,6 +241,7 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
>  {
>      ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
>      RADEONInfoPtr  info   = RADEONPTR(pScrn);
> +    rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
>      PixmapPtr pixmap;
>      struct radeon_surface *surface;
>
> @@ -249,6 +250,20 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
>         return FALSE;
>      pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS;
>
> +    /* Set the RandR primary output if Xorg hasn't */
> +    if (
> +#ifdef RADEON_PIXMAP_SHARING
> +       !pScreen->isGPU &&
> +#endif
> +       !rrScrPriv->primaryOutput)
> +    {
> +       xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
> +
> +       rrScrPriv->primaryOutput = xf86_config->output[0]->randr_output;
> +       RROutputChanged(rrScrPriv->primaryOutput, FALSE);
> +       rrScrPriv->layoutChanged = TRUE;
> +    }
> +
>      if (!drmmode_set_desired_modes(pScrn, &info->drmmode, FALSE))
>         return FALSE;
>
> --
> 2.6.2
>
> _______________________________________________
> xorg-driver-ati mailing list
> xorg-driver-ati at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-driver-ati


More information about the xorg-driver-ati mailing list