Alex Deucher
d7767a1fd4
drm/amdgpu/vcn3: implement ring reset
...
Use the new helpers to handle engine resets for VCN.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:17:07 -04:00
Alex Deucher
63b8c9fdfb
drm/amdgpu/vcn2.5: implement ring reset
...
Use the new helpers to handle engine resets for VCN.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:17:04 -04:00
Alex Deucher
64ac009747
drm/amdgpu/vcn2: implement ring reset
...
Use the new helpers to handle engine resets for VCN.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:17:01 -04:00
Alex Deucher
7b6cde7f4e
drm/amdgpu/vcn: add a helper framework for engine resets
...
With engine resets we reset all queues on the engine rather
than just a single queue. Add a framework to handle this
similar to SDMA.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:58 -04:00
Alex Deucher
3871149081
drm/amdgpu/vcn5: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:55 -04:00
Alex Deucher
6166e37afd
drm/amdgpu/vcn4.0.5: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:47 -04:00
Alex Deucher
64c54f0aa2
drm/amdgpu/vcn4.0.3: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:44 -04:00
Alex Deucher
d156ba3970
drm/amdgpu/vcn4: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:41 -04:00
Alex Deucher
8bea669e67
drm/amdgpu/jpeg5.0.1: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:36 -04:00
Alex Deucher
e708f2cb56
drm/amdgpu/jpeg5: add queue reset
...
Add queue reset support for jpeg 5.0.0.
Use the new helpers to re-emit the unprocessed state
after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:33 -04:00
Alex Deucher
cf07ece3a8
drm/amdgpu/jpeg4.0.5: add queue reset
...
Add queue reset support for jpeg 4.0.5.
Use the new helpers to re-emit the unprocessed state
after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:25 -04:00
Alex Deucher
98f16636a2
drm/amdgpu/jpeg4.0.3: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:08 -04:00
Alex Deucher
429ccbf6f4
drm/amdgpu/jpeg4: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:16:03 -04:00
Alex Deucher
b81891589b
drm/amdgpu/jpeg3: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:15:22 -04:00
Alex Deucher
bb7928f9fc
drm/amdgpu/jpeg2.5: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:15:19 -04:00
Alex Deucher
3c9e205f32
drm/amdgpu/jpeg2: re-emit unprocessed state on ring reset
...
Re-emit the unprocessed state after resetting the queue.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:15:12 -04:00
Asad Kamal
461f43b9b6
drm/amd/pm: Remove unnecessary variable
...
Remove unnecessary variable ret from smu_v13_0_12_get_smu_metrics_data
Reported-by: kernel test robot <lkp@intel.com >
Closes: https://lore.kernel.org/oe-kbuild-all/202507150618.WOfvWsQF-lkp@intel.com
Signed-off-by: Asad Kamal <asad.kamal@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:14:51 -04:00
Lijo Lazar
25c314aa3e
drm/amdgpu: Increase reset counter only on success
...
Increment the reset counter only if soft recovery succeeded. This is
consistent with a ring hard reset behaviour where counter gets
incremented only if hard reset succeeded.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:14:44 -04:00
Lijo Lazar
9ad73536f8
drm/amd/pm: Get max/min frequency on aldebaran VF
...
PMFW interface to get max/min frequencies is not available on aldebaran
VFs. Use data, if available, in DPM tables to get the max/min
frequencies.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Asad Kamal <asad.kamal@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:14:37 -04:00
Alex Deucher
ec8fbb44b5
drm/amdgpu: make compute timeouts consistent
...
For kernel compute queues, align the timeout with
other kernel queues (10 sec). This had previously
been set higher for OpenCL when it used kernel
queues, but now OpenCL uses KFD user queues which
don't have a timeout limitation. This also aligns
with SR-IOV which already used a shorter timeout.
Additionally the longer timeout negatively impacts
the user experience with kernel queues for interactive
applications.
Reviewed-by: Kent Russell <kent.russell@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:14:29 -04:00
Tony Yi
991f2e0c63
drm/amdgpu: Check SQ_CONFIG register support on SRIOV
...
On SRIOV environments, check if RLCG supports
SQ_CONFIG register programming.
Signed-off-by: Tony Yi <Tony.Yi@amd.com >
Reviewed-by: Zhigang Luo <zhigang.luo@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:14:21 -04:00
Alex Deucher
77cc0da39c
drm/amdgpu: track ring state associated with a fence
...
We need to know the wptr and sequence number associated
with a fence so that we can re-emit the unprocessed state
after a ring reset. Pre-allocate storage space for
the ring buffer contents and add helpers to save off
and re-emit the unprocessed state so that it can be
re-emitted after the queue is reset.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:14:11 -04:00
Alex Deucher
bc29c03b28
drm/amdgpu: clean up GC reset functions
...
Make them consistent and use the reset flags.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:10:10 -04:00
Alex Deucher
e3f15cfd8b
drm/amdgpu: clean up jpeg reset functions
...
Make them consistent and use the reset flags.
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:10:01 -04:00
Alex Deucher
290ccae52d
drm/amdgpu/vcn: don't enable per queue resets on SR-IOV
...
Power control is only available in bare metal. SR-IOV
will need a different method.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:09:48 -04:00
Alex Deucher
94ee19ea14
drm/amdgpu/jpeg4: add additional ring reset error checking
...
Start and stop can fail, so add checks.
Fixes: 74894ffc7d ("drm/amdgpu: Add ring reset callback for JPEG4_0_0")
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Sathishkumar S <sathishkumar.sundararaju@amd.com >
2025-07-16 16:09:25 -04:00
Alex Deucher
2918487455
drm/amdgpu/jpeg3: add additional ring reset error checking
...
Start and stop can fail, so add checks.
Fixes: 03399d0bff ("drm/amdgpu: Add ring reset callback for JPEG3_0_0")
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Sathishkumar S <sathishkumar.sundararaju@amd.com >
2025-07-16 16:08:59 -04:00
Alex Deucher
c9bfafc1a6
drm/amdgpu/jpeg2: add additional ring reset error checking
...
Start and stop can fail, so add checks.
Fixes: 500c04d2a7 ("drm/amdgpu: Add ring reset callback for JPEG2_0_0")
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Sathishkumar S <sathishkumar.sundararaju@amd.com >
2025-07-16 16:08:17 -04:00
Alex Deucher
d18e1faef6
drm/amdgpu: clean up sdma reset functions
...
Make them consistent and drop unneeded extra variables.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 16:08:05 -04:00
Christophe JAILLET
28c5c48638
drm/amdgpu: Fix missing unlocking in an error path in amdgpu_userq_create()
...
If kasprintf() fails, some mutex still need to be released to avoid locking
issue, as already done in all other error handling path.
Fixes: c03ea34cbf ("drm/amdgpu: add support of debugfs for mqd information")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Link: https://lore.kernel.org/all/366557fa7ca8173fd78c58336986ca56953369b9.1752087753.git.christophe.jaillet@wanadoo.fr/
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2025-07-16 15:46:04 -04:00
Piotr Piórkowski
4b0a5f5ce7
drm/xe: Unify the initialization of VRAM regions
...
Currently in the drivers we have defined VRAM regions per device and per
tile. Initialization of these regions is done in two completely different
ways. To simplify the logic of the code and make it easier to add new
regions in the future, let's unify the way we initialize VRAM regions.
v2:
- fix doc comments in struct xe_vram_region
- remove unnecessary includes (Jani)
v3:
- move code from xe_vram_init_regions_managers to xe_tile_init_noalloc
(Matthew)
- replace ioremap_wc to devm_ioremap_wc for mapping VRAM BAR
(Matthew)
- Replace the tile id parameter with vram region in the xe_pf_begin
function.
v4:
- remove tile back pointer from struct xe_vram_region
- add new back pointers: xe and migarte to xe_vram_region
Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com >
Cc: Stuart Summers <stuart.summers@intel.com >
Cc: Matthew Auld <matthew.auld@intel.com >
Cc: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com > # rev3
Acked-by: Matthew Brost <matthew.brost@intel.com >
Link: https://lore.kernel.org/r/20250714184818.89201-6-piotr.piorkowski@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2025-07-16 12:15:00 -07:00
Piotr Piórkowski
d65ff1ec85
drm/xe: Split xe_migrate allocation from initialization
...
Currently, xe_migrate_init handled both allocation and initialization,
Lets moves allocation to xe_tile_alloc via a new xe_migrate_alloc
function, and keep initialization in xe_migrate_init.
This will allow the migration pointers to be passed to other structures
before full initialization.
Also replaces devm_kzalloc with drmm_kzalloc for better
DRM-managed memory.
Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com >
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Link: https://lore.kernel.org/r/20250714184818.89201-5-piotr.piorkowski@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2025-07-16 12:12:49 -07:00
Piotr Piórkowski
7a20b4f558
drm/xe: Move struct xe_vram_region to a dedicated header
...
Let's move the xe_vram_region structure to a new header dedicated to VRAM
to improve modularity and avoid unnecessary dependencies when only
VRAM-related structures are needed.
v2: Fix build if CONFIG_DRM_XE_DEVMEM_MIRROR is enabled
v3: Fix build if CONFIG_DRM_XE_DISPLAY is enabled
v4: Move helper to get tile dpagemap to xe_svm.c
Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com >
Suggested-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com > # rev3
Acked-by: Matthew Brost <matthew.brost@intel.com >
Link: https://lore.kernel.org/r/20250714184818.89201-4-piotr.piorkowski@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2025-07-16 12:12:36 -07:00
Piotr Piórkowski
f92cfd72d9
drm/xe: Use dynamic allocation for tile and device VRAM region structures
...
In future platforms, we will need to represent the device and tile
VRAM regions in a more dynamic way, so let's abandon the static
allocation of these structures and start use a dynamic allocation.
v2:
- Add a helpers for accessing fields of the xe_vram_region structure
v3:
- Add missing EXPORT_SYMBOL_IF_KUNIT for
xe_vram_region_actual_physical_size
Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com >
Cc: Stuart Summers <stuart.summers@intel.com >
Cc: Matthew Auld <matthew.auld@intel.com >
Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com >
Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com >
Acked-by: Matthew Brost <matthew.brost@intel.com >
Link: https://lore.kernel.org/r/20250714184818.89201-3-piotr.piorkowski@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2025-07-16 12:08:31 -07:00
Piotr Piórkowski
922ae87523
drm/xe: Use devm_ioremap_wc for VRAM mapping and drop manual unmap
...
Let's replace the manual call to ioremap_wc function with devm_ioremap_wc
function, ensuring that VRAM mappings are automatically released when
the driver is detached.
Since devm_ioremap_wc registers the mapping with the device's managed
resources, the explicit iounmap call in vram_fini is no longer needed,
so let's remove it.
Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com >
Suggested-by: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Acked-by: Matthew Brost <matthew.brost@intel.com >
Link: https://lore.kernel.org/r/20250714184818.89201-2-piotr.piorkowski@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2025-07-16 12:06:25 -07:00
Ville Syrjälä
41ab92d35c
drm: Make passing of format info to drm_helper_mode_fill_fb_struct() mandatory
...
Now that everyone passes along the format info to
drm_helper_mode_fill_fb_struct() we can make this behaviour
mandatory and drop the extra lookup.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-20-ville.syrjala@linux.intel.com
2025-07-16 20:12:35 +03:00
Ville Syrjälä
3f019d7496
drm/vmwgfx: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
Cc: Zack Rusin <zack.rusin@broadcom.com >
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-19-ville.syrjala@linux.intel.com
2025-07-16 20:12:09 +03:00
Ville Syrjälä
e7e9cde252
drm/virtio: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
Cc: David Airlie <airlied@redhat.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Cc: Gurchetan Singh <gurchetansingh@chromium.org >
Cc: Chia-I Wu <olvaffe@gmail.com >
Cc: virtualization@lists.linux.dev
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-18-ville.syrjala@linux.intel.com
2025-07-16 20:11:52 +03:00
Ville Syrjälä
b146e3e03b
drm/tegra: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
For the fbdev case a manual drm_get_format_info() lookup
is needed.
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Mikko Perttunen <mperttunen@nvidia.com >
Cc: linux-tegra@vger.kernel.org
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-17-ville.syrjala@linux.intel.com
2025-07-16 20:11:34 +03:00
Ville Syrjälä
1506b10310
drm/msm: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookups.
For the fbdev case a manual drm_get_format_info() lookup
is needed.
Cc: Rob Clark <robdclark@gmail.com >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Dmitry Baryshkov <lumag@kernel.org >
Cc: Sean Paul <sean@poorly.run >
Cc: Marijn Suijten <marijn.suijten@somainline.org >
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-16-ville.syrjala@linux.intel.com
2025-07-16 20:11:05 +03:00
Ville Syrjälä
7a46d03936
drm/komeda: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
Cc: Liviu Dudau <liviu.dudau@arm.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-15-ville.syrjala@linux.intel.com
2025-07-16 20:10:46 +03:00
Ville Syrjälä
800df9e50c
drm/i915: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
For the fbdev case a manual drm_get_format_info() lookup
is needed.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-14-ville.syrjala@linux.intel.com
2025-07-16 20:09:08 +03:00
Ville Syrjälä
4a792c5920
drm/gma500: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
For the fbdev case a manual drm_get_format_info() lookup
is needed.
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-13-ville.syrjala@linux.intel.com
2025-07-16 20:08:34 +03:00
Ville Syrjälä
d26e853410
drm/exynos: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
For the fbdev case a manual drm_get_format_info() lookup
is needed.
Cc: Inki Dae <inki.dae@samsung.com >
Cc: Seung-Woo Kim <sw0312.kim@samsung.com >
Cc: Kyungmin Park <kyungmin.park@samsung.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-12-ville.syrjala@linux.intel.com
2025-07-16 20:07:55 +03:00
Ville Syrjälä
797f8fc4cc
drm/armada: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
For the fbdev case a manual drm_get_format_info() lookup
is needed.
Cc: Russell King <linux@armlinux.org.uk >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-11-ville.syrjala@linux.intel.com
2025-07-16 20:07:32 +03:00
Ville Syrjälä
b4d360701b
drm/amdgpu: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Plumb the format info from .fb_create() all the way to
drm_helper_mode_fill_fb_struct() to avoid the redundant
lookup.
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: amd-gfx@lists.freedesktop.org
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-10-ville.syrjala@linux.intel.com
2025-07-16 20:07:03 +03:00
Ville Syrjälä
283da9e3a9
drm/gem/afbc: Eliminate redundant drm_get_format_info()
...
Pass along the format info from .fb_create() to aliminate the
redundant drm_get_format_info() calls from the afbc code.
Cc: Sandy Huang <hjc@rock-chips.com >
Cc: "Heiko Stübner" <heiko@sntech.de >
Cc: Andy Yan <andy.yan@rock-chips.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-9-ville.syrjala@linux.intel.com
2025-07-16 20:06:22 +03:00
Ville Syrjälä
04a5889cf7
drm/gem: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct()
...
Pass along the format info from .fb_create() to eliminate the
redundant drm_get_format_info() calls from the gem fb code.
v2: Fix kernel docs (Laurent)
Cc: Dave Airlie <airlied@redhat.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: Sandy Huang <hjc@rock-chips.com >
Cc: "Heiko Stübner" <heiko@sntech.de >
Cc: Andy Yan <andy.yan@rock-chips.com >
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com >
Cc: virtualization@lists.linux.dev
Cc: spice-devel@lists.freedesktop.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-8-ville.syrjala@linux.intel.com
2025-07-16 20:05:58 +03:00
Ville Syrjälä
e3c5074b1f
drm/malidp: Pass along the format info from .fb_create() malidp_verify_afbc_framebuffer_size()
...
Plumb the format info from .fb_create() all the way to
malidp_verify_afbc_framebuffer_size() to avoid the
redundant lookup.
Cc: Liviu Dudau <liviu.dudau@arm.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-7-ville.syrjala@linux.intel.com
2025-07-16 20:05:19 +03:00
Ville Syrjälä
a34cc7bf10
drm: Allow the caller to pass in the format info to drm_helper_mode_fill_fb_struct()
...
Soon all drivers should have the format info already available in the
places where they call drm_helper_mode_fill_fb_struct(). Allow it to
be passed along into drm_helper_mode_fill_fb_struct() instead of doing
yet another redundant lookup.
Start by always passing in NULL and still doing the extra lookup.
The actual changes to avoid the lookup will follow.
Done with cocci (with some manual fixups):
@@
identifier dev, fb, mode_cmd;
expression get_format_info;
@@
void drm_helper_mode_fill_fb_struct(struct drm_device *dev,
struct drm_framebuffer *fb,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
...
- fb->format = get_format_info;
+ fb->format = info ?: get_format_info;
...
}
@@
identifier dev, fb, mode_cmd;
@@
void drm_helper_mode_fill_fb_struct(struct drm_device *dev,
struct drm_framebuffer *fb,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd);
@@
expression dev, fb, mode_cmd;
@@
drm_helper_mode_fill_fb_struct(dev, fb
+ ,NULL
,mode_cmd);
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Inki Dae <inki.dae@samsung.com >
Cc: Seung-Woo Kim <sw0312.kim@samsung.com >
Cc: Kyungmin Park <kyungmin.park@samsung.com >
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Dmitry Baryshkov <lumag@kernel.org >
Cc: Sean Paul <sean@poorly.run >
Cc: Marijn Suijten <marijn.suijten@somainline.org >
Cc: Lyude Paul <lyude@redhat.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Mikko Perttunen <mperttunen@nvidia.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Cc: Gurchetan Singh <gurchetansingh@chromium.org >
Cc: Chia-I Wu <olvaffe@gmail.com >
Cc: Zack Rusin <zack.rusin@broadcom.com >
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com >
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: linux-tegra@vger.kernel.org
Cc: virtualization@lists.linux.dev
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-6-ville.syrjala@linux.intel.com
2025-07-16 20:04:45 +03:00