summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
AgeCommit message (Collapse)AuthorLines
2025-09-30drm/xe/debugfs: Update xe_mocs_dump signatureMichal Wajdeczko-16/+15
Our debugfs helper xe_gt_debugfs_show_with_rpm() expects print() functions to return int. New signature allows us to drop wrapper. While around, move kernel-doc closer to the function definition, as suggested in the doc-guide. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/20250923211613.193347-5-michal.wajdeczko@intel.com
2025-09-30drm/xe/debugfs: Update xe_tuning_dump signatureMichal Wajdeczko-11/+16
Our debugfs helper xe_gt_debugfs_show_with_rpm() expects print() functions to return int. New signature allows us to drop wrapper. While around, print additional separation lines using puts() to avoid output with leading \n which might confuse some printers. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/20250923211613.193347-4-michal.wajdeczko@intel.com
2025-09-30drm/xe/debugfs: Update xe_wa_dump signatureMichal Wajdeczko-12/+17
Our debugfs helper xe_gt_debugfs_show_with_rpm() expects print() functions to return int. New signature allows us to drop wrapper. While around, print additional separation lines using puts() to avoid output with leading \n which might confuse some printers. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/20250923211613.193347-3-michal.wajdeczko@intel.com
2025-09-30drm/xe/debugfs: Update xe_gt_topology_dump signatureMichal Wajdeczko-10/+11
Our debugfs helper xe_gt_debugfs_show_with_rpm() expects print() functions to return int. New signature allows us to drop wrapper. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/20250923211613.193347-2-michal.wajdeczko@intel.com
2025-09-30drm/i915/irq: duplicate HAS_FBC() for irq error mask usageJani Nikula-3/+3
The error irq handling needs to mask page table errors on gen 2/3 with FBC. See commit e7e12f6ec8bf ("drm/i915: Mask page table errors on gen2/3 with FBC") for details. We want to avoid using display feature checks in i915 core code. Since FBC can't be fused off on gen 2/3, just list the platforms that support FBC. Add a macro purely for making the code self-documenting. With this, we can drop the intel_display_core.h include, and make struct intel_display opaque inside i915_irq.c. Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://lore.kernel.org/r/20250929133418.2033006-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-09-30drm/gma500: Remove unused helper psb_fbdev_fb_setcolreg()Thomas Zimmermann-43/+0
Remove psb_fbdev_fb_setcolreg(), which hasn't been called in almost a decade. Gma500 commit 4d8d096e9ae8 ("gma500: introduce the framebuffer support code") added the helper psb_fbdev_fb_setcolreg() for setting the fbdev palette via fbdev's fb_setcolreg callback. Later commit 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops") set several default helpers for fbdev emulation, including fb_setcmap. The fbdev subsystem always prefers fb_setcmap over fb_setcolreg. [1] Hence, the gma500 code is no longer in use and gma500 has been using drm_fb_helper_setcmap() for several years without issues. Fixes: 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops") Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: Stefan Christ <contact@stefanchrist.eu> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v4.10+ Link: https://elixir.bootlin.com/linux/v6.16.9/source/drivers/video/fbdev/core/fbcmap.c#L246 # [1] Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://lore.kernel.org/r/20250929082338.18845-1-tzimmermann@suse.de
2025-09-30Merge tag 'amd-drm-next-6.18-2025-09-26' of ↵Dave Airlie-392/+991
https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.18-2025-09-26: amdgpu: - Misc fixes - Misc cleanups - SMU 13.x fixes - MES fix - VCN 5.0.1 reset fixes - DCN 3.2 watermark fixes - AVI infoframe fixes - PSR fix - Brightness fixes - DCN 3.1.4 fixes - DCN 3.1+ DTM fixes - DCN powergating fixes - DMUB fixes - DCN/SMU cleanup - DCN stutter fixes - DCN 3.5 fixes - GAMMA_LUT fixes - Add UserQ documentation - GC 9.4 reset fixes - Enforce isolation cleanups - UserQ fixes - DC/non-DC common modes cleanup - DCE6-10 fixes amdkfd: - Fix a race in sw_fini - Switch partition fix Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://lore.kernel.org/r/20250926143918.2030854-1-alexander.deucher@amd.com
2025-09-30drm/xe/pf: Make GGTT/LMEM debugfs files per-tileMichal Wajdeczko-65/+163
Due to initial design of the Xe debugfs, the GGTT and LMEM files were defined on the primary GT, instead of being per-tile. While PF provisioning code is now still maintaining GGTT and LMEM also on the per primary-GT level, this will be refactored soon, but we can fix debugfs layout now, as part of the new SR-IOV tree. For backward compatibility we will provide some symlinks that can be removed once our tools will be fully converted. As we are making all those changes in the user facing interface, take this as apportunity to also start replacing the "LMEM" term, used by the SR-IOV code, with the "VRAM" term, used by Xe driver. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20250928140029.198847-7-michal.wajdeczko@intel.com
2025-09-29drm/xe/debugfs: Promote xe_tile_debugfs_simple_showMichal Wajdeczko-7/+10
We will want to use this helper function in other files. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20250928140029.198847-6-michal.wajdeczko@intel.com
2025-09-29drm/xe/pf: Move SR-IOV GT debugfs files to new treeMichal Wajdeczko-135/+234
Instead of expanding GT debugfs directories with large number of SR-IOV files, as those are replicated per each SR-IOV function, move them to our new debugfs tree, organized by the function. But to avoid breaking IGT tests that use current layout, provide symlinks which could be removed once transition period is over, or we can we can leave them for convenience. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20250928140029.198847-5-michal.wajdeczko@intel.com
2025-09-29drm/xe/pf: Populate SR-IOV debugfs tree with tilesMichal Wajdeczko-1/+129
Populate new per SR-IOV function debugfs directories with next level directories that represent tiles. There are no files yet, but we will continue updating that tree in upcoming patches. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20250928140029.198847-4-michal.wajdeczko@intel.com
2025-09-29drm/xe/pf: Create separate debugfs tree for SR-IOV filesMichal Wajdeczko-9/+49
Currently we expose debugfs files related to SR-IOV functions together with other native files, but that approach will not scale well as we plan to add more attributes and also expose some of them on the per-tile basis. Start building separate tree for SR-IOV specific debugfs files where we can replicate similar files per every SR-IOV function: /sys/kernel/debug/dri/BDF/ ├── sriov │ ├── pf │ │ ├── tile0 │ │ │ ├── gt0 │ │ │ ├── gt1 │ │ │ : │ │ ├── tile1 │ │ : │ ├── vf1 │ │ ├── tile0 │ │ │ ├── gt0 │ │ │ ├── gt1 │ │ │ : │ │ : │ ├── vf2 │ ├── ... We will populate this new tree in upcoming patches. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20250928140029.198847-3-michal.wajdeczko@intel.com
2025-09-29drm/xe/pf: Promote PF debugfs function to its own fileMichal Wajdeczko-48/+74
In upcoming patches, we will build on the PF separate debugfs tree for all SR-IOV related files and this new code will need dedicated file. To minimize large diffs later, move existing function now as-is, so any future modifications will be done directly in target file. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20250928140029.198847-2-michal.wajdeczko@intel.com
2025-09-29drm/xe/vf: Don't claim support for firmware late-bind if VFMichal Wajdeczko-0/+1
In general, the VFs can't load firmwares so attempt to initialize the firmware late-bind component leads to errors like: [] xe 0000:03:00.1: [drm] *ERROR* Late bind component not bound Fixes: 918bd789d62e ("drm/xe/xe_late_bind_fw: Introduce xe_late_bind_fw") Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6190 Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Badal Nilawar <badal.nilawar@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Link: https://lore.kernel.org/r/20250928174811.198933-3-michal.wajdeczko@intel.com
2025-09-29drm/xe/vf: Rename sriov_update_device_infoMichal Wajdeczko-9/+9
This is a VF only function and its name should reflect that to avoid any confusion. Move the VF check to the caller side. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Link: https://lore.kernel.org/r/20250928174811.198933-2-michal.wajdeczko@intel.com
2025-09-29drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-2/+5
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://lore.kernel.org/r/20250821081918.79786-26-tzimmermann@suse.de
2025-09-29drm/xe: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-4/+4
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Align the buffer size according to hardware requirements. Xe's internal calculation allowed for 64-bit wide buffer sizes, but the ioctl's internal checks always verified against 32-bit wide limits. Hance, it is safe to limit the driver code to 32-bit calculations as well. v3: - mention 32-bit calculation in commit description (Matthew) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Acked-by: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/20250821081918.79786-24-tzimmermann@suse.de
2025-09-29drm/vmwgfx: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-17/+4
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Zack Rusin <zack.rusin@broadcom.com> Cc: Zack Rusin <zack.rusin@broadcom.com> Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com> Link: https://lore.kernel.org/r/20250821081918.79786-23-tzimmermann@suse.de
2025-09-29drm/tegra: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-3/+5
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Thierry Reding <treding@nvidia.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Mikko Perttunen <mperttunen@nvidia.com> Link: https://lore.kernel.org/r/20250821081918.79786-21-tzimmermann@suse.de
2025-09-29drm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-6/+6
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 64. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Heiko Stuebner <heiko@sntech.de> Cc: Sandy Huang <hjc@rock-chips.com> Cc: "Heiko Stübner" <heiko@sntech.de> Cc: Andy Yan <andy.yan@rock-chips.com> Link: https://lore.kernel.org/r/20250821081918.79786-20-tzimmermann@suse.de
2025-09-29drm/renesas/rcar-du: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-2/+5
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20250821081918.79786-18-tzimmermann@suse.de
2025-09-29drm/omapdrm: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-8/+7
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://lore.kernel.org/r/20250821081918.79786-16-tzimmermann@suse.de
2025-09-29drm/nouveau: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-3/+4
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 256. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Lyude Paul <lyude@redhat.com> Cc: Karol Herbst <kherbst@redhat.com> Cc: Lyude Paul <lyude@redhat.com> Cc: Danilo Krummrich <dakr@kernel.org> Link: https://lore.kernel.org/r/20250821081918.79786-15-tzimmermann@suse.de
2025-09-29drm/msm: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-2/+25
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Alignment is specified in bytes, but the hardware requires the scanline pitch to be a multiple of 32 pixels. Therefore compute the byte size of 32 pixels in the given color mode and align the pitch accordingly. This replaces the existing code in the driver's align_pitch() helper. v3: - clarify pitch alignment in commit message (Dmitry) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Cc: Rob Clark <robdclark@gmail.com> Cc: Abhinav Kumar <quic_abhinavk@quicinc.com> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Cc: Sean Paul <sean@poorly.run> Cc: Marijn Suijten <marijn.suijten@somainline.org> Link: https://lore.kernel.org/r/20250821081918.79786-14-tzimmermann@suse.de
2025-09-29drm/loongson: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-21/+8
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev> Cc: Sui Jingfeng <sui.jingfeng@linux.dev> Link: https://lore.kernel.org/r/20250821081918.79786-12-tzimmermann@suse.de
2025-09-29drm/imx/ipuv3: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-8/+23
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. The hardware requires the framebuffer width to be a multiple of 8. The scanline pitch has to be large enough to support this. Therefore compute the byte size of 8 pixels in the given color mode and align the pitch accordingly. v5: - fix typo in commit description Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Shawn Guo <shawnguo@kernel.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Cc: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20250821081918.79786-11-tzimmermann@suse.de
2025-09-29drm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-3/+5
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Inki Dae <inki.dae@samsung.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Alim Akhtar <alim.akhtar@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Link: https://lore.kernel.org/r/20250821081918.79786-8-tzimmermann@suse.de
2025-09-29drm/gem-shmem: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-11/+5
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://lore.kernel.org/r/20250821081918.79786-5-tzimmermann@suse.de
2025-09-29drm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()Thomas Zimmermann-3/+8
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Push the current calculation into the only direct caller imx. Imx's hardware requires the framebuffer width to be aligned to 8. The driver's current approach is actually incorrect, as it only guarantees this implicitly and requires bpp to be a multiple of 8 already. A later commit will fix this problem by aligning the scanline pitch such that an aligned width still fits into each scanline's memory. A number of other drivers are build on top of gem-dma helpers and implement their own dumb-buffer allocation. These drivers invoke drm_gem_dma_dumb_create_internal(), which is not affected by this commit. v5: - avoid reset of arguments (Tomi) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://lore.kernel.org/r/20250821081918.79786-4-tzimmermann@suse.de
2025-09-29drm/dumb-buffers: Provide helper to set pitch and sizeThomas Zimmermann-0/+130
Add drm_modes_size_dumb(), a helper to calculate the dumb-buffer scanline pitch and allocation size. Implementations of struct drm_driver.dumb_create can call the new helper for their size computations. There is currently quite a bit of code duplication among DRM's memory managers. Each calculates scanline pitch and buffer size from the given arguments, but the implementations are inconsistent in how they treat alignment and format support. Later patches will unify this code on top of drm_mode_size_dumb() as much as possible. drm_mode_size_dumb() uses existing 4CC format helpers to interpret the given color mode. This makes the dumb-buffer interface behave similar the kernel's video= parameter. Current per-driver implementations again likely have subtle differences or bugs in how they support color modes. The dumb-buffer UAPI is only specified for known color modes. These values describe linear, single-plane RGB color formats or legacy index formats. Other values should not be specified. But some user space still does. So for unknown color modes, there are a number of known exceptions for which drm_mode_size_dumb() calculates the pitch from the bpp value, as before. All other values work the same but print an error. v6: - document additional use cases for DUMB_CREATE2 in TODO list (Tomi) - fix typos in documentation (Tomi) v5: - check for overflows with check_mul_overflow() (Tomi) v4: - use %u conversion specifier (Geert) - list DRM_FORMAT_Dn in UAPI docs (Geert) - avoid dmesg spamming with drm_warn_once() (Sima) - add more information about bpp special case (Sima) - clarify parameters for hardware alignment - add a TODO item for DUMB_CREATE2 v3: - document the UAPI semantics - compute scanline pitch from for unknown color modes (Andy, Tomi) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://lore.kernel.org/r/20250821081918.79786-3-tzimmermann@suse.de
2025-09-29drm/dumb-buffers: Sanitize output on errorsThomas Zimmermann-11/+29
The ioctls MODE_CREATE_DUMB and MODE_MAP_DUMB return results into a memory buffer supplied by user space. On errors, it is possible that intermediate values are being returned. The exact semantics depends on the DRM driver's implementation of these ioctls. Although this is most-likely not a security problem in practice, avoid any uncertainty by clearing the memory to 0 on errors. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://lore.kernel.org/r/20250821081918.79786-2-tzimmermann@suse.de
2025-09-29drm/ast: Remove generic device initializationThomas Zimmermann-166/+2
The code in ast_main.c has been split into several helpers in other source files. Delete the source file. With the generic device init gone, fail probing on unknown hardware generations. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-13-tzimmermann@suse.de
2025-09-29drm/ast: Move Gen7 device initialization into separate helperThomas Zimmermann-0/+74
Split off device initialization for Gen7 hardware into the helpers ast_2600_device_create() and ast_2600_detect_wide_screen(). The new functions are duplicates of their counterparts in ast_main.c, but stripped from most non-Gen7 support. Simplifies maintenance as the driver's number of supported hardware generations grows. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-12-tzimmermann@suse.de
2025-09-29drm/ast: Move Gen6 device initialization into separate helperThomas Zimmermann-0/+75
Split off device initialization for Gen6 hardware into the helpers ast_2500_device_create() and ast_2500_detect_wide_screen(). The new functions are duplicates of their counterparts in ast_main.c, but stripped from most non-Gen6 support. Simplifies maintenance as the driver's number of supported hardware generations grows. v2: - simplify widescreen-detection logic Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-11-tzimmermann@suse.de
2025-09-29drm/ast: Move Gen5 device initialization into separate helperThomas Zimmermann-0/+107
Split off device initialization for Gen5 hardware into the helpers ast_2400_device_create() and ast_2400_detect_wide_screen(). The new functions are duplicates of their counterparts in ast_main.c, but stripped from most non-Gen5 support. Simplifies maintenance as the driver's number of supported hardware generations grows. v2: - simplify widescreen-detection logic Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-10-tzimmermann@suse.de
2025-09-29drm/ast: Move Gen4 device initialization into separate helperThomas Zimmermann-0/+71
Split off device initialization for Gen4 hardware into the helpers ast_2300_device_create() and ast_2300_detect_wide_screen(). The new functions are duplicates of their counterparts in ast_main.c, but stripped from most non-Gen4 support. Simplifies maintenance as the driver's number of supported hardware generations grows. v2: - simplify widescreen-detection logic Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-9-tzimmermann@suse.de
2025-09-29drm/ast: Move Gen3 device initialization into separate helperThomas Zimmermann-0/+99
Split off device initialization for Gen3 hardware into the helpers ast_2200_device_create() and ast_2200_detect_wide_screen(). The new functions are duplicates of their counterparts in ast_main.c, but stripped from most non-Gen3 support. Simplifies maintenance as the driver's number of supported hardware generations grows. v2: - simplify widescreen-detection logic Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-8-tzimmermann@suse.de
2025-09-29drm/ast: Move Gen2 device initialization into separate helperThomas Zimmermann-0/+65
Split off device initialization for Gen2 hardware into the helpers ast_2100_device_create() and ast_2100_detect_wide_screen(). The new functions are duplicates of their counterparts in ast_main.c, but stripped from most non-Gen2 support. Simplifies maintenance as the driver's number of supported hardware generations grows. v2: - simplify widescreen-detection logic (Jocelyn) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-7-tzimmermann@suse.de
2025-09-29drm/ast: Move Gen1 device initialization into separate helperThomas Zimmermann-0/+52
Split off device initialization for Gen1 hardware into the helper ast_2000_device_create(). The new function is a duplicate of their counterpart in ast_main.c, but stripped from most non-Gen1 support. Simplifies maintenance as the driver's number of supported hardware generations grows. v2: - remove unnecessary widescreen-detection logic Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-6-tzimmermann@suse.de
2025-09-29drm/ast: Prepare per-Gen device initializationThomas Zimmermann-7/+28
Switch device creation by hardware Gen. Return the value from the call to ast_detect_chip(). All generations are still initialized by ast_device_create(). Also add ast_device_init() for setting some common fields in struct ast_device. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-5-tzimmermann@suse.de
2025-09-29drm/ast: Split ast_detect_tx_chip() per chip generationThomas Zimmermann-89/+119
Gen4 and later models detect the TX chip from VGACRD1, while earlier models detect from VGACRA3. Split up the detection helper into two separate helpers. Use SZ_ constants instead of plain numbers. Then inline the call into its only caller ast_device_create(). When ast_device_create() gets split up per Gen, either call will remain. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-4-tzimmermann@suse.de
2025-09-29drm/ast: Move mode-detection helpers to Gen2 source filesThomas Zimmermann-27/+33
Wide-screen modes are only available on Gen2 and later. Move the detection helpers to the appropriate source file. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-3-tzimmermann@suse.de
2025-09-29drm/ast: Move display-clock tables to per-Gen source filesThomas Zimmermann-62/+72
Move display-clock tables to the appropriate per-Gen source files. The tables are almost identical, except for mode entries 0x17 and 0x1a. Rename to tables to match common style. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250922083708.45564-2-tzimmermann@suse.de
2025-09-29Merge branches 'pm-core', 'pm-runtime' and 'pm-sleep'Rafael J. Wysocki-1/+1
Merge changes related to system sleep and runtime PM framework for 6.18-rc1: - Annotate loops walking device links in the power management core code as _srcu and add macros for walking device links to reduce the likelihood of coding mistakes related to them (Rafael Wysocki) - Document time units for *_time functions in the runtime PM API (Brian Norris) - Clear power.must_resume in noirq suspend error path to avoid resuming a dependant device under a suspended parent or supplier (Rafael Wysocki) - Fix GFP mask handling during hybrid suspend and make the amdgpu driver handle hybrid suspend correctly (Mario Limonciello, Rafael Wysocki) - Fix GFP mask handling after aborted hibernation in platform mode and combine exit paths in power_down() to avoid code duplication (Rafael Wysocki) - Use vmalloc_array() and vcalloc() in the hibernation core to avoid open-coded size computations (Qianfeng Rong) - Fix typo in hibernation core code comment (Li Jun) - Call pm_wakeup_clear() in the same place where other functions that do bookkeeping prior to suspend_prepare() are called (Samuel Wu) * pm-core: PM: core: Add two macros for walking device links PM: core: Annotate loops walking device links as _srcu * pm-runtime: PM: runtime: Documentation: ABI: Document time units for *_time * pm-sleep: PM: hibernate: Combine return paths in power_down() PM: hibernate: Restrict GFP mask in power_down() PM: hibernate: Fix pm_hibernation_mode_is_suspend() build breakage drm/amd: Fix hybrid sleep PM: hibernate: Add pm_hibernation_mode_is_suspend() PM: hibernate: Fix hybrid-sleep PM: sleep: core: Clear power.must_resume in noirq suspend error path PM: sleep: Make pm_wakeup_clear() call more clear PM: hibernate: Fix typo in memory bitmaps description comment PM: hibernate: Use vmalloc_array() and vcalloc() to improve code
2025-09-29drm/{i915,xe}: driver agnostic drm to display pointer chaseJani Nikula-9/+27
The display driver needs to get from the struct drm_device pointer to the struct intel_display pointer. Currently, this depends on knowledge of the struct drm_i915_private and struct xe_device definitions, but we'd like to hide those definitions from display. Require the struct drm_device and struct intel_display * members within struct drm_i915_private and struct xe_device to be placed next to each other, to be able to figure out the display pointer without knowledge of the structures. Use a generic dummy device structure to define the relative offsets of the drm and display members, and add static assertions to ensure this holds for both i915 and xe. Use the dummy structure to do the pointer chase from struct drm_device * to struct intel_display *. This requires moving the display member in struct xe_device after the drm member. Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Suggested-by: Simona Vetter <simona.vetter@ffwll.ch> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20250926111032.1188876-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-09-29drm/xe/stolen: use the same types as i915 interfaceJani Nikula-8/+7
Unify the i915 and xe interfaces by switching to the same types as i915. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://lore.kernel.org/r/f15d41bc232dfa957841f16d9a069c777af40194.1758732183.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-09-29drm/{i915, xe}/stolen: convert stolen interface to struct drm_deviceJani Nikula-21/+25
Make the stolen interface agnostic to i915/xe, and pass struct drm_device instead. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://lore.kernel.org/r/bbfc2aeaeee3156e92d49c73983be05b6feeede2.1758732183.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-09-29drm/{i915, xe}/stolen: use the stored i915/xe device pointerJani Nikula-50/+33
Now that we store the i915/xe device pointer in struct intel_stolen_node, we can reduce parameter passing in a number of functions. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://lore.kernel.org/r/6f31114c8113ce2254d422ca53992088b673fb2f.1758732183.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-09-29drm/{i915, xe}/stolen: add device pointer to struct intel_stolen_nodeJani Nikula-0/+8
Add backpointers to i915/xe to allow simplifying some interfaces in follow-up. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://lore.kernel.org/r/321354d47f9e530159caefef510d5394f4177470.1758732183.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-09-29drm/{i915, xe}/stolen: make struct intel_stolen_node opaqueJani Nikula-30/+89
Add i915_gem_stolen_node_alloc() and i915_gem_stolen_node_free(), returning struct intel_stolen_node pointer. Make struct intel_stolen_node an opaque pointer, with different implementations in i915 and xe. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://lore.kernel.org/r/3fe71bbb4c75ee86b4d129fafa3d4cd6526363f4.1758732183.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>