linux-block.git
4 months agobus: mhi: host: Add a policy to enable image transfer via BHIe in PBL
Matthew Leung [Fri, 17 Jan 2025 17:09:38 +0000 (10:09 -0700)]
bus: mhi: host: Add a policy to enable image transfer via BHIe in PBL

Currently, MHI host only performs firmware transfer via BHI in PBL and
BHIe from SBL. To support BHIe transfer directly from PBL, a policy
needs to be added.

With this policy, BHIe will be used to transfer firmware in PBL if the
MHI controller has BHIe regs, sets seg_len, and does not set
fbc_download. The intention is to transfer firmware using BHIe in PBL
without further BHIe transfers in SBL.

Signed-off-by: Matthew Leung <quic_mattleun@quicinc.com>
Reviewed-by: Youssef Samir <quic_yabdulra@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117170943.2643280-3-quic_jhugo@quicinc.com
4 months agobus: mhi: host: Refactor BHI/BHIe based firmware loading
Matthew Leung [Fri, 17 Jan 2025 17:09:37 +0000 (10:09 -0700)]
bus: mhi: host: Refactor BHI/BHIe based firmware loading

Refactor the firmware loading code to have distinct helper functions for
BHI and BHIe operations. This lays the foundation for separating the
firmware loading protocol from the firmware being loaded and the EE it
is loaded in.

Signed-off-by: Matthew Leung <quic_mattleun@quicinc.com>
Reviewed-by: Youssef Samir <quic_yabdulra@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117170943.2643280-2-quic_jhugo@quicinc.com
4 months agodrm/ast: Fix ast_dp connection status
Jocelyn Falempe [Fri, 24 Jan 2025 14:11:31 +0000 (15:11 +0100)]
drm/ast: Fix ast_dp connection status

ast_dp_is_connected() used to also check for link training success
to report the DP connector as connected. Without this check, the
physical_status is always connected. So if no monitor is present, it
will fail to read the EDID and set the default resolution to 640x480
instead of 1024x768.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Fixes: 2281475168d2 ("drm/ast: astdp: Perform link training during atomic_enable")
Reported-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Tested-by: Jose Lopez <jose.lopez@hpe.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.12+
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124141142.2434138-1-jfalempe@redhat.com
4 months agodt-bindings: display: renesas,du: add top-level constraints
Krzysztof Kozlowski [Tue, 28 Jan 2025 09:47:19 +0000 (10:47 +0100)]
dt-bindings: display: renesas,du: add top-level constraints

Properties with variable number of items per each device are expected to
have widest constraints in top-level "properties:" block and further
customized (narrowed) in "if:then:".  Add missing top-level constraints
for clocks, clock-names, interrupts, resets, reset-names, renesas,cmms
and renesas,vsps.

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250128094719.63776-2-krzysztof.kozlowski@linaro.org
4 months agodt-bindings: display: renesas,du: narrow interrupts and resets per variants
Krzysztof Kozlowski [Tue, 28 Jan 2025 09:47:18 +0000 (10:47 +0100)]
dt-bindings: display: renesas,du: narrow interrupts and resets per variants

Each variable-length property like interrupts or resets must have fixed
constraints on number of items for given variant in binding.  The
clauses in "if:then:" block should define both limits: upper and lower.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250128094719.63776-1-krzysztof.kozlowski@linaro.org
4 months agoMAINTAINERS: Update drm/rcar-du maintainers
Tomi Valkeinen [Tue, 28 Jan 2025 12:14:43 +0000 (14:14 +0200)]
MAINTAINERS: Update drm/rcar-du maintainers

Update drm/rcar-du maintainer entries:

* Add myself as drm/rcar-du maintainer.
* Update Laurent's email to include +renesas.
* Switch Kieran from a maintainer to reviewer.
* Change rcar-du to be under drm-misc umbrella.

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250128-rcar-du-maintainers-v2-1-4a3860a3e1ef@ideasonboard.com
4 months agoMAINTAINERS: Remove Noralf Trønnes as driver maintainer
Noralf Trønnes [Thu, 23 Jan 2025 16:34:25 +0000 (17:34 +0100)]
MAINTAINERS: Remove Noralf Trønnes as driver maintainer

Remove myself as maintainer for gud, mi0283qt, panel-mipi-dbi and repaper.
My fatigue illness has finally closed the door on doing development of
even moderate complexity so it's sad to let this go.

Acked-by: Thomas Zimmremann <tzimmermann@suse.de>
Acked-by: Simona Vetter <simona.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20250123-remove-myself-as-maintainer-v1-1-cc3ab7cd98ae@tronnes.org
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
4 months agodrm: bridge: adv7511: remove s32 format from i2s capabilities
Olivier Moysan [Wed, 8 Jan 2025 17:03:56 +0000 (18:03 +0100)]
drm: bridge: adv7511: remove s32 format from i2s capabilities

The ADV7511 chip allows 24 bits samples max in I2S mode, excepted for
direct AES3 mode (SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE format).
However the HDMI codec exposes S32_LE format as supported.
Adapt ADV7511 HDMI I2S format list to expose formats actually supported.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250108170356.413063-4-olivier.moysan@foss.st.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
4 months agoASoC: hdmi-codec: allow to refine formats actually supported
Olivier Moysan [Wed, 8 Jan 2025 17:03:55 +0000 (18:03 +0100)]
ASoC: hdmi-codec: allow to refine formats actually supported

Currently the hdmi-codec driver registers all the formats that are
allowed on the I2S bus. Add i2s_formats field to codec data, to allow
the hdmi codec client to refine the list of the audio I2S formats
actually supported.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250108170356.413063-3-olivier.moysan@foss.st.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
4 months agodrm: bridge: adv7511: fill stream capabilities
Olivier Moysan [Wed, 8 Jan 2025 17:03:54 +0000 (18:03 +0100)]
drm: bridge: adv7511: fill stream capabilities

Set no_i2s_capture and no_spdif_capture flags in hdmi_codec_pdata structure
to report that the ADV7511 HDMI bridge does not support i2s or spdif audio
capture.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250108170356.413063-2-olivier.moysan@foss.st.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
4 months agodrm/nouveau: consume the return of large GSP message
Zhi Wang [Fri, 24 Jan 2025 18:29:58 +0000 (10:29 -0800)]
drm/nouveau: consume the return of large GSP message

As the GSP message recv path is able to handle the return of large GSP
message, consume the return of large GSP message in the sending path.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-16-zhiw@nvidia.com
4 months agodrm/nouveau: support handling the return of large GSP message
Zhi Wang [Fri, 24 Jan 2025 18:29:57 +0000 (10:29 -0800)]
drm/nouveau: support handling the return of large GSP message

The max GSP message element size is 16 pages (including the headers). To
send a message larger than 16 pages, nvkm should split it into multiple
and send them accordingly. The first element has the expected function
number, while the rest are sent with function number as
NV_VGPU_MSG_FUNCTION_CONTINUATION_RECORD. GSP consumes the elements from
the cmdq and always writes the result back to the msgq. The result is also
formed as split elements.

However, nvkm is able to split the large GSP message and send them, but
totally not aware of handling the return of the large GSP message, which
are the split elements in the msgq. Thus, it keeps dumping the unknown RPC
messages from msgq, which is actually CONTINUATION_RECORD message,
discard them unexpectedly. Thus, the caller will not be able to consume
the result from GSP.

Introduce the handling of the return of large GSP message on the msgq path.
Slightly re-factor the low-level part of msg receiving routines. Merge the
split elements back into a large element before handling it to the upper
level. Thus, the upper-level of GSP RPC APIs don't need to be heavily
changed.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-15-zhiw@nvidia.com
4 months agodrm/nouveau: factor out r535_gsp_msgq_recv_one_elem()
Zhi Wang [Fri, 24 Jan 2025 18:29:56 +0000 (10:29 -0800)]
drm/nouveau: factor out r535_gsp_msgq_recv_one_elem()

Prepare for supporting receive the large GSP RPC message.

