Boris Brezillon
a600794afe
accel/amdxdna: s/drm_gem_v[un]map_unlocked/drm_gem_v[un]map/
...
Commit 8f5c4871a0 ("drm/gem: Change locked/unlocked postfix of
drm_gem_v/unmap() function names") dropped the _unlocked suffix,
but accel drivers were left behind.
Fixes: 8f5c4871a0 ("drm/gem: Change locked/unlocked postfix of drm_gem_v/unmap() function names")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Cc: Min Ma <min.ma@amd.com >
Cc: Lizhi Hou <lizhi.hou@amd.com >
Cc: Oded Gabbay <ogabbay@kernel.org >
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Tested-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250327104300.1982058-3-boris.brezillon@collabora.com
2025-03-27 14:33:35 +03:00
Boris Brezillon
835b14ce4e
accel/ivpu: s/drm_gem_shmem_v[un]map/drm_gem_shmem_v[un]map_locked/
...
Commit 954907f714 ("drm/shmem-helper: Refactor locked/unlocked
functions") suffixed drm_gem_shmem_v[un]map with _locked to reflect
the fact these functions must be called with the GEM resv lock held,
but accel drivers were left behind.
Fixes: 954907f714 ("drm/shmem-helper: Refactor locked/unlocked functions")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Cc: Maciej Falkowski <maciej.falkowski@linux.intel.com >
Cc: Oded Gabbay <ogabbay@kernel.org >
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Tested-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250327104300.1982058-2-boris.brezillon@collabora.com
2025-03-27 14:33:31 +03:00
Boris Brezillon
d5d0daffcc
accel/ivpu: pages_use_count is now a refcount_t
...
Commit 051b6646d3 ("drm/shmem-helper: Use refcount_t for
pages_use_count") changed the type of
drm_gem_shmem_object::pages_use_count but accel drivers were left
behind.
Fixes: 051b6646d3 ("drm/shmem-helper: Use refcount_t for pages_use_count")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Cc: Maciej Falkowski <maciej.falkowski@linux.intel.com >
Cc: Oded Gabbay <ogabbay@kernel.org >
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Tested-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250327104300.1982058-1-boris.brezillon@collabora.com
2025-03-27 14:33:26 +03:00
Dmitry Osipenko
e1fc39a923
drm/shmem-helper: Use refcount_t for vmap_use_count
...
Use refcount_t helper for vmap_use_count to make refcounting consistent
with pages_use_count and pages_pin_count that use refcount_t. This also
makes vmapping to benefit from the refcount_t's overflow checks.
Acked-by: Maxime Ripard <mripard@kernel.org >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-11-dmitry.osipenko@collabora.com
2025-03-26 23:00:22 +03:00
Dmitry Osipenko
0271cc484f
drm/shmem-helper: Switch drm_gem_shmem_vmap/vunmap to use pin/unpin
...
The vmapped pages shall be pinned in memory and previously get/put_pages()
were implicitly hard-pinning/unpinning the pages. This will no longer be
the case with addition of memory shrinker because pages_use_count > 0 won't
determine anymore whether pages are hard-pinned (they will be soft-pinned),
while the new pages_pin_count will do the hard-pinning. Switch the
vmap/vunmap() to use pin/unpin() functions in a preparation of addition
of the memory shrinker support to drm-shmem.
Acked-by: Maxime Ripard <mripard@kernel.org >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-10-dmitry.osipenko@collabora.com
2025-03-26 23:00:21 +03:00
Dmitry Osipenko
051b6646d3
drm/shmem-helper: Use refcount_t for pages_use_count
...
Use atomic refcount_t helper for pages_use_count to optimize pin/unpin
functions by skipping reservation locking while GEM's pin refcount > 1.
Acked-by: Maxime Ripard <mripard@kernel.org >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-9-dmitry.osipenko@collabora.com
2025-03-26 23:00:19 +03:00
Dmitry Osipenko
d586b535f1
drm/shmem-helper: Add and use pages_pin_count
...
Add separate pages_pin_count for tracking of whether drm-shmem pages are
moveable or not. With the addition of memory shrinker support to drm-shmem,
the pages_use_count will no longer determine whether pages are hard-pinned
in memory, but whether pages exist and are soft-pinned (and could be swapped
out). The pages_pin_count > 1 will hard-pin pages in memory.
Acked-by: Maxime Ripard <mripard@kernel.org >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-8-dmitry.osipenko@collabora.com
2025-03-26 23:00:16 +03:00
Dmitry Osipenko
eab1053807
drm/shmem-helper: Remove obsoleted is_iomem test
...
Everything that uses the mapped buffer should be agnostic to is_iomem.
The only reason for the is_iomem test is that we're setting shmem->vaddr
to the returned map->vaddr. Now that the shmem->vaddr code is gone, remove
the obsoleted is_iomem test to clean up the code.
Acked-by: Maxime Ripard <mripard@kernel.org >
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-7-dmitry.osipenko@collabora.com
2025-03-26 23:00:14 +03:00
Dmitry Osipenko
954907f714
drm/shmem-helper: Refactor locked/unlocked functions
...
Add locked and remove unlocked postfixes from drm-shmem function names,
making names consistent with the drm/gem core code.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-6-dmitry.osipenko@collabora.com
2025-03-26 23:00:12 +03:00
Dmitry Osipenko
1d23391d7e
drm/shmem-helper: Make all exported symbols GPL
...
Make all drm-shmem exported symbols GPL to make them consistent with
the rest of drm-shmem symbols.
Acked-by: Maxime Ripard <mripard@kernel.org >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-5-dmitry.osipenko@collabora.com
2025-03-26 23:00:09 +03:00
Dmitry Osipenko
5462dc8371
drm/gem: Document locking rule of vmap and evict callbacks
...
The vmap/vunmap/evict GEM callbacks are always invoked with a held GEM's
reservation lock. Document this locking rule for clarity.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-4-dmitry.osipenko@collabora.com
2025-03-26 23:00:06 +03:00
Dmitry Osipenko
9a0fd089f0
drm/gem: Add _locked postfix to functions that have unlocked counterpart
...
Add _locked postfix to drm_gem functions that have unlocked counterpart
functions to make GEM functions naming more consistent and intuitive in
regards to the locking requirements.
Acked-by: Maxime Ripard <mripard@kernel.org >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-3-dmitry.osipenko@collabora.com
2025-03-26 23:00:02 +03:00
Dmitry Osipenko
8f5c4871a0
drm/gem: Change locked/unlocked postfix of drm_gem_v/unmap() function names
...
Make drm/gem API function names consistent by having locked function
use the _locked postfix in the name, while the unlocked variants don't
use the _unlocked postfix. Rename drm_gem_v/unmap() function names to
make them consistent with the rest of the API functions.
Acked-by: Maxime Ripard <mripard@kernel.org >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-2-dmitry.osipenko@collabora.com
2025-03-26 22:59:56 +03:00
David Turner
2f9d51740c
drm/vc4: hdmi: Add jack detection to HDMI audio driver
...
Add ALSA jack detection to the vc4-hdmi audio driver so userspace knows
when to add/remove HDMI audio devices.
Signed-off-by: Stefan Wahren <wahrenst@gmx.net >
Reviewed-by: Maxime Ripard <mripard@kernel.org >
Signed-off-by: David Turner <david.turner@raspberrypi.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-vc4_hotplug-v4-3-2af625629186@raspberrypi.com
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
2025-03-25 18:40:12 +00:00
Stefan Wahren
34f051acce
drm/vc4: hdmi: Call HDMI hotplug helper on disconnect
...
drm_atomic_helper_connector_hdmi_hotplug() must be called
regardless of the connection status, otherwise the HDMI audio
disconnect event won't be notified.
Fixes: 2ea9ec5d2c ("drm/vc4: hdmi: use drm_atomic_helper_connector_hdmi_hotplug()")
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Stefan Wahren <wahrenst@gmx.net >
Reviewed-by: Maxime Ripard <mripard@kernel.org >
Signed-off-by: David Turner <david.turner@raspberrypi.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-vc4_hotplug-v4-2-2af625629186@raspberrypi.com
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
2025-03-25 18:40:12 +00:00
David Turner
0b87bbbeaf
drm/display: Update comment on hdmi hotplug helper
...
Update the comment on drm_atomic_helper_connector_hdmi_hotplug() to
clarify that it must be called for all status updates.
Signed-off-by: David Turner <david.turner@raspberrypi.com >
Reviewed-by: Maxime Ripard <mripard@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-vc4_hotplug-v4-1-2af625629186@raspberrypi.com
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
2025-03-25 18:40:12 +00:00
Dmitry Baryshkov
95c4ea2e03
drm/display: dp-tunnel: use new DCPD access helpers
...
Switch drm_dp_tunnel.c to use new set of DPCD read / write helpers.
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-6-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-25 16:20:38 +02:00
Dmitry Baryshkov
2554da0de3
drm/display: dp-mst-topology: use new DCPD access helpers
...
Switch drm_dp_mst_topology.c to use new set of DPCD read / write helpers.
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-5-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-25 16:20:38 +02:00
Dmitry Baryshkov
97f3793988
drm/display: dp-cec: use new DCPD access helpers
...
Switch drm_dp_cec.c to use new set of DPCD read / write helpers.
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-4-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-25 16:20:38 +02:00
Dmitry Baryshkov
af67978ee3
drm/display: dp: use new DCPD access helpers
...
Switch drm_dp_helper.c to use new set of DPCD read / write helpers.
Reviewed-by: Lyude Paul <lyude@redhat.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-3-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-25 16:20:38 +02:00
Dmitry Baryshkov
fcbb93f1e4
drm/display: dp: change drm_dp_dpcd_read_link_status() return value
...
drm_dp_dpcd_read_link_status() follows the "return error code or number
of bytes read" protocol, with the code returning less bytes than
requested in case of some errors. However most of the drivers
interpreted that as "return error code in case of any error". Switch
drm_dp_dpcd_read_link_status() to drm_dp_dpcd_read_data() and make it
follow that protocol too.
Acked-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-2-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-25 16:20:38 +02:00
Dmitry Baryshkov
d8343e1156
drm/display: dp: implement new access helpers
...
Existing DPCD access functions return an error code or the number of
bytes being read / write in case of partial access. However a lot of
drivers either (incorrectly) ignore partial access or mishandle error
codes. In other cases this results in a boilerplate code which compares
returned value with the size.
Implement new set of DPCD access helpers, which ignore partial access,
always return 0 or an error code.
Suggested-by: Jani Nikula <jani.nikula@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-1-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
2025-03-25 16:20:38 +02:00
Vignesh Raman
1bb2864b71
drm/ci: arm64.config: mediatek: enable PHY drivers
...
The mediatek display driver fails to probe on mt8173-elm-hana and
mt8183-kukui-jacuzzi-juniper-sku16 in v6.14-rc4 due to missing PHY
configurations.
Enable the following PHY drivers for MediaTek platforms:
- CONFIG_PHY_MTK_HDMI=y for HDMI display
- CONFIG_PHY_MTK_MIPI_DSI=y for DSI display
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com >
Acked-by: Helen Koike <helen.fornazier@gmail.com >
Link: https://lore.kernel.org/r/20250314085858.39328-4-vignesh.raman@collabora.com
2025-03-25 16:29:58 +05:30
Vignesh Raman
8be48c4f0c
drm/ci: uprev IGT
...
Uprev IGT to the latest version and update expectation files.
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com >
Acked-by: Helen Koike <helen.fornazier@gmail.com >
Link: https://lore.kernel.org/r/20250314085858.39328-3-vignesh.raman@collabora.com
2025-03-25 16:29:52 +05:30
Vignesh Raman
a8bd38e04a
drm/ci: uprev mesa
...
LAVA was recently patched [1] with a fix on how parameters are parsed in
`lava-test-case`, so we don't need to repeat quotes to send the
arguments properly to it. Uprev mesa to fix this issue.
[1] https://gitlab.com/lava/lava/-/commit/18c9cf79
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com >
Acked-by: Helen Koike <helen.fornazier@gmail.com >
Acked-by: Daniel Stone <daniels@collabora.com >
Link: https://lore.kernel.org/r/20250314085858.39328-2-vignesh.raman@collabora.com
2025-03-25 16:29:51 +05:30
Anusha Srivatsa
c8ba07caae
drm/panel/synaptics-r63353: Use _multi variants
...
Move away from using deprecated API and use _multi
variants if available. Use mipi_dsi_msleep()
and mipi_dsi_usleep_range() instead of msleep()
and usleep_range() respectively.
Used Coccinelle to find the _multi variant APIs,
replacing mpi_dsi_msleep() where necessary and for returning
dsi_ctx.accum_err in these functions. Manually handled the
reset step before returning from r63353_panel_activate()
v2: Do not skip the reset in case of error during
panel activate (Dmitry)
- Convert all usleep_range()
v3: mipi_dsi_usleep_range() is to be used only when in
between _multi commands(Doug)
- Check for error once in the end while using _multi
variants (Doug)
v4: Change return type of r63353_panel_deactivate() to void (Doug)
@rule_1@
identifier dsi_var;
identifier r;
identifier func;
type t;
position p;
expression dsi_device;
expression list es;
@@
t func(...) {
...
struct mipi_dsi_device *dsi_var = dsi_device;
+struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi_var };
<+...
(
-r = mipi_dsi_dcs_nop(dsi_var)@p;
+mipi_dsi_dcs_nop_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_exit_sleep_mode(dsi_var)@p;
+mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_enter_sleep_mode(dsi_var)@p;
+mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_write_buffer(dsi_var,es)@p;
+mipi_dsi_dcs_write_buffer_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_display_off(dsi_var,es)@p;
+mipi_dsi_dcs_set_display_off_multi(&dsi_ctx,es);
|
-r = mipi_dsi_compression_mode_ext(dsi_var,es)@p;
+mipi_dsi_compression_mode_ext_multi(&dsi_ctx,es);
|
-r = mipi_dsi_compression_mode(dsi_var,es)@p;
+mipi_dsi_compression_mode_multi(&dsi_ctx,es);
|
-r = mipi_dsi_picture_parameter_set(dsi_var,es)@p;
+mipi_dsi_picture_parameter_set_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_display_on(dsi_var,es)@p;
+mipi_dsi_dcs_set_display_on_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_tear_on(dsi_var)@p;
+mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx);
|
-r = mipi_dsi_turn_on_peripheral(dsi_var)@p;
+mipi_dsi_turn_on_peripheral_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_soft_reset(dsi_var)@p;
+mipi_dsi_dcs_soft_reset_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_set_display_brightness(dsi_var,es)@p;
+mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_pixel_format(dsi_var,es)@p;
+mipi_dsi_dcs_set_pixel_format_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_column_address(dsi_var,es)@p;
+mipi_dsi_dcs_set_column_address_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_page_address(dsi_var,es)@p;
+mipi_dsi_dcs_set_page_address_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_tear_scanline(dsi_var,es)@p;
+mipi_dsi_dcs_set_tear_scanline_multi(&dsi_ctx,es);
)
-if(r < 0) {
-...
-}
...+>
}
@rule_2@
identifier dsi_var;
identifier r;
identifier func;
type t;
position p;
expression dsi_device;
expression list es;
@@
t func(...) {
...
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi_var };
<+...
(
-r = msleep(es)@p;
+r = mipi_dsi_msleep(&dsi_ctx,es);
|
-msleep(es)@p;
+mipi_dsi_msleep(&dsi_ctx,es);
|
-r = usleep_range(es)@p;
+r = mipi_dsi_usleep_range(&dsi_ctx,es);
|
-usleep_range(es)@p;
+mipi_dsi_usleep_range(&dsi_ctx,es);
)
...+>
}
@rule_3@
identifier dsi_var;
identifier func;
type t;
position p;
expression list es;
@@
t func(...) {
...
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi_var };
...
-return 0;
+return dsi_ctx.accum_err;
}
Cc: Maxime Ripard <mripard@kernel.org >
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Cc: Tejas Vipin <tejasvipin76@gmail.com >
Cc: Douglas Anderson <dianders@chromium.org >
Cc: Neil Armstrong <neil.armstrong@linaro.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250318-synaptic-expt-v1-1-fa3831a7d883@redhat.com
2025-03-24 09:26:10 -07:00
Tejas Vipin
15a226179c
drm/panel: novatek-nt36523: transition to mipi_dsi wrapped functions
...
Changes the novatek-nt36523 panel to use multi style functions for
improved error handling.
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250315182522.628187-1-tejasvipin76@gmail.com
2025-03-24 09:22:07 -07:00
Tejas Vipin
837f9b917c
drm/panel: samsung-s6d7aa0: transition to mipi_dsi wrapped functions
...
Changes the samsung-s6d7aa0 panel to use multi style functions for
improved error handling.
Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
[dianders: fixed whitespace errors]
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250319183106.12613-1-tejasvipin76@gmail.com
2025-03-24 09:19:49 -07:00
Wolfram Sang
d69362f55f
drm/bridge: ti-sn65dsi86: Check bridge connection failure
...
Read out and check the ID registers, so we can bail out if I2C
communication does not work or if the device is unknown. Tested on a
Renesas GrayHawk board (R-Car V4M) by using a wrong I2C address and by
not enabling RuntimePM for the device.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250318155549.19625-2-wsa+renesas@sang-engineering.com
2025-03-24 08:47:58 -07:00
Wolfram Sang
1d1f7b15cb
drm/bridge: ti-sn65dsi86: make use of debugfs_init callback
...
Do not create a custom directory in debugfs-root, but use the
debugfs_init callback to create a custom directory at the given place
for the bridge. The new directory layout looks like this on a Renesas
GrayHawk-Single with a R-Car V4M SoC:
/sys/kernel/debug/dri/feb00000.display/DP-1/1-002c
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250315201651.7339-2-wsa+renesas@sang-engineering.com
2025-03-24 08:47:49 -07:00
Tvrtko Ursulin
909bda2206
drm/sched: Add a basic test for checking credit limit
...
Add a basic test for checking whether scheduler respects the configured
credit limit.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Philipp Stanner <phasta@kernel.org >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Philipp Stanner <phasta@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-7-tvrtko.ursulin@igalia.com
2025-03-24 10:41:55 +01:00
Tvrtko Ursulin
c85fc5db76
drm/sched: Add a basic test for modifying entities scheduler list
...
Add a basic test for exercising modifying the entities scheduler list at
runtime.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Philipp Stanner <phasta@kernel.org >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Philipp Stanner <phasta@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-6-tvrtko.ursulin@igalia.com
2025-03-24 10:41:55 +01:00
Tvrtko Ursulin
7b765cda7a
drm/sched: Add basic priority tests
...
Add some basic tests for exercising entity priority handling.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Philipp Stanner <phasta@kernel.org >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Philipp Stanner <phasta@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-5-tvrtko.ursulin@igalia.com
2025-03-24 10:41:54 +01:00
Tvrtko Ursulin
53e6597492
drm/sched: Add a simple timeout test
...
Add a very simple timeout test which submits a single job and verifies
that the timeout handling will run if the backend failed to complete the
job in time.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Philipp Stanner <phasta@kernel.org >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Philipp Stanner <phasta@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-4-tvrtko.ursulin@igalia.com
2025-03-24 10:41:53 +01:00
Tvrtko Ursulin
5a99350794
drm/sched: Add scheduler unit testing infrastructure and some basic tests
...
Implement a mock scheduler backend and add some basic test to exercise the
core scheduler code paths.
Mock backend (kind of like a very simple mock GPU) can either process jobs
by tests manually advancing the "timeline" job at a time, or alternatively
jobs can be configured with a time duration in which case they get
completed asynchronously from the unit test code.
Core scheduler classes are subclassed to support this mock implementation.
The tests added are just a few simple submission patterns.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com >
Suggested-by: Philipp Stanner <phasta@kernel.org >
Cc: Christian König <christian.koenig@amd.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Philipp Stanner <phasta@kernel.org >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Philipp Stanner <phasta@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-3-tvrtko.ursulin@igalia.com
2025-03-24 10:41:52 +01:00
Tvrtko Ursulin
8e623137f1
drm: Move some options to separate new Kconfig
...
Move some options out into a new debug specific kconfig file in order to
make things a bit cleaner.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: Danilo Krummrich <dakr@kernel.org >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Philipp Stanner <phasta@kernel.org >
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Philipp Stanner <phasta@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-2-tvrtko.ursulin@igalia.com
2025-03-24 10:41:51 +01:00
Thomas Zimmermann
f878af62c0
drm/probe-helper: Do not fail from drmm_kms_helper_poll_init()
...
Failing to set up connector polling is not significant enough to
fail device probing. Print a warning and return nothing from the
init helper.
This only affects the managed init function. The unmanaged init
already never fails with an error.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250303145604.62962-4-tzimmermann@suse.de
2025-03-24 09:31:03 +01:00
Thomas Zimmermann
695a7f1c11
drm/udl: Switch poll helpers to managed cleanup
...
Call drmm_kms_helper_poll_init() to set up managed cleanup for
connector polling.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250303145604.62962-3-tzimmermann@suse.de
2025-03-24 09:31:02 +01:00
Thomas Zimmermann
ff9cb6d203
drm/udl: Unregister device before cleaning up on disconnect
...
Disconnecting a DisplayLink device results in the following kernel
error messages
[ 93.041748] [drm:udl_urb_completion [udl]] *ERROR* udl_urb_completion - nonzero write bulk status received: -115
[ 93.055299] [drm:udl_submit_urb [udl]] *ERROR* usb_submit_urb error fffffffe
[ 93.065363] [drm:udl_urb_completion [udl]] *ERROR* udl_urb_completion - nonzero write bulk status received: -115
[ 93.078207] [drm:udl_submit_urb [udl]] *ERROR* usb_submit_urb error fffffffe
coming from KMS poll helpers. Shutting down poll helpers runs them
one final time when the USB device is already gone.
Run drm_dev_unplug() first in udl's USB disconnect handler. Udl's
polling code already handles disconnects gracefully if the device has
been marked as unplugged.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Fixes: b1a981bd55 ("drm/udl: drop drm_driver.release hook")
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org > # v5.8+
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250303145604.62962-2-tzimmermann@suse.de
2025-03-24 09:31:01 +01:00
Luca Ceresoli
616299b666
drm/bridge: fsl-ldb: make warning message more informative
...
This warning notifies a clock was set to an inaccurate value. Modify the
string to also show the clock name.
While doing that also rewrap the entire function call.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Acked-by: Liu Ying <victor.liu@nxp.com >
Signed-off-by: Liu Ying <victor.liu@nxp.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250306-drm-two-ldb-improvements-v1-2-f139d768b92c@bootlin.com
2025-03-24 10:24:41 +08:00
Luca Ceresoli
8c6c3d2075
drm/bridge: imx8qxp-ldb: cleanup return value
...
'ret' can only be 0 at this point, being preceded by a 'if (ret) return
ret;'. So return 0 for clarity.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com >
Reviewed-by: Liu Ying <victor.liu@nxp.com >
Signed-off-by: Liu Ying <victor.liu@nxp.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250306-drm-two-ldb-improvements-v1-1-f139d768b92c@bootlin.com
2025-03-24 10:24:41 +08:00
Maíra Canal
1bdf2ccc35
drm/v3d: Use V3D_SMS registers for power on/off and reset on V3D 7.x
...
In addition to the standard reset controller, V3D 7.x requires configuring
the V3D_SMS registers for proper power on/off and reset. Add the new
registers to `v3d_regs.h` and ensure they are properly configured during
device probing, removal, and reset.
This change fixes GPU reset issues on the Raspberry Pi 5 (BCM2712).
Without exposing these registers, a GPU reset causes the GPU to hang,
stopping any further job execution and freezing the desktop GUI. The same
issue occurs when unloading and loading the v3d driver.
Link: https://github.com/raspberrypi/linux/issues/6660
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Signed-off-by: Maíra Canal <mcanal@igalia.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-5-f3ee7717ed17@igalia.com
2025-03-23 11:06:15 -03:00
Maíra Canal
b1cd1d738e
dt-bindings: gpu: v3d: Add V3D driver maintainer as DT maintainer
...
As established in commit 89d04995f7 ("MAINTAINERS: Drop Emma Anholt
from all M lines."), Emma is no longer active in the Linux kernel and
dropped the V3D maintainership. Therefore, remove Emma as one of the DT
maintainers and add the current V3D driver maintainer.
Acked-by: Emma Anholt <emma@anholt.net >
Acked-by: Rob Herring (Arm) <robh@kernel.org >
Signed-off-by: Maíra Canal <mcanal@igalia.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-4-f3ee7717ed17@igalia.com
2025-03-23 11:06:12 -03:00
Maíra Canal
e29671ae97
dt-bindings: gpu: v3d: Add SMS register to BCM2712 compatible
...
V3D 7.1 exposes a new register block, called V3D_SMS. As BCM2712 has a
V3D 7.1 core, add a new register item to its compatible. Similar to the
GCA, which is specific for V3D 3.3, SMS should only be added for V3D 7.1
variants (such as brcm,2712-v3d).
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Signed-off-by: Maíra Canal <mcanal@igalia.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-3-f3ee7717ed17@igalia.com
2025-03-23 11:06:05 -03:00
Maíra Canal
38712c5281
dt-bindings: gpu: v3d: Add per-compatible register restrictions
...
In order to enforce per-SoC register rules, add per-compatible
restrictions. For example, V3D 3.3 (used in brcm,7268-v3d) has a cache
controller (GCA), which is not present in other V3D generations. Declaring
these differences helps ensure the DTB accurately reflect the hardware
design.
The example was using an incorrect order for the register names. This
commit corrects that by enforcing the order established in the register
items description.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Signed-off-by: Maíra Canal <mcanal@igalia.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-2-f3ee7717ed17@igalia.com
2025-03-23 11:06:01 -03:00
Maíra Canal
76dbd0973c
drm/v3d: Associate a V3D tech revision to all supported devices
...
The V3D driver currently determines the GPU tech version (33, 41...)
by reading a register. This approach has worked so far since this
information wasn’t needed before powering on the GPU.
V3D 7.1 introduces new registers that must be written to power on the
GPU, requiring us to know the V3D version beforehand. To address this,
associate each supported SoC with the corresponding VideoCore GPU version
as part of the device data.
To prevent possible mistakes, add an assertion to verify that the version
specified in the device data matches the one reported by the hardware.
If there is a mismatch, the kernel will trigger a warning.
With the goal of maintaining consistency around the driver, use `enum
v3d_gen` to assign values to `v3d->ver` and for comparisons with other
V3D generations. Note that all mentions of unsupported or non-existing V3D
generations (such as V3D 4.0) were removed by this commit and replaced
with supported generations without functional changes.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Reviewed-by: Stefan Wahren <wahrenst@gmx.net >
Signed-off-by: Maíra Canal <mcanal@igalia.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-1-f3ee7717ed17@igalia.com
2025-03-23 11:04:16 -03:00
Maxime Ripard
f24d1d4a7a
drm/bridge: ti-sn65dsi86: Remove drm_encoder->crtc use
...
The TI sn65dsi86 driver follows the drm_encoder->crtc pointer that is
deprecated and shouldn't be used by atomic drivers.
Fortunately, the atomic hooks provide the drm_atomic_state and we can
access our current CRTC from that, going from the bridge to its encoder,
to its connector, and to its CRTC.
This bridge driver uses the atomic hooks already, but dereferences the
drm_encoder->crtc pointer in functions that don't have access to it.
Let's rework the driver to pass the state where needed, and remove the
need for the drm_encoder->crtc dereference.
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Tested-by: Douglas Anderson <dianders@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-16-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-03-20 14:45:53 +01:00
Maxime Ripard
070bac234b
drm/bridge: tc358768: Convert to atomic helpers
...
The tc358768 driver follows the drm_encoder->crtc pointer that is
deprecated and shouldn't be used by atomic drivers.
Fortunately, the atomic hooks provide the drm_atomic_state and we can
access our current CRTC from that, going from the bridge to its encoder,
to its connector, and to its CRTC.
Let's convert this bridge driver to atomic so we can get rid of the
drm_encoder->crtc dereference.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-15-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-03-20 14:45:52 +01:00
Maxime Ripard
9c77154b71
drm/bridge: tc358768: Stop disabling when failing to enable
...
The tc358768 bridge driver, if enabling it fails, tries to disable it.
This is pretty uncommon in bridge drivers, and also stands in the way
for further reworks.
Worse, since pre_enable and enable aren't expected to fail, disable and
post_disable might be called twice: once to handle the failure, and once
to actually disable the bridge.
Since post_disable uses regulators and clocks, this would lead to enable
count imbalances.
In order to prevent that imbalance, and to allow further reworks, let's
drop the calls to disable and post_disable, but keep the warning to let
users know about what's going on.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-14-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-03-20 14:45:51 +01:00
Maxime Ripard
ae87518031
drm/bridge: tc358775: Switch to atomic commit
...
The tc358775 driver follows the drm_encoder->crtc pointer that is
deprecated and shouldn't be used by atomic drivers.
Fortunately, the atomic hooks provide the drm_atomic_state and we can
access our current CRTC from that, going from the bridge to its encoder,
to its connector, and to its CRTC.
Let's convert this bridge driver to atomic so we can get rid of the
drm_encoder->crtc dereference.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-13-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2025-03-20 14:45:51 +01:00