William Shallum

xrandr Set Default Scaling Mode

Posted Apr 18 2015, 22:10 by William Shallum [updated Jul 5 2015, 08:17]

Among other annoyances, the TV monitor does not react well (displays a fringing effect between high contrast areas) when the xrandr scaling mode is set to Full (using the nouveau driver here). Sadly this is the default. Even sadder, there is no place in the xorg.conf to actually fix this (xrandr being a dynamic mechanism after all, to support adding displays dynamically), so the fix is to run xrandr on every X startup.

The best place to do that is in GDM (version 3) initialization since that will also fix the GDM login display.

On my CentOS 7 system this is /etc/gdm/Init/Default (but don’t edit that). The docs say that GDM will load the Default script if there is no display-specific script. Let’s just add a display-specific script /etc/gdm/Init/:0:

#!/bin/sh

XRANDR=/usr/bin/xrandr
if [ -x "$XRANDR" ] ; then
  if "$XRANDR" | grep '^DVI-I-1 connected' >/dev/null 2>&1 ; then
    "$XRANDR" --output DVI-I-1 --set "scaling mode" "None"
  fi
fi

exec /etc/gdm/Init/Default

This was not a problem when CentOS 6 was installed on the machine so I can only guess there were some interesting changes in the intervening versions.

References: