Skip to content

media:phytium:update phytium media function update to 6.6.0.4#1681

Open
wangchenlu2236 wants to merge 3 commits into
deepin-community:linux-6.6.yfrom
wangchenlu2236:media-6.6.y
Open

media:phytium:update phytium media function update to 6.6.0.4#1681
wangchenlu2236 wants to merge 3 commits into
deepin-community:linux-6.6.yfrom
wangchenlu2236:media-6.6.y

Conversation

@wangchenlu2236
Copy link
Copy Markdown

@wangchenlu2236 wangchenlu2236 commented May 12, 2026

This patches updates the support for phytium media controller driver.

1.Redesign the "No Signal" prompt display feature on KVM
2.Add platform dependencies in Kconfig file
3.Reduce resolution switching latency

Summary by Sourcery

Update Phytium media JPEG driver signal/power handling and timing, and harden rxrpc packet handling for fragmented/skb-shared buffers.

New Features:

  • Track host power state and signal presence in the Phytium JPEG driver using a reserved buffer index and new status flag to distinguish no-signal, host power-off, and normal output.

Bug Fixes:

  • Avoid in-place decryption on rxrpc sk_buffs that are cloned or share/contain fragment lists by forcing unsharing, preventing unsafe modification of shared buffers.
  • Correct Phytium JPEG driver detection of no-signal conditions by basing status on the new signal/power indicator rather than only zero resolution values.

Enhancements:

  • Reduce Phytium JPEG resolution change delay to lower latency when switching display resolutions.
  • Refine Phytium JPEG resolution change workflow to restore configuration when the host stays powered during resolution switches and to skip unnecessary delays.
  • Extend Phytium JPEG destination buffer array and initialize signal-indicator register at startup for more robust state tracking.

Chores:

  • Adjust Phytium media driver Kconfig platform dependency configuration (details not shown in diff).

V4bel and others added 3 commits May 11, 2026 15:41
…are present

maillist inclusion
category: bugfix

The DATA-packet handler in rxrpc_input_call_event() and the RESPONSE
handler in rxrpc_verify_response() copy the skb to a linear one before
calling into the security ops only when skb_cloned() is true.  An skb
that is not cloned but still carries externally-owned paged fragments
(e.g. SKBFL_SHARED_FRAG set by splice() into a UDP socket via
__ip_append_data, or a chained skb_has_frag_list()) falls through to
the in-place decryption path, which binds the frag pages directly into
the AEAD/skcipher SGL via skb_to_sgvec().

Extend the gate to also unshare when skb_has_frag_list() or
skb_has_shared_frag() is true.  This catches the splice-loopback vector
and other externally-shared frag sources while preserving the
zero-copy fast path for skbs whose frags are kernel-private (e.g. NIC
page_pool RX, GRO).  The OOM/trace handling already in place is reused.

Fixes: d0d5c0c ("rxrpc: Use skb_unshare() rather than skb_cow_data()")
Cc: stable@vger.kernel.org
Signed-off-by: Wang Chenlu <wangchenlu2236@phytium.com.cn>
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by:Wang Chenlu <wangchenlu2236@phytium.com.cn>
Signed-off-by:Wang Chenlu <wangchenlu2236@phytium.com.cn>
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign opsiff for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link
Copy Markdown

Hi @wangchenlu2236. Thanks for your PR. 😃

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 12, 2026

Reviewer's Guide

Updates the Phytium JPEG media controller driver to refine KVM "No Signal" handling and host power state detection via a reserved buffer index register, reduces resolution-change latency, tracks host power-off transitions, and tightens rxrpc skb sharing checks for in-place decryption, along with minor cleanup and initialization changes.

File-Level Changes

