Skip to content

Conversation

minlexx
Copy link
Member

@minlexx minlexx commented Jun 24, 2025

To make things more upstreamable, pick new panel allocation functions
and switch to them.

For pioneer panel, also switch to multi-api.

For lavender-boe pick newest upstream commit from @barni2000 .

Affected devices:

  • xiaomi-clover, xiaomi-clover-plus
  • xiaomi-whyred
  • sony-xperia-nile-pioneer
  • possibly xiaomi-lavender with BOE panel

Fixes #92

anushasrivats and others added 9 commits June 24, 2025 22:26
Introduce reference counted allocations for panels to avoid
use-after-free. The patch adds the macro devm_drm_bridge_alloc()
to allocate a new refcounted panel. Followed the documentation for
drmm_encoder_alloc() and devm_drm_dev_alloc and other similar
implementations for this purpose.

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]>
Allocate panel via reference counting. Add _get() and _put() helper
functions to ensure panel allocations are refcounted. Avoid use after
free by ensuring panel pointer is valid and can be usable till the last
reference is put.

Reviewed-by: Luca Ceresoli <[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]>
Start moving to the new refcounted allocations using
the new API devm_drm_panel_alloc(). Deprecate any other
allocation.

Reviewed-by: Luca Ceresoli <[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]>
…oc()

Start using the new helper that does the refcounted
allocations.

Reviewed-by: Luca Ceresoli <[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]>
This reverts commit c240450.

New one from upstream wil be picked instead
Add driver for BOE TD4320 DSI panel, used in Xiaomi Redmi Note 7
mobile phone.

Signed-off-by: Barnabás Czémán <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
@minlexx
Copy link
Member Author

minlexx commented Jun 24, 2025

I've tested that display still works on clover-plus, whyred & pioneer. Hopefully lavender-boe doesn't break, too :)

Most of other (nt36672 based) panel drivers will be upgraded in neigbour PR #89

@minlexx minlexx merged commit e1fff71 into qcom-sdm660-6.15.y Jun 24, 2025
3 checks passed
@minlexx minlexx deleted the alexeymin/modernize-panels branch June 24, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Cherry-pick refcounted drm panel functions from 6.16 into 6.15
3 participants