Factor out r535_gsp_msgq_recv_one_elem(). Fold its params into a data
structure of params. Move the allocation of the GSP RPC message to its
caller. Refine the variable names in the re-factor.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-14-zhiw@nvidia.com
4 months agodrm/nouveau: factor out r535_gsp_msgq_peek()
Zhi Wang [Fri, 24 Jan 2025 18:29:55 +0000 (10:29 -0800)]
drm/nouveau: factor out r535_gsp_msgq_peek()

To receive a GSP message queue element from the GSP status queue, the
driver needs to make sure there are available elements in the queue.

The previous r535_gsp_msgq_wait() consists of three functions, which is
a little too complicated for a single function:
- wait for an available element.
- peek the message element header in the queue.
- recevice the element from the queue.

Factor out r535_gsp_msgq_peek() and divide the functions in
r535_gsp_msgq_wait() into three functions.

No functional change is intended.

Cc: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-13-zhiw@nvidia.com
4 months agodrm/nouveau: rename the variable "cmd" to "msg" in r535_gsp_cmdq_{get, push}()
Zhi Wang [Fri, 24 Jan 2025 18:29:54 +0000 (10:29 -0800)]
drm/nouveau: rename the variable "cmd" to "msg" in r535_gsp_cmdq_{get, push}()

Refine the name to align with the terms in the kernel doc.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-12-zhiw@nvidia.com
4 months agodrm/nouveau: refine the variable names in r535_gsp_msg_recv()
Zhi Wang [Fri, 24 Jan 2025 18:29:53 +0000 (10:29 -0800)]
drm/nouveau: refine the variable names in r535_gsp_msg_recv()

The variable "msg" in r535_gsp_msg_recv() actually means the GSP RPC.

Refine the names to align with the terms in the kernel doc.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-11-zhiw@nvidia.com
4 months agodrm/nouveau: refine the variable names in r535_gsp_rpc_push()
Zhi Wang [Fri, 24 Jan 2025 18:29:52 +0000 (10:29 -0800)]
drm/nouveau: refine the variable names in r535_gsp_rpc_push()

The variable names in r535_gsp_rpc_push() are quite confusing and some
of them are not representing what they really are.

Update the names and explanations in the decoder section of the
kernel doc. Refine the names to align with the terms in the kernel doc.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-10-zhiw@nvidia.com
4 months agodrm/nouveau: remove the magic number in r535_gsp_rpc_push()
Zhi Wang [Fri, 24 Jan 2025 18:29:51 +0000 (10:29 -0800)]
drm/nouveau: remove the magic number in r535_gsp_rpc_push()

There has been a GSP_MSG_MAX_SIZE which represents the max size of a GSP
message element header. Use it instead of a magic number.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-9-zhiw@nvidia.com
4 months agodrm/nouveau: fix the broken marco GSP_MSG_MAX_SIZE
Zhi Wang [Fri, 24 Jan 2025 18:29:50 +0000 (10:29 -0800)]
drm/nouveau: fix the broken marco GSP_MSG_MAX_SIZE

The macro GSP_MSG_MAX_SIZE refers to another macro that doesn't exist.
It represents the max GSP message element size.

Fix the broken marco so it can be used to replace some magic numbers in
the code.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-8-zhiw@nvidia.com
4 months agodrm/nouveau: rename "argc" to what it represents in GSP RPC routines
Zhi Wang [Fri, 24 Jan 2025 18:29:49 +0000 (10:29 -0800)]
drm/nouveau: rename "argc" to what it represents in GSP RPC routines

The name "argc" has different meanings in different functions.

To improve the readability, it's better to refine it to a name that
reflects what it represents.

