summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-03-12drm/ast: Add helper for computing framebuffer location in video memoryThomas Zimmermann1-4/+21
The ast driver stores the primary plane's image in the framebuffer memory up to where the cursor is located. Add helpers to calculate the offset and size. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-6-tzimmermann@suse.de
2025-03-12drm/ast: cursor: Add helpers for computing location in video memoryThomas Zimmermann2-2/+20
The ast drivers stores the cursor image at the end of the video memory. Add helpers to calculate the offset and size. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-5-tzimmermann@suse.de
2025-03-12drm/ast: Add VGACR99 register constantsThomas Zimmermann2-7/+7
Add register constants for VGACR99 and use them when detecting the size of the VGA memory. Aligns the code with the programming manual. Also replace literal size values with Linux' SZ_ size constants. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-4-tzimmermann@suse.de
2025-03-12drm/ast: Add VGACRAA register constantsThomas Zimmermann2-2/+4
Add register constants for VGACRAA and use them when detecting the size of the VGA memory. Aligns the code with the programming manual. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-3-tzimmermann@suse.de
2025-03-12drm/ast: Replace AST_VIDMEM_SIZE_ with Linux SZ_ constantsThomas Zimmermann3-25/+16
Ast's AST_VIDMEM_SIZE_ constants enumerate supported video-memory sizes from 8 MiB to 128 MiB. Replace them with Linux' SZ_ constants of the same value. When expanded, the literal values remain the same. The size constant for 128 MiB is unused and the default size is not necessary. Remove both of them. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-2-tzimmermann@suse.de
2025-03-12drm/ci: enable lockdep detectionVignesh Raman3-3/+29
We have enabled PROVE_LOCKING (which enables LOCKDEP) in drm-ci. This will output warnings when kernel locking errors are encountered and will continue executing tests. To detect if lockdep has been triggered, check the debug_locks value in /proc/lockdep_stats after the tests have run. When debug_locks is 0, it indicates that lockdep has detected issues and turned itself off. Check this value, and if lockdep is detected, exit with an error and configure it as a warning in GitLab CI. GitLab CI ignores exit codes other than 1 by default. Pass the correct exit code with variable FF_USE_NEW_BASH_EVAL_STRATEGY set to true or exit on failure. Also update the documentation. Acked-by: Helen Koike <helen.fornazier@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250217053719.442644-4-vignesh.raman@collabora.com Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
2025-03-12drm/ci: enable CONFIG_DEBUG_WW_MUTEX_SLOWPATHVignesh Raman1-3/+3
Enable CONFIG_DEBUG_WW_MUTEX_SLOWPATH for mutex slowpath debugging. Acked-by: Helen Koike <helen.fornazier@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250217053719.442644-3-vignesh.raman@collabora.com Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
2025-03-12drm/ci: refactor software-driver stage jobsVignesh Raman1-35/+24
Move common job configuration for software-driver stage jobs to separate job. Acked-by: Helen Koike <helen.fornazier@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250217053719.442644-2-vignesh.raman@collabora.com Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
2025-03-11Documentation: Update the todoAnusha Srivatsa1-6/+7
Update the Documentation to be more precise. v2: Update for clarity v3: Further details in Todo Cc: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/640856/?series=144073&rev=5
2025-03-10drm/sti: move to devm_platform_ioremap_resource() usageAnusha Srivatsa7-77/+21
Replace platform_get_resource/_byname + devm_ioremap with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule@ identifier res; expression ioremap; identifier pdev; constant mem; expression name; @@ -struct resource *res; ... -res = platform_get_resource_byname(pdev,mem,name); <... -if (!res) { -... -} ...> -ioremap = devm_ioremap(...); +ioremap = devm_platform_ioremap_resource_byname(pdev,name); and @rule_2@ identifier res; expression ioremap; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); <... -if (!res) { -... -} ...> -ioremap = devm_ioremap(...); +ioremap = devm_platform_ioremap_resource(pdev,0); v2: Fix compilation error. v3: Handle returns properly since the new API return error pointers and not NULL Cc: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com> Cc: Alain Volmat <alain.volmat@foss.st.com> Reviewed-by: Maxime Ripard <mripard@kernel.org>(v2) Acked-by: Raphael Gallais-Pou <rgallaispou@gmail.com>(v2) Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Link: https://patchwork.freedesktop.org/patch/640854/?series=144073&rev=5
2025-03-10drm/sprd: move to devm_platform_ioremap_resource() usageAnusha Srivatsa2-20/+6
Replace platform_get_resource + devm_ioremap with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_2@ identifier res; expression ioremap; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); <... -if (!res) { -... -} ...> -ioremap = devm_ioremap(...); +ioremap = devm_platform_ioremap_resource(pdev,0); v2: Address the return handling properly since the new API returns error pointers and not NULL. Cc: Chunyan Zhang <zhang.lyra@gmail.com> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Reviewed-by: Chunyan Zhang <zhang.lyra@gmail.com>(v1) Reviewed-by: Maxime Ripard <mripard@kernel.org>(v1) Link: https://patchwork.freedesktop.org/patch/640854/?series=144073&rev=5
2025-03-10drm/vmwgfx: Add error path for xa_store in vmw_bo_add_detached_resourceKeisuke Nishimura3-5/+17
The xa_store() may fail due to memory allocation failure because there is no guarantee that the index is already used. This fix introduces new paths to handle the error. This patch also aligns the order of function calls by calling vmw_bo_add_detached_resource() before ttm_prime_object_init() in order to allow consistent error handling. Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Signed-off-by: Keisuke Nishimura <keisuke.nishimura@inria.fr> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250225145223.34773-1-keisuke.nishimura@inria.fr
2025-03-10drm/vmwgfx: Add seqno waiter for sync_filesIan Forbes1-0/+26
Because sync_files are passive waiters they do not participate in the processing of fences like the traditional vmw_fence_wait IOCTL. If userspace exclusively uses sync_files for synchronization then nothing in the kernel actually processes fence updates as interrupts for fences are masked and ignored if the kernel does not indicate to the SVGA device that there are active waiters. This oversight results in a bug where the entire GUI can freeze waiting on a sync_file that will never be signalled as we've masked the interrupts to signal its completion. This bug is incredibly racy as any process which interacts with the fencing code via the 3D stack can process the stuck fences on behalf of the stuck process causing it to run again. Even a simple app like eglinfo is enough to resume the stuck process. Usually this bug is seen at a login screen like GDM because there are no other 3D apps running. By adding a seqno waiter we re-enable interrupt based processing of the dma_fences associated with the sync_file which is signalled as part of a dma_fence_callback. This has likely been broken since it was initially added to the kernel in 2017 but has gone unnoticed until mutter recently started using sync_files heavily over the course of 2024 as part of their explicit sync support. Fixes: c906965dee22 ("drm/vmwgfx: Add export fence to file descriptor support") Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250228200633.642417-1-ian.forbes@broadcom.com
2025-03-10drm/vmwgfx: Bump the minor versionZack Rusin1-1/+1
Bump the minor version of vmwgfx in order to detect releases where the cursor issues have been fixed. Cursors created with dumb buffer were broken on vmwgfx. Userspace (e.g. kwin) has workarounds for those issues and often disables hardware cursors on vmwgfx. This allows enabling hardware cursors on vmwgfx again. Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com> Reviewed-by: Martin Krastev <martin.krastev@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250307125836.3877138-3-zack.rusin@broadcom.com
2025-03-10drm/vmwgfx: Refactor cursor handlingZack Rusin15-1064/+1042
Refactor cursor handling to make the code maintainable again. Over the last 12 years the svga device improved support for virtualized cursors and at the same time the drm interfaces evolved quite a bit from pre-atomic to current atomic ones. vmwgfx only added new code over the years, instead of adjusting/refactoring the paths. Export the cursor plane handling to its own file. Remove special handling of the legacy cursor support to make it fit within the global cursor plane mechanism. Finally redo dirty tracking because memcmp never worked correctly resulting in the cursor not being properly updated in the guest. Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com> Reviewed-by: Martin Krastev <martin.krastev@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250307125836.3877138-2-zack.rusin@broadcom.com
2025-03-10MAINTAINERS: Update drm/ci maintainersVignesh Raman1-1/+2
Update drm/ci maintainer entries: * Add myself as drm/ci maintainer. * Update Helen's email address. Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com> Acked-by: Helen Koike <helen.fornazier@gmail.com> Acked-by: Daniel Stone <daniels@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250205134811.2002718-1-vignesh.raman@collabora.com
2025-03-10drm/panic: clean Clippy warningMiguel Ojeda1-1/+1
Clippy warns: error: manual implementation of an assign operation --> drivers/gpu/drm/drm_panic_qr.rs:418:25 | 418 | self.carry = self.carry % pow; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.carry %= pow` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern Thus clean it up. Fixes: dbed4a797e00 ("drm/panic: Better binary encoding in QR code") Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250303093242.1011790-1-ojeda@kernel.org
2025-03-10drm/gma500: Remove unused psb_mmu_virtual_to_pfnDr. David Alan Gilbert2-43/+0
psb_mmu_virtual_to_pfn() was added in 2011 by commit 8c8f1c958ab5 ("gma500: introduce the GTT and MMU handling logic") but hasn't been used. Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250308234428.255164-1-linux@treblig.org
2025-03-10drm/gma500/psb_intel_modes: Remove unused psb_intel_ddc_probeDr. David Alan Gilbert2-32/+0
psb_intel_ddc_probe() was added in 2011 by commit 89c78134cc54 ("gma500: Add Poulsbo support") but has remained unused (probably because drm_get_edid is used instead). Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250308234356.255114-1-linux@treblig.org
2025-03-09drm/vc4: plane: fix inconsistent indenting warningCharles Han1-1/+1
Fix below inconsistent indenting smatch warning. smatch warnings: drivers/gpu/drm/vc4/vc4_plane.c:2083 vc6_plane_mode_set() warn: inconsistent indenting Signed-off-by: Charles Han <hanchunchao@inspur.com> Signed-off-by: Maíra Canal <mcanal@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250305102107.2595-1-hanchunchao@inspur.com
2025-03-09drm/nouveau/nvkm: introduce new GSP reply policy NVKM_GSP_RPC_REPLY_POLLZhi Wang3-1/+8
Some GSP RPC commands need a new reply policy: "caller don't care about the message content but want to make sure a reply is received". To support this case, a new reply policy is introduced. NV_VGPU_MSG_FUNCTION_ALLOC_MEMORY is a large GSP RPC command. The actual required policy is NVKM_GSP_RPC_REPLY_POLL. This can be observed from the dump of the GSP message queue. After the large GSP RPC command is issued, GSP will write only an empty RPC header in the queue as the reply. Without this change, the policy "receiving the entire message" is used for NV_VGPU_MSG_FUNCTION_ALLOC_MEMORY. This causes the timeout of receiving the returned GSP message in the suspend/resume path. Introduce the new reply policy NVKM_GSP_RPC_REPLY_POLL, which waits for the returned GSP message but discards it for the caller. Use the new policy NVKM_GSP_RPC_REPLY_POLL on the GSP RPC command NV_VGPU_MSG_FUNCTION_ALLOC_MEMORY. Fixes: 50f290053d79 ("drm/nouveau: support handling the return of large GSP message") Cc: Danilo Krummrich <dakr@kernel.org> Cc: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Ben Skeggs <bskeggs@nvidia.com> Signed-off-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Danilo Krummrich <dakr@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20250227013554.8269-3-zhiw@nvidia.com
2025-03-09drm/nouveau/nvkm: factor out current GSP RPC command policiesZhi Wang5-44/+72
There can be multiple cases of handling the GSP RPC messages, which are the reply of GSP RPC commands according to the requirement of the callers and the nature of the GSP RPC commands. The current supported reply policies are "callers don't care" and "receive the entire message" according to the requirement of the callers. To introduce a new policy, factor out the current RPC command reply polices. Also, centralize the handling of the reply in a single function. Factor out NVKM_GSP_RPC_REPLY_NOWAIT as "callers don't care" and NVKM_GSP_RPC_REPLY_RECV as "receive the entire message". Introduce a kernel doc to document the policies. Factor out r535_gsp_rpc_handle_reply(). No functional change is intended for small GSP RPC commands. For large GSP commands, the caller decides the policy of how to handle the returned GSP RPC message. Cc: Ben Skeggs <bskeggs@nvidia.com> Cc: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Danilo Krummrich <dakr@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20250227013554.8269-2-zhiw@nvidia.com
2025-03-07drm/vkms: Allow to attach connectors and encodersJosé Expósito5-13/+216
Add a list of possible encoders to the connector configuration and helpers to attach and detach them. Now that the default configuration has its connector and encoder correctly, configure the output following the configuration. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-15-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Allow to configure multiple connectorsJosé Expósito5-0/+205
Add a list of connectors to vkms_config and helper functions to add and remove as many connectors as wanted. For backwards compatibility, add one enabled connector to the default configuration. A future patch will allow to attach connectors and encoders, but for the moment there are no changes in the way the output is configured. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-14-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Allow to attach encoders and CRTCsJosé Expósito5-20/+266
Add a list of possible CRTCs to the encoder configuration and helpers to attach and detach them. Now that the default configuration has its encoder and CRTC correctly attached, configure the output following the configuration. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-13-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Allow to configure multiple encodersJosé Expósito4-0/+195
Add a list of encoders to vkms_config and helper functions to add and remove as many encoders as wanted. For backwards compatibility, add one encoder to the default configuration. A future patch will allow to attach encoders and CRTCs, but for the moment there are no changes in the way the output is configured. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-12-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Allow to attach planes and CRTCsJosé Expósito6-36/+454
Add a list of possible CRTCs to the plane configuration and helpers to attach, detach and get the primary and cursor planes attached to a CRTC. Now that the default configuration has its planes and CRTC correctly attached, configure the output following the configuration. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-11-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Allow to configure multiple CRTCsJosé Expósito4-5/+222
Add a list of CRTCs to vkms_config and helper functions to add and remove as many CRTCs as wanted. For backwards compatibility, add one CRTC to the default configuration. A future patch will allow to attach planes and CRTCs, but for the moment there are no changes in the way the output is configured. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-10-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Allow to configure multiple planesJosé Expósito5-36/+370
Add a list of planes to vkms_config and create as many planes as configured during output initialization. For backwards compatibility, add one primary plane and, if configured, one cursor plane and NUM_OVERLAY_PLANES planes to the default configuration. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-9-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Add a validation function for VKMS configurationLouis Chauvet4-0/+21
As the configuration will be used by userspace, add a validator to avoid creating a broken DRM device. For the moment, the function always returns true, but rules will be added in future patches. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-8-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Set device name from vkms_configJosé Expósito5-5/+40
In order to be able to create multiple devices, the device name needs to be unique. Allow to set it in the VKMS configuration. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-7-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Move default_config creation to its own functionJosé Expósito4-5/+71
Extract the initialization of the default configuration to a function. Refactor, no functional changes. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-6-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Extract vkms_config headerJosé Expósito7-42/+121
Creating a new vkms_config structure will be more complex once we start adding more options. Extract the vkms_config structure to its own header and source files and add functions to create and delete a vkms_config and to initialize debugfs. Refactor, no functional changes. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-5-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Add KUnit test scaffoldingJosé Expósito5-0/+42
Add the required boilerplate to start creating KUnit test. To run the tests: $ ./tools/testing/kunit/kunit.py run \ --kunitconfig=drivers/gpu/drm/vkms/tests Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Arthur Grillo <arthurgrillo@riseup.net> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-4-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Create vkms_connector structJosé Expósito3-7/+16
Create a structure wrapping the drm_connector. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-3-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm/vkms: Extract vkms_connector headerJosé Expósito4-38/+73
Up until now, the logic to manage connectors was in vkms_output.c. Since more options will be added to connectors in the future, extract the code to its own file. Refactor, no functional changes. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-2-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-03-07drm: pl111: fix inconsistent indenting warningCharles Han1-1/+1
Fix below inconsistent indenting smatch warning. smatch warnings: drivers/gpu/drm/pl111/pl111_versatile.c:504 pl111_versatile_init() warn: inconsistent indenting Signed-off-by: Charles Han <hanchunchao@inspur.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20250305102540.2815-1-hanchunchao@inspur.com
2025-03-07drm/gma500: Remove unused mrst_clock_funcsDr. David Alan Gilbert1-7/+0
The mrst_clock_funcs const was added in 2013 by commit ac6113ebb70d ("drm/gma500/mrst: Add SDVO clock calculation") and commented as 'Not used yet'. It's not been used since, so remove it. The helper functions it points to are still used elsewhere. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250306155155.212599-1-linux@treblig.org
2025-03-07drm/imx: legacy-bridge: fix inconsistent indenting warningCharles Han1-3/+3
Fix below inconsistent indenting smatch warning. smatch warnings: drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c:79 devm_imx_drm_legacy_bridge() warn: inconsistent indenting Signed-off-by: Charles Han <hanchunchao@inspur.com> Reviewed-by: Liu Ying <victor.liu@nxp.com> Signed-off-by: Liu Ying <victor.liu@nxp.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250305103042.3017-1-hanchunchao@inspur.com
2025-03-06drm/tegra: move to devm_platform_ioremap_resource() usageAnusha Srivatsa1-3/+1
Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Link: https://patchwork.freedesktop.org/patch/640855/?series=144073&rev=5
2025-03-06drm/mxsfb: move to devm_platform_ioremap_resource() usageAnusha Srivatsa2-6/+2
Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Marek Vasut <marex@denx.de> Cc: Stefan Agner <stefan@agner.ch> Reviewed-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Link: https://patchwork.freedesktop.org/patch/640852/?series=144073&rev=5
2025-03-06drm/hisilicon: move to devm_platform_ioremap_resource() usageAnusha Srivatsa2-6/+2
Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Xinliang Liu <xinliang.liu@linaro.org> Cc: Tian Tao <tiantao6@hisilicon.com> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Yongqin Liu <yongqin.liu@linaro.org> Cc: John Stultz <jstultz@google.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Link: https://patchwork.freedesktop.org/patch/640850/?series=144073&rev=5
2025-03-06drm/fsl-dcu: move to devm_platform_ioremap_resource() usageAnusha Srivatsa1-3/+1
Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Stefan Agner <stefan@agner.ch> Cc: Alison Wang <alison.wang@nxp.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Link: https://patchwork.freedesktop.org/patch/640851/?series=144073&rev=5
2025-03-06drm/ttm: test private resv obj on release/destroyChristian König1-2/+2
Test the fences in the private dma_resv object instead of the pointer to a potentially shared dma_resv object. This only matters for imported BOs with an SG table since those don't get their dma_resv pointer replaced on release. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: James Zhu <James.Zhu@amd.com> Reviewed-by: James Zhu <James.Zhu@amd.com> Tested-by: James Zhu <James.Zhu@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250129152849.15777-1-christian.koenig@amd.com
2025-03-06drm/sched: Update timedout_job()'s documentationPhilipp Stanner1-31/+47
drm_sched_backend_ops.timedout_job()'s documentation is outdated. It mentions the deprecated function drm_sched_resubmit_jobs(). Furthermore, it does not point out the important distinction between hardware and firmware schedulers. Since firmware schedulers typically only use one entity per scheduler, timeout handling is significantly more simple because the entity the faulted job came from can just be killed without affecting innocent processes. Update the documentation with that distinction and other details. Reformat the docstring to work to a unified style with the other handles. Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20250305130551.136682-5-phasta@kernel.org
2025-03-06drm/sched: Document run_job() refcount hazardPhilipp Stanner1-3/+6
drm_sched_backend_ops.run_job() returns a dma_fence for the scheduler. That fence is signalled by the driver once the hardware completed the associated job. The scheduler does not increment the reference count on that fence, but implicitly expects to inherit this fence from run_job(). This is relatively subtle and prone to misunderstandings. This implies that, to keep a reference for itself, a driver needs to call dma_fence_get() in addition to dma_fence_init() in that callback. It's further complicated by the fact that the scheduler even decrements the refcount in drm_sched_run_job_work() since it created a new reference in drm_sched_fence_scheduled(). It does, however, still use its pointer to the fence after calling dma_fence_put() - which is safe because of the aforementioned new reference, but actually still violates the refcounting rules. Move the call to dma_fence_put() to the position behind the last usage of the fence. Suggested-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Philipp Stanner <pstanner@redhat.com> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20250305130551.136682-4-phasta@kernel.org
2025-03-06drm/sched: Adjust outdated docu for run_job()Philipp Stanner1-4/+30
The documentation for drm_sched_backend_ops.run_job() mentions a certain function called drm_sched_job_recovery(). This function does not exist. What's actually meant is drm_sched_resubmit_jobs(), which is by now also deprecated. Furthermore, the scheduler expects to "inherit" a reference on the fence from the run_job() callback. This, so far, is also not documented. Remove the mention of the removed function. Discourage the behavior of drm_sched_backend_ops.run_job() being called multiple times for the same job. Document the necessity of incrementing the refcount in run_job(). Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20250305130551.136682-3-phasta@kernel.org
2025-03-06dma-buf: drop caching of sg_tablesChristian König5-50/+0
That was purely for the transition from static to dynamic dma-buf handling and can be removed again now. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch> Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250211163109.12200-5-christian.koenig@amd.com
2025-03-06dma-buf: dma-buf: stop mapping sg_tables on attach v2Christian König2-106/+59
As a workaround to smoothly transit from static to dynamic DMA-buf handling we cached the sg_table on attach if dynamic handling mismatched between exporter and importer. Since Dmitry and Thomas cleaned that up and also documented the lock handling we can drop this workaround now. V2: implement Sima's comments Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20250211163109.12200-4-christian.koenig@amd.com
2025-03-06dma-buf/dma-fence: remove unnecessary callbacksChristian König5-87/+2
The fence_value_str and timeline_value_str callbacks were just an unnecessary abstraction in the SW sync implementation. The only caller of those callbacks already knew that the fence in questions is a timeline_fence. So print the values directly instead of using a redirection. Additional to that remove the implementations from virtgpu and vgem. As far as I can see those were never used in the first place. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20250211163109.12200-3-christian.koenig@amd.com