Damon Ding [Thu, 6 Feb 2025 03:03:29 +0000 (11:03 +0800)]
dt-bindings: display: rockchip: Fix label name of hdptxphy for RK3588 HDMI TX Controller
The hdptxphy is a combo transmit-PHY for HDMI2.1 TMDS Link, FRL Link, DP
and eDP Link. Therefore, it is better to name it hdptxphy0 other than
hdptxphy_hdmi0, which will be referenced by both hdmi0 and edp0 nodes.
Vignesh Raman [Wed, 5 Feb 2025 08:16:46 +0000 (13:46 +0530)]
drm/ci: uprev mesa
Uprev mesa to adapt to the latest changes in mesa ci
which includes new container jobs and stages. Also update
lava-submit script to adapt to the recent changes in mesa
to use LAVA rootfs overlays.
Paz Zcharya [Wed, 29 Jan 2025 14:20:58 +0000 (14:20 +0000)]
drm/vkms: Add support for ABGR8888 pixel format
Add support for pixel format ABGR8888, which is the default format
on Android devices. This will allow us to use VKMS as the default
display driver in Android Emulator (Cuttlefish) and increase VKMS
adoption.
This message reports a mismatch between new_crtc_state->enable and
has_connectors, which should be either both true or both false. However it
does not mention which one is true and which is false, which can be useful
for debugging. Add the value of both avriables to the log message.
Suraj Kandpal [Wed, 22 Jan 2025 05:33:57 +0000 (11:03 +0530)]
drm/display/dp: Define function to setup Extended wake time
Extended wake timeout request helps to give additional
time by reading the DPCD register through which sink requests the
minimal amount of time required to wake the sink up.
Source device shall keep retying the AUX tansaction till the
extended timeout that is being granted for LTTPRs from the
sink device.
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:16 +0000 (10:21 +0100)]
drm/ast: Only look up VBIOS mode on full modesets
Only look up the VBIOS mode during atomic_check if the display mode
changes. For page flips, the previous settings still apply. Avoids the
runtime overhead of looking up the VBIOS mode on each page flip.
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:15 +0000 (10:21 +0100)]
drm/ast: Remove struct ast_vbios_mode_info
The type struct ast_vbios_mode_info used to store information about
the color format and display mode. It has outlived its purpose. Inline
its fields into struct ast_crtc_state and replace all instances.
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:14 +0000 (10:21 +0100)]
drm/ast: astdp: Look up mode index from table
Replace the large switch statement with a look-up table when selecting
the mode index. Makes the code easier to read. The table is sorted by
resolutions; if run-time overhead from traversal becomes significant,
binary search would be a possible optimization.
The mode index requires a refresh-rate index to be added or subtracted,
which still requires a minimal switch. In the original code, some of
the indices did not contain this computation. Those cases would have been
equivalent to adding 0, so they are now all subsumed in the switch's
default branch.
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:13 +0000 (10:21 +0100)]
drm/ast: astdp: Rework display-mode setting
ASTDP requires a mode index, depending on the resolution. Move the
look-up code from ast_dp_set_mode() into a separate helper. Inline
the rest of the function into its only caller. Rename the variable
names and register constants to match the programming manual.
As before, the mode-index lookup still happens during the update's
atomic commit. Right now, there's no way of doing it during the atomic
check. The lookup requires the VBIOS mode, which is not available at
the atomic check's invocation. At least warn now if the mode index
could not be found.
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:11 +0000 (10:21 +0100)]
drm/ast: Validate DRM display modes against VBIOS modes
Test DRM display modes against the list of modes supported by the
VBIOS. The helper will respect the supported-modes flags in struct
ast_device. Hence only DRM display modes supported by the VBIOS
will be reported; without the current duplication of this information.
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:10 +0000 (10:21 +0100)]
drm/ast: Add helpers for VBIOS mode lookup
Mode lines are independent from hardware Gen or TX chip, so hide all
VBIOS mode tables in ast_vbios.c.
Move the look-up code for VBIOS modes from ast_vbios_get_mode_info()
to ast_vbios_find_mode(). The new look-up function respects the
supported-mode flags in struct ast_device. For example, if a device
does not have struct ast_device.support_fullhd set, the helper does
not return a valid mode for 1920x1080. Taking the supported-mode flags
into account allows for making the VBIOS tables the single reference
for validating and setting display modes against hardware capabilities.
v2:
- replace mode switch with look-up table (Jocelyn)
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:09 +0000 (10:21 +0100)]
drm/ast: Add empty initializer for VBIOS modes
VBIOS mode tables are terminated by an entry with a refresh rate of
0xff. The code is hard to read and fragile to use. Therefore create
an empty entry with AST_VBIOS_MODE_INVALID to terminate each mode list.
Stop at the invalid entry when searching for modes in the tables.
Instead of testing for refresh == 0xff, test with a helper function if
the mode's size and refresh have meaningful values.
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:08 +0000 (10:21 +0100)]
drm/ast: Find VBIOS mode from regular display size
The ast driver looks up supplied display modes from an internal list of
display modes supported by the VBIOS.
Do not use the crtc_-prefixed display values from struct drm_display_mode
for looking up the VBIOS mode. The fields contain raw values that the
driver programs to hardware. They are affected by display settings like
double-scan or interlace.
Instead use the regular vdisplay and hdisplay fields for lookup. As the
programmed values can now differ from the values used for lookup, set
struct drm_display_mode.crtc_vdisplay and .crtc_hdisplay from the VBIOS
mode.
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:07 +0000 (10:21 +0100)]
drm/ast: Always validate H/V sync flags
The ast driver matches DRM display modes against an internal list of
modes supported by the VBIOS. Matching H/V sync flags between modes is
preferred, but optional. If sync flags are not matching, the driver
would program the VBIOS settings to hardware and let the display handle
the difference.
DRM modes are generated from attached displays or standard mode lines.
Therefore differences to the VBIOS modes are not just cosmetical, but
signal possible incompatibility with the display hardware.
Hence make matching H/V sync flags mandatory. If the VBIOS does not
support a certain mode, we should report it as unsupported. Note that
the VBIOS mode tables all appear to refer to standard modes.
(If sync flags really make no difference to the VBIOS, the ast driver
shouldn't match them in the first place.)
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:06 +0000 (10:21 +0100)]
drm/ast: Add support_wuxga flag to struct ast_device
Detect support for 1920x1200 (WUXGA) in ast_detect_widescreen(). The
flag is cleared by default. The test logic has been taken from existing
code in ast_crtc_helper_mode_valid(). The code in that function is being
replaced by the new flag.
v2:
- move shared detection code into helper (Jocelyn)
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:05 +0000 (10:21 +0100)]
drm/ast: Add support_fullhd flag to struct ast_device
Detect support for 1920x1080 (FullHD) in ast_detect_widescreen(). The
flag is cleared by default. The test logic has been taken from existing
code in ast_crtc_helper_mode_valid(). The code in that function is being
replaced by the new flag.
For Gen3, a new branch duplicates the Gen2 logic and adds a test for
AST2200. Gen2 adds a test for AST2100.
v2:
- use fullhd flag for setting max width/height
Thomas Zimmermann [Fri, 31 Jan 2025 09:21:04 +0000 (10:21 +0100)]
drm/ast: Reorganize widescreen test around hardware Gens
Testing for support of widescreen modes mixes up various hardware
Gens. First branch by hardware Gen, then do specific tests for each
Gen. By default, widesscreen support is disabled.
Later patches will add more specific tests for each Gen.
v2:
- move shared detection code into helper (Jocelyn)
Karol Wachowski [Wed, 29 Jan 2025 12:56:33 +0000 (13:56 +0100)]
accel/ivpu: Fix missing MMU events if file_priv is unbound
Move the ivpu_mmu_discard_events() function to the common portion of
the abort work function. This ensures it is called only once, even if
there are no faulty contexts in context_xa, to guarantee that MMU events
are discarded and new events are not missed.
Jacek Lawrynowicz [Wed, 29 Jan 2025 12:56:32 +0000 (13:56 +0100)]
accel/ivpu: Update last_busy in IRQ handler
Call pm_runtime_mark_last_busy() in top half of IRQ handler to prevent
device from being runtime suspended before bottom half is executed on
a workqueue.
Jacek Lawrynowicz [Wed, 29 Jan 2025 12:56:31 +0000 (13:56 +0100)]
accel/ivpu: Add support for hardware fault injection
Introduces the capability to simulate hardware faults for testing
purposes. The new `fail_hw` fault can be injected in
`ivpu_hw_reg_poll_fld()`, which is used in various parts of the driver
to wait for the hardware to reach a specific state. This allows to test
failures during NPU boot and shutdown, IPC message handling and more.
Fault injection can be enabled using debugfs or a module parameter.
Jeffrey Hugo [Fri, 17 Jan 2025 17:09:43 +0000 (10:09 -0700)]
accel/qaic: Add AIC200 support
Add basic support for the new AIC200 product. The PCIe Device ID is
0xa110. With this, we can turn on the lights for AIC200 by leveraging
much of the existing driver.
Jeffrey Hugo [Fri, 17 Jan 2025 17:09:42 +0000 (10:09 -0700)]
accel/qaic: Add config structs for supported cards
As the number of cards supported by the driver grows, their
configurations will differ. The driver needs to become more dynamic
to support these configurations. Currently, each card may differ in
the exposed BARs, the regions they map to, and the family.
Create config structs for each card, and let the driver configure the
qaic_device struct based on the configurations passed to the driver.
Youssef Samir [Fri, 17 Jan 2025 17:09:41 +0000 (10:09 -0700)]
accel/qaic: Mask out SR-IOV PCI resources
During the initialization of the qaic device, pci_select_bars() is
used to fetch a bitmask of the BARs exposed by the device. On devices
that have Virtual Functions capabilities, the bitmask includes SR-IOV
BARs.
Use a mask to filter out SR-IOV BARs if they exist.
Youssef Samir [Fri, 17 Jan 2025 17:09:40 +0000 (10:09 -0700)]
accel/qaic: Add support for MSI-X
AIC200 device will support MSI-X while AIC100 devices will keep using
MSI. pci_alloc_irq_vectors() will try to allocate MSI-X vectors if it
is supported by the target device, otherwise, it will fallback to MSI.
Add support for MSI-X vectors allocation for AIC200 devices.
Youssef Samir [Fri, 17 Jan 2025 17:09:39 +0000 (10:09 -0700)]
accel/qaic: Allocate an exact number of MSIs
Devices use 1 MSI vector for the MHI controller and as many vectors as
the DMA bridge channels on the device. During the probing of the
device, the driver allocates 32 MSI vectors, which is usually more
than what is needed for AIC100 devices, which is wasting resources.
Allocate only the needed number of MSI vectors per device.
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
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
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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:
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
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.)
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.