aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vc4
Commit message (Collapse)AuthorAgeFilesLines
* drm: Pass the format info to .fb_create()Ville Syrjälä2025-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Cc: Liviu Dudau <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Russell King <[email protected]> Cc: Inki Dae <[email protected]> Cc: Seung-Woo Kim <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: Patrik Jakobsson <[email protected]> Cc: Chun-Kuang Hu <[email protected]> Cc: Philipp Zabel <[email protected]> Cc: Rob Clark <[email protected]> Cc: Abhinav Kumar <[email protected]> Cc: Dmitry Baryshkov <[email protected]> Cc: Sean Paul <[email protected]> Cc: Marijn Suijten <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Stefan Agner <[email protected]> Cc: Lyude Paul <[email protected]> Cc: Danilo Krummrich <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: Kieran Bingham <[email protected]> Cc: Biju Das <[email protected]> Cc: Sandy Huang <[email protected]> Cc: "Heiko Stübner" <[email protected]> Cc: Andy Yan <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Mikko Perttunen <[email protected]> Cc: Dave Stevenson <[email protected]> Cc: "Maíra Canal" <[email protected]> Cc: Raspberry Pi Kernel Maintenance <[email protected]> Cc: Dmitry Osipenko <[email protected]> Cc: Gurchetan Singh <[email protected]> Cc: Chia-I Wu <[email protected]> Cc: Zack Rusin <[email protected]> Cc: Broadcom internal kernel review list <[email protected]> Cc: Oleksandr Andrushchenko <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Acked-by: Liviu Dudau <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* Merge tag 'drm-misc-next-2025-06-12' of ↵Dave Airlie2025-06-171-1/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.freedesktop.org/drm/misc/kernel into drm-next drm-misc-next for 6.17: UAPI Changes: Cross-subsystem Changes: Core Changes: - atomic-helpers: Tune the enable / disable sequence - bridge: Add destroy hook - color management: Add helpers for hardware gamma LUT handling - HDMI: Add CEC handling, YUV420 output support - sched: tracing improvements Driver Changes: - hyperv: Move out of simple-kms, drm_panic support - i915: drm_panel_follower support - imx: Add IMX8qxq Display Controller Support - lima: Add Rockchip RK3528 GPU Support - nouveau: fence handling cleanup - panfrost: Add BO labeling, 64-bit registers access - qaic: Add RAS Support - rz-du: Add RZ/V2H(P) Support, MIPI-DSI DCS Support - sun4i: Add H616 Support - tidss: Add TI AM62L Support - vkms: YUV and R* formats support - bridges: - Switched to reference counted drm_bridge allocations - panels: - Switched to reference counted drm_panel allocations - Add support for fwnode-based panel lookup - himax-hx8394: Support for Huiling hl055fhv028c - ilitek-ili9881c: Support for 7" Raspberry Pi 720x1280 - panel-edp: Support for KDC KD116N3730A05, N160JCE-ELL CMN, - panel-simple: Support for AUO P238HAN01 - st7701: Support for Winstar wf40eswaa6mnn0 - visionox-rm69299: Support for rm69299-shift - New panels: Renesas R61307, Renesas R69328 Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/20250612-coucal-of-impossible-cleaning-a5eecf@houat
| * Merge drm/drm-next into drm-misc-nextThomas Zimmermann2025-06-112-2/+2
| |\ | | | | | | | | | | | | | | | Backmerging to forward to v6.16-rc1 Signed-off-by: Thomas Zimmermann <[email protected]>
| * | drm/bridge: allow limiting I2S formatsDmitry Baryshkov2025-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default HDMI codec registers all formats supported on the I2S bus. Allow bridges (and connectors) to limit the list of the PCM formats supported by the HDMI codec. Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/20250517-drm-hdmi-connector-cec-v6-2-35651db6f19b@oss.qualcomm.com Signed-off-by: Dmitry Baryshkov <[email protected]>
* | | drm/vc4: fix infinite EPROBE_DEFER loopGabriel Dalimonte2025-06-101-6/+6
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | `vc4_hdmi_audio_init` calls `devm_snd_dmaengine_pcm_register` which may return EPROBE_DEFER. Calling `drm_connector_hdmi_audio_init` adds a child device. The driver model docs[1] state that adding a child device prior to returning EPROBE_DEFER may result in an infinite loop. [1] https://www.kernel.org/doc/html/v6.14/driver-api/driver-model/driver.html Fixes: 9640f1437a88 ("drm/vc4: hdmi: switch to using generic HDMI Codec infrastructure") Signed-off-by: Gabriel Dalimonte <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* | treewide, timers: Rename from_timer() to timer_container_of()Ingo Molnar2025-06-082-2/+2
|/ | | | | | | | | | | Move this API to the canonical timer_*() namespace. [ tglx: Redone against pre rc1 ] Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
* drm/vc4: convert to devm_drm_bridge_alloc() APILuca Ceresoli2025-04-291-29/+5
| | | | | | | | | | | | | | | This is the new API for allocating DRM bridges. This driver already implements refcounting of the struct vc4_dsi, which embeds struct drm_bridge. Now this is a duplicate of the refcounting implemented by the DRM bridge core, so convert the vc4_dsi_get/put() calls into drm_bridge_get/put() calls and get rid of the driver-specific refcounting implementation. Signed-off-by: Luca Ceresoli <[email protected]> Acked-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-27-8f91a404d86b@bootlin.com Signed-off-by: Louis Chauvet <[email protected]>
* Merge drm/drm-next into drm-misc-nextThomas Zimmermann2025-04-071-1/+1
|\ | | | | | | | | | | | | Backmerging to get v6.15-rc1 into drm-misc-next. Also fixes a build issue when enabling CONFIG_DRM_SCHED_KUNIT_TEST. Signed-off-by: Thomas Zimmermann <[email protected]>
| * treewide: Switch/rename to timer_delete[_sync]()Thomas Gleixner2025-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree over and remove the historical wrapper inlines. Conversion was done with coccinelle plus manual fixups where necessary. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
* | drm/vc4: tests: Retry pv-muxing tests when EDEADLKMaxime Ripard2025-04-071-1/+112
| | | | | | | | | | | | | | | | | | | | | | | | Some functions used by the HVS->PV muxing tests can return with EDEADLK, meaning the entire sequence should be restarted. It's not a fatal error and we should treat it as a recoverable error, and recover, instead of failing the test like we currently do. Fixes: 76ec18dc5afa ("drm/vc4: tests: Add unit test suite for the PV muxing") Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* | drm/vc4: tests: Stop allocating the state in test initMaxime Ripard2025-04-071-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vc4-pv-muxing-combinations and vc5-pv-muxing-combinations test suites use a common test init function which, in part, allocates the drm atomic state the test will use. That allocation relies on drm_kunit_helper_atomic_state_alloc(), and thus requires a struct drm_modeset_acquire_ctx. This context will then be stored in the allocated state->acquire_ctx field. However, the context is local to the test init function, and is cleared as soon as drm_kunit_helper_atomic_state_alloc() is done. We thus end up with an dangling pointer to a cleared context in state->acquire_ctx for our test to consumes. We should really allocate the context and the state in the test functions, so we can also control when we're done with it. Fixes: 30188df0c387 ("drm/tests: Drop drm_kunit_helper_acquire_ctx_alloc()") Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* | drm/vc4: tests: Document output handling functionsMaxime Ripard2025-04-071-0/+26
| | | | | | | | | | | | | | | | | | | | | | vc4_mock_atomic_add_output() and vc4_mock_atomic_del_output() are public but aren't documented. Let's provide the documentation. In particular, special care should be taken to deal with EDEADLK. Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* | drm/vc4: tests: Use return instead of assertMaxime Ripard2025-04-071-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vc4_mock_atomic_add_output() and vc4_mock_atomic_del_output() assert that the functions they are calling didn't fail. Since some of them can return EDEADLK, we can't properly deal with it. Since both functions are expected to return an int, and all caller check the return value, let's just properly propagate the errors when they occur. Fixes: f759f5b53f1c ("drm/vc4: tests: Introduce a mocking infrastructure") Fixes: 76ec18dc5afa ("drm/vc4: tests: Add unit test suite for the PV muxing") Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* | drm/vc4: hdmi: Add jack detection to HDMI audio driverDavid Turner2025-03-252-0/+25
| | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: David Turner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: hdmi: Call HDMI hotplug helper on disconnectStefan Wahren2025-03-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: 2ea9ec5d2c20 ("drm/vc4: hdmi: use drm_atomic_helper_connector_hdmi_hotplug()") Suggested-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: David Turner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/bridge: Add encoder parameter to drm_bridge_funcs.attachMaxime Ripard2025-03-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The drm_bridge structure contains an encoder pointer that is widely used by bridge drivers. This pattern is largely documented as deprecated in other KMS entities for atomic drivers. However, one of the main use of that pointer is done in attach to just call drm_bridge_attach on the next bridge to add it to the bridge list. While this dereferences the bridge->encoder pointer, it's effectively the same encoder the bridge was being attached to. We can make it more explicit by adding the encoder the bridge is attached to to the list of attach parameters. This also removes the need to dereference bridge->encoder in most drivers. Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Tested-by: Douglas Anderson <[email protected]> Tested-by: Luca Ceresoli <[email protected]> Reviewed-by: Luca Ceresoli <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* | drm/vc4: plane: fix inconsistent indenting warningCharles Han2025-03-091-1/+1
|/ | | | | | | | | | Fix below inconsistent indenting smatch warning. smatch warnings: drivers/gpu/drm/vc4/vc4_plane.c:2083 vc6_plane_mode_set() warn: inconsistent indenting Signed-off-by: Charles Han <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/vc4: hdmi: Fix some NULL vs IS_ERR() bugsDan Carpenter2025-03-031-14/+14
| | | | | | | | | | The devm_platform_ioremap_resource_byname() function doesn't return NULL, it returns error pointers. Update the checking to match. Fixes: b93f07cf090a ("drm/vc4: move to devm_platform_ioremap_resource() usage") Signed-off-by: Dan Carpenter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/tests: Drop drm_kunit_helper_acquire_ctx_alloc()Maxime Ripard2025-03-031-19/+27
| | | | | | | | | | | | | | lockdep complains when a lock is released in a separate thread the lock is taken in, and it turns out that kunit does run its actions in a separate thread than the test ran in. This means that drm_kunit_helper_acquire_ctx_alloc() just cannot work as it's supposed to, so let's just get rid of it. Suggested-by: Simona Vetter <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/vc4: move to devm_platform_ioremap_resource() usageAnusha Srivatsa2025-02-261-35/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace platform_get_resource_byname + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: //rule s/(devm_)platform_get_resource_byname + //(devm_)ioremap/devm_platform_ioremap_resource. @rule_3@ identifier res; expression ioremap; identifier pdev; constant mem; expression name; @@ -struct resource *res; <+... -res = platform_get_resource_byname(pdev,mem,name); <... -if (!res) { -... -} ...> -ioremap = devm_ioremap(...); +ioremap = devm_platform_ioremap_resource_byname(pdev,name); ...+> v2: Change the SmPl patch to work on multiple occurences of the pattern. This also fixes the compilation error. v3: Do not convert "hd" resource to follow the rest of the refactor. (Maxime) v4: fix compiler error Cc: Maxime Ripard <[email protected]> Cc: Dave Stevenson <[email protected]> Cc: Maíra Canal <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/bridge: Pass full state to atomic_post_disableMaxime Ripard2025-02-191-1/+1
| | | | | | | | | | | | It's pretty inconvenient to access the full atomic state from drm_bridges, so let's change the atomic_post_disable hook prototype to pass it directly. Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Tested-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/bridge: Pass full state to atomic_disableMaxime Ripard2025-02-191-1/+1
| | | | | | | | | | | | It's pretty inconvenient to access the full atomic state from drm_bridges, so let's change the atomic_disable hook prototype to pass it directly. Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Tested-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/bridge: Pass full state to atomic_enableMaxime Ripard2025-02-191-1/+1
| | | | | | | | | | | | It's pretty inconvenient to access the full atomic state from drm_bridges, so let's change the atomic_enable hook prototype to pass it directly. Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Tested-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/bridge: Pass full state to atomic_pre_enableMaxime Ripard2025-02-191-2/+1
| | | | | | | | | | | | It's pretty inconvenient to access the full atomic state from drm_bridges, so let's change the atomic_pre_enable hook prototype to pass it directly. Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Tested-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/atomic: Let drivers decide which planes to async flipAndré Almeida2025-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, DRM atomic uAPI allows only primary planes to be flipped asynchronously. However, each driver might be able to perform async flips in other different plane types. To enable drivers to set their own restrictions on which type of plane they can or cannot flip, use the existing atomic_async_check() from struct drm_plane_helper_funcs to enhance this flexibility, thus allowing different plane types to be able to do async flips as well. Create a new parameter for the atomic_async_check(), `bool flip`. This parameter is used to distinguish when this function is being called from a plane update from a full page flip. In order to prevent regressions and such, we keep the current policy: we skip the driver check for the primary plane, because it is always allowed to do async flips on it. Signed-off-by: André Almeida <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Christopher Snowhill <[email protected]> Tested-by: Christopher Snowhill <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
* drm/vc4: hdmi: Use drm_atomic_helper_reset_crtc()Herve Codina2025-02-131-29/+1
| | | | | | | | | | | | | | | | | The current code uses a the reset_pipe() local function to reset the CRTC outputs. drm_atomic_helper_reset_crtc() has been introduced recently and it performs exact same operations. In order to avoid code duplication, use the new helper instead of the local function. Signed-off-by: Herve Codina <[email protected]> Acked-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
* drm/vc4: Remove BOs seqnosMaíra Canal2025-01-194-113/+17
| | | | | | | | | | | | | | | | `bo->seqno`, `bo->write_seqno`, and `exec->bin_dep_seqno` are leftovers from a time when VC4 didn't support DMA Reservation Objects. Before DMA Resv was introduced, tracking the correspondence between BOs and jobs through the job's seqno made sense. However, this is no longer needed, as VC4 now supports DMA Reservation Objects and attaches the "job done" fence to the BOs. Therefore, remove the BOs seqnos in favor of using DMA Resv Objects. Signed-off-by: Maíra Canal <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Reviewed-by: Melissa Wen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/vc4: Use DMA Resv to implement VC4 wait BO IOCTLMaíra Canal2025-01-191-11/+14
| | | | | | | | | | Since the BOs used by VC4 have DMA Reservation Objects attached to them, waiting for seqnos to check BO availability is unnecessary. Instead, `drm_gem_dma_resv_wait()` can be used. Signed-off-by: Maíra Canal <[email protected]> Reviewed-by: Melissa Wen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/vc4: Use DRM Execution ContextsMaíra Canal2025-01-192-78/+22
| | | | | | | | | | | | | | VC4 has internal copies of `drm_gem_lock_reservations()` and `drm_gem_unlock_reservations()` within the driver. Ideally, these hard-coded functions should be replaced with the generic functions provided by DRM common code. However, instead of using the DRM GEM functions to (un)lock reservations, transition to the new DRM Execution Contexts API. Signed-off-by: Maíra Canal <[email protected]> Acked-by: Christian König <[email protected]> Reviewed-by: Melissa Wen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/connector: make mode_valid take a const struct drm_display_modeDmitry Baryshkov2025-01-071-1/+1
| | | | | | | | | | | | | | | | | The mode_valid() callbacks of drm_encoder, drm_crtc and drm_bridge take a const struct drm_display_mode argument. Change the mode_valid callback of drm_connector to also take a const argument. Acked-by: Jani Nikula <[email protected]> Reviewed-by: Liviu Dudau <[email protected]> Reviewed-by: Raphael Gallais-Pou <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20241214-drm-connector-mode-valid-const-v2-5-4f9498a4c822@linaro.org Signed-off-by: Dmitry Baryshkov <[email protected]>
* drm/vc4: hdmi: use drm_atomic_helper_connector_hdmi_hotplug()Dmitry Baryshkov2025-01-041-6/+3
| | | | | | | | | | | Use the helper function to update the connector's information. This makes sure that HDMI-related events are handled in a generic way. Currently it is limited to the HDMI state reporting to the sound system. Acked-by: Maxime Ripard <[email protected]> Tested-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20241224-drm-bridge-hdmi-connector-v10-10-dc89577cd438@linaro.org Signed-off-by: Dmitry Baryshkov <[email protected]>
* drm/vc4: hdmi: stop rereading EDID in get_modes()Dmitry Baryshkov2025-01-041-21/+0
| | | | | | | | | | | | The vc4_hdmi_connector_detect_ctx() via vc4_hdmi_handle_hotplug() already reads EDID and propagates it to the drm_connector. Stop rereading EDID as a part of the .get_modes() callback and just update the list of modes. This matches the behaviour of the i915 driver. Acked-by: Maxime Ripard <[email protected]> Tested-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
* drm/vc4: hdmi: switch to using generic HDMI Codec infrastructureDmitry Baryshkov2025-01-043-57/+20
| | | | | | | | | | Drop driver-specific implementation and use the generic HDMI Codec framework in order to implement the HDMI audio support. Acked-by: Maxime Ripard <[email protected]> Tested-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
* drm/vc4: hdmi: use eld_mutex to protect access to connector->eldDmitry Baryshkov2024-12-161-2/+2
| | | | | | | | | | Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access. Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
* drm/vc4: unlock on error in vc4_hvs_get_fifo_frame_count()Dan Carpenter2024-12-121-1/+1
| | | | | | | | | | | The default statement is never used in real life. However, if it were used for some reason then call drm_dev_exit() before returning. Fixes: 8f2fc64773be ("drm/vc4: Fix reading of frame count on GEN5 / Pi4") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* drm/vc4: plane: Remove WARN on state being set in plane_resetDave Stevenson2024-12-111-1/+4
| | | | | | | | | | | It is permitted on situations such as system resume for plane->state to be non-NULL, and that should be handled by freeing it. Do so. Signed-off-by: Dave Stevenson <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* Merge remote-tracking branch 'drm/drm-next' into drm-misc-nextMaarten Lankhorst2024-12-099-9/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The v6.13-rc2 release included a bunch of breaking changes, specifically the MODULE_IMPORT_NS commit. Backmerge in order to fix them before the next pull-request. Include the fix from Stephen Roswell. Caused by commit 25c3fd1183c0 ("drm/virtio: Add a helper to map and note the dma addrs and lengths") Interacting with commit cdd30ebb1b9f ("module: Convert symbol namespace to string literal") Reported-by: Stephen Rothwell <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
| * Get rid of 'remove_new' relic from platform driver structLinus Torvalds2024-12-019-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The continual trickle of small conversion patches is grating on me, and is really not helping. Just get rid of the 'remove_new' member function, which is just an alias for the plain 'remove', and had a comment to that effect: /* * .remove_new() is a relic from a prototype conversion of .remove(). * New drivers are supposed to implement .remove(). Once all drivers are * converted to not use .remove_new any more, it will be dropped. */ This was just a tree-wide 'sed' script that replaced '.remove_new' with '.remove', with some care taken to turn a subsequent tab into two tabs to make things line up. I did do some minimal manual whitespace adjustment for places that used spaces to line things up. Then I just removed the old (sic) .remove_new member function, and this is the end result. No more unnecessary conversion noise. Signed-off-by: Linus Torvalds <[email protected]>
* | drm/vc4: use drm_hdmi_connector_mode_valid()Dmitry Baryshkov2024-12-051-3/+2
| | | | | | | | | | | | | | | | | | | | Use new drm_hdmi_connector_mode_valid() helper instead of a module-specific copy. Reviewed-by: Chen-Yu Tsai <[email protected]> Acked-by: Dave Stevenson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
* | drm: remove driver date from struct drm_driver and all driversJani Nikula2024-12-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We stopped using the driver initialized date in commit 7fb8af6798e8 ("drm: deprecate driver date") and (eventually) started returning "0" for drm_version ioctl instead. Finish the job, and remove the unused date member from struct drm_driver, its initialization from drivers, along with the common DRIVER_DATE macros. v2: Also update drivers/accel (kernel test robot) Reviewed-by: Javier Martinez Canillas <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Simon Ser <[email protected]> Acked-by: Jeffrey Hugo <[email protected]> Acked-by: Lucas De Marchi <[email protected]> Acked-by: Dmitry Baryshkov <[email protected]> # msm Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/1f2bf2543aed270a06f6c707fd6ed1b78bf16712.1733322525.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
* | drm/vc4: Drop planes that are completely off-screen or 0 crtc sizeDave Stevenson2024-11-271-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is permitted for a plane to be configured such that none of it is on-screen via either negative dest rectangle X,Y offset, or an offset that is greater than the crtc dimensions. These planes were resized via drm_atomic_helper_check_plane_state such that the source rectangle had a zero width or height, but they still created a dlist entry even though they contributed no pixels. In the case of vc6_plane_mode_set, that it could result in negative values being written into registers, which caused incorrect behaviour. Drop planes that result in a source width or height of 0 pixels or an on-screen size of 0 pixels to avoid the incorrect rendering. Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: Enable bg_fill if there are no planes enabledDave Stevenson2024-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The default was to have enable_bg_fill disabled and the first plane set it if it wasn't opaque and covering the whole screen. However that meant that if no planes were enabled, then the background fill wasn't enabled, and would give a striped output from the uninitialised output buffer. Initialise it to enabled to avoid this. Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: Add additional warn_on for incorrect revisionsMaxime Ripard2024-11-273-2/+51
| | | | | | | | | | | | | | | | | | Some code path in vc4 are conditional to a generation and cannot be executed on others. Let's put a WARN_ON if that ever happens. Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: hdmi: Support 2712 D-step register mapDave Stevenson2024-11-272-2/+26
| | | | | | | | | | | | | | | | | | | | The D-step has increased FIFO sizes of the MAI_THR blocks, resulting in changes to the register masking. Add support for it. Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: plane: Add support for 2712 D-step.Dave Stevenson2024-11-272-21/+60
| | | | | | | | | | | | | | | | | | There are a few minor changes in the display list generation for the D-step of the chip, so add them. Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: hvs: Add in support for 2712 D-step.Dave Stevenson2024-11-274-41/+229
| | | | | | | | | | | | | | | | | | The registers have been moved around, and a couple of minor changes made, so adapt for this. Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: drv: Add support for 2712 D-stepDave Stevenson2024-11-274-0/+9
| | | | | | | | | | | | | | | | Add in the compatible string and VC4_GEN_ enum for the D-step Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: txp: Add BCM2712 MOPLET supportMaxime Ripard2024-11-271-0/+14
| | | | | | | | | | | | | | | | | | The BCM2712 features a simpler TXP called MOPLET. Let's add support for it. Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: txp: Add support for BCM2712 MOPMaxime Ripard2024-11-271-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | The BCM2712 has an evolution of what used to be called TXP in the earlier SoCs, but is now called MOP. There's a few differences still, so we can add a new compatible to deal with them easily. Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>
* | drm/vc4: txp: Add a new TXP encoder typeMaxime Ripard2024-11-275-58/+59
| | | | | | | | | | | | | | | | | | Starting with BCM2712, we'll have a two TXP. Let's follow the HDMI example and add two encoder types for TXP: TXP0 and TXP1. Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]>