Rename "argc" to what it represents. Add terms in the decoder section to
explain their meaning.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
[ Fix indentation. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-7-zhiw@nvidia.com
4 months agodrm/nouveau: rename "argv" to what it represents in *rm_{alloc, ctrl}_*()
Zhi Wang [Fri, 24 Jan 2025 18:29:48 +0000 (10:29 -0800)]
drm/nouveau: rename "argv" to what it represents in *rm_{alloc, ctrl}_*()

The name "argv" has different meanings in different functions.

To improve the readability, it's better to refine it to a name that
reflects what it represents.

Rename "argv" to what it represents. Wrap the long container_of() into
to_payload_header() to denote a clear meaning and make checkpatch.pl
happy.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-6-zhiw@nvidia.com
4 months agodrm/nouveau: remove unused param repc in *rm_alloc_push()
Zhi Wang [Fri, 24 Jan 2025 18:29:47 +0000 (10:29 -0800)]
drm/nouveau: remove unused param repc in *rm_alloc_push()

The user of *rm_alloc_push() always pass 0 in repc.

Remove unused param repc since no user actually uses it.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-5-zhiw@nvidia.com
4 months agodrm/nouveau: rename "argv" to what it represents on the GSP message send path
Zhi Wang [Fri, 24 Jan 2025 18:29:46 +0000 (10:29 -0800)]
drm/nouveau: rename "argv" to what it represents on the GSP message send path

The name "argv" has different meanings in different functions.

To improve the readability, it's better to refine it to a name that
reflects what it represents.

Rename "repc" to what it represents in the GSP message send path.
Wrap the long container_of() into to_gsp_hdr() to make checkpatch.pl
happy.

No functional change is intended.

Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-4-zhiw@nvidia.com
4 months agodrm/nouveau: rename "repc" to "gsp_rpc_len" on the GSP message recv path
Zhi Wang [Fri, 24 Jan 2025 18:29:45 +0000 (10:29 -0800)]
drm/nouveau: rename "repc" to "gsp_rpc_len" on the GSP message recv path

The name "repc" has different meanings in different contexts.

To improve the readability, it's better to refine it to a name that
reflects what it actually represents.

Rename "repc" to "gsp_rpc_len" in the GSP message recv path. Add an
section in the doc to explain the terms.

No functional change is intended.

Cc: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-3-zhiw@nvidia.com
4 months agodrm/nouveau: add a kernel doc to introduce the GSP RPC
Zhi Wang [Fri, 24 Jan 2025 18:29:44 +0000 (10:29 -0800)]
drm/nouveau: add a kernel doc to introduce the GSP RPC

In order to explain the name clean-ups in GSP RPC routines, a kernel
doc to explain the memory layout and terms is required.

Add a kernel doc to introduce the GSP RPC.

Cc: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
[ Fix bullet list indentation; add SPDX-License-Identifier. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124182958.2040494-2-zhiw@nvidia.com
4 months agodrm/dp_mst: Add helper to get port number at specific LCT from RAD
Wayne Lin [Mon, 13 Jan 2025 09:11:00 +0000 (17:11 +0800)]
drm/dp_mst: Add helper to get port number at specific LCT from RAD

Add a helper drm_dp_mst_get_ufp_num_at_lct_from_rad() to extract the up
facing port number at specific link count from the RAD. Use the added
helper in drm_dp_mst_rad_to_str() & drm_dp_get_mst_branch_device() to
unify the implementation.

V2:
- Adjust the code format (Lyude)

V3:
- Adjust parameter "rad" of drm_dp_mst_get_ufp_num_at_lct_from_rad() to
be constant (Kernel test robot)

Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Lyude Paul <lyude@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
[fixed commit message typo]
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113091100.3314533-3-Wayne.Lin@amd.com
4 months agodrm/dp_mst: Fix drm RAD print
Wayne Lin [Mon, 13 Jan 2025 09:10:59 +0000 (17:10 +0800)]
drm/dp_mst: Fix drm RAD print

[Why]
The RAD of sideband message printed today is incorrect.
For RAD stored within MST branch
- If MST branch LCT is 1, it's RAD array is untouched and remained as 0.
- If MST branch LCT is larger than 1, use nibble to store the up facing
  port number in cascaded sequence as illustrated below:

  u8 RAD[0] = (LCT_2_UFP << 4) | LCT_3_UFP
     RAD[1] = (LCT_4_UFP << 4) | LCT_5_UFP
     ...

In drm_dp_mst_rad_to_str(), it wrongly to use BIT_MASK(4) to fetch the port
number of one nibble.

[How]
Adjust the code by:
- RAD array items are valuable only for LCT >= 1.
- Use 0xF as the mask to replace BIT_MASK(4)

V2:
- Document how RAD is constructed (Imre)

V3:
- Adjust the comment for rad[] so kdoc formats it properly (Lyude)

Fixes: 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing + selftests")
Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Lyude Paul <lyude@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113091100.3314533-2-Wayne.Lin@amd.com
4 months agodrm/panel: samsung-s6e88a0-ams452ef01: transition to mipi_dsi wrapped functions
Tejas Vipin [Wed, 22 Jan 2025 03:11:10 +0000 (08:41 +0530)]
drm/panel: samsung-s6e88a0-ams452ef01: transition to mipi_dsi wrapped functions

Changes the samsung-s6e88a0-ams452ef01 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>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250122031110.286079-1-tejasvipin76@gmail.com
4 months agodrm/virtio: Support partial maps of GEM objects
Sasha Finkelstein [Thu, 9 Jan 2025 21:45:46 +0000 (22:45 +0100)]
drm/virtio: Support partial maps of GEM objects

Those are useful to implement coherent cross-vm mmap.

Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250109-virtgpu-gem-partial-map-v1-1-a914b48776bd@gmail.com
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
[dmitry.osipenko@collabora.com: Corrected vm_size check to account vm_pgoff]

5 months agodrm: add modifiers for MediaTek tiled formats
Eric R. Smith [Thu, 19 Dec 2024 17:49:28 +0000 (13:49 -0400)]
drm: add modifiers for MediaTek tiled formats

MediaTek (MTK) uses some unique tiled memory formats
for video decoding. Add these to the uapi drm_fourcc.h
so that we can use them in Mesa, GStreamer, and other
tools/libraries.

v2:
- Classify the modifier bits into categories and provide
  room for expansion (Daniel S.)

Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241219174929.126205-1-eric.smith@collabora.com
Signed-off-by: Daniel Stone <daniels@collabora.com>
5 months agodrm/tidss: Fix typos
Andrew Kreimer [Thu, 12 Sep 2024 12:57:24 +0000 (15:57 +0300)]
drm/tidss: Fix typos

Fix typos in comments.

Reported-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Kreimer <algonell@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240912125735.45114-1-algonell@gmail.com
5 months agodrm/omap: Remove hdmi5_core_handle_irqs()
Dr. David Alan Gilbert [Wed, 18 Dec 2024 02:01:24 +0000 (02:01 +0000)]
drm/omap: Remove hdmi5_core_handle_irqs()

hdmi5_core_handle_irqs() is a function that was copied from omapdss by
commit f76ee892a99e ("omapfb: copy omapdss & displays for omapfb")

but it wasn't used in the original anyway.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241218020124.278925-1-linux@treblig.org
5 months agodrm/omap/dss: Use syscon_regmap_lookup_by_phandle_args
Krzysztof Kozlowski [Tue, 14 Jan 2025 14:58:40 +0000 (15:58 +0100)]
drm/omap/dss: Use syscon_regmap_lookup_by_phandle_args

Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
syscon_regmap_lookup_by_phandle() combined with getting the syscon
argument.  Except simpler code this annotates within one line that given
phandle has arguments, so grepping for code would be easier.

There is also no real benefit in printing errors on missing syscon
argument, because this is done just too late: runtime check on
static/build-time data.  Dtschema and Devicetree bindings offer the
static/build-time check for this already.

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250114145840.505459-2-krzysztof.kozlowski@linaro.org
5 months agodrm/omap/dss: Use of_property_present() to test existence of DT property
Krzysztof Kozlowski [Tue, 14 Jan 2025 14:58:39 +0000 (15:58 +0100)]
drm/omap/dss: Use of_property_present() to test existence of DT property

of_property_read_bool() should be used only on boolean properties.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250114145840.505459-1-krzysztof.kozlowski@linaro.org
5 months agodrm/panel-edp: Add STA 116QHD024002
Langyan Ye [Thu, 23 Jan 2025 11:20:55 +0000 (19:20 +0800)]
drm/panel-edp: Add STA 116QHD024002

Add support for the STA 116QHD024002, pleace the EDID here for
subsequent reference.

00 ff ff ff ff ff ff 00 4e 81 09 00 00 00 00 00
26 21 01 04 a5 1a 0e 78 02 1e b5 9a 5f 57 94 26
0f 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 8e 1c 56 a0 50 00 1e 30 28 20
55 00 00 90 10 00 00 18 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 fe 00 20
20 20 20 20 20 0a 20 20 20 20 20 20 00 00 00 fe
00 31 31 36 51 48 44 30 32 34 30 30 32 0a 00 3b

Signed-off-by: Langyan Ye <yelangyan@huaqin.corp-partner.google.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250123112055.1521471-1-yelangyan@huaqin.corp-partner.google.com
5 months agodrm/atomic-helper: document drm_atomic_helper_check() restrictions
Dmitry Baryshkov [Sun, 22 Dec 2024 05:00:41 +0000 (07:00 +0200)]
drm/atomic-helper: document drm_atomic_helper_check() restrictions

The drm_atomic_helper_check() calls drm_atomic_helper_check_modeset()
insternally. Document that corresponding restrictions also apply to the
drivers that call the former function (as it's easy to miss the
documentation for the latter function).

Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241222-drm-dirty-modeset-v1-1-0e76a53eceb9@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
5 months agodrm/bridge: adv7511: Switch to atomic operations
Jesse Van Gavere [Mon, 6 Jan 2025 12:10:54 +0000 (13:10 +0100)]
drm/bridge: adv7511: Switch to atomic operations

Use the atomic version of enable/disable.

To support bridges where bus format negotiation is needed such as TIDSS we
need to implement atomic_get_input_bus_fmts, prepare the driver for this by
switching the existing operations to it's atomic variants.

Signed-off-by: Jesse Van Gavere <jesseevg@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250106121054.96739-1-jesseevg@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
5 months agodrm/ast: Only warn about unsupported TX chips on Gen4 and later
Thomas Zimmermann [Fri, 17 Jan 2025 10:29:13 +0000 (11:29 +0100)]
drm/ast: Only warn about unsupported TX chips on Gen4 and later

Only Gen4 and later read the installed TX chip from the SoC. So only
warn on those generations about unsupported chips.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117103450.28692-9-tzimmermann@suse.de
5 months agodrm/ast: Merge TX-chip detection code for Gen4 and later
Thomas Zimmermann [Fri, 17 Jan 2025 10:29:12 +0000 (11:29 +0100)]
drm/ast: Merge TX-chip detection code for Gen4 and later

Gens 4 to 6 and Gen7 use the same pattern for detecting the installed
TX chips. Merge the code into a single branch.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117103450.28692-8-tzimmermann@suse.de
5 months agodrm/ast: Align Gen1 DVO detection to register manual
Thomas Zimmermann [Fri, 17 Jan 2025 10:29:11 +0000 (11:29 +0100)]
drm/ast: Align Gen1 DVO detection to register manual

Align variable names and register constants for TX-chip detection
to the names in the register manual.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117103450.28692-7-tzimmermann@suse.de
5 months agodrm/ast: Hide Gens 1 to 3 TX detection in branch
Thomas Zimmermann [Fri, 17 Jan 2025 10:29:10 +0000 (11:29 +0100)]
drm/ast: Hide Gens 1 to 3 TX detection in branch

Gen7 only supports ASTDP. Gens 4 to 6 support various TX chips,
except ASTDP. These boards detect the TX chips by reading the SoC
scratch register as VGACRD1.

Gens 1 to 3 only support SIL164. These boards read the DVO bit from
VGACRA3. Hence move this test behind a branch, so that it does not
run on later generations.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117103450.28692-6-tzimmermann@suse.de
5 months agodrm/ast: Initialize ASTDP in ast_post_gpu()
Thomas Zimmermann [Fri, 17 Jan 2025 10:29:09 +0000 (11:29 +0100)]
drm/ast: Initialize ASTDP in ast_post_gpu()

Remove the call to ast_dp_launch() from ast_detect_tx_chip() and
perform it unconditionally in ast_post_gpu().

Also add error handling: the detection code apparently used
ast_dp_launch() to test for a working ASTDP, falling back to VGA on
errors. As the VBIOS reports ASTDP, silently ignoring errors is
questionable behavior. With the refactoring, failing to initialize
the ASTDP will also fail probing the driver.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117103450.28692-5-tzimmermann@suse.de
5 months agodrm/ast: Refactor ast_post_gpu() by Gen
Thomas Zimmermann [Fri, 17 Jan 2025 10:29:08 +0000 (11:29 +0100)]
drm/ast: Refactor ast_post_gpu() by Gen

Reorganize ast_post_gpu() so that it first branches by Gen and then
by config mode and TX chip. This will later make it possible to split
up the function by Gen.

The helper ast_init_3rdtx() only handles Gen4 and Gen5, so leave it
out from the other Gens.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117103450.28692-4-tzimmermann@suse.de
5 months agodrm/ast: Detect DRAM before TX-chip
Thomas Zimmermann [Fri, 17 Jan 2025 10:29:07 +0000 (11:29 +0100)]
drm/ast: Detect DRAM before TX-chip

Move DRAM detection before TX-chip detection. Both steps are independent
from each other. Detection of the TX-chip is now next to posting those
chips, which can be done in a single step.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117103450.28692-3-tzimmermann@suse.de
5 months agodrm/ast: Detect wide-screen support before creating modeset pipeline
Thomas Zimmermann [Fri, 17 Jan 2025 10:29:06 +0000 (11:29 +0100)]
drm/ast: Detect wide-screen support before creating modeset pipeline

Wide-screen support is relevant for mode validation. Do not detect it
before setting up the mode-setting pipeline. Gets the function call out
of the way of other initialization code.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117103450.28692-2-tzimmermann@suse.de
5 months agodrm/vkms: Switch to dynamic allocation for CRTC
Louis Chauvet [Fri, 17 Jan 2025 09:04:29 +0000 (10:04 +0100)]
drm/vkms: Switch to dynamic allocation for CRTC

A specific allocation for the CRTC is not strictly necessary at this
point, but in order to implement dynamic configuration of VKMS (configFS),
it will be easier to have one allocation per CRTC.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117-b4-vkms-allocated-v4-3-8ec8fd21aaf6@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm/vkms: Switch to dynamic allocation for encoder
Louis Chauvet [Fri, 17 Jan 2025 09:04:28 +0000 (10:04 +0100)]
drm/vkms: Switch to dynamic allocation for encoder

A specific allocation for the encoder is not strictly necessary  at this
point, but in order to implement dynamic configuration of VKMS (configFS),
it will be easier to have one allocation per encoder.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117-b4-vkms-allocated-v4-2-8ec8fd21aaf6@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm/vkms: Switch to dynamic allocation for connector
Louis Chauvet [Fri, 17 Jan 2025 09:04:27 +0000 (10:04 +0100)]
drm/vkms: Switch to dynamic allocation for connector

A specific allocation for the connector is not strictly necessary
at this point, but in order to implement dynamic configuration of
VKMS (configFS), it will be easier to have one allocation per
connector.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117-b4-vkms-allocated-v4-1-8ec8fd21aaf6@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm/vkms: Switch to managed for writeback connector
Louis Chauvet [Thu, 16 Jan 2025 17:47:20 +0000 (18:47 +0100)]
drm/vkms: Switch to managed for writeback connector

The current VKMS driver uses non-managed function to create
writeback connectors. It is not an issue yet, but in order
to support multiple devices easily, convert this code to
use drm and device managed helpers.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116-google-vkms-managed-v9-8-3e4ae1bd05a0@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm: writeback: Create drmm variants for drm_writeback_connector initialization
Louis Chauvet [Thu, 16 Jan 2025 17:47:19 +0000 (18:47 +0100)]
drm: writeback: Create drmm variants for drm_writeback_connector initialization

To allows driver to only use drmm objects, add helper to create
drm_writeback_connectors with automated lifetime management.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116-google-vkms-managed-v9-7-3e4ae1bd05a0@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm: writeback: Add missing cleanup in case of initialization failure
Louis Chauvet [Thu, 16 Jan 2025 17:47:18 +0000 (18:47 +0100)]
drm: writeback: Add missing cleanup in case of initialization failure

The current implementation of drm_writeback_connector initialization does
not properly clean up all resources in case of failure (allocated
properties and possible_encoders). Add this cleaning in case of failure.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116-google-vkms-managed-v9-6-3e4ae1bd05a0@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm: writeback: Create an helper for drm_writeback_connector initialization
Louis Chauvet [Thu, 16 Jan 2025 17:47:17 +0000 (18:47 +0100)]
drm: writeback: Create an helper for drm_writeback_connector initialization

As the old drm and the new drmm variants of drm_writeback_connector
requires almost the same initialization, create an internal helper to do
most of the initialization work.

Currently there is no cleanup function for writeback connectors. To allows
implementation of drmm variant of writeback connector, create a cleanup
function that can be used to properly remove all the writeback-specific
properties and allocations.

This also introduce an helper to cleanup only the drm_writeback_connector
properties, so it can be used during initialization to cleanup in case of
failure.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116-google-vkms-managed-v9-5-3e4ae1bd05a0@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm/vkms: Switch to managed for crtc
Louis Chauvet [Thu, 16 Jan 2025 17:47:16 +0000 (18:47 +0100)]
drm/vkms: Switch to managed for crtc

The current VKMS driver uses managed function to create crtc, but
don't use it to properly clean the crtc workqueue. It is not an
issue yet, but in order to support multiple devices easily,
convert this code to use drm and device managed helpers.

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116-google-vkms-managed-v9-4-3e4ae1bd05a0@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm/managed: Add DRM-managed alloc_ordered_workqueue
Louis Chauvet [Thu, 16 Jan 2025 17:47:15 +0000 (18:47 +0100)]
drm/managed: Add DRM-managed alloc_ordered_workqueue

Add drmm_alloc_ordered_workqueue(), a helper that provides managed ordered
workqueue cleanup. The workqueue will be destroyed with the final
reference of the DRM device.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116-google-vkms-managed-v9-3-3e4ae1bd05a0@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm/vkms: Switch to managed for encoder
Louis Chauvet [Thu, 16 Jan 2025 17:47:14 +0000 (18:47 +0100)]
drm/vkms: Switch to managed for encoder

The current VKMS driver uses non-managed function to create encoders. It
is not an issue yet, but in order to support multiple devices easily,
convert this code to use drm and device managed helpers.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116-google-vkms-managed-v9-2-3e4ae1bd05a0@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm/vkms: Switch to managed for connector
Louis Chauvet [Thu, 16 Jan 2025 17:47:13 +0000 (18:47 +0100)]
drm/vkms: Switch to managed for connector

The current VKMS driver uses non-managed function to create connectors. It
is not an issue yet, but in order to support multiple devices easily,
convert this code to use drm and device managed helpers.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116-google-vkms-managed-v9-1-3e4ae1bd05a0@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
5 months agodrm/imagination: Use the drm_sched_job_has_dependency helper
Tvrtko Ursulin [Mon, 13 Jan 2025 10:33:41 +0000 (10:33 +0000)]
drm/imagination: Use the drm_sched_job_has_dependency helper

Instead of manually peeking into the DRM scheduler implementation details
lets use the previously added helper.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <pstanner@redhat.com>
Cc: Frank Binns <frank.binns@imgtec.com>
Cc: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113103341.43914-2-tvrtko.ursulin@igalia.com
5 months agodrm/sched: Add helper to check job dependencies
Tvrtko Ursulin [Mon, 13 Jan 2025 10:33:40 +0000 (10:33 +0000)]
drm/sched: Add helper to check job dependencies

Lets isolate scheduler internals from drivers such as pvr which currently
walks the dependency array to look for fences.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113103341.43914-1-tvrtko.ursulin@igalia.com
5 months agodrm/vc4: Remove BOs seqnos
Maíra Canal [Fri, 20 Dec 2024 13:37:09 +0000 (10:37 -0300)]
drm/vc4: Remove BOs seqnos

`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 <mcanal@igalia.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241220134204.634577-4-mcanal@igalia.com
5 months agodrm/vc4: Use DMA Resv to implement VC4 wait BO IOCTL
Maíra Canal [Fri, 20 Dec 2024 13:37:08 +0000 (10:37 -0300)]
drm/vc4: Use DMA Resv to implement VC4 wait BO IOCTL

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 <mcanal@igalia.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241220134204.634577-3-mcanal@igalia.com
5 months agodrm/vc4: Use DRM Execution Contexts
Maíra Canal [Fri, 20 Dec 2024 13:37:07 +0000 (10:37 -0300)]
drm/vc4: Use DRM Execution Contexts

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 <mcanal@igalia.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241220134204.634577-2-mcanal@igalia.com
5 months agodrm/virtio: Don't return error if virtio-gpu PCI dev is not found
Vivek Kasireddy [Tue, 14 Jan 2025 07:57:59 +0000 (23:57 -0800)]
drm/virtio: Don't return error if virtio-gpu PCI dev is not found

While fixing a shared VGA resource ownership issue, commit 5dd8b536bbda
("drm/virtio: Lock the VGA resources during initialization") wrongly
assumed that there is always a PCI device associated with virtio-gpu
and it would return error if this device is not found during init.

This is incorrect, as virtio-gpu can be operated in MMIO mode (M68K)
where a PCI device would probably not be created for it. Therefore,
fix this issue by not erroring out if the associated PCI device is
not found during initialization.

Fixes: 5dd8b536bbda ("drm/virtio: Lock the VGA resources during initialization")
Suggested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250114075759.2616551-1-vivek.kasireddy@intel.com
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250114075759.2616551-1-vivek.kasireddy@intel.com
5 months agodrm/panel-edp: Add BOE NV140FHM-NZ panel entry
Andy Yan [Fri, 17 Jan 2025 01:00:29 +0000 (09:00 +0800)]
drm/panel-edp: Add BOE NV140FHM-NZ panel entry

Add an eDP panel entry for BOE NV140FHM-NZ.

No datasheet found for this panel, so the timing
is based on a similar NV140FHM-N41 datasheet that
I can find on internet[0].

edid:
00 ff ff ff ff ff ff 00 09 e5 09 0b 00 00 00 00
01 20 01 04 a5 1f 11 78 03 9b 75 99 5b 5d 8f 2a
23 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 c8 37 80 cc 70 38 28 40 6c 30
aa 00 35 ae 10 00 00 1a 00 00 00 fd 00 30 3c 43
43 8f 01 0a 20 20 20 20 20 20 00 00 00 fe 00 42
4f 45 20 48 46 0a 20 20 20 20 20 20 00 00 00 fe
00 4e 56 31 34 30 46 48 4d 2d 4e 34 5a 0a 00 35

[0]:http://www.tfinno.com/PIC/PIC/20215121628440.pdf

Signed-off-by: Andy Yan <andyshrk@163.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250117010039.1815430-1-andyshrk@163.com
5 months agoaccel/qaic: Change aic100_image_table definition
Youssef Samir [Fri, 13 Dec 2024 18:51:10 +0000 (11:51 -0700)]
accel/qaic: Change aic100_image_table definition

aic100_image_table is currently defined as a "const char *" array,
this can potentially lead to the accidental modification of the
pointers inside. Also, checkpatch.pl gives a warning about it.

Change the type to a "const char * const" array to make the pointers
immutable, preventing accidental modification of the images' paths.

Signed-off-by: Youssef Samir <quic_yabdulra@quicinc.com>
Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241213185110.2469159-1-quic_jhugo@quicinc.com
5 months agoMAINTAINERS: Update intel_vpu maintainer list
Jacek Lawrynowicz [Tue, 14 Jan 2025 08:44:36 +0000 (09:44 +0100)]
MAINTAINERS: Update intel_vpu maintainer list

Slawek moved to another project and Maciej will be replacing him.

Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250114084436.1326127-1-jacek.lawrynowicz@linux.intel.com
5 months agoMAINTAINERS: Add DRM GPU Scheduler reviewer
Philipp Stanner [Mon, 13 Jan 2025 12:18:51 +0000 (13:18 +0100)]
MAINTAINERS: Add DRM GPU Scheduler reviewer

Christian König is the original author of much of the scheduler's code
and, thus, well suited to do reviews.

Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113121851.31382-2-phasta@kernel.org
5 months agoMAINTAINERS: Update DRM GPU Scheduler section
Philipp Stanner [Mon, 13 Jan 2025 12:18:50 +0000 (13:18 +0100)]
MAINTAINERS: Update DRM GPU Scheduler section

Luben has not been active and has not responded to mails since summer
2024. Remove him from MAINTAINERS and add an entry in CREDITS.

Philipp has a new email address and an ACK to commit work time to the
scheduler. Thus, set the state to 'Supported'.

Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113121851.31382-1-phasta@kernel.org
5 months agodrm/sched: Remove weak paused submission checks
Tvrtko Ursulin [Tue, 14 Jan 2025 10:59:42 +0000 (10:59 +0000)]
drm/sched: Remove weak paused submission checks

There is no need to check the boolean in the work item's prologues since
the boolean can be set at any later time anyway.

The helper which pauses submission sets it and synchronously cancels the
work and helpers which queue the work check for the flag so all should be
good.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250114105942.64832-1-tvrtko.ursulin@igalia.com
5 months agodrm/ssd130x: ensure ssd132x pitch is correct
John Keeping [Wed, 15 Jan 2025 11:01:38 +0000 (11:01 +0000)]
drm/ssd130x: ensure ssd132x pitch is correct

The bounding rectangle is adjusted to ensure it aligns to
SSD132X_SEGMENT_WIDTH, which may adjust the pitch.  Calculate the pitch
after aligning the left and right edge.

Fixes: fdd591e00a9c ("drm/ssd130x: Add support for the SSD132x OLED controller family")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250115110139.1672488-3-jkeeping@inmusicbrands.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
5 months agodrm/ssd130x: fix ssd132x encoding
John Keeping [Wed, 15 Jan 2025 11:01:37 +0000 (11:01 +0000)]
drm/ssd130x: fix ssd132x encoding

The ssd132x buffer is encoded one pixel per nibble, with two pixels in
each byte.  When encoding an 8-bit greyscale input, take the top 4-bits
as the value and ensure the two pixels are distinct and do not overwrite
each other.

Fixes: fdd591e00a9c ("drm/ssd130x: Add support for the SSD132x OLED controller family")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250115110139.1672488-2-jkeeping@inmusicbrands.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
5 months agodrm/tests/buddy: fix build with unused prng
Matthew Auld [Wed, 15 Jan 2025 12:49:42 +0000 (12:49 +0000)]
drm/tests/buddy: fix build with unused prng

We no longer use the prng, which leads to the following warning:

drivers/gpu/drm/tests/drm_buddy_test.c: In function
‘drm_test_buddy_alloc_clear’:
drivers/gpu/drm/tests/drm_buddy_test.c:264:23: error: unused variable
‘prng’ [-Werror=unused-variable]
  264 |         DRM_RND_STATE(prng, random_seed);

v2 (Thomas)
 - Add Closes links

Reported-by: Jani Nikula <jani.nikula@intel.com>
Closes: https://lore.kernel.org/dri-devel/875xmggvcs.fsf@intel.com/
Reported-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Closes: https://lore.kernel.org/dri-devel/3f816555e6913fdbcb254523f65c98088d70581b.camel@intel.com/
Fixes: 8cb3a1e2b350 ("drm/buddy: Add a testcase to verify the multiroot fini")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250115124941.155990-2-matthew.auld@intel.com
5 months agodrm/v3d: Remove `v3d->cpu_job`
Maíra Canal [Mon, 13 Jan 2025 15:47:41 +0000 (12:47 -0300)]
drm/v3d: Remove `v3d->cpu_job`

CPU jobs, like Cache Clean jobs, execute synchronously once the DRM
scheduler starts running them. Consequently, a global `v3d->cpu_job`
variable is unnecessary, as everything is managed within the
`v3d_cpu_job_run()` function.

This commit removes the `v3d->cpu_job` pointer, as it is not needed.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113154741.67520-2-mcanal@igalia.com
5 months agodrm/atomic: clarify the rules around drm_atomic_state->allow_modeset
Simona Vetter [Wed, 8 Jan 2025 17:24:16 +0000 (18:24 +0100)]
drm/atomic: clarify the rules around drm_atomic_state->allow_modeset

msm is automagically upgrading normal commits to full modesets, and
that's a big no-no:

- for one this results in full on->off->on transitions on all these
  crtc, at least if you're using the usual helpers. Which seems to be
  the case, and is breaking uapi

- further even if the ctm change itself would not result in flicker,
  this can hide modesets for other reasons. Which again breaks the
  uapi

v2: I forgot the case of adding unrelated crtc state. Add that case
and link to the existing kerneldoc explainers. This has come up in an
irc discussion with Manasi and Ville about intel's bigjoiner mode.
Also cc everyone involved in the msm irc discussion, more people
joined after I sent out v1.

v3: Wording polish from Pekka and Thomas

Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: Manasi Navare <navaremanasi@google.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Simona Vetter <simona.vetter@intel.com>
Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20250108172417.160831-1-simona.vetter@ffwll.ch
5 months agodrm/buddy: Add a testcase to verify the multiroot fini
Arunpravin Paneer Selvam [Thu, 26 Dec 2024 07:01:16 +0000 (12:31 +0530)]
drm/buddy: Add a testcase to verify the multiroot fini

- Added a testcase to verify the multiroot force merge fini.
- Added a new field in_use to track the mm freed status.

v2:(Matthew)
  - Add kunit_fail_current_test() when WARN_ON is true.

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Signed-off-by: Lin.Cao <lincao12@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241226070116.309290-2-Arunpravin.PaneerSelvam@amd.com
5 months agodrm/buddy: fix issue that force_merge cannot free all roots
Lin.Cao [Thu, 26 Dec 2024 07:01:15 +0000 (12:31 +0530)]
drm/buddy: fix issue that force_merge cannot free all roots

If buddy manager have more than one roots and each root have sub-block
need to be free. When drm_buddy_fini called, the first loop of
force_merge will merge and free all of the sub block of first root,
which offset is 0x0 and size is biggest(more than have of the mm size).
In subsequent force_merge rounds, if we use 0 as start and use remaining
mm size as end, the block of other roots will be skipped in
__force_merge function. It will cause the other roots can not be freed.

Solution: use roots' offset as the start could fix this issue.

Signed-off-by: Lin.Cao <lincao12@amd.com>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241226070116.309290-1-Arunpravin.PaneerSelvam@amd.com
5 months agodrm/probe-helper: Call connector detect functions in single helper
Thomas Zimmermann [Mon, 15 Jul 2024 09:38:57 +0000 (11:38 +0200)]
drm/probe-helper: Call connector detect functions in single helper

Move the logic to call the connector's detect helper into a single
internal function. Reduces code dupliction.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240715093936.793552-2-tzimmermann@suse.de
5 months agoaccel/amdxdna: Declare sched_ops as static
Lizhi Hou [Mon, 13 Jan 2025 18:26:17 +0000 (10:26 -0800)]
accel/amdxdna: Declare sched_ops as static

Fix sparse warning:
  symbol 'sched_ops' was not declared. Should it be static?

Fixes: aac243092b70 ("accel/amdxdna: Add command execution")
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113182617.1256094-2-lizhi.hou@amd.com
5 months agoaccel/amdxdna: Remove casting mailbox payload pointer
Lizhi Hou [Mon, 13 Jan 2025 18:26:16 +0000 (10:26 -0800)]
accel/amdxdna: Remove casting mailbox payload pointer

The mailbox payload pointer is void __iomem *. Casting it to u32 * is
incorrect and causes sparse warning.
  cast removes address space '__iomem' of expression

Fixes: b87f920b9344 ("accel/amdxdna: Support hardware mailbox")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501130921.ktqwsMLH-lkp@intel.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113182617.1256094-1-lizhi.hou@amd.com
5 months agodrm/panel-edp: Add Starry 116KHD024006
Douglas Anderson [Thu, 9 Jan 2025 22:28:53 +0000 (14:28 -0800)]
drm/panel-edp: Add Starry 116KHD024006

We have a few reports of sc7180-trogdor-pompom devices that have a
panel in them that IDs as STA 0x0004 and has the following raw EDID:

  00 ff ff ff ff ff ff 00  4e 81 04 00 00 00 00 00
  10 20 01 04 a5 1a 0e 78  0a dc dd 96 5b 5b 91 28
  1f 52 54 00 00 00 01 01  01 01 01 01 01 01 01 01
  01 01 01 01 01 01 8e 1c  56 a0 50 00 1e 30 28 20
  55 00 00 90 10 00 00 18  00 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 fe
  00 31 31 36 4b 48 44 30  32 34 30 30 36 0a 00 e6

We've been unable to locate a datasheet for this panel and our partner
has not been responsive, but all Starry eDP datasheets that we can
find agree on the same timing (delay_100_500_e200) so it should be
safe to use that here instead of the super conservative timings. We'll
still go a little extra conservative and allow `hpd_absent` of 200
instead of 100 because that won't add any real-world delay in most
cases.

We'll associate the string from the EDID ("116KHD024006") with this
panel. Given that the ID is the suspicious value of 0x0004 it seems
likely that Starry doesn't always update their IDs but the string will
still work to differentiate if we ever need to in the future.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250109142853.1.Ibcc3009933fd19507cc9c713ad0c99c7a9e4fe17@changeid
5 months agodrm/panel-edp: Add CSW MNB601LS1-3
Langyan Ye [Fri, 27 Dec 2024 10:19:13 +0000 (18:19 +0800)]
drm/panel-edp: Add CSW MNB601LS1-3

Add support for the CSW MNB601LS1-3, pleace the EDID here for
subsequent reference.

00 ff ff ff ff ff ff 00 0e 77 03 11 00 00 00 00
00 22 01 04 95 1a 0e 78 03 a1 35 9b 5e 58 91 25
1c 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 09 1e 56 dc 50 00 28 30 30 20
36 00 00 90 10 00 00 1a 00 00 00 fd 00 28 3c 30
30 08 01 0a 20 20 20 20 20 20 00 00 00 fe 00 43
53 4f 54 20 54 39 0a 20 20 20 20 20 00 00 00 fe
00 4d 4e 42 36 30 31 4c 53 31 2d 33 0a 20 00 32

Signed-off-by: Langyan Ye <yelangyan@huaqin.corp-partner.google.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241227101913.1711071-1-yelangyan@huaqin.corp-partner.google.com
5 months agodrm/panel-edp: Add B140UAN04.4 and MNE007QS3-7
Langyan Ye [Wed, 25 Dec 2024 02:01:09 +0000 (10:01 +0800)]
drm/panel-edp: Add B140UAN04.4 and MNE007QS3-7

The raw edid for B140UAN04.4 panel is:

00 ff ff ff ff ff ff 00 06 af b3 a7 00 00 00 00
0c 22 01 04 a5 1e 13 78 03 cb 55 91 57 5a 91 29
1c 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 f4 3c 80 b8 70 b0 24 40 10 10
3e 00 2d bc 10 00 00 18 00 00 00 0f 00 00 00 00
00 00 00 00 00 00 00 00 00 20 00 00 00 fe 00 41
55 4f 0a 20 20 20 20 20 20 20 20 20 00 00 00 fe
00 42 31 34 30 55 41 4e 30 34 2e 34 20 0a 01 46

70 20 79 02 00 22 00 14 87 61 02 85 7f 07 b7 00
0f 80 0f 00 af 04 23 00 02 00 0d 00 25 01 09 87
61 02 87 61 02 28 3c 80 81 00 15 74 1a 00 00 03
01 28 3c 00 00 53 50 53 50 3c 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 0b 90

The raw edid for MNE007QS3-7 panel is:

00 ff ff ff ff ff ff 00 0e 77 48 14 00 00 00 00
34 20 01 04 a5 1e 13 78 03 2c c5 94 5c 59 95 29
1e 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 ea 3d 80 c8 70 b0 2e 40 30 20
36 00 2e bd 10 00 00 1a 00 00 00 fd 00 28 3c 4b
4b 10 01 0a 20 20 20 20 20 20 00 00 00 fe 00 43
53 4f 54 20 54 39 0a 20 20 20 20 20 00 00 00 fe
00 4d 4e 45 30 30 37 51 53 33 2d 37 0a 20 00 df

Signed-off-by: Langyan Ye <yelangyan@huaqin.corp-partner.google.com>
[dianders: adjusted sort ordering]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241225020109.1051449-1-yelangyan@huaqin.corp-partner.google.com
5 months agodrm/panel: xinpeng-xpp055c272: transition to mipi_dsi wrapped functions
Tejas Vipin [Tue, 7 Jan 2025 09:25:10 +0000 (14:55 +0530)]
drm/panel: xinpeng-xpp055c272: transition to mipi_dsi wrapped functions

Changes the xinpeng-xpp055c272 panel to use multi style functions for
improved error handling.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250107092510.174089-1-tejasvipin76@gmail.com
5 months agodrm/panel: ebbg-ft8719: transition to mipi_dsi wrapped functions
Tejas Vipin [Mon, 6 Jan 2025 04:11:29 +0000 (09:41 +0530)]
drm/panel: ebbg-ft8719: transition to mipi_dsi wrapped functions

Changes the ebbg-ft8719 panel to use multi style functions for
improved error handling.

Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250106041129.114867-1-tejasvipin76@gmail.com
5 months agodrm/ttm/pool: Restructure the pool allocation code
Thomas Hellström [Tue, 17 Dec 2024 14:58:46 +0000 (15:58 +0100)]
drm/ttm/pool: Restructure the pool allocation code

Simplify the pool allocation code somewhat by merging loop arguments
used by multiple functions together in a struct and simplifying the
loop. Also add documentation.
This hopefully makes the behaviour of the allocation loop
simplier to understand, but above all paves the way for upcoming
restore-while-allocating functionality.

There are no functional changes, but the "allow_pools" bool
introduced to keep current functionality could be removed as a
follow up, which would enable using write-back cached pools when
allocating memory for other caching modes, rather than to resort
to allocating from the system directly.

v15:
- Introduce this patch to simplify the upcoming patch that introduces
  restore while allocating.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241217145852.37342-4-thomas.hellstrom@linux.intel.com
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
5 months agodrm/ttm: Balance ttm_resource_cursor_init() and ttm_resource_cursor_fini()
Thomas Hellström [Tue, 17 Dec 2024 14:58:44 +0000 (15:58 +0100)]
drm/ttm: Balance ttm_resource_cursor_init() and ttm_resource_cursor_fini()

Make the interface more symmetric by providing and using a
ttm_resource_cursor_init().

v10:
- Fix a stray newline (Matthew Brost)
- Update kerneldoc (Matthew Brost)

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241217145852.37342-2-thomas.hellstrom@linux.intel.com
Signed-off-by: Christian König <christian.koenig@amd.com>
5 months agodrm/panthor: Fix a race between the reset and suspend path
Boris Brezillon [Tue, 17 Dec 2024 09:24:57 +0000 (10:24 +0100)]
drm/panthor: Fix a race between the reset and suspend path

If a reset is scheduled when the suspend happens, we drop the
reset-pending info on the floor assuming the resume will fix things,
but the resume logic might try a fast reset. If we're lucky, the
fast reset fails and we fallback to a slow reset, but if the FW was
corrupted in a way that makes it partially functional (it boots but
doesn't quite do what it's expected to do), we won't notice immediately
that things are not working correctly, leading to a new reset further
down the road.

Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241217092457.1582053-1-boris.brezillon@collabora.com
5 months agodrm/sched: Delete unused update_job_credits
Tvrtko Ursulin [Fri, 10 Jan 2025 11:13:01 +0000 (11:13 +0000)]
drm/sched: Delete unused update_job_credits

No driver is using the update_job_credits() schduler vfunc
so lets remove it.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <pstanner@redhat.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Matt Coster <matt.coster@imgtec.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250110111301.76909-1-tvrtko.ursulin@igalia.com
5 months agodrm/panthor: fix all mmu kernel-doc comments
Randy Dunlap [Sat, 11 Jan 2025 06:28:32 +0000 (22:28 -0800)]
drm/panthor: fix all mmu kernel-doc comments

Use the correct format for all kernel-doc comments.
Use structname.membername for named structs.
Don't precede function names in kernel-doc with '@' sign.
Use the correct function parameter names in kernel-doc comments.

This fixes around 80 kernel-doc warnings.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Steven Price <steven.price@arm.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Simona Vetter <simona@ffwll.ch>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250111062832.910495-1-rdunlap@infradead.org
5 months agodrm/panthor: Remove dead code
Florent Tomasin [Tue, 7 Jan 2025 17:33:09 +0000 (17:33 +0000)]
drm/panthor: Remove dead code

Remove unused function declaration in panthor_gem.h:
- `panthor_gem_prime_import_sg_table()`

Remove duplicate macro definitions:
- `MAX_CSG_PRIO`
- `MIN_CS_PER_CSG`
- `MIN_CSGS`

Signed-off-by: Florent Tomasin <florent.tomasin@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250107173310.88329-1-florent.tomasin@arm.com
5 months agodrm/rockchip: Don't change hdmi reference clock rate
Derek Foreman [Tue, 17 Dec 2024 20:17:07 +0000 (14:17 -0600)]
drm/rockchip: Don't change hdmi reference clock rate

The code that changes hdmi->ref_clk was accidentally copied from
downstream code that sets a different clock. We don't actually
want to set any clock here at all.

Setting this clock incorrectly leads to incorrect timings for
DDC, CEC, and HDCP signal generation.

No Fixes listed, as the theoretical timing error in DDC appears to
still be within tolerances and harmless - and HDCP and CEC are not
yet supported.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20241217201708.3320673-1-derek.foreman@collabora.com
5 months agoaccel/amdxdna: Return error when setting clock failed for npu1
Lizhi Hou [Thu, 9 Jan 2025 19:48:11 +0000 (11:48 -0800)]
accel/amdxdna: Return error when setting clock failed for npu1

Due to miss returning error when setting clock, the smatch static
checker reports warning:
  drivers/accel/amdxdna/aie2_smu.c:68 npu1_set_dpm()
  error: uninitialized symbol 'freq'.

Fixes: f4d7b8a6bc8c ("accel/amdxdna: Enhance power management settings")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/dri-devel/202267d0-882e-4593-b58d-be9274592f9b@stanley.mountain/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250109194811.499505-1-lizhi.hou@amd.com
5 months agodrm/nouveau: fix kernel-doc comments
Timur Tabi [Wed, 8 Jan 2025 23:43:29 +0000 (17:43 -0600)]
drm/nouveau: fix kernel-doc comments

Fix some malformed kernel-doc comments that were added in a recent commit.

Also, kernel-doc does not support global variables, so change those
kernel-doc comments into regular comments.

Fixes: 214c9539cf2f ("drm/nouveau: expose GSP-RM logging buffers via debugfs")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412310834.jtCJj4oz-lkp@intel.com/
Signed-off-by: Timur Tabi <ttabi@nvidia.com>
Reviewed-by: Ben Skeggs <bskeggs@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250108234329.842256-1-ttabi@nvidia.com
5 months agodma-fence: Add some more fence-merge-unwrap tests
Tvrtko Ursulin [Fri, 15 Nov 2024 10:21:53 +0000 (10:21 +0000)]
dma-fence: Add some more fence-merge-unwrap tests

So far all tests use seqno one and only vary the context. Lets add some
tests which vary the seqno too.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241115102153.1980-6-tursulin@igalia.com
5 months agodma-buf: add selftest for fence order after merge
Christian König [Fri, 15 Nov 2024 10:21:52 +0000 (10:21 +0000)]
dma-buf: add selftest for fence order after merge

Add a test which double checks that fences are in the expected order
after a merge.

While at it also switch to using a mock array for the complex test
instead of a merge.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241115102153.1980-5-tursulin@igalia.com
5 months agodma-fence: Add a single fence fast path for fence merging
Tvrtko Ursulin [Fri, 15 Nov 2024 10:21:51 +0000 (10:21 +0000)]
dma-fence: Add a single fence fast path for fence merging

Testing some workloads in two different scenarios, such as games running
under Gamescope on a Steam Deck, or vkcube under a Plasma desktop, shows
that in a significant portion of calls the dma_fence_unwrap_merge helper
is called with just a single unsignalled fence.

Therefore it is worthile to add a fast path for that case and so bypass
the memory allocation and insertion sort attempts.

Tested scenarios:

1) Hogwarts Legacy under Gamescope

~1500 calls per second to __dma_fence_unwrap_merge.

Percentages per number of fences buckets, before and after checking for
signalled status, sorting and flattening:

   N       Before      After
   0       0.85%
   1      69.80%        ->   The new fast path.
  2-9     29.36%        9%   (Ie. 91% of this bucket flattened to 1 fence)
 10-19
 20-40
  50+

2) Cyberpunk 2077 under Gamescope

~2400 calls per second.

   N       Before      After
   0       0.71%
   1      52.53%        ->    The new fast path.
  2-9     44.38%      50.60%  (Ie. half resolved to a single fence)
 10-19     2.34%
 20-40     0.06%
  50+

3) vkcube under Plasma

90 calls per second.

   N       Before      After
   0
   1
  2-9      100%         0%   (Ie. all resolved to a single fence)
 10-19
 20-40
  50+

In the case of vkcube all invocations in the 2-9 bucket were actually
just two input fences.

v2:
 * Correct local variable name and hold on to unsignaled reference. (Chistian)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241115102153.1980-4-tursulin@igalia.com
5 months agodrm/virtio: Factor out common dmabuf unmapping code
Dmitry Osipenko [Mon, 2 Dec 2024 05:39:55 +0000 (08:39 +0300)]
drm/virtio: Factor out common dmabuf unmapping code

Move out dmabuf detachment and unmapping into separate function. This
removes duplicated code and there is no need to check the GEM's kref now,
since both bo->attached and bo->sgt are unset under held reservation lock.

Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241202053955.2451321-1-dmitry.osipenko@collabora.com
5 months agodrm/virtio: Set missing bo->attached flag
Dmitry Osipenko [Fri, 29 Nov 2024 15:53:57 +0000 (18:53 +0300)]
drm/virtio: Set missing bo->attached flag

VirtIO-GPU driver now supports detachment of shmem BOs from host, but
doing it only for imported dma-bufs. Mark all shmem BOs as attached, not
just dma-bufs. This is a minor correction since detachment of a non-dmabuf
BOs not supported today.

Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241129155357.2265357-1-dmitry.osipenko@collabora.com
5 months agodrm/virtio: Lock the VGA resources during initialization
Vivek Kasireddy [Wed, 11 Dec 2024 06:43:43 +0000 (22:43 -0800)]
drm/virtio: Lock the VGA resources during initialization

If another driver for a VGA compatible GPU (that is passthrough'd)
locks the VGA resources (by calling vga_get()), then virtio_gpu
driver would encounter the following errors and fail to load during
probe and initialization:

Invalid read at addr 0x7200005014, size 1, region '(null)', reason: rejected
Invalid write at addr 0x7200005014, size 1, region '(null)', reason: rejected
virtio_gpu virtio0: virtio: device uses modern interface but does not have VIRTIO_F_VERSION_1
virtio_gpu virtio0: probe with driver virtio_gpu failed with error -22

This issue is only seen if virtio-gpu and the other GPU are on
different PCI buses, which can happen if the user includes an
additional PCIe port and associates the VGA compatible GPU with
it while launching Qemu:
qemu-system-x86_64...
-device virtio-vga,max_outputs=1,xres=1920,yres=1080,blob=true
-device pcie-root-port,id=pcie.1,bus=pcie.0,addr=1c.0,slot=1,chassis=1,multifunction=on
-device vfio-pci,host=03:00.0,bus=pcie.1,addr=00.0 ...

In the above example, the device 03:00.0 is an Intel DG2 card and
this issue is seen when both i915 driver and virtio_gpu driver are
loading (or initializing) concurrently or when i915 is loaded first.
Note that during initalization, i915 driver does the following in
intel_vga_reset_io_mem():
vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
outb(inb(VGA_MIS_R), VGA_MIS_W);
vga_put(pdev, VGA_RSRC_LEGACY_IO);

Although, virtio-gpu might own the VGA resources initially, the
above call (in i915) to vga_get_uninterruptible() would result in
these resources being taken away, which means that virtio-gpu would
not be able to decode VGA anymore. This happens in __vga_tryget()
when it calls
pci_set_vga_state(conflict->pdev, false, pci_bits, flags);
where
pci_bits = PCI_COMMAND_MEMORY | PCI_COMMAND_IO
flags = PCI_VGA_STATE_CHANGE_DECODES | PCI_VGA_STATE_CHANGE_BRIDGE

Therefore, to solve this issue, virtio-gpu driver needs to call
vga_get() whenever it needs to reclaim and access VGA resources,
which is during initial probe and setup. After that, a call to
vga_put() would release the lock to allow other VGA compatible
devices to access these shared VGA resources.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: Chia-I Wu <olvaffe@gmail.com>
Reported-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241211064343.550153-1-vivek.kasireddy@intel.com
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
5 months agodrm/virtio: Fix UAF in virtgpu_dma_buf_free_obj()
Vivek Kasireddy [Thu, 12 Dec 2024 05:54:21 +0000 (21:54 -0800)]
drm/virtio: Fix UAF in virtgpu_dma_buf_free_obj()

Fix the following issues identified by Smatch static checker:
- The call to dma_buf_put(attach->dmabuf) after dma_buf_detach()
  leads to a UAF bug as dma_buf_detach() frees the attach object.
  Fix this by extracting the dmabuf object from attach and using
  that in the call to dma_buf_put().

- The resv object is extracted from attach before checking to see
  if attach is valid (that is !NULL) or not. Although, attach would
  very likely be valid, fix this by making sure that the resv object
  is used only after ensuring that attach is valid.

Fixes: 2885e575abc7 ("drm/virtio: Add helpers to initialize and free the imported object")
Fixes: ca77f27a2665 ("drm/virtio: Import prime buffers from other devices as guest blobs")
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: Chia-I Wu <olvaffe@gmail.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241212055421.775759-1-vivek.kasireddy@intel.com
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
[dmitry.osipenko@collabora.com: Edited commit title]

5 months agoaccel/ivpu: Enable HWS by default on all platforms
Jacek Lawrynowicz [Tue, 7 Jan 2025 17:32:37 +0000 (18:32 +0100)]
accel/ivpu: Enable HWS by default on all platforms

Enable HWS on selected platforms if FW API version is above 3.19.

Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Karol Wachowski <karol.wachowski@intel.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250107173238.381120-15-maciej.falkowski@linux.intel.com