Change Details Files
Redesigned JPEG input resolution and signal detection to distinguish host power-off, KVM no-signal cases, and valid video, using a reserved VB buffer index register and a new once_poweroff state flag.
  • Removed a fixed 50 ms delay in the JPEG power-off path to reduce latency when turning clocks off.
  • Extended resolution detection to read BUF_LIST_INDEX_ADDR(VB_BUF_LAST) as an input signal/power-state indicator and log the state for debugging.
  • Introduced HAVE_SIGNAL, HOST_POWER_ON, HOST_POWER_OFF constants and VB_BUF_LAST index, and expanded dst_addrs size to include this reserved entry.
  • Added logic to treat HOST_POWER_OFF as a host shutdown event that sets once_poweroff and short-circuits resolution handling, and to treat HOST_POWER_ON as a KVM no-signal condition after a prior power-off.
  • Ensured v4l2_input_status is only cleared when a valid signal is present or a resolution change is detected, instead of unconditionally on non-zero resolution.
  • Update query_dv_timings to infer no-signal from the BUF_LIST_INDEX_ADDR(VB_BUF_LAST) power-status value instead of checking for zero width/height.
  • Initialized BUF_LIST_INDEX_ADDR(VB_BUF_LAST) to HAVE_SIGNAL during JPEG init and reset it (and once_poweroff) during resolution-change work to reflect a powered-on host.
  • Added once_poweroff flag to phytium_jpeg_dev and initialized it in video setup to track whether the host has ever powered off since driver start.
  • Tweaked log message punctuation and fixed IRQ request indentation for consistency.
drivers/media/platform/phytium/phytium_jpeg_core.c
drivers/media/platform/phytium/phytium_jpeg_core.h
Adjusted JPEG timing constants to reduce resolution switching latency.
  • Reduced RESOLUTION_CHANGE_DELAY from 250 ms to 150 ms while leaving other timeouts unchanged to speed up reaction to resolution changes.
drivers/media/platform/phytium/phytium_jpeg_core.h
Tightened rxrpc skb mutability checks before in-place decryption to cover additional shared-buffer cases.
  • Extended the condition in rxrpc_input_call_event to also unshare packets that have a frag list or shared frags, not just cloned skbs.
  • Similarly extended the mutability check in rxrpc_verify_response so that any skb with cloning, frag list, or shared frag triggers an skb copy before decryption.
net/rxrpc/call_event.c
net/rxrpc/conn_event.c
Introduced or updated Phytium media Kconfig platform dependencies and added/updated ancillary build or status files.
  • Modified the Phytium media Kconfig entry to express new or adjusted platform dependencies for the JPEG controller driver (exact symbols should be reviewed in the file).
  • Added or updated build.log and tatus files, which appear to be auxiliary outputs or placeholders and may not be intended for inclusion in the final tree.
drivers/media/platform/phytium/Kconfig
build.log
tatus

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Copy Markdown

Hi @wangchenlu2236. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The host power/signal markers (HAVE_SIGNAL, HOST_POWER_ON, HOST_POWER_OFF) and use of VB_BUF_LAST as a status slot are fairly implicit; consider wrapping access to BUF_LIST_INDEX_ADDR(VB_BUF_LAST) in small helper functions and/or an enum to make the state machine easier to understand and harder to misuse.
  • The once_poweroff flag is written in several paths but its lifetime and concurrency model are not obvious; consider adding a short comment near the field definition or centralizing its reset/transition logic so it’s clear under which conditions it toggles and how it interacts with resolution changes.
  • It looks like build.log and tatus were added accidentally to the tree; these should be removed from the commit to avoid tracking build artifacts or temporary files.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The host power/signal markers (HAVE_SIGNAL, HOST_POWER_ON, HOST_POWER_OFF) and use of VB_BUF_LAST as a status slot are fairly implicit; consider wrapping access to BUF_LIST_INDEX_ADDR(VB_BUF_LAST) in small helper functions and/or an enum to make the state machine easier to understand and harder to misuse.
- The `once_poweroff` flag is written in several paths but its lifetime and concurrency model are not obvious; consider adding a short comment near the field definition or centralizing its reset/transition logic so it’s clear under which conditions it toggles and how it interacts with resolution changes.
- It looks like `build.log` and `tatus` were added accidentally to the tree; these should be removed from the commit to avoid tracking build artifacts or temporary files.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread build.log
***
/home/user/deepin-kernel/Makefile:775: include/config/auto.conf.cmd: 没有那个文件或目录
make[1]: *** [/home/user/deepin-kernel/Makefile:784:.config] 错误 1
make: *** [Makefile:234:__sub-make] 错误 2
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Comment thread tatus
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

