fix: Abdock-Sequenz erst eDP an, dann Profil (amdgpu-Commit-Race)
This commit is contained in:
1 parent
85e75f196f
commit
b4976ed44f
2 files changed
+30
-1
No files matched your search
Binary file not shown.
@@ -113,7 +113,7 @@ def detect_outputs():
|
|||||||
outputs.append(
|
outputs.append(
|
||||||
{
|
{
|
||||||
"name": name,
|
"name": name,
|
||||||
"internal": name.startswith(("eDP-", "LVDS-", "DSI-")),
|
"internal": is_internal_name(name),
|
||||||
"width": chosen.get("width"),
|
"width": chosen.get("width"),
|
||||||
"height": chosen.get("height"),
|
"height": chosen.get("height"),
|
||||||
"rate": norm_rate(chosen.get("refresh") or chosen.get("rate")),
|
"rate": norm_rate(chosen.get("refresh") or chosen.get("rate")),
|
||||||
@@ -340,6 +340,25 @@ def notify_send(summary, body=""):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def is_internal_name(name):
|
||||||
|
return name.startswith(("eDP-", "LVDS-", "DSI-"))
|
||||||
|
|
||||||
|
|
||||||
|
def enable_outputs(names):
|
||||||
|
"""Ausgaenge per wlr-randr einschalten (stiller Vorab-Schritt)."""
|
||||||
|
if shutil.which("wlr-randr") is None:
|
||||||
|
return
|
||||||
|
for n in sorted(names):
|
||||||
|
try:
|
||||||
|
subprocess.run(
|
||||||
|
["wlr-randr", "--output", n, "--on"],
|
||||||
|
timeout=15, check=False,
|
||||||
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def find_kanshi_pids():
|
def find_kanshi_pids():
|
||||||
"""PIDs laufender kanshi-Prozesse (ohne uns selbst), ohne pkill-Abhaengigkeit."""
|
"""PIDs laufender kanshi-Prozesse (ohne uns selbst), ohne pkill-Abhaengigkeit."""
|
||||||
pids, me = [], os.getpid()
|
pids, me = [], os.getpid()
|
||||||
@@ -407,6 +426,16 @@ def run_watch():
|
|||||||
if is_managed(CONFIG_PATH) and names != config_output_names(CONFIG_PATH):
|
if is_managed(CONFIG_PATH) and names != config_output_names(CONFIG_PATH):
|
||||||
apply(merge_configs(safe_read(CONFIG_PATH), render(outputs)))
|
apply(merge_configs(safe_read(CONFIG_PATH), render(outputs)))
|
||||||
elif names != last_set:
|
elif names != last_set:
|
||||||
|
# Abdock-Sequenz: Waren Externe da und ist jetzt (auch) ein
|
||||||
|
# internes Panel da, erst das interne anzünden und kurz
|
||||||
|
# warten, BEVOR kanshi das volle Profil anwendet. Der
|
||||||
|
# kombinierte Commit (MST-Abbau + eDP-An in einem) hängt
|
||||||
|
# sonst die amdgpu-Pipeline (selbst die VT bleibt schwarz).
|
||||||
|
prev_extern = {o for o in last_set if not is_internal_name(o)}
|
||||||
|
new_intern = {o["name"] for o in outputs if o["internal"]}
|
||||||
|
if prev_extern and new_intern:
|
||||||
|
enable_outputs(new_intern)
|
||||||
|
time.sleep(2)
|
||||||
profile = None
|
profile = None
|
||||||
if is_managed(CONFIG_PATH):
|
if is_managed(CONFIG_PATH):
|
||||||
if names != config_output_names(CONFIG_PATH):
|
if names != config_output_names(CONFIG_PATH):
|
||||||
|
|||||||
Reference in new issue
Block a user