Tvrtko Ursulin
2650bc4007
drm/sched: Fix a race in DRM_GPU_SCHED_STAT_NO_HANG test
...
The "skip reset" test waits for the timeout handler to run for the
duration of 2 * MOCK_TIMEOUT, and because the mock scheduler opted to
remove the "skip reset" flag once it fires, this gives opportunity for the
timeout handler to run twice. Second time the job will be removed from the
mock scheduler job list and the drm_mock_sched_advance() call in the test
will fail.
Fix it by making the "don't reset" flag persist for the lifetime of the
job and add a new flag to verify that the code path had executed as
expected.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com >
Fixes: 1472e7549f ("drm/sched: Add new test for DRM_GPU_SCHED_STAT_NO_HANG")
Cc: Maíra Canal <mcanal@igalia.com >
Cc: Philipp Stanner <phasta@kernel.org >
Reviewed-by: Maíra Canal <mcanal@igalia.com >
Signed-off-by: Philipp Stanner <phasta@kernel.org >
Link: https://lore.kernel.org/r/20250716084817.56797-1-tvrtko.ursulin@igalia.com
2025-07-17 11:39:19 +02: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
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
Ville Syrjälä
81112eaac5
drm: Pass the format info to .fb_create()
...
Pass along the format information from the top to .fb_create()
so that we can avoid redundant (and somewhat expensive) lookups
in the drivers.
Done with cocci (with some manual fixups):
@@
identifier func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *func(
struct drm_device *dev,
struct drm_file *file,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
...
(
- const struct drm_format_info *info = drm_get_format_info(...);
|
- const struct drm_format_info *info;
...
- info = drm_get_format_info(...);
)
<...
- if (!info)
- return ...;
...>
}
@@
identifier func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *func(
struct drm_device *dev,
struct drm_file *file,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
...
}
@find@
identifier fb_create_func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *fb_create_func(
struct drm_device *dev,
struct drm_file *file,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd);
@@
identifier find.fb_create_func;
expression dev, file, mode_cmd;
@@
fb_create_func(dev, file
+ ,info
,mode_cmd)
@@
expression dev, file, mode_cmd;
@@
drm_gem_fb_create(dev, file
+ ,info
,mode_cmd)
@@
expression dev, file, mode_cmd;
@@
drm_gem_fb_create_with_dirty(dev, file
+ ,info
,mode_cmd)
@@
expression dev, file_priv, mode_cmd;
identifier info, fb;
@@
info = drm_get_format_info(...);
...
fb = dev->mode_config.funcs->fb_create(dev, file_priv
+ ,info
,mode_cmd);
@@
identifier dev, file_priv, mode_cmd;
@@
struct drm_mode_config_funcs {
...
struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
struct drm_file *file_priv,
+ const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd);
...
};
v2: Fix kernel docs (Laurent)
Fix commit msg (Geert)
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Maxime Ripard <mripard@kernel.org >
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: Chun-Kuang Hu <chunkuang.hu@kernel.org >
Cc: Philipp Zabel <p.zabel@pengutronix.de >
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: Marek Vasut <marex@denx.de >
Cc: Stefan Agner <stefan@agner.ch >
Cc: Lyude Paul <lyude@redhat.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com >
Cc: Biju Das <biju.das.jz@bp.renesas.com >
Cc: Sandy Huang <hjc@rock-chips.com >
Cc: "Heiko Stübner" <heiko@sntech.de >
Cc: Andy Yan <andy.yan@rock-chips.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Mikko Perttunen <mperttunen@nvidia.com >
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com >
Cc: "Maíra Canal" <mcanal@igalia.com >
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.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: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.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: virtualization@lists.linux.dev
Cc: spice-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.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-5-ville.syrjala@linux.intel.com
2025-07-16 20:03:14 +03:00
Ville Syrjälä
d5d6340c0b
drm: Look up the format info earlier
...
Look up the format info already in drm_internal_framebuffer_create()
so that we can later pass it along to .fb_create(). Currently various
drivers are doing additional lookups in their .fb_create()
implementations, and these lookups are rather expensive now (given
how many different pixel formats we have).
v2: Fix commit msg (Thomas)
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-4-ville.syrjala@linux.intel.com
2025-07-16 20:01:58 +03:00
Ville Syrjälä
0e7d5874fb
drm: Pass pixel_format+modifier directly to drm_get_format_info()
...
Decouple drm_get_format_info() from struct drm_mode_fb_cmd2 and just
pass the pixel format+modifier combo in by hand.
We may want to use drm_get_format_info() outside of the normal
addfb paths where we won't have a struct drm_mode_fb_cmd2, and
creating a temporary one just for this seems silly.
Done with cocci:
@@
identifier dev, mode_cmd;
@@
struct drm_format_info *
drm_get_format_info(struct drm_device *dev,
- const struct drm_mode_fb_cmd2 *mode_cmd
+ u32 pixel_format, u64 modifier
)
{
<...
(
- mode_cmd->pixel_format
+ pixel_format
|
- mode_cmd->modifier[0]
+ modifier
)
...>
}
@@
identifier dev, mode_cmd;
@@
struct drm_format_info *
drm_get_format_info(struct drm_device *dev,
- const struct drm_mode_fb_cmd2 *mode_cmd
+ u32 pixel_format, u64 modifier
);
@@
expression dev, mode_cmd;
@@
- drm_get_format_info(dev, mode_cmd)
+ drm_get_format_info(dev, mode_cmd->pixel_format, mode_cmd->modifier[0])
v2: Fix kernel docs (Laurent)
Drop drm_mode_fb_cmd2 forward declaration (Thomas)
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: Chun-Kuang Hu <chunkuang.hu@kernel.org >
Cc: Philipp Zabel <p.zabel@pengutronix.de >
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: Marek Vasut <marex@denx.de >
Cc: Stefan Agner <stefan@agner.ch >
Cc: Lyude Paul <lyude@redhat.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Sandy Huang <hjc@rock-chips.com >
Cc: "Heiko Stübner" <heiko@sntech.de >
Cc: Andy Yan <andy.yan@rock-chips.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Mikko Perttunen <mperttunen@nvidia.com >
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-tegra@vger.kernel.org
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com >
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com >
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-3-ville.syrjala@linux.intel.com
2025-07-16 20:01:13 +03:00
Ville Syrjälä
0389e4256e
drm: Pass pixel_format+modifier to .get_format_info()
...
Decouple .get_format_info() from struct drm_mode_fb_cmd2 and just
pass the pixel format+modifier combo in by hand.
We may want to use .get_format_info() outside of the normal
addfb paths where we won't have a struct drm_mode_fb_cmd2, and
creating a temporary one just for this seems silly.
v2: Fix intel_fb_get_format_info() docs (Laurent)
Cc: Harry Wentland <harry.wentland@amd.com >
Cc: Leo Li <sunpeng.li@amd.com >
Cc: Rodrigo Siqueira <siqueira@igalia.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: amd-gfx@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 >
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-2-ville.syrjala@linux.intel.com
2025-07-16 19:59:59 +03:00
Maxime Ripard
d618363a53
drm/tests: edid: Add edid-decode --check output
...
Some of our EDIDs are (rightfully) invalid, but most of them should be
valid.
Let's add the edid-decode --check of these EDIDs when they were
generated, so we know what to expect going forward, and a comment to
explicitly mention when we expect them to be broken.
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Link: https://lore.kernel.org/r/20250625-drm-update-edid-v1-3-2d963743ab9e@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 17:31:42 +02:00
Maxime Ripard
b17ade59aa
drm/tests: edid: Update CTA-861 HDMI Vendor Specific Data Block
...
For some reason, the HDMI VSDBs in our kunit EDIDs had a length longer
than expected.
While this was harmless, we should get rid of it to make it somewhat
predictable.
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Link: https://lore.kernel.org/r/20250625-drm-update-edid-v1-2-2d963743ab9e@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 17:31:41 +02:00
Maxime Ripard
2bf85c45db
drm/tests: edid: Fix monitor range limits
...
For some reason, some EDIDs used by kunit had Monitor Range Limits
making no sense, and not matching the edid-decode output in the comment.
While they were in the comments as:
Display Range Limits:
Monitor ranges (GTF): 50-70 Hz V, 30-70 kHz H, max dotclock 150 MHz
They were actually:
Display Range Limits:
Monitor ranges (GTF): 50-70 Hz V, 0-0 kHz H, max dotclock 1960 MHz
Fix that section of the EDIDs to match the expected edid-decode output.
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Link: https://lore.kernel.org/r/20250625-drm-update-edid-v1-1-2d963743ab9e@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 17:24:51 +02:00
Anusha Srivatsa
d27da6792c
drm/panel/boe-himax8279d: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-14-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:15 +02:00
Anusha Srivatsa
51929b6850
drm/panel/boe-tv101wum-nl6: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-13-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:14 +02:00
Anusha Srivatsa
46c8779be6
drm/panel/himax-hx83102: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-12-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:14 +02:00
Anusha Srivatsa
ea8642fe79
drm/panel/ilitek-ili9882t: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-11-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:13 +02:00
Anusha Srivatsa
d29ab79c6f
drm/panel/lpm102a188a: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-10-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:13 +02:00
Anusha Srivatsa
b669ce70f4
drm/panel/jdi-lt070me05000: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-9-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:12 +02:00
Anusha Srivatsa
95ec5c606d
drm/panel/khadas-ts050: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-8-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:12 +02:00
Anusha Srivatsa
6a855c7f56
drm/panel/kd097d04: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-7-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:11 +02:00
Anusha Srivatsa
daeca2b7c7
drm/panel/lg-sw43408: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-6-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:11 +02:00
Anusha Srivatsa
a8f268ac9d
drm/panel/novatek-nt36672a: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-5-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:10 +02:00
Anusha Srivatsa
6afbf43edf
drm/panel/osd101t2587-53ts: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-4-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:09 +02:00
Anusha Srivatsa
8e4e733d95
drm/panel/vvx10f034n00: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-3-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:09 +02:00
Anusha Srivatsa
6299cb4a21
drm/panel/raspberrypi: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-2-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:08 +02:00
Anusha Srivatsa
1e57377dad
drm/panel/lq101r1sx01: Use refcounted allocation in place of devm_kzalloc()
...
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-1-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-07-16 16:58:08 +02:00
Javier Martinez Canillas
a55863ba4c
drm/sitronix/st7571-i2c: Add support for the ST7567 Controller
...
The Sitronix ST7567 is a monochrome Dot Matrix LCD Controller that has SPI,
I2C and parallel interfaces. The st7571-i2c driver only has support for I2C
so displays using other transport interfaces are currently not supported.
The DRM_FORMAT_R1 pixel format and data commands are the same than what
is used by the ST7571 controller, so only is needed a different callback
that implements the expected initialization sequence for the ST7567 chip.
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://lore.kernel.org/r/20250715110411.448343-6-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com >
2025-07-16 12:12:39 +02:00
Javier Martinez Canillas
d2bfb99964
dt-bindings: display: Add Sitronix ST7567 LCD Controller
...
Sitronix ST7567 is a monochrome Dot Matrix LCD Controller.
Reviewed-by: Rob Herring (Arm) <robh@kernel.org >
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com >
Link: https://lore.kernel.org/r/20250715110411.448343-5-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com >
2025-07-16 12:12:39 +02:00
Javier Martinez Canillas
d9ace6d550
drm/sitronix/st7571-i2c: Add an indirection level to parse DT
...
Other Sitronix display controllers might need a different parsing DT
logic, so lets add a .parse_dt callback to struct st7571_panel_data.
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com >
Link: https://lore.kernel.org/r/20250715110411.448343-4-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com >
2025-07-16 12:12:38 +02:00
Javier Martinez Canillas
720799d946
drm/sitronix/st7571-i2c: Log probe deferral cause for GPIO get failure
...
The driver already uses the dev_err_probe() helper (that only prints error
messages for the -EPROBE_DEFER case) when fails to get any other resource.
Also do the same when it fails to obtain the reset GPIO.
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com >
Link: https://lore.kernel.org/r/20250715110411.448343-3-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com >
2025-07-16 12:12:38 +02:00
Javier Martinez Canillas
1d043d6c00
drm/sitronix/st7571-i2c: Fix encoder callbacks function names
...
It seems the driver took some inspiration from ssd130x and some of the
functions (encoder callbacks) were not renamed to use a st7571_ prefix.
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com >
Link: https://lore.kernel.org/r/20250715110411.448343-2-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com >
2025-07-16 12:12:38 +02:00
Christian König
76689eb526
drm/ttm: remove ttm_bo_validate_swapout test
...
The test is quite fragile since it tries to allocate halve available system
memory + 1 page.
If the system has either not enough memory to make the allocation work
with other things running in parallel or to much memory so the allocation
fails as to large/invalid the test will fail.
Completely remove the test. We already validate swapout on the device
level and that test seems to be stable.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Link: https://lore.kernel.org/r/20250710144129.1803-2-christian.koenig@amd.com
2025-07-16 11:19:20 +02:00
Christian König
8b824e9d2d
drm/ttm: fix locking in test ttm_bo_validate_no_placement_signaled
...
The test works even without it, but lockdep starts screaming when it is
activated.
Trivially fix it by acquiring the lock before we try to allocate
something.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Link: https://lore.kernel.org/r/20250710144129.1803-1-christian.koenig@amd.com
2025-07-16 11:17:18 +02:00
Dale Whinham
0bcc0f5e98
dt-bindings: display: panel: samsung,atna30dw01: document ATNA30DW01
...
The Samsung ATNA30DW01 panel is a 13" AMOLED eDP panel. It is similar to
the ATNA33XC20 except that it is smaller and has a higher resolution.
Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com >
Signed-off-by: Dale Whinham <daleyo@gmail.com >
Acked-by: Rob Herring (Arm) <robh@kernel.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://lore.kernel.org/r/20250714173554.14223-3-daleyo@gmail.com
2025-07-15 10:15:58 -07:00
Andy Yan
a622663dbf
drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: Fix a compile error due to bridge->detect parameter changes
...
Fix the compile error due to bridge->detect parameter changes.
Reported-by: Dixit Ashutosh <ashutosh.dixit@intel.com >
Closes: https://lore.kernel.org/dri-devel/175250667117.3567548.8371527247937906463.b4-ty@oss.qualcomm.com/T/#m8ecd00a05a330bc9c76f11c981daafcb30a7c2e0
Fixes: 5d156a9c3d ("drm/bridge: Pass down connector to drm bridge detect hook")
Signed-off-by: Andy Yan <andyshrk@163.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Link: https://lore.kernel.org/r/20250715054754.800765-1-andyshrk@163.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-07-15 15:13:52 +03:00
Maíra Canal
9fb32803df
drm/panfrost: Use DRM_GPU_SCHED_STAT_NO_HANG to skip the reset
...
Panfrost can skip the reset if TDR has fired before the free-job worker.
Currently, since Panfrost doesn't take any action on these scenarios, the
job is being leaked, considering that `free_job()` won't be called.
To avoid such leaks, inform the scheduler that the job did not actually
timeout and no reset was performed through the new status code
DRM_GPU_SCHED_STAT_NO_HANG.
Reviewed-by: Steven Price <steven.price@arm.com >
Link: https://lore.kernel.org/r/20250714-sched-skip-reset-v6-8-5c5ba4f55039@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com >
2025-07-15 08:27:08 -03:00
Maíra Canal
53dcd0eaa2
drm/xe: Use DRM_GPU_SCHED_STAT_NO_HANG to skip the reset
...
Xe can skip the reset if TDR has fired before the free job worker and can
also re-arm the timeout timer in some scenarios. Instead of manipulating
scheduler's internals, inform the scheduler that the job did not actually
timeout and no reset was performed through the new status code
DRM_GPU_SCHED_STAT_NO_HANG.
Note that, in the first case, there is no need to restart submission if it
hasn't been stopped.
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Link: https://lore.kernel.org/r/20250714-sched-skip-reset-v6-7-5c5ba4f55039@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com >
2025-07-15 08:27:08 -03:00
Maíra Canal
8902c2b17a
drm/etnaviv: Use DRM_GPU_SCHED_STAT_NO_HANG to skip the reset
...
Etnaviv can skip a hardware reset in two situations:
1. TDR has fired before the free-job worker and the timeout is spurious.
2. The GPU is still making progress on the front-end and we can give
the job a chance to complete.
Instead of manipulating scheduler's internals, inform the scheduler that
the job did not actually timeout and no reset was performed through
the new status code DRM_GPU_SCHED_STAT_NO_HANG.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Link: https://lore.kernel.org/r/20250714-sched-skip-reset-v6-6-5c5ba4f55039@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com >
2025-07-15 08:27:08 -03:00