Allow Dual Screen Configurations for intel IGPs

improve xrandr_facts.py to match drm and xrandr outputs

TODO: use drm.edid_firmware kernel boot parameter to load EDID files
  on startup
This commit is contained in:
Alexander Grothe
2019-02-22 00:12:02 +01:00
parent c0dc185952
commit 08ed05594e
5 changed files with 966 additions and 593 deletions

View File

@@ -44,6 +44,12 @@
- '-w alsa-driver-broken'
# - '-a pulse' # do we need this with our existing asound.conf?
- name: vdr-config | use vaapi for softhddevice if we got an intel IGP
lineinfile:
path: /etc/vdr/conf.avail/softhddevice.conf
line: '-v va-pi'
state: present if intel_detected else absent
- name: add a login shell for the user vdr
user:
name: '{{ vdr.user }}'

View File

@@ -1,19 +1,39 @@
{{ ansible_managed | comment }}
{% set output = xorg.primary.connector|replace("-", "") %}
{% set primary_output = xorg.primary.connector|replace("-", "") %}
{% if xorg.secondary is defined %}
{% set secondary_output = xorg.secondary.connector|replace("-", "") %}
{% endif %}
Section "Device"
Identifier "Device0"
Driver "intel"
Option "TearFree" "true"
Option "UseEDID" "true"
Option "CustomEDID" "{{ output }}:{{ xorg.primary.edid }}"
{% if xorg.secondary is defined %}
Option "ZaphodHeads" "{{ primary_output }}"
Screen 0
{% endif %}
EndSection
{% if xorg.secondary is defined %}
Section "Device"
Identifier "Device1"
Driver "intel"
Option "TearFree" "true"
Option "ZaphodHeads" "{{ secondary_output }}"
Screen 1
EndSection
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
EndSection
{% endif %}
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "{{ output }}"
Monitor "{{ primary_output }}"
DefaultDepth 24
SubSection "Display"
Depth 24
@@ -24,8 +44,26 @@ Section "Screen"
{% endif %}
EndSubSection
EndSection
{% if xorg.secondary is defined %}
Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "{{ secondary_output }}"
DefaultDepth 24
SubSection "Display"
Depth 24
{% if xorg.secondary.mode %}
Modes "{{ xorg.secondary.mode }}"
{% else %}
Modes "1920x1080_50" "1920x1080_60" "1920x1080_24"
{% endif %}
EndSubSection
EndSection
{% endif %}
Section "Monitor"
Identifier "{{ output }}"
Identifier "{{ primary_output }}"
{% if xorg.primary.modelines %}
{% for modeline in xorg.primary.modelines %}
{{ modeline }}
@@ -37,8 +75,23 @@ Section "Monitor"
{% endif %}
EndSection
{% if xorg.secondary is defined %}
Section "Monitor"
Identifier "{{ secondary_output }}"
{% if xorg.secondary.modelines %}
{% for modeline in xorg.secondary.modelines %}
{{ modeline }}
{% endfor %}
{% else %}
Modeline "1920x1080_24" 74.230 1920 2560 2604 2752 1080 1084 1089 1125 +hsync +vsync
Modeline "1920x1080_50" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
Modeline "1920x1080_60" 148.500 1920 2008 2056 2200 1080 1084 1089 1125 +hsync +vsync
{% endif %}
EndSection
{% endif %}
{% for connector, data in xrandr["Screen 0:"].iteritems() %}
{% if not data.is_connected or connector != xorg.primary.connector %}
{% if not data.is_connected or connector != xorg.primary.connector or (xorg.secondary is defined and connector != xorg.secondary.connector) %}
Section "Monitor"
Identifier "{{ connector|replace("-","") }}"
Option "Ignore" "true"