net/rxrpc/call_event.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Phytium JPEG media driver’s signal/power handling and resolution-switch timing, and adjusts RxRPC packet handling to avoid in-place crypto operations on skbs that may share fragment storage.

Changes:

  • RxRPC: unshare/copy DATA and RESPONSE packets not only when skb_cloned(), but also when skb_has_frag_list() or skb_has_shared_frag().
  • Phytium JPEG: reduce resolution-change delay, expand destination buffer bookkeeping, and add host-power/signal tracking via a reserved buffer-list index.
  • Add a platform dependency in the Phytium media Kconfig (currently referencing a missing symbol in this tree).

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
net/rxrpc/call_event.c Extends the conditions that trigger copying/unsharing before in-place decryption of DATA packets.
net/rxrpc/conn_event.c Extends the conditions that trigger copying/unsharing before verifying/decrypting RESPONSE packets.
drivers/media/platform/phytium/phytium_jpeg_core.h Adjusts timing constants and introduces new signal/power markers and buffer index constants.
drivers/media/platform/phytium/phytium_jpeg_core.c Implements revised no-signal/host-power logic and reduces resolution-switch latency.
drivers/media/platform/phytium/Kconfig Adds an architecture dependency for the driver (currently uses an undefined symbol here).
tatus Adds a repository artifact (appears to be pasted VCS output; should not be in-tree).
build.log Adds a local build artifact (should not be in-tree).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tristate "Phytium JPEG Encoder Engine driver"
depends on V4L_PLATFORM_DRIVERS
depends on VIDEO_DEV
depends on ARCH_PHYTIUM
Comment thread tatus
Comment on lines +1 to +66
commit 02ced38ea255f262806c92e557bddc5e17a71410 (HEAD -> media-6.6.y, origin/linux-6.6.y, origin/HEAD, linux-6.6.y)
Author: Hyunwoo Kim <imv4bel@gmail.com>
Date: Fri May 8 17:53:09 2026 +0900

FROMLIST: rxrpc: Also unshare DATA/RESPONSE packets when paged frags are present

maillist inclusion
category: bugfix

The DATA-packet handler in rxrpc_input_call_event() and the RESPONSE
handler in rxrpc_verify_response() copy the skb to a linear one before
calling into the security ops only when skb_cloned() is true. An skb
that is not cloned but still carries externally-owned paged fragments
(e.g. SKBFL_SHARED_FRAG set by splice() into a UDP socket via
__ip_append_data, or a chained skb_has_frag_list()) falls through to
the in-place decryption path, which binds the frag pages directly into
the AEAD/skcipher SGL via skb_to_sgvec().

Extend the gate to also unshare when skb_has_frag_list() or
skb_has_shared_frag() is true. This catches the splice-loopback vector
and other externally-shared frag sources while preserving the
zero-copy fast path for skbs whose frags are kernel-private (e.g. NIC
page_pool RX, GRO). The OOM/trace handling already in place is reused.

Fixes: d0d5c0cd1e71 ("rxrpc: Use skb_unshare() rather than skb_cow_data()")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

net/rxrpc/call_event.c | 4 +++-
net/rxrpc/conn_event.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)

commit 79d762c30c5a37252749488c83d258a5410a70fa
Author: David Howells <dhowells@redhat.com>
Date: Thu Apr 23 21:09:06 2026 +0100

BACKPORT: rxrpc: Fix rxrpc_input_call_event() to only unshare DATA packets

mainline inclusion
from mainline-v7.1-rc1
category: bugfix

commit 55b2984c96c37f909bbfe8851f13152693951382 upstream.

Fix rxrpc_input_call_event() to only unshare DATA packets and not ACK,
ABORT, etc..

And with that, rxrpc_input_packet() doesn't need to take a pointer to the
pointer to the packet, so change that to just a pointer.

Fixes: 1f2740150f90 ("rxrpc: Fix potential UAF after skb_unshare() failure")
Closes: https://sashiko.dev/#/patchset/20260422161438.2593376-4-dhowells@redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
Link: https://patch.msgid.link/20260423200909.3049438-2-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

net/rxrpc/call_event.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants