Mohammed Anees [Sun, 11 Aug 2024 10:16:51 +0000 (06:16 -0400)]
drm: Add missing documentation for struct drm_plane_size_hint
This patch takes care of the following warnings during documentation
compiling:
./include/uapi/drm/drm_mode.h:869: warning: Function parameter or struct member 'width' not described in 'drm_plane_size_hint'
./include/uapi/drm/drm_mode.h:869: warning: Function parameter or struct member 'height' not described in 'drm_plane_size_hint'
Jocelyn Falempe [Wed, 7 Aug 2024 13:36:14 +0000 (15:36 +0200)]
drm/panic: Add panic description
Now that kmsg dump callback has the description parameter, use it in
the user panic screen.
This is the string passed to panic(), like "VFS: Unable to mount root
fs on xxx" or "Attempted to kill init! exitcode=0xxxx".
It gives a hint on why the panic occurred, without being too cryptic.
Jocelyn Falempe [Wed, 7 Aug 2024 13:36:12 +0000 (15:36 +0200)]
drm/panic: Move drm_panic_register prototype to drm_crtc_internal.h
drm_panic_[un]register() are only used by the core drm, and are not
intended to be called by other drm drivers, so move their prototypes
to drm_crtc_internal.h.
Mgag200's BMC connector tracks the status of an underlying physical
connector and updates the BMC status accordingly. This functionality
works around GNOME's settings app, which cannot handle multiple
outputs on the same CRTC.
The workaround is now obsolete as the VGA-BMC connector handles BMC
support internally. Hence, remove the driver's code and the BMC output
entirely.
drm/mgag200: vga-bmc: Control BMC scanout from encoder
Move calls to stop and start BMC scanout from CRTC helpers to the
VGA-BMC encoder's atomic_disable and atomic_enable. Makes the BMC
scanout transparent to the CRTC.
DRM's atomic helpers call an encoder's atomic_disable and atomic_enable
helpers for all enabled encoders. The BMC stops scanning out the VGA
signal if modeset disables the VGA encoder, and starts scanning out
if the modeset enables the VGA encoder.
drm/mgag200: vga-bmc: Control CRTC VIDRST flag from encoder
Control the VIDRST pin from the VGA-BMC encoder's atomic_check and
remove the respective code from CRTC. Makes the VIDRST functionality
fully composable.
The VIDRST pin allows an external clock source to control the SYNC
signals of the Matrox chip. The functionality is part of the CRTC,
but depends on the presence of the clock source. This is the case for
some BMCs, so control the pin from the VGA-BMC output.
The VGA-BMC connector selects the VGA output if a display has been
attached to the physical connector. Otherwise it selects the BMC
output. In any case, the connector status is set to 'detected', so
that the userspace compositor displays to it.
Depending on the setting, the connector's display modes either come
from the VGA monitor's EDID or from an internal list of BMC-compatible
modes.
Duplicate VGA output to VGA-BMC output and update all code for Matrox
server chips. The new output represents a VGA output that has a BMC
attached to it. No functional changes so far.
drm/ci: rockchip: add tests for rockchip display driver
For rockchip rk3288 and rk3399, the display driver is rockchip
and gpu driver is panfrost. Currently, in drm-ci for rockchip
rk3288 and rk3399, only the gpu driver is tested. Refactor
the existing rockchip jobs to test both display and gpu driver
and update xfails.
Since the correct driver name is passed from the job to test gpu
and display driver, remove the check to set IGT_FORCE_DRIVER
based on driver name for rockchip jobs.
For Amlogic Meson G12B (A311D) SOC the display driver is meson and
gpu driver is panfrost. Currently, in drm-ci for Meson G12B (A311D),
only the gpu driver is tested. Refactor the existing meson jobs
and add support in drm-ci to test both display and gpu driver for
Amlogic Meson G12B (A311D) and update xfails.
Since the correct driver name is passed from the job to test gpu
and display driver, remove the check to set IGT_FORCE_DRIVER
based on driver name for meson jobs.
drm/ci: mediatek: add tests for powervr gpu driver
For mediatek mt8173, the display driver is mediatek, while the
gpu driver is powervr. Currently, in drm-ci for mt8173, only the
display driver is tested. Add support in drm-ci to test powervr
driver for mt8173. Powervr driver was merged in linux kernel,
but there's no mediatek support yet. So disable the powervr:mt8173
job which uses powervr driver.
Also update the MAINTAINERS file to include xfails for powervr driver.
drm/ci: mediatek: add tests for mediatek display driver
For mediatek mt8183, the display driver is mediatek, while the
gpu driver is panfrost. Currently, in drm-ci for mt8183, only
the gpu driver is tested. Refactor the existing mediatek jobs
and add support in drm-ci to test both display and gpu driver
for mt8183 and update xfails.
Since the correct driver name is passed from the job to test gpu
and display driver, remove the check to set IGT_FORCE_DRIVER
based on driver name for mediatek jobs.
Update the MAINTAINERS file to include xfails for panfrost driver.
Enable CONFIG_DRM_ANALOGIX_ANX7625 in the arm64 defconfig to get
display driver probed on the mt8183-kukui-jacuzzi-juniper machine.
arch/arm64/configs/defconfig has CONFIG_DRM_ANALOGIX_ANX7625=m,
but drm-ci don't have initrd with modules, so add
CONFIG_DRM_ANALOGIX_ANX7625=y in CI arm64 config.
drm/bridge: lt9611uxc: drop support for !DRM_BRIDGE_ATTACH_NO_CONNECTOR
Having no in-kernel devices that use !DRM_BRIDGE_ATTACH_NO_CONNECTOR
mode for the Lontium LT9611UXC bridge, drop the in-bridge implementation
of the drm_connector.
Christoph Fritz [Fri, 5 Jul 2024 09:38:44 +0000 (11:38 +0200)]
drm/bridge: synopsys: dw-mipi-dsi: enable EoTp by default
Enable the transmission of an EoTp (end of transmission packet) by
default. EoTp should be enabled anyway because it is a Linux necessity
that can be disabled by a dsi mod_flag if needed.
EoTp signals the end of an HS transmission, this adds overall robustness
at protocol level at the expense of an increased overhead.
Fix support for VBLANK interrupts on G200ER, G200EV and G200SE, which
use a slightly different implementation than the others. The original
commits forgot to update the custom helpers when adding interrupt
handling for VBLANK events.
drm/ast: astdp: Perform link training during atomic_enable
The place for link training is in the encoder's atomic_enable
helper. Remove all related tests from other helper ASTDP functions;
especially ast_astdp_is_connected(), which tests HPD status.
DP link training is controlled by the firmware. A status flag reports
success or failure. The process can be fragile on Aspeed hardware. Moving
the test from connector detection to the atomic_enable allows for several
retries and a longer timeout.
drm/ast: astdp: Only test HDP state in ast_astdp_is_connected()
The overall control flow of the driver ensures that it never reads
EDID or sets display state on unconnected outputs. Therefore remove
all tests for Hot Plug Detection from these helpers. Also rename
the register constants.
drm/ast: astdp: Test firmware status once during probing
Test for running ASTDP firmware during probe. Do not bother testing
this later. We cannot do much anyway if the firmware fails. Do not
initialize the ASTDP conenctor if the test fails during device probing.
I2C v7, SMBus 3.2, and I3C 1.1.1 specifications have replaced "master/slave"
with more appropriate terms. Inspired by Wolfram's series to fix drivers/i2c/,
fix the terminology for users of I2C_ALGOBIT bitbanging interface, now that
the approved verbiage exists in the specification.
Ben Skeggs [Fri, 26 Jul 2024 04:38:25 +0000 (14:38 +1000)]
drm/nouveau: remove master
The only remaining nouveau_drm.master struct member that's being used is
the mutex that protects its object tree. Move that into nouveau_drm and
remove nouveau_drm.master entirely.
A pending series to remove the "ioctl" layer between DRM and NVKM also
removes the need for object handle lookups, and hence this mutex, but
it's still required for the moment.
Ben Skeggs [Fri, 26 Jul 2024 04:38:19 +0000 (14:38 +1000)]
drm/nouveau: add nvif_mmu to nouveau_drm
This allocates a new nvif_mmu in nouveau_drm, and uses it for TTM
backend memory allocations instead of nouveau_drm.master.mmu,
which is removed by a later commit that removes nouveau_drm.master
entirely.
Ben Skeggs [Fri, 26 Jul 2024 04:38:18 +0000 (14:38 +1000)]
drm/nouveau: move nvxx_* definitions to nouveau_drv.h
These are some dodgy "convenience" macros for the DRM driver to peek
into NVKM state. They're still used in a few places, but don't belong
in nvif/device.h in any case.
Move them to nouveau_drv.h, and modify callers to pass a nouveau_drm
instead of an nvif_device.
v2:
- use drm->nvkm pointer for nvxx_*() macros, removing some void*
v3:
- add some explanation of the nvxx_*() macros
Ben Skeggs [Fri, 26 Jul 2024 04:38:17 +0000 (14:38 +1000)]
drm/nouveau/nvif: remove disp chan rd/wr
There's no good reason the ioremap() that results from nvif_object_map()
should fail, so add a check that the map succeeded, and remove the rd/wr
methods from display channel objects.
As this was the last user of rd/wr methods, the nvif plumbing is removed
at the same time.
Ben Skeggs [Fri, 26 Jul 2024 04:38:15 +0000 (14:38 +1000)]
drm/nouveau: always map device
The next commit removes the nvif rd/wr methods from nvif_device, which
were probably a bad idea, and mostly intended as a fallback if ioremap()
failed (or wasn't available, as was the case in some tools I once used).
The nv04 KMS driver already mapped the device, because it's mostly been
kept alive on life-support for many years and still directly bashes PRI
a lot for modesetting.
Post-nv50, I tried pretty hard to keep PRI accesses out of the DRM code,
but there's still a few random places where we do, and those were using
the rd/wr paths prior to this commit.
This allocates and maps a new nvif_device (which will replace the usage
of nouveau_drm.master.device later on), and replicates this pointer to
all other possible users.
This will be cleaned up by the end of another patch series, after it's
been made safe to do so.
Ben Skeggs [Fri, 26 Jul 2024 04:38:07 +0000 (14:38 +1000)]
drm/nouveau/nvif: remove nvxx_object()
This hasn't been used in a while.
Moves io accessors from nvkm/core/os.h to nvif/os.h at the same time to
fix a compile issue that results from <nvkm/core/object.h> no longer
being included.
Ben Skeggs [Fri, 26 Jul 2024 04:38:03 +0000 (14:38 +1000)]
drm/nouveau/nvkm: remove perfmon
This has never really been used for anything, in part due to never
having reclocking stable enough in general to attempt to implement
dynamic clock changes based on load, etc.
To avoid having to rework its interfaces, remove it entirely.
Ben Skeggs [Fri, 26 Jul 2024 04:38:00 +0000 (14:38 +1000)]
drm/nouveau: remove abi16->device
The previous commit removes the last remnants of userspace's own nvif
instance, so this isn't needed anymore to hide the abi16 objects from
userspace and we can use nouveau_cli.device instead.
Ben Skeggs [Fri, 26 Jul 2024 04:37:59 +0000 (14:37 +1000)]
drm/nouveau: handle limited nvif ioctl in abi16
nouveau_usif.c was already stripped right back a couple of years ago,
limiting what userspace could do with it.
A follow-on series removes the nvkm side of these interfaces entirely,
in order to make it less of a nightmare to add/change internal APIs in
the future.
Unfortunately. Userspace uses some of this.
Fortunately, userspace only ever ended up using a fraction of the APIs,
so those are reimplemened here in a more direct manner, and return
-EINVAL to userspace for everything else.
v2:
- simplified struct nouveau_abi16_obj
- added a couple of comments
v3:
- comment harder
Ben Skeggs [Fri, 26 Jul 2024 04:37:57 +0000 (14:37 +1000)]
drm/nouveau: move allocation of root client out of nouveau_cli_init()
drm->master isn't really a nouveau_cli, and is mostly just used to get
at an nvif_mmu object to implement a hack around issues with the ioctl
interface to nvkm.
Later patches in this series allocate nvif_device/mmu objects in
nouveau_drm directly, removing the need for master.
A pending series to remove the "ioctl" layer between DRM and NVKM
removes the need for the above-mentioned hack entirely.
The only other member of drm->master that's needed is the nvif_client,
and is a dependency of device/mmu. So the first step is to move its
allocation out of code handling nouveau_cli init.
v2:
- modified slightly due to the addition of tegra/pci cleanup patches
v3:
- move nvif init below drm_dev_alloc() to avoid changing nouveau_name()
Ben Skeggs [Fri, 26 Jul 2024 04:37:55 +0000 (14:37 +1000)]
drm/nouveau: create pci device once
HW isn't touched anymore (aside from detection) until the first
nvif_device has been allocated, so we no longer need a separate
probe-only step before kicking efifb (etc) off the HW.
Ben Skeggs [Fri, 26 Jul 2024 04:37:54 +0000 (14:37 +1000)]
drm/nouveau: replace drm_device* with nouveau_drm* as dev drvdata
We almost always want to cast the pointer from dev_get_drvdata() to
'struct nouveau_drm *', so just directly store that pointer instead,
simplifying callers, and fixing some clumsy naming of dev/drm_dev
variables at the same time.
Ben Skeggs [Fri, 26 Jul 2024 04:37:53 +0000 (14:37 +1000)]
drm/nouveau: handle pci/tegra drm_dev_{alloc, register} from common code
Unify some more of the PCI/Tegra DRM driver init, both as a general
cleanup, and because a subsequent commit changes the pointer stored
via dev_set_drvdata(), and this allows the change to be made in one
place.
Hamza Mahfooz [Thu, 25 Jul 2024 20:51:08 +0000 (16:51 -0400)]
drm/vblank: add dynamic per-crtc vblank configuration support
We would like to be able to enable vblank_disable_immediate
unconditionally, however there are a handful of cases where a small off
delay is necessary (e.g. with PSR enabled). So, we would like to be able
to adjust the vblank off delay and disable imminent values dynamically
for a given CRTC. Since, it will allow drivers to apply static screen
optimizations more quickly and consequently allow users to benefit more
so from the power savings afforded by the aforementioned optimizations,
while avoiding issues in cases where an off delay is still warranted.
In particular, the PSR case requires a small off delay of 2 frames,
otherwise display firmware isn't able to keep up with all of the
requests made to amdgpu. So, introduce drm_crtc_vblank_on_config() which
is like drm_crtc_vblank_on(), but it allows drivers to specify the
vblank CRTC configuration before enabling vblanking support for a given
CRTC.
accel/qaic: Remove the description of DRM_IOCTL_QAIC_PART_DEV
The partition device ioctl was removed during the development of the
initial version of qaic driver. Remove its description from the
documentation to avoid confusing readers.
Before building an image, the build script looks to see if there are fixes
to apply from an upstream repository. The link for the upstream repository
git://anongit.freedesktop.org/drm/drm became obsolete with the move to
Gitlab server in March 2024. Until recently, this obsolete link was
harmless because anongit would at least respond that there were no such
fixes available. In the last few days anongit has stopped responding to
requests causing the build script to hang indefinitely.
Update the link from anongit to the Gitlab server to prevent the build
script from hanging indefinitely.
Marco Pagani [Tue, 23 Jul 2024 19:10:35 +0000 (21:10 +0200)]
drm/test: use kunit action wrapper macro in the gem shmem test suite
Replace deferred action function wrappers with equivalent ones defined
using the macro introduced by commit 56778b49c9a2 ("kunit: Add a macro to
wrap a deferred action function")
drm/amdgpu: reset vm state machine after gpu reset(vram lost)
[Why]
Page table of compute VM in the VRAM will lost after gpu reset.
VRAM won't be restored since compute VM has no shadows.
[How]
Use higher 32-bit of vm->generation to record a vram_lost_counter.
Reset the VM state machine when vm->genertaion is not equal to
the new generation token.
v2: Check vm->generation instead of calling drm_sched_entity_error
in amdgpu_vm_validate.
v3: Use new generation token instead of vram_lost_counter for check.
The ras command shared memory is allocated from
VRAM and the response status of the command
buffer will not be zero due to gpu being in
fatal error state after ras UE error injection.
drm/amd/display: Remove ASSERT if significance is zero in math_ceil2
In the DML math_ceil2 function, there is one ASSERT if the significance
is equal to zero. However, significance might be equal to zero
sometimes, and this is not an issue for a ceil function, but the current
ASSERT will trigger warnings in those cases. This commit removes the
ASSERT if the significance is equal to zero to avoid unnecessary noise.
Alex Deucher [Tue, 9 Jul 2024 21:54:11 +0000 (17:54 -0400)]
drm/amdgpu/sdma5.2: Update wptr registers as well as doorbell
We seem to have a case where SDMA will sometimes miss a doorbell
if GFX is entering the powergating state when the doorbell comes in.
To workaround this, we can update the wptr via MMIO, however,
this is only safe because we disallow gfxoff in begin_ring() for
SDMA 5.2 and then allow it again in end_ring().
Enable this workaround while we are root causing the issue with
the HW team.