Ville Syrjälä
f895e3db65
drm/i915: Move psr unlock out from the pipe update critical section
...
Do the PSR unlock after the vblank evade critcal section is
fully over, not before.
Cc: Manasi Navare <navaremanasi@chromium.org >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-2-ville.syrjala@linux.intel.com
Reviewed-by: Manasi Navare <navaremanasi@chromium.org >
Reviewed-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com >
2023-09-20 22:27:08 +03:00
William Tseng
fc3bbd5760
drm/i915/dsi: let HW maintain CLK_POST
...
This change is to adjust TCLK-POST timing so DSI signaling can
meet CTS specification.
For clock lane, the TCLK-POST timing may be changed from
133.44 ns to 178.72 ns, which is greater than (60 ns+52*UI)
and is conformed to the CTS standard.
The computed UI is around 1.47 ns.
v2: remove the change of HS-TRAIL.
Cc: Ville Syrjala <ville.syrjala@linux.intel.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Vandita Kulkarni <vandita.kulkarni@intel.com >
Cc: Suraj Kandpal <suraj.kandpal@intel.com >
Cc: Lee Shawn C <shawn.c.lee@intel.com >
Signed-off-by: William Tseng <william.tseng@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230914095137.4132029-1-william.tseng@intel.com
2023-09-20 20:16:09 +03:00
AngeloGioacchino Del Regno
8878780145
drm/bridge: panel: Fix device link for DRM_BRIDGE_ATTACH_NO_CONNECTOR
...
When external bridges are attached with DRM_BRIDGE_ATTACH_NO_CONNECTOR,
the panel bridge may also get the same flag, but in the .attach()
callback for the panel bridge a device link is added only when this
flag is not present; To make things worse, the .detach() callback
tries to delete the device link unconditionally and without checking
if it was created in the first place, crashing the kernel with a NULL
pointer kernel panic upon calling panel_bridge_detach().
Fix that by moving the device_link_add() call before checking if the
DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is present.
Fixes: 199cf07ebd ("drm/bridge: panel: Add a device link between drm device and panel device")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: Liu Ying <victor.liu@nxp.com >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230920082727.57729-1-angelogioacchino.delregno@collabora.com
2023-09-20 19:00:38 +02:00
Tvrtko Ursulin
1c7a387ffe
drm: Update file owner during use
...
With the typical model where the display server opens the file descriptor
and then hands it over to the client(*), we were showing stale data in
debugfs.
Fix it by updating the drm_file->pid on ioctl access from a different
process.
The field is also made RCU protected to allow for lockless readers. Update
side is protected with dev->filelist_mutex.
Before:
$ cat /sys/kernel/debug/dri/0/clients
command pid dev master a uid magic
Xorg 2344 0 y y 0 0
Xorg 2344 0 n y 0 2
Xorg 2344 0 n y 0 3
Xorg 2344 0 n y 0 4
After:
$ cat /sys/kernel/debug/dri/0/clients
command tgid dev master a uid magic
Xorg 830 0 y y 0 0
xfce4-session 880 0 n y 0 1
xfwm4 943 0 n y 0 2
neverball 1095 0 n y 0 3
*)
More detailed and historically accurate description of various handover
implementation kindly provided by Emil Velikov:
"""
The traditional model, the server was the orchestrator managing the
primary device node. From the fd, to the master status and
authentication. But looking at the fd alone, this has varied across
the years.
IIRC in the DRI1 days, Xorg (libdrm really) would have a list of open
fd(s) and reuse those whenever needed, DRI2 the client was responsible
for open() themselves and with DRI3 the fd was passed to the client.
Around the inception of DRI3 and systemd-logind, the latter became
another possible orchestrator. Whereby Xorg and Wayland compositors
could ask it for the fd. For various reasons (hysterical and genuine
ones) Xorg has a fallback path going the open(), whereas Wayland
compositors are moving to solely relying on logind... some never had
fallback even.
Over the past few years, more projects have emerged which provide
functionality similar (be that on API level, Dbus, or otherwise) to
systemd-logind.
"""
v2:
* Fixed typo in commit text and added a fine historical explanation
from Emil.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com >
Reviewed-by: Rob Clark <robdclark@gmail.com >
Tested-by: Rob Clark <robdclark@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230621094824.2348732-1-tvrtko.ursulin@linux.intel.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-09-20 15:27:44 +02:00
Tomi Valkeinen
9fc75c40fa
drm/bridge: tc358768: Attempt to fix DSI horizontal timings
...
The DSI horizontal timing calculations done by the driver seem to often
lead to underflows or overflows, depending on the videomode.
There are two main things the current driver doesn't seem to get right:
DSI HSW and HFP, and VSDly. However, even following Toshiba's
documentation it seems we don't always get a working display.
This patch attempts to fix the horizontal timings for DSI event mode, and
on a system with a DSI->HDMI encoder, a lot of standard HDMI modes now
seem to work. The work relies on Toshiba's documentation, but also quite
a bit on empirical testing.
This also adds timing related debug prints to make it easier to improve
on this later.
The DSI pulse mode has only been tested with a fixed-resolution panel,
which limits the testing of different modes on DSI pulse mode. However,
as the VSDly calculation also affects pulse mode, so this might cause a
regression.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-12-31725f008a50@ideasonboard.com
2023-09-20 13:54:08 +02:00
Tomi Valkeinen
f1dabbe645
drm/bridge: tc358768: Fix tc358768_ns_to_cnt()
...
The tc358768_ns_to_cnt() is, most likely, supposed to do a div-round-up
operation, but it misses subtracting one from the dividend.
Fix this by just using DIV_ROUND_UP().
Fixes: ff1ca6397b ("drm/bridge: Add tc358768 driver")
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-11-31725f008a50@ideasonboard.com
2023-09-20 13:48:47 +02:00
Tomi Valkeinen
b3aa7b3492
drm/bridge: tc358768: Clean up clock period code
...
The driver defines TC358768_PRECISION as 1000, and uses "nsk" to refer
to clock periods. The original author does not remember where all this
came from. Effectively the driver is using picoseconds as the unit for
clock periods, yet referring to them by "nsk".
Clean this up by just saying the periods are in picoseconds.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-10-31725f008a50@ideasonboard.com
2023-09-20 13:48:46 +02:00
Tomi Valkeinen
699cf62a7d
drm/bridge: tc358768: Rename dsibclk to hsbyteclk
...
The Toshiba documentation talks about HSByteClk when referring to the
DSI HS byte clock, whereas the driver uses 'dsibclk' name. Also, in a
few places the driver calculates the byte clock from the DSI clock, even
if the byte clock is already available in a variable.
To align the driver with the documentation, change the 'dsibclk'
variable to 'hsbyteclk'. This also make it easier to visually separate
'dsibclk' and 'dsiclk' variables.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-9-31725f008a50@ideasonboard.com
2023-09-20 13:48:44 +02:00
Tomi Valkeinen
89cfd50e13
drm/bridge: tc358768: Use dev for dbg prints, not priv->dev
...
Simplify the code by capturing the priv->dev value to dev variable, and
use it.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-8-31725f008a50@ideasonboard.com
2023-09-20 13:48:43 +02:00
Tomi Valkeinen
013ea98cdf
drm/bridge: tc358768: Print logical values, not raw register values
...
The driver debug prints DSI related timings as raw register values in
hex. It is much more useful to see the "logical" value of the timing,
not the register value.
Change the prints to print the values separately, in case a single
register contains multiple values, and use %u to have it in a more human
consumable form.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-7-31725f008a50@ideasonboard.com
2023-09-20 13:48:42 +02:00
Tomi Valkeinen
e5fb216781
drm/bridge: tc358768: Use struct videomode
...
The TC358768 documentation uses HFP, HBP, etc. values to deal with the
video mode, while the driver currently uses the DRM display mode
(htotal, hsync_start, etc).
Change the driver to convert the DRM display mode to struct videomode,
which then allows us to use the same units the documentation uses. This
makes it much easier to work on the code when using the TC358768
documentation as a reference.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-6-31725f008a50@ideasonboard.com
2023-09-20 13:48:40 +02:00
Tomi Valkeinen
1e08e78871
drm/bridge: tc358768: Cleanup PLL calculations
...
As is quite common, some of TC358768's PLL register fields are to be
programmed with (value - 1). Specifically, the FBD and PRD, multiplier
and divider, are such fields.
However, what the driver currently does is that it considers that the
formula used for PLL rate calculation is:
RefClk * [(FBD + 1)/ (PRD + 1)] * [1 / (2^FRS)]
where FBD and PRD are values directly from the registers, while a more
sensible way to look at it is:
RefClk * FBD / PRD * (1 / (2^FRS))
and when the FBD and PRD values are written to the registers, they will
be subtracted by one.
Change the driver accordingly, as it simplifies the PLL code.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-5-31725f008a50@ideasonboard.com
2023-09-20 13:48:39 +02:00
Tomi Valkeinen
66962d5c3c
drm/bridge: tc358768: Fix bit updates
...
The driver has a few places where it does:
if (thing_is_enabled_in_config)
update_thing_bit_in_hw()
This means that if the thing is _not_ enabled, the bit never gets
cleared. This affects the h/vsyncs and continuous DSI clock bits.
Fix the driver to always update the bit.
Fixes: ff1ca6397b ("drm/bridge: Add tc358768 driver")
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-4-31725f008a50@ideasonboard.com
2023-09-20 13:48:38 +02:00
Tomi Valkeinen
aa23099f47
drm/bridge: tc358768: Default to positive h/v syncs
...
As the TC358768 is a DPI to DSI bridge, the DSI side does not need to
define h/v sync polarities. This means that sometimes we have a mode
without defined sync polarities, which does not work on the DPI side.
Add a mode_fixup hook to default to positive sync polarities.
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-3-31725f008a50@ideasonboard.com
2023-09-20 13:48:36 +02:00
Tomi Valkeinen
a2d9036615
drm/bridge: tc358768: Fix use of uninitialized variable
...
smatch reports:
drivers/gpu/drm/bridge/tc358768.c:223 tc358768_update_bits() error: uninitialized symbol 'orig'.
Fix this by bailing out from tc358768_update_bits() if the
tc358768_read() produces an error.
Fixes: ff1ca6397b ("drm/bridge: Add tc358768 driver")
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com >
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com > # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-2-31725f008a50@ideasonboard.com
2023-09-20 13:48:35 +02:00
Thierry Reding
1716b1891e
drm/tegra: rgb: Parameterize V- and H-sync polarities
...
The polarities of the V- and H-sync signals are encoded as flags in the
display mode, so use the existing information to setup the signals for
the RGB interface.
Signed-off-by: Thierry Reding <treding@nvidia.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
[tomi.valkeinen@ideasonboard.com: default to positive sync]
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com> # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-1-31725f008a50@ideasonboard.com
2023-09-20 13:48:34 +02:00
Alicja Michalska
bb9fb4a42d
drm/bridge/analogix/anx78xx: Add missing definition
...
Analogix ANX78XX driver is missing definitions for anx7816.
It uses the same I2C register set as anx7818.
Signed-off-by: Alicja Michalska <ahplka19@gmail.com >
Reviewed-by: Robert Foss <rfoss@kernel.org >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/ZPvagaXnQ/TlNEkJ@tora
2023-09-20 12:57:07 +02:00
Alicja Michalska
5305d85077
dt-bindings: display: anx7814: Add definition for anx7816
...
As requested by Robert Foss <rfoss@kernel.org >, this patch adds
definition for anx7816. It supplements the patch submitted to dri-devel.
Signed-off-by: Alicja Michalska <ahplka19@gmail.com >
Acked-by: Rob Herring <robh@kernel.org >
Signed-off-by: Robert Foss <rfoss@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/ZQjFabKW7QvrvsnG@tora
2023-09-20 12:56:31 +02:00
Ben Skeggs
073bde4536
drm/nouveau/kms/nv50-: disable dcb parsing
...
- nvkm should provide all this info now
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-45-lyude@redhat.com
2023-09-19 18:22:30 -04:00
Ben Skeggs
0a4410a79f
drm/nouveau/kms/nv50-: create outputs based on nvkm info
...
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-44-lyude@redhat.com
2023-09-19 18:22:29 -04:00
Ben Skeggs
8b7d92cad9
drm/nouveau/kms/nv50-: create connectors based on nvkm info
...
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-43-lyude@redhat.com
2023-09-19 18:22:27 -04:00
Ben Skeggs
9c3361de06
drm/nouveau/kms/nv50-: name aux channels after their connector
...
- removes use of VBIOS data for naming
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-42-lyude@redhat.com
2023-09-19 18:22:27 -04:00
Ben Skeggs
0880bf4c43
drm/nouveau/kms/nv50-: create heads after outps/conns
...
- output info will be used later to determine MST support
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-41-lyude@redhat.com
2023-09-19 18:22:26 -04:00
Ben Skeggs
571028c46f
drm/nouveau/kms/nv50-: create heads based on nvkm head mask
...
No need to go poking HW directly, and probably shouldn't on GSP-RM.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-40-lyude@redhat.com
2023-09-19 18:22:26 -04:00
Ben Skeggs
56d732839e
drm/nouveau/disp/nv50-: skip DCB_OUTPUT_TV
...
We've never supported it.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-39-lyude@redhat.com
2023-09-19 18:22:25 -04:00
Ben Skeggs
cb3ec8cbd0
drm/nouveau/disp: move outp init/fini paths to chipset code
...
- pre-nv5x doesn't use any of this
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-38-lyude@redhat.com
2023-09-19 18:22:24 -04:00
Ben Skeggs
62b0eef237
drm/nouveau/disp: move outp/conn construction to chipset code
...
- pre-nv5x doesn't use any of this, has its own version DRM-side
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-37-lyude@redhat.com
2023-09-19 18:22:23 -04:00
Ben Skeggs
1958d69fa8
drm/nouveau/disp: add dp mst id get/put methods
...
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-36-lyude@redhat.com
2023-09-19 18:22:22 -04:00
Ben Skeggs
e206cae1e5
drm/nouveau/disp: add dp sst config method
...
This is presently unused on HW, we read a bunch of regs and calculate
the watermark during the second supervisor interrupt.
I don't want to change this yet as I need to re-remember how older HW
works exactly, but RM wants this info via RPC.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-35-lyude@redhat.com
2023-09-19 18:22:21 -04:00
Ben Skeggs
3147ce0d07
drm/nouveau/disp: move link training out of supervisor
...
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-34-lyude@redhat.com
2023-09-19 18:22:19 -04:00
Ben Skeggs
633716501c
drm/nouveau/disp: add dp train method
...
- passes DPCD information from DRM to NVKM
- removes NVKM's own sink caps handling
- link still trained from supervisor, more patches to come
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-33-lyude@redhat.com
2023-09-19 18:22:18 -04:00
Ben Skeggs
757033808c
drm/nouveau/kms/nv50-: fixup sink D3 before tearing down link
...
- fixes bug preventing this on SST
- implement for MST
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-32-lyude@redhat.com
2023-09-19 18:22:17 -04:00
Ben Skeggs
625ead3d39
drm/nouveau/kms/nv50-: flush mst disables together
...
- fixes some issues tearing down modes on tiled displays
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-31-lyude@redhat.com
2023-09-19 18:22:17 -04:00
Ben Skeggs
a5a7379f6d
drm/nouveau/kms/nv50-: split DP disable+enable into two modesets
...
Link training can finally be moved out of the supervisor sequence,
but first we need to split DP modesets into separate disable and
enable sequences to be able to perform link training between them
instead.
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-30-lyude@redhat.com
2023-09-19 18:22:16 -04:00
Ben Skeggs
bfb03a077b
drm/nouveau/disp: add dp rates method
...
- moves building of link rates table from NVKM to DRM
- preparing to move link training out of supervisor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-29-lyude@redhat.com
2023-09-19 18:22:12 -04:00
Ben Skeggs
bd7a61bcbb
drm/nouveau/disp: add dp aux xfer method
...
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-28-lyude@redhat.com
2023-09-19 18:22:11 -04:00
Ben Skeggs
0bd4e9f7dc
drm/nouveau/disp: move dp aux pwr method to HAL
...
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-27-lyude@redhat.com
2023-09-19 18:22:10 -04:00
Ben Skeggs
e9c9b5b942
drm/nouveau/disp: add hdmi audio hal function
...
This just adds a hook for RM to use, HW paths remain untouched, but
should probably be cleaned up to use this too at some point.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-26-lyude@redhat.com
2023-09-19 18:22:10 -04:00
Ben Skeggs
5b9c0307a1
drm/nouveau/disp: add output lvds config method
...
- was previously part of acquire()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-25-lyude@redhat.com
2023-09-19 18:22:09 -04:00
Ben Skeggs
2274ce7e36
drm/nouveau/disp: add output backlight control methods
...
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-24-lyude@redhat.com
2023-09-19 18:22:06 -04:00
Ben Skeggs
422f6d8a24
drm/nouveau/disp: remove SOR routing updates from supervisor
...
- these shouldn't be necessary now, and are done in acquire()/release()
- preparation for GSP-RM, where we don't control the supervisor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-23-lyude@redhat.com
2023-09-19 18:22:05 -04:00
Ben Skeggs
b24bf8b8ba
drm/nouveau/disp: release outputs post-modeset
...
Prior to this commit, KMS would call release() prior to modeset, and the
second supervisor interrupt would update SOR routing if needed.
Now, KMS will call release() post-modeset and update routing immediately.
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-22-lyude@redhat.com
2023-09-19 18:22:04 -04:00
Ben Skeggs
8ed094211f
drm/nouveau/disp: move hdmi disable out of release()
...
- release() is being moved post-modeset, preserve hdmi behaviour for now
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-21-lyude@redhat.com
2023-09-19 18:22:04 -04:00
Ben Skeggs
6c6abab20b
drm/nouveau/disp: add output hdmi config method
...
- was previously part of acquire()
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-20-lyude@redhat.com
2023-09-19 18:22:03 -04:00
Ben Skeggs
c0f7b72942
drm/nouveau/kms/nv50-: move audio enable post-modeset
...
- adds tracking for post-UPDATE modeset operations, similar to mst[mo]'s
- audio won't work on RM without this
- we should probably have been doing this anyway
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-19-lyude@redhat.com
2023-09-19 18:22:02 -04:00
Ben Skeggs
232856e896
drm/nouveau/kms/nv50-: keep output state around until modeset complete
...
- we'll want this info post-UPDATE for later patches
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-18-lyude@redhat.com
2023-09-19 18:22:01 -04:00
Ben Skeggs
42db5692aa
drm/nouveau/kms/nv50-: remove nv_encoder.audio.connector
...
- use nv_encoder.conn instead, outp->conn never changes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-17-lyude@redhat.com
2023-09-19 18:22:01 -04:00
Ben Skeggs
e32de3da3f
drm/nouveau/kms/nv50-: pull some common init out of OR-specific code
...
- cleanup before additional changes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-16-lyude@redhat.com
2023-09-19 18:22:00 -04:00
Ben Skeggs
45d954c05d
drm/nouveau/disp: update SOR routing immediately on acquire()
...
- was previously delayed until second supervisor interrupt
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-15-lyude@redhat.com
2023-09-19 18:22:00 -04:00
Ben Skeggs
cefc3c1452
drm/nouveau/disp: add acquire_sor/pior()
...
- preparing to move protocol-specific args out of acquire() again
- avoid re-acquiring acquired output, will matter when enforced later
- sor/pior done at same time due to shared tmds/dp handling
Signed-off-by: Ben Skeggs <bskeggs@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Danilo Krummrich <me@dakr.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-14-lyude@redhat.com
2023-09-19 18:21:59 -04:00