Configure the Kuycon by what it is, not where it is plugged in
The panel's 4500x3000 mode, 1.5 scale, and 10-bit request were a rule for connector DP-2 outright, which handed them to whatever monitor a stranger's machine had on its most common DisplayPort connector. The rule is now matched by description, the per-output prefs loop covers every connector including DP-2, and the displays contract pins the policy to the description rather than the port.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
-- ─────────────────────────────────────────────────────────────────────────────
|
||||
-- Monitors
|
||||
--
|
||||
-- Kuycon P20 on DP-2: 4500x3000 @ 60Hz, 1.5x fractional scale.
|
||||
-- Kuycon P20 (matched by description): 4500x3000 @ 60Hz, 1.5x fractional scale.
|
||||
-- 4500/1.5 = 3000 and 3000/1.5 = 2000, both integers, so this is a "clean"
|
||||
-- fractional scale and Hyprland will not complain.
|
||||
--
|
||||
@@ -125,17 +125,38 @@ local function display_position(entry, fallback)
|
||||
return fallback
|
||||
end
|
||||
|
||||
-- Every connected output uses the same validated per-output store. Automatic
|
||||
-- placement and the compositor's normal color policy unless the entry says
|
||||
-- otherwise.
|
||||
for output, _ in pairs(displays) do
|
||||
local entry = display_entry(output)
|
||||
if entry ~= nil then
|
||||
hl.monitor({
|
||||
output = output,
|
||||
mode = entry.mode,
|
||||
position = display_position(entry, "auto"),
|
||||
scale = entry.scale,
|
||||
transform = entry.transform,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- The Kuycon P20, matched by what it is rather than where it is plugged in.
|
||||
-- This used to be a rule for connector DP-2 outright, which handed the panel's
|
||||
-- 4500x3000 mode and 1.5 scale to whatever monitor a stranger's machine had on
|
||||
-- its most common DisplayPort connector. Emitted after the prefs loop so a
|
||||
-- saved entry for its connector still carries the mode/scale/position, while
|
||||
-- this rule holds the shipped defaults and the panel-specific color policy.
|
||||
local shipped_mode = "4500x3000@60"
|
||||
local shipped_scale = 1.5
|
||||
local shipped_transform = 0
|
||||
local dp2 = display_entry("DP-2")
|
||||
|
||||
local kuycon = display_entry("DP-2")
|
||||
hl.monitor({
|
||||
output = "DP-2",
|
||||
mode = dp2 and dp2.mode or shipped_mode,
|
||||
position = display_position(dp2, "0x0"),
|
||||
scale = dp2 and dp2.scale or shipped_scale,
|
||||
transform = dp2 and dp2.transform or shipped_transform,
|
||||
output = "desc:GVT Kuycon P20",
|
||||
mode = kuycon and kuycon.mode or shipped_mode,
|
||||
position = display_position(kuycon, "0x0"),
|
||||
scale = kuycon and kuycon.scale or shipped_scale,
|
||||
transform = kuycon and kuycon.transform or shipped_transform,
|
||||
|
||||
-- 10-bit output. 4500x3000@60 at 10bpc is ~24 Gbps, right at the edge of
|
||||
-- DP 1.4 HBR3, so this relies on DSC. If the display fails to light up or
|
||||
@@ -146,24 +167,6 @@ hl.monitor({
|
||||
cm = "auto",
|
||||
})
|
||||
|
||||
-- Other connected outputs use the same validated per-output store. They keep
|
||||
-- automatic placement and the compositor's normal color policy; DP-2 alone
|
||||
-- carries the panel-specific 10-bit policy documented above.
|
||||
for output, _ in pairs(displays) do
|
||||
if output ~= "DP-2" then
|
||||
local entry = display_entry(output)
|
||||
if entry ~= nil then
|
||||
hl.monitor({
|
||||
output = output,
|
||||
mode = entry.mode,
|
||||
position = display_position(entry, "auto"),
|
||||
scale = entry.scale,
|
||||
transform = entry.transform,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Any monitor not named above: sane defaults rather than nothing.
|
||||
hl.monitor({
|
||||
output = "",
|
||||
|
||||
Reference in New Issue
Block a user