Christian König
bb99c51bda
drm/loongson: use GEM references instead of TTMs
...
Instead of a TTM reference grab a GEM reference whenever necessary.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Sui Jingfeng <suijingfeng@loongson.cn >
Link: https://patchwork.freedesktop.org/patch/msgid/20240723121750.2086-3-christian.koenig@amd.com
2024-08-01 10:03:44 +02:00
Thomas Zimmermann
6c9e14ee9f
drm/mgag200: Fix VBLANK interrupt handling
...
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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Fixes: 89c6ea2006 ("drm/mgag200: Add vblank support")
Fixes: d5070c9b29 ("drm/mgag200: Implement struct drm_crtc_funcs.get_vblank_timestamp")
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Jocelyn Falempe <jfalempe@redhat.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Dave Airlie <airlied@redhat.com >
Cc: dri-devel@lists.freedesktop.org
Acked-by: Sui Jingfeng <sui.jingfeng@linux.dev >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240731071004.519566-1-tzimmermann@suse.de
2024-08-01 08:33:24 +02:00
Mitul Golani
a755947e05
drm/dp: Describe target_rr_divider in struct drm_dp_as_sdp
...
Describe newly added parameter target_rr_divider in struct
drm_dp_as_sdp.
-v2:
Remove extra line from commit message.(Lucas)
-v3:
Rebase.
Fixes: a20c6d954d ("drm/dp: Add refresh rate divider to struct representing AS SDP")
Cc: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com >
Cc: Arun R Murthy <arun.r.murthy@intel.com >
Cc: Suraj Kandpal <suraj.kandpal@intel.com >
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com >
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Stephen Rothwell <sfr@canb.auug.org.au >
Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com >
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com >
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240715162514.2836421-1-mitulkumar.ajitkumar.golani@intel.com
2024-07-31 13:13:28 +02:00
Thomas Zimmermann
2000ddac9b
drm/ast: astdp: Clean up EDID reading
...
Simplify ast_astdp_read_edid(). Rename register constants. Drop
unnecessary error handling. On success, the helper returns 0; an
error code otherwise.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240717143319.104012-6-tzimmermann@suse.de
2024-07-30 12:15:37 +02:00
Thomas Zimmermann
2281475168
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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240717143319.104012-5-tzimmermann@suse.de
2024-07-30 12:15:37 +02:00
Thomas Zimmermann
cbacb1b744
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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240717143319.104012-4-tzimmermann@suse.de
2024-07-30 12:15:37 +02:00
Thomas Zimmermann
c91d75a3c6
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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reported-by: Shixiong Ou <oushixiong@kylinos.cn >
Tested-by: Shixiong Ou <oushixiong@kylinos.cn >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240717143319.104012-3-tzimmermann@suse.de
2024-07-30 12:15:37 +02:00
Zenghui Yu
e2fc28837a
MAINTAINERS: Add selftests to DMA-BUF HEAPS FRAMEWORK entry
...
Include dmabuf-heaps selftests in the correct entry so that updates to it
can be sent to the right place.
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20240729081202.937-1-yuzenghui@huawei.com
2024-07-30 10:39:03 +02:00
Shixiong Ou
250ac9ee60
drm: Add the missing symbol '.'
...
Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20240729065756.123788-1-oushixiong1025@163.com
2024-07-30 10:38:22 +02:00
Jani Nikula
a6ed988ecd
drm/nouveau: remove unused variable ret
...
Fix build with CONFIG_NOUVEAU_PLATFORM_DRIVER enabled:
../drivers/gpu/drm/nouveau/nouveau_platform.c: In function ‘nouveau_platform_probe’:
../drivers/gpu/drm/nouveau/nouveau_platform.c:29:13: error: unused variable ‘ret’ [-Werror=unused-variable]
29 | int ret;
| ^~~
Fixes: 961ae5f980 ("drm/nouveau: handle pci/tegra drm_dev_{alloc, register} from common code")
Cc: Ben Skeggs <bskeggs@nvidia.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240729123624.868907-1-jani.nikula@intel.com
2024-07-29 15:04:16 +02:00
Thomas Zimmermann
0e8655b4e8
Merge drm/drm-next into drm-misc-next
...
Backmerging to get a late RC of v6.10 before moving into v6.11.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2024-07-29 09:35:54 +02:00
Easwar Hariharan
0c3f3a83c7
drm/gma500: Make I2C terminology more inclusive
...
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.
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com >
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20240711052734.1273652-3-eahariha@linux.microsoft.com
2024-07-29 09:12:07 +02:00
Ben Skeggs
61671d85de
drm/nouveau/kms: remove push pointer from nv50_dmac
...
The struct itself lives in nv50_dmac already, just use that.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-38-bskeggs@nvidia.com
2024-07-27 03:05:51 +02:00
Ben Skeggs
723388bc0f
drm/nouveau/kms: remove a few unused struct members and fn decls
...
Left-overs from the past that are completely unused now.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-37-bskeggs@nvidia.com
2024-07-27 03:05:51 +02:00
Ben Skeggs
0df26c0d69
drm/nouveau: remove push pointer from nouveau_channel
...
The struct itself lives in nouveau_channel already, just use that.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-36-bskeggs@nvidia.com
2024-07-27 03:05:49 +02:00
Ben Skeggs
034142a303
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-35-bskeggs@nvidia.com
2024-07-27 03:05:48 +02:00
Ben Skeggs
3543e84e20
drm/nouveau: remove chan->drm
...
The nouveau_cli that owns the channel is now stored in nouveau_chan, and
it has a pointer to the drm device already.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-34-bskeggs@nvidia.com
2024-07-27 03:05:47 +02:00
Ben Skeggs
2eb58f22e2
drm/nouveau: remove nouveau_chan.device
...
nouveau_chan.device is always the same as nouveau_chan.cli.device,
so there's no need to store it separately.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-33-bskeggs@nvidia.com
2024-07-27 03:05:46 +02:00
Ben Skeggs
5cca41ac70
drm/nouveau: pass cli to nouveau_channel_new() instead of drm+device
...
Both of these are stored in nouveau_cli already, and also allows the
removal of some void casts.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-32-bskeggs@nvidia.com
2024-07-27 03:05:43 +02:00
Ben Skeggs
3019023ec9
drm/nouveau: pass drm to nv50_dmac_create(), rather than device+disp
...
Both of these are stored in nouveau_drm already.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-31-bskeggs@nvidia.com
2024-07-27 03:05:42 +02:00
Ben Skeggs
0fa0955acd
drm/nouveau: pass drm to nouveau_mem_new(), instead of cli
...
The nouveau_cli pointer is only ever used to eventually access
nouveau_drm, so just store it directly.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-30-bskeggs@nvidia.com
2024-07-27 03:05:41 +02:00
Ben Skeggs
c6bf82d426
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-29-bskeggs@nvidia.com
2024-07-27 03:05:41 +02:00
Ben Skeggs
6901f1d647
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
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-28-bskeggs@nvidia.com
2024-07-27 03:05:38 +02:00
Ben Skeggs
8d7b2d3a7e
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-27-bskeggs@nvidia.com
2024-07-27 03:05:37 +02:00
Ben Skeggs
216c3c4424
drm/nouveau/nvif: remove device rd/wr
...
The previous commit ensures the device is always mapped, so these
are unneeded.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-26-bskeggs@nvidia.com
2024-07-27 03:05:36 +02:00
Ben Skeggs
cced63c3dd
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-25-bskeggs@nvidia.com
2024-07-27 03:05:35 +02:00
Ben Skeggs
fabc65d163
drm/nouveau/nvif: remove device args
...
These were once used by used by userspace tools (with nvkm built as a
library), to access multiple GPUs from a single nvif_client.
The DRM code just uses the driver's default device, so remove the
arguments.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-24-bskeggs@nvidia.com
2024-07-27 03:05:35 +02:00
Ben Skeggs
246b228eb9
drm/nouveau/nvif: remove client fini
...
Does nothing. Remove it.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-23-bskeggs@nvidia.com
2024-07-27 03:05:34 +02:00
Ben Skeggs
c45c999cfb
drm/nouveau/nvif: remove client devlist
...
This was once used by userspace tools (with nvkm built as a library),
but is now unused.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-22-bskeggs@nvidia.com
2024-07-27 03:05:33 +02:00
Ben Skeggs
def122b64e
drm/nouveau/nvif: remove client version
...
This is not, and has never, been used for anything. Remove it.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-21-bskeggs@nvidia.com
2024-07-27 03:05:33 +02:00
Ben Skeggs
a897f65b3a
drm/nouveau/nvif: remove client device arg
...
This was once used by userspace tools (with nvkm built as a library), as
a way to select a "default device".
The DRM code doesn't need this at all as clients only have access to a
single device already, so inherit the value from its parent.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-20-bskeggs@nvidia.com
2024-07-27 03:05:32 +02:00
Ben Skeggs
7e0d8de4d3
drm/nouveau/nvif: remove driver keep/fini
...
These are remnants of code long gone. Remove them.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-19-bskeggs@nvidia.com
2024-07-27 03:05:31 +02:00
Ben Skeggs
ffe9f1bfb3
drm/nouveau/nvif: remove nvxx_client()
...
Make use of nouveau_cli.name instead of nvkm_client.name.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-18-bskeggs@nvidia.com
2024-07-27 03:05:30 +02:00
Ben Skeggs
455167e875
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-17-bskeggs@nvidia.com
2024-07-27 03:05:30 +02:00
Ben Skeggs
d6e44a8548
drm/nouveau/nvif: remove route/token
...
These were a cludge used to prevent userspace's nvif ioctl from
accessing objects created by the kernel for the same client.
That interface was removed in a previous patch, so these are no
longer useful for anything.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-16-bskeggs@nvidia.com
2024-07-27 03:05:28 +02:00
Ben Skeggs
ca6eef9b1c
drm/nouveau/nvif: remove support for userspace backends
...
The tools that used libnvkm no longer exist.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-15-bskeggs@nvidia.com
2024-07-27 03:05:28 +02:00
Ben Skeggs
b2d474d4c8
drm/nouveau/nvkm: remove nvkm_client_search()
...
Has been unused for a while now.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-14-bskeggs@nvidia.com
2024-07-27 03:05:27 +02:00
Ben Skeggs
4a865f6a76
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-13-bskeggs@nvidia.com
2024-07-27 03:05:25 +02:00
Ben Skeggs
b5bd7cf76b
drm/nouveau/nvkm: remove detect/mmio/subdev_mask from device args
...
All callers now pass "detect=true, mmio=true, subdev_mask=~0ULL",
so remove the function arguments, and associated code.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-12-bskeggs@nvidia.com
2024-07-27 03:05:24 +02:00
Ben Skeggs
8bc1ab4f61
drm/nouveau: remove abi16->handles
...
Hasn't been needed since 2015...
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-11-bskeggs@nvidia.com
2024-07-27 03:05:24 +02:00
Ben Skeggs
d075d99ef7
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-10-bskeggs@nvidia.com
2024-07-27 03:05:23 +02:00
Ben Skeggs
ba6b8479c9
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
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-9-bskeggs@nvidia.com
2024-07-27 03:05:22 +02:00
Ben Skeggs
2e408ad7a5
drm/nouveau: add nouveau_cli to nouveau_abi16
...
Store a pointer to struct nouveau_cli in struct nouveau_abi16 to
avoid some dubious void casts.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-8-bskeggs@nvidia.com
2024-07-27 03:05:22 +02:00
Ben Skeggs
ea94c8e217
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()
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-7-bskeggs@nvidia.com
2024-07-27 03:05:21 +02:00
Ben Skeggs
6777264dfa
drm/nouveau: store nvkm_device pointer in nouveau_drm
...
There's various different places in the drm code that get at the
nvkm_device via various creative (and not very type-safe) means.
One of those being via nvif_device.object.priv.
Another patch series is going to entirely remove the ioctl-like
interfaces beween the drm code and nvkm, and that field will no
longer exist.
This provides a safer replacement for accessing the nvkm_device,
and will used more in upcoming patches to cleanup other cases.
v2:
- fixup printk macros to not oops if used before client ctor
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-6-bskeggs@nvidia.com
2024-07-27 03:05:21 +02:00
Ben Skeggs
c0bfe34330
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-5-bskeggs@nvidia.com
2024-07-27 03:05:20 +02:00
Ben Skeggs
448359c1ce
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-4-bskeggs@nvidia.com
2024-07-27 03:05:19 +02:00
Ben Skeggs
961ae5f980
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.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-3-bskeggs@nvidia.com
2024-07-27 03:05:19 +02:00
Ben Skeggs
20d70de582
drm/nouveau: move nouveau_drm_device_fini() above init()
...
The next commit wants to be able to call fini() from an init() failure
path to remove the need to duplicate a bunch of cleanup.
Moving fini() above init() avoids the need for a forward-declaration.
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com >
Signed-off-by: Danilo Krummrich <dakr@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-2-bskeggs@nvidia.com
2024-07-27 03:05:18 +02:00
Hamza Mahfooz
0d5040e406
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.
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20240725205109.209743-1-hamza.mahfooz@amd.com
2024-07-26 17:40:10 -04:00