Linus Torvalds
bf4afc53b7
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
...
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2026-02-21 17:09:51 -08:00
Kees Cook
69050f8d6d
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
...
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org >
2026-02-21 01:02:28 -08:00
Jani Nikula
63c7f93b60
drm/{i915, xe}/panic: move panic handling to parent interface
...
Move the panic handling to the display parent interface, making display
more independent of i915 and xe driver implementations.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patch.msgid.link/e27eca5424479e8936b786018d0af19a34f839f6.1765474612.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2025-12-12 15:17:58 +02:00
Maarten Lankhorst
beaae3c0a4
drm/xe/display: Make panic support work on vram.
...
Add a special path for VRAM using xe_res iterators to ensure a panic
screen is shown on VRAM as well.
Acked-by: Jocelyn Falempe <jfalempe@redhat.com >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://lore.kernel.org/r/20251016075701.379023-3-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se >
Acked-by: Jani Nikula <jani.nikula@linux.intel.com >
2025-10-21 13:23:17 +02:00
Jani Nikula
0b470321e9
drm/{i915,xe}/panic: pass struct intel_panic to intel_panic_setup()
...
Reduce the struct intel_framebuffer usage within the panic
implementation.
Cc: Jocelyn Falempe <jfalempe@redhat.com >
Cc: Maarten Lankhorst <dev@lankhorst.se >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://lore.kernel.org/r/2a016167b1f6f0b432aed0a630f9dbcd07fadb7b.1756835342.git.jani.nikula@intel.com
2025-09-08 14:23:46 +03:00
Jani Nikula
427a3f939a
drm/{i915,xe}/panic: convert intel_panic_finish() to struct intel_panic
...
The intel_panic_finish() function really needs the struct intel_panic
pointer, not struct intel_framebuffer. Make it so.
Cc: Jocelyn Falempe <jfalempe@redhat.com >
Cc: Maarten Lankhorst <dev@lankhorst.se >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://lore.kernel.org/r/3fdbcbe17e0e90c4a590f2a2486a9ec79a90cf62.1756835342.git.jani.nikula@intel.com
2025-09-08 14:23:46 +03:00
Jani Nikula
729c5f7ffa
drm/{i915,xe}/panic: move framebuffer allocation where it belongs
...
The struct intel_framebuffer allocation naturally belongs in intel_fb.c,
not hidden inside panic implementation. Separate the panic
allocation. Drop the unnecessary struct i915_framebuffer and struct
xe_framebuffer types.
Cc: Jocelyn Falempe <jfalempe@redhat.com >
Cc: Maarten Lankhorst <dev@lankhorst.se >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://lore.kernel.org/r/d29f63e0118d002fc8edd368caea7e8185418e17.1756835342.git.jani.nikula@intel.com
2025-09-08 14:23:46 +03:00
Jani Nikula
fa48f6335a
drm/{i915,xe}/panic: rename struct {i915,xe}_panic_data to struct intel_panic
...
Prepare for better shared interfaces between panic implementations. The
struct intel_panic remains an opaque data type, with unique
implementations in i915 and xe.
This allows us to change the panic data pointer from void * to struct
intel_panic *, helping type safety.
Cc: Jocelyn Falempe <jfalempe@redhat.com >
Cc: Maarten Lankhorst <dev@lankhorst.se >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://lore.kernel.org/r/884ffc80c8b5fef1b92956e644a4e559560cc2ba.1756835342.git.jani.nikula@intel.com
2025-09-08 14:23:46 +03:00
Jani Nikula
4e839f2c7b
drm/{i915,xe}/fb: add panic pointer member to struct intel_framebuffer
...
Add a panic data pointer member in struct intel_framebuffer in
preparation for breaking the artificial subclassing between
intel_framebuffer and panic structures.
Cc: Jocelyn Falempe <jfalempe@redhat.com >
Cc: Maarten Lankhorst <dev@lankhorst.se >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://lore.kernel.org/r/41f42e1de8545409274d54854aa12e0fb390e394.1756835342.git.jani.nikula@intel.com
2025-09-08 14:23:46 +03:00
Jani Nikula
05a85e781f
drm/{i915,xe}/panic: rename intel_bo_panic_*() to intel_panic_*()
...
Rename the intel_bo_panic_*() functions according to the functionality,
dropping the misleading intel_bo reference.
Keep intel_bo_alloc_framebuffer() for now; it'll be refactored later.
Cc: Jocelyn Falempe <jfalempe@redhat.com >
Cc: Maarten Lankhorst <dev@lankhorst.se >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://lore.kernel.org/r/a3be8f8b5e7dd208027a1131e89452d9a214054f.1756835342.git.jani.nikula@intel.com
2025-09-08 14:23:46 +03:00
Jani Nikula
5f54b2196c
drm/{i915,xe}/panic: split out intel_panic.[ch]
...
intel_bo.[ch] is not the appropriate location for the panic
functionality. Split out intel_panic.[ch] and xe_panic.c in i915 and
xe. Keep the function names for now.
Cc: Jocelyn Falempe <jfalempe@redhat.com >
Cc: Maarten Lankhorst <dev@lankhorst.se >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://lore.kernel.org/r/d98b831a011a028ffd33ce99b0ba62be061ee235.1756835342.git.jani.nikula@intel.com
2025-09-08 14:23:46 +03:00