OSDN Git Service

tomoyo/tomoyo-test1.git
2 years agodrm: lcdif: Add support for i.MX8MP LCDIF variant
Marek Vasut [Tue, 28 Jun 2022 17:41:52 +0000 (19:41 +0200)]
drm: lcdif: Add support for i.MX8MP LCDIF variant

Add support for i.MX8MP LCDIF variant. This is called LCDIFv3 and is
completely different from the LCDIFv3 found in i.MX23 in that it has
a completely scrambled register layout compared to all previous LCDIF
variants. The new LCDIFv3 also supports 36bit address space.

Add a separate driver which is really a fork of MXSFB driver with the
i.MX8MP LCDIF variant handling filled in.

Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Tested-by: Martyn Welch <martyn.welch@collabora.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Robby Cai <robby.cai@nxp.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stefan Agner <stefan@agner.ch>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220628174152.167284-2-marex@denx.de
2 years agodt-bindings: lcdif: Add compatible for i.MX8MP
Marek Vasut [Tue, 28 Jun 2022 17:41:51 +0000 (19:41 +0200)]
dt-bindings: lcdif: Add compatible for i.MX8MP

Add compatible string for i.MX8MP LCDIF variant. This is called LCDIFv3
and is completely different from the LCDIFv3 found in i.MX23 in that it
has a completely scrambled register layout compared to all previous LCDIF
variants. The new LCDIFv3 also supports 36bit address space. However,
except for the complete bit reshuffling, this is still LCDIF and it still
works like one.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Robby Cai <robby.cai@nxp.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stefan Agner <stefan@agner.ch>
Cc: devicetree@vger.kernel.org
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220628174152.167284-1-marex@denx.de
2 years agodrm/bridge: tc358767: Do not cache dsi_lanes twice
Marek Vasut [Fri, 24 Jun 2022 18:19:02 +0000 (20:19 +0200)]
drm/bridge: tc358767: Do not cache dsi_lanes twice

The DSI lane count can be accessed via the dsi device pointer,
make use of that. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220624181902.151959-1-marex@denx.de
2 years agodrm/display/selftests: drop extra word 'for' in comments for MST selftests
Jiang Jian [Thu, 23 Jun 2022 10:06:32 +0000 (18:06 +0800)]
drm/display/selftests: drop extra word 'for' in comments for MST selftests

there is an unexpected word 'for' in the comments that need to be dropped

file - ./drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c
line - 3

* Test cases for for the DRM DP MST helpers

changed to:

* Test cases for the DRM DP MST helpers

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220623100632.27056-1-jiangjian@cdjrlc.com
2 years agodrm/vc4: hdmi: Move pixel doubling from Pixelvalve to HDMI block
Dave Stevenson [Mon, 13 Jun 2022 14:48:00 +0000 (16:48 +0200)]
drm/vc4: hdmi: Move pixel doubling from Pixelvalve to HDMI block

With the change to 2 pixels/clock, the pixel doubling in the PV
results in doubling each pair of pixels, ie ABABCDCD instead of
AABBCCDD.

Move the pixel doubling to the HDMI block, however this means
that DBLCLK modes now fall foul of requiring even values for
all the horizontal timing parameters.
As both 480i and 576i fail this, attempt to fix up DBLCLK modes
that have odd timings values.

Fixes: 8323989140f3 ("drm/vc4: hdmi: Support the BCM2711 HDMI controllers")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-34-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Correct HDMI timing registers for interlaced modes
Dave Stevenson [Mon, 13 Jun 2022 14:47:59 +0000 (16:47 +0200)]
drm/vc4: hdmi: Correct HDMI timing registers for interlaced modes

For interlaced modes the timings were not being correctly
programmed into the HDMI block, so correct them.

Fixes: 8323989140f3 ("drm/vc4: hdmi: Support the BCM2711 HDMI controllers")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-33-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Force modeset when bpc or format changes
Dom Cobley [Mon, 13 Jun 2022 14:47:58 +0000 (16:47 +0200)]
drm/vc4: hdmi: Force modeset when bpc or format changes

Whenever the maximum BPC is changed, vc4_hdmi_encoder_compute_config()
might pick up a different BPC or format depending on the display
capabilities.

That change will have a number of side effects, including the clock
rates and whether the scrambling is enabled.

However, only drm_crtc_state.connectors_changed will be set to true,
since that properly only affects the connector.

This means that while drm_atomic_crtc_needs_modeset() will return true,
and thus drm_atomic_helper_commit_modeset_enables() will call our
encoder atomic_enable() hook, mode_changed will be false.

So crtc_set_mode() will not call our encoder .atomic_mode_set() hook. We
use this hook in vc4 to set the vc4_hdmi_connector_state.output_bpc (and
output_format), and will then reuse the value in .atomic_enable() to select
whether or not scrambling should be enabled.

However, since our clock rate is pre-computed during .atomic_check(), we
end up with the clocks properly configured, but the scrambling disabled,
leading to a blank screen.

Let's set mode_changed to true in our HDMI driver to force the update of
output_bpc, and thus prevent the issue entirely.

Fixes: ba8c0faebbb0 ("drm/vc4: hdmi: Enable 10/12 bpc output")
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-32-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Fix timings for interlaced modes
Mateusz Kwiatkowski [Mon, 13 Jun 2022 14:47:57 +0000 (16:47 +0200)]
drm/vc4: hdmi: Fix timings for interlaced modes

Increase the number of post-sync blanking lines on odd fields instead of
decreasing it on even fields. This makes the total number of lines
properly match the modelines.

Additionally fix the value of PV_VCONTROL_ODD_DELAY, which did not take
pixels_per_clock into account, causing some displays to invert the
fields when driven by bcm2711.

Fixes: 682e62c45406 ("drm/vc4: Fix support for interlaced modes on HDMI.")
Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-31-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Report that 3d/stereo is allowed
Dom Cobley [Mon, 13 Jun 2022 14:47:56 +0000 (16:47 +0200)]
drm/vc4: hdmi: Report that 3d/stereo is allowed

Our HDMI controllers supports Stereo output so let's enable it.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-30-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Add MISC_CONTROL register for vc4
Dave Stevenson [Mon, 13 Jun 2022 14:47:55 +0000 (16:47 +0200)]
drm/vc4: hdmi: Add MISC_CONTROL register for vc4

The MISC_CONTROL register allows configuration of pixel repetition
for pixel doubling in the HDMI block instead of PixelValve.
It was already defined for vc5, so add it for vc4.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-29-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Add HDMI format detection registers to register list
Dave Stevenson [Mon, 13 Jun 2022 14:47:54 +0000 (16:47 +0200)]
drm/vc4: hdmi: Add HDMI format detection registers to register list

The block can detect what the incoming image timings are for
debug purposes. Add them to the list of registers understood
by the driver to allow easy dumping of the values.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-28-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Remove VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWAYS_KEEPOUT
Dom Cobley [Mon, 13 Jun 2022 14:47:53 +0000 (16:47 +0200)]
drm/vc4: hdmi: Remove VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWAYS_KEEPOUT

This bit ensures data island packets are never generated when disallowed
by HDCP. As no Pi boards support HDCP this is providing an unnecessary
restriction

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-27-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Skip writes to disabled packet RAM
Dom Cobley [Mon, 13 Jun 2022 14:47:52 +0000 (16:47 +0200)]
drm/vc4: hdmi: Skip writes to disabled packet RAM

This path actually occurs when audio is started during a hdmi mode set.
As the data will be written by vc4_hdmi_set_infoframes when packet RAM
is enabled again, don't treat as an error

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-26-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Stop checking for enabled output in audio
Dom Cobley [Mon, 13 Jun 2022 14:47:51 +0000 (16:47 +0200)]
drm/vc4: hdmi: Stop checking for enabled output in audio

The current HDMI driver, in vc4_hdmi_audio_can_stream() checks whether
the display output is enabled.

This has been there in one form or the other since the introduction of
the audio support in the VC4 HDMI driver in commit bb7d78568814
("drm/vc4: Add HDMI audio support"), but no justification for this check
is in the commit message, or in the discussions around the patches.

One can only assume this was done to prevent a user from playing audio
on the ALSA soundcard when the monitor doesn't support it.

However, this is causing some issues. Indeed, Kodi, for example, was
hitting some errors if it was streaming audio during a modeset. With the
theory above, it does make sense, but the display and audio threads are
typically completely different processes with no opportunity to
synchronise which makes it hard to workaround.

Removing that check also doesn't seem to cause any trouble, so let's
just remove it.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-25-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Move HDMI reset to pm_resume
Dave Stevenson [Mon, 13 Jun 2022 14:47:50 +0000 (16:47 +0200)]
drm/vc4: hdmi: Move HDMI reset to pm_resume

The BCM2835-37 found in the RaspberryPi 0 to 3 have a power domain
attached to the HDMI block, handled in Linux through runtime_pm.

That power domain is shared with the VEC block, so even if we put our
runtime_pm reference in the HDMI driver it would keep being on. If the
VEC is disabled though, the power domain would be disabled and we would
lose any initialization done in our bind implementation.

That initialization involves calling the reset function and initializing
the CEC registers.

Let's move the initialization to our runtime_resume implementation so
that we initialize everything properly if we ever need to.

Fixes: c86b41214362 ("drm/vc4: hdmi: Move the HSM clock enable to runtime_pm")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-24-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Switch to pm_runtime_status_suspended
Dave Stevenson [Mon, 13 Jun 2022 14:47:49 +0000 (16:47 +0200)]
drm/vc4: hdmi: Switch to pm_runtime_status_suspended

If the controller isn't clocked or its domain powered up, the register
accesses will either stall the CPU or return garbage, respectively.

Thus, we had a warning in our register access function to complain when
that kind of risky accesses were performed.

In order to check the runtime_pm power state, we were using
pm_runtime_active(), but it turns out that it will become active only
once the runtime_resume hook has been executed.

This prevents us from doing any WARN-free register access in our
runtime_resume() implementation, while this is valid.

Let's switch to pm_runtime_status_suspended() instead.

Fixes: 14e193b95604 ("drm/vc4: hdmi: Warn if we access the controller while disabled")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-23-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Reset HDMI MISC_CONTROL register
Dave Stevenson [Mon, 13 Jun 2022 14:47:48 +0000 (16:47 +0200)]
drm/vc4: hdmi: Reset HDMI MISC_CONTROL register

The HDMI block can repeat pixels for double clocked modes,
and the firmware is now configuring the block to do this as
the PV is doing it incorrectly when at 2pixels/clock.
If the kernel doesn't reset it then we end up with strange
modes.

Reset MISC_CONTROL.

Fixes: 8323989140f3 ("drm/vc4: hdmi: Support the BCM2711 HDMI controllers")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-22-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Avoid full hdmi audio fifo writes
Dom Cobley [Mon, 13 Jun 2022 14:47:47 +0000 (16:47 +0200)]
drm/vc4: hdmi: Avoid full hdmi audio fifo writes

We are getting occasional VC4_HD_MAI_CTL_ERRORF in
HDMI_MAI_CTL which seem to correspond with audio dropouts.

Reduce the threshold where we deassert DREQ to avoid the fifo
overfilling

Fixes: bb7d78568814 ("drm/vc4: Add HDMI audio support")
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-21-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Clear unused infoframe packet RAM registers
Dom Cobley [Mon, 13 Jun 2022 14:47:46 +0000 (16:47 +0200)]
drm/vc4: hdmi: Clear unused infoframe packet RAM registers

Using a hdmi analyser the bytes in packet ram
registers beyond the length were visible in the
infoframes and it flagged the checksum as invalid.

Zeroing unused words of packet RAM avoids this

Fixes: 21317b3fba54 ("drm/vc4: Set up the AVI and SPD infoframes.")
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-20-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Add all the vc5 HDMI registers into the debugfs dumps
Dave Stevenson [Mon, 13 Jun 2022 14:47:45 +0000 (16:47 +0200)]
drm/vc4: hdmi: Add all the vc5 HDMI registers into the debugfs dumps

The vc5 HDMI registers hadn't been added into the debugfs
register sets, therefore weren't dumped on request.
Add them in.

Fixes: 8323989140f3 ("drm/vc4: hdmi: Support the BCM2711 HDMI controllers")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-19-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hdmi: Disable audio if dmas property is present but empty
Phil Elwell [Mon, 13 Jun 2022 14:47:44 +0000 (16:47 +0200)]
drm/vc4: hdmi: Disable audio if dmas property is present but empty

The dmas property is used to hold the dmaengine channel used for audio
output.

Older device trees were missing that property, so if it's not there we
disable the audio output entirely.

However, some overlays have set an empty value to that property, mostly
to workaround the fact that overlays cannot remove a property. Let's add
a test for that case and if it's empty, let's disable it as well.

Cc: <stable@vger.kernel.org>
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Link: https://lore.kernel.org/r/20220613144800.326124-18-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dsi: Add correct stop condition to vc4_dsi_encoder_disable iteration
Dave Stevenson [Mon, 13 Jun 2022 14:47:43 +0000 (16:47 +0200)]
drm/vc4: dsi: Add correct stop condition to vc4_dsi_encoder_disable iteration

vc4_dsi_encoder_disable is partially an open coded version of
drm_bridge_chain_disable, but it missed a termination condition
in the loop for ->disable which meant that no post_disable
calls were made.

Add in the termination clause.

Fixes: 033bfe7538a1 ("drm/vc4: dsi: Fix bridge chain handling")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-17-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dsi: Fix dsi0 interrupt support
Dave Stevenson [Mon, 13 Jun 2022 14:47:42 +0000 (16:47 +0200)]
drm/vc4: dsi: Fix dsi0 interrupt support

DSI0 seemingly had very little or no testing as a load of
the register mappings were incorrect/missing, so host
transfers always timed out due to enabling/checking incorrect
bits in the interrupt enable and status registers.

Fixes: 4078f5757144 ("drm/vc4: Add DSI driver")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-16-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dsi: Register dsi0 as the correct vc4 encoder type
Dave Stevenson [Mon, 13 Jun 2022 14:47:41 +0000 (16:47 +0200)]
drm/vc4: dsi: Register dsi0 as the correct vc4 encoder type

vc4_dsi was registering both dsi0 and dsi1 as VC4_ENCODER_TYPE_DSI1
which seemed to work OK for a single DSI display, but fails
if there are two DSI displays connected.

Update to register the correct type.

Fixes: 4078f5757144 ("drm/vc4: Add DSI driver")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-15-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dsi: Correct pixel order for DSI0
Dave Stevenson [Mon, 13 Jun 2022 14:47:40 +0000 (16:47 +0200)]
drm/vc4: dsi: Correct pixel order for DSI0

For slightly unknown reasons, dsi0 takes a different pixel format
to dsi1, and that has to be set in the pixel valve.

Amend the setup accordingly.

Fixes: a86773d120d7 ("drm/vc4: Add support for feeding DSI encoders from the pixel valve.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-14-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dsi: Correct DSI divider calculations
Dave Stevenson [Mon, 13 Jun 2022 14:47:39 +0000 (16:47 +0200)]
drm/vc4: dsi: Correct DSI divider calculations

The divider calculations tried to find the divider just faster than the
clock requested. However if it required a divider of 7 then the for loop
aborted without handling the "error" case, and could end up with a clock
lower than requested.

The integer divider from parent PLL to DSI clock is also capable of
going up to /255, not just /7 that the driver was trying.  This allows
for slower link frequencies on the DSI bus where the resolution permits.

Correct the loop so that we always have a clock greater than requested,
and covering the whole range of dividers.

Fixes: 86c1b9eff3f2 ("drm/vc4: Adjust modes in DSI to work around the integer PLL divider.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-13-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dsi: Release workaround buffer and DMA
Dave Stevenson [Mon, 13 Jun 2022 14:47:38 +0000 (16:47 +0200)]
drm/vc4: dsi: Release workaround buffer and DMA

On Pi0-3 the driver allocates a buffer and requests a DMA channel
because the ARM can't write to DSI1's registers directly.

However, we never release that buffer or channel. Let's add a
device-managed action to release each.

Fixes: 4078f5757144 ("drm/vc4: Add DSI driver")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-12-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dpi: Ensure a default format is selected
Dave Stevenson [Mon, 13 Jun 2022 14:47:37 +0000 (16:47 +0200)]
drm/vc4: dpi: Ensure a default format is selected

In a couple of error/incomplete configuration cases, the
DPI_FORMAT bits wouldn't get set.

Enforce our RGB888 default in all these cases.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-11-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dpi: Add option for inverting pixel clock and output enable
Dave Stevenson [Mon, 13 Jun 2022 14:47:36 +0000 (16:47 +0200)]
drm/vc4: dpi: Add option for inverting pixel clock and output enable

DRM provides flags for inverting pixel clock and output enable
signals, but these were not mapped to the relevant registers.

Add those mappings.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-10-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: dpi: Add support for composite syncs to vc4_dpi
Dave Stevenson [Mon, 13 Jun 2022 14:47:35 +0000 (16:47 +0200)]
drm/vc4: dpi: Add support for composite syncs to vc4_dpi

The hardware can combine H&V syncs onto the output enable line
as composite syncs, so add the relevant configuration to do that.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-9-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: hvs: Add debugfs node that dumps the current display lists
Dave Stevenson [Mon, 13 Jun 2022 14:47:34 +0000 (16:47 +0200)]
drm/vc4: hvs: Add debugfs node that dumps the current display lists

This allows easy analysis of display lists when debugging.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-8-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: plane: Add alpha_blend_mode property to each plane.
Dave Stevenson [Mon, 13 Jun 2022 14:47:33 +0000 (16:47 +0200)]
drm/vc4: plane: Add alpha_blend_mode property to each plane.

Move from only supporting the default of pre-multiplied
alpha to supporting user specified blend mode using the
standardised property.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-7-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: plane: Fix margin calculations for the right/bottom edges
Dave Stevenson [Mon, 13 Jun 2022 14:47:32 +0000 (16:47 +0200)]
drm/vc4: plane: Fix margin calculations for the right/bottom edges

The current plane margin calculation code clips the right and bottom
edges of the range based using the left and top margins.

This is obviously wrong, so let's fix it.

Fixes: 666e73587f90 ("drm/vc4: Take margin setup into account when updating planes")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-6-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: plane: Remove subpixel positioning check
Dom Cobley [Mon, 13 Jun 2022 14:47:31 +0000 (16:47 +0200)]
drm/vc4: plane: Remove subpixel positioning check

There is little harm in ignoring fractional coordinates
(they just get truncated).

Without this:
modetest -M vc4 -F tiles,gradient -s 32:1920x1080-60 -P89@74:1920x1080*.1.1@XR24

is rejected. We have the same issue in Kodi when trying to
use zoom options on video.

Note: even if all coordinates are fully integer. e.g.
src:[0,0,1920,1080] dest:[-10,-10,1940,1100]

it will still get rejected as drm_atomic_helper_check_plane_state
uses drm_rect_clip_scaled which transforms this to fractional src coords

Fixes: 21af94cf1a4c ("drm/vc4: Add support for scaling of display planes.")
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-5-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/vc4: kms: Use maximum FIFO load for the HVS clock rate
Maxime Ripard [Mon, 13 Jun 2022 14:47:30 +0000 (16:47 +0200)]
drm/vc4: kms: Use maximum FIFO load for the HVS clock rate

The core clock computation takes into account both the load due to the
input (ie, planes) and its output (ie, encoders).

However, while the input load needs to consider all the planes, and thus
sum all of their associated loads, the output happens mostly in
parallel.

Therefore, we need to consider only the maximum of all the output loads,
and not the sum like we were doing. This resulted in a clock rate way
too high which could be discarded for being too high by the clock
framework.

Since recent changes, the clock framework will even downright reject it,
leading to a core clock being too low for its current needs.

Fixes: 16e101051f32 ("drm/vc4: Increase the core clock based on HVS load")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-4-maxime@cerno.tech
2 years agodrm/vc4: kms: Warn if clk_set_min_rate fails
Maxime Ripard [Mon, 13 Jun 2022 14:47:29 +0000 (16:47 +0200)]
drm/vc4: kms: Warn if clk_set_min_rate fails

We currently ignore the clk_set_min_rate return code assuming it would
succeed. However, it can fail if we ask for a rate higher than the
current maximum for example.

Since we can't fail in atomic_commit, at least warn on failure.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-3-maxime@cerno.tech
2 years agodrm/vc4: drv: Adopt the dma configuration from the HVS or V3D component
Dave Stevenson [Mon, 13 Jun 2022 14:47:28 +0000 (16:47 +0200)]
drm/vc4: drv: Adopt the dma configuration from the HVS or V3D component

vc4_drv isn't necessarily under the /soc node in DT as it is a
virtual device, but it is the one that does the allocations.
The DMA addresses are consumed by primarily the HVS or V3D, and
those require VideoCore cache alias address mapping, and so will be
under /soc.

During probe find the a suitable device node for HVS or V3D,
and adopt the DMA configuration of that node.

Cc: <stable@vger.kernel.org>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-2-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2 years agodrm/fourcc: Document the Intel CCS modifiers' CC plane expected pitch
Imre Deak [Thu, 23 Jun 2022 14:49:55 +0000 (17:49 +0300)]
drm/fourcc: Document the Intel CCS modifiers' CC plane expected pitch

The driver expects the pitch of the Intel CCS CC color planes to be
64 bytes aligned, adjust the modifier descriptions accordingly.

Cc: Nanley Chery <nanley.g.chery@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220623144955.2486736-1-imre.deak@intel.com
2 years agodrm/doc: Fix comment typo
Marek Vasut [Tue, 28 Jun 2022 00:34:07 +0000 (02:34 +0200)]
drm/doc: Fix comment typo

Replace apprpriately with appropriately.

Fixes: 1e4d84c6589e9 ("drm/doc: Polish plane composition property docs")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Simon Ser <contact@emersion.fr>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/20220628003407.77765-1-marex@denx.de
2 years agodrm/stm: ltdc: update hardware error management
Yannick Fertre [Fri, 3 Jun 2022 13:46:54 +0000 (15:46 +0200)]
drm/stm: ltdc: update hardware error management

The latest hardware version (0x40100) supports a hardware threshold
register (aka FUTR) to trigger a fifo underrun interrupt.
A software threshold has been implemented for other hardware versions.
The threshold is set to 128 by default.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220603134654.594373-1-yannick.fertre@foss.st.com
2 years agodrm/stm: ltdc: add support of horizontal & vertical mirroring
Yannick Fertre [Fri, 3 Jun 2022 13:45:47 +0000 (15:45 +0200)]
drm/stm: ltdc: add support of horizontal & vertical mirroring

Support of vertical & horizontal mirroring features thanks to
the plane rotation property.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220603134547.593790-1-yannick.fertre@foss.st.com
2 years agodrm/stm: ltdc: add support of the dynamic z-order
Yannick Fertre [Fri, 3 Jun 2022 13:44:59 +0000 (15:44 +0200)]
drm/stm: ltdc: add support of the dynamic z-order

Zpos property is immutable for all hardware versions except the last
version (0x40100) which support the blending order feature
(dynamic z-order).

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220603134459.593379-1-yannick.fertre@foss.st.com
2 years agodrm/stm: ltdc: fix various coding-style warnings
Yannick Fertre [Fri, 3 Jun 2022 13:43:34 +0000 (15:43 +0200)]
drm/stm: ltdc: fix various coding-style warnings

Fix issues reported by checkpatch.pl:
- Braces {} should be used on all arms
- Blank lines

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220603134334.592805-1-yannick.fertre@foss.st.com
2 years agodrm/stm: ltdc: remove error message about scaling
Yannick Fertre [Fri, 3 Jun 2022 13:42:50 +0000 (15:42 +0200)]
drm/stm: ltdc: remove error message about scaling

Remove error message about scaling & replace it by a debug
message to avoid too much error.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220603134250.592408-1-yannick.fertre@foss.st.com
2 years agodrm/stm: ltdc: disable all layers before crtc shutdown
Yannick Fertre [Fri, 3 Jun 2022 13:41:51 +0000 (15:41 +0200)]
drm/stm: ltdc: disable all layers before crtc shutdown

All plans must be disabled before the CRTC shutdown helping
the crtc to restart from a clean situation (without unwanted
planes already enable).

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220603134151.591997-1-yannick.fertre@foss.st.com
2 years agodrm/doc: Add KUnit documentation
José Expósito [Mon, 20 Jun 2022 16:06:40 +0000 (18:06 +0200)]
drm/doc: Add KUnit documentation

Explain how to run the KUnit tests present in the DRM subsystem and
clarify why the UML-only options were not added to the configuration
file present in drivers/gpu/drm/.kunitconfig [1] [2].

[1] https://lore.kernel.org/dri-devel/CABVgOSn8i=LO5p7830h2XU1Jgg0KrN0qTnxkOMhf1oTgxjaKKw@mail.gmail.com/
[2] https://lore.kernel.org/dri-devel/CAGS_qxqpiCim_sy1LDK7PLwVgWf-LKW+uNFTGM=T7ydk-dYcEw@mail.gmail.com/

Reviewed-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: David Gow <davidgow@google.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220620160640.3790-4-jose.exposito89@gmail.com
2 years agodrm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb332()
José Expósito [Mon, 20 Jun 2022 16:06:39 +0000 (18:06 +0200)]
drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb332()

Test the conversion from XRGB8888 to RGB332.

What is tested?

 - Different values for the X in XRGB8888 to make sure it is ignored
 - Different clip values: Single pixel and full and partial buffer
 - Well known colors: White, black, red, green, blue, magenta, yellow
   and cyan
 - Other colors: Randomly picked
 - Destination pitch

How to run the tests?

 $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/gpu/drm/tests \
         --kconfig_add CONFIG_VIRTIO_UML=y \
         --kconfig_add CONFIG_UML_PCI_OVER_VIRTIO=y

Suggested-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: David Gow <davidgow@google.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220620160640.3790-3-jose.exposito89@gmail.com
2 years agodrm/rect: Add DRM_RECT_INIT() macro
José Expósito [Mon, 20 Jun 2022 16:06:38 +0000 (18:06 +0200)]
drm/rect: Add DRM_RECT_INIT() macro

Add a helper macro to initialize a rectangle from x, y, width and
height information.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: David Gow <davidgow@google.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220620160640.3790-2-jose.exposito89@gmail.com
2 years agodrm/ast: Enable primary plane with CRTC
Thomas Zimmermann [Fri, 17 Jun 2022 10:32:26 +0000 (12:32 +0200)]
drm/ast: Enable primary plane with CRTC

As the CRTC requires a primary plane for display, ensure that the
primary plane is enabled with the CRTC.

Use drm_atomic_helper_check_crtc_state(). Add all affected planes
to the atomic state so that their state will be checked as well.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220617103226.25617-4-tzimmermann@suse.de
2 years agodrm/simple-kms: Use drm_atomic_helper_check_crtc_state()
Thomas Zimmermann [Fri, 17 Jun 2022 10:32:25 +0000 (12:32 +0200)]
drm/simple-kms: Use drm_atomic_helper_check_crtc_state()

Simple-KMS helpers guarantee that the CRTC and plane enable
flags are synchronized. Implement this with atomic helpers
drm_atomic_helper_check_crtc_state() on the CRTC side, and
drm_atomic_helper_check_plane_state() on the plane side.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220617103226.25617-3-tzimmermann@suse.de
2 years agodrm/atomic-helper: Add helper drm_atomic_helper_check_crtc_state()
Thomas Zimmermann [Fri, 17 Jun 2022 10:32:24 +0000 (12:32 +0200)]
drm/atomic-helper: Add helper drm_atomic_helper_check_crtc_state()

Add drm_atomic_helper_check_crtc_state(), which contains tests common
to many CRTCs. The first added test verifies that an enabled CRTC has
at least one enabled primary plane.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220617103226.25617-2-tzimmermann@suse.de
2 years agodrm/fb-helper: Fix out-of-bounds access
Thomas Zimmermann [Tue, 21 Jun 2022 10:46:17 +0000 (12:46 +0200)]
drm/fb-helper: Fix out-of-bounds access

Clip memory range to screen-buffer size to avoid out-of-bounds access
in fbdev deferred I/O's damage handling.

Fbdev's deferred I/O can only track pages. From the range of pages, the
damage handler computes the clipping rectangle for the display update.
If the fbdev screen buffer ends near the beginning of a page, that page
could contain more scanlines. The damage handler would then track these
non-existing scanlines as dirty and provoke an out-of-bounds access
during the screen update. Hence, clip the maximum memory range to the
size of the screen buffer.

While at it, rename the variables min/max to min_off/max_off in
drm_fb_helper_deferred_io(). This avoids confusion with the macros of
the same name.

Reported-by: Nuno Gonçalves <nunojpg@gmail.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Nuno Gonçalves <nunojpg@gmail.com>
Fixes: 67b723f5b742 ("drm/fb-helper: Calculate damaged area in separate helper")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: <stable@vger.kernel.org> # v5.18+
Link: https://patchwork.freedesktop.org/patch/msgid/20220621104617.8817-1-tzimmermann@suse.de
2 years agovfio/pci: Remove console drivers
Alex Williamson [Wed, 22 Jun 2022 14:01:34 +0000 (16:01 +0200)]
vfio/pci: Remove console drivers

Console drivers can create conflicts with PCI resources resulting in
userspace getting mmap failures to memory BARs.  This is especially
evident when trying to re-use the system primary console for userspace
drivers.  Use the aperture helpers to remove these conflicts.

v3:
* call aperture_remove_conflicting_pci_devices()

Reported-by: Laszlo Ersek <lersek@redhat.com>
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220622140134.12763-4-tzimmermann@suse.de
2 years agodrm: Implement DRM aperture helpers under video/
Thomas Zimmermann [Wed, 22 Jun 2022 14:01:33 +0000 (16:01 +0200)]
drm: Implement DRM aperture helpers under video/

Implement DRM's aperture helpers under video/ for sharing with other
sub-systems. Remove DRM-isms from the interface. The helpers track
the ownership of framebuffer apertures and provide hand-over from
firmware, such as EFI and VESA, to native graphics drivers.

Other subsystems, such as fbdev and vfio, also have to maintain ownership
of framebuffer apertures. Moving DRM's aperture helpers to a more public
location allows all subsystems to interact with each other and share a
common implementation.

The aperture helpers are selected by the various firmware drivers within
DRM and fbdev, and the VGA text-console driver.

The original DRM interface is kept in place for use by DRM drivers.

v3:
* prefix all interfaces with aperture_ (Javier)
* rework and simplify documentation (Javier)
* rename struct dev_aperture to struct aperture_range
* rebase onto latest DRM
* update MAINTAINERS entry

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220622140134.12763-3-tzimmermann@suse.de
2 years agoMAINTAINERS: Broaden scope of simpledrm entry
Thomas Zimmermann [Wed, 22 Jun 2022 14:01:32 +0000 (16:01 +0200)]
MAINTAINERS: Broaden scope of simpledrm entry

There will be more DRM drivers for firmware-provided framebuffers. Use
the existing entry for simpledrm instead of adding a new one for each
driver. Also add DRM's aperture helpers, which are part of the driver's
infrastructure.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220622140134.12763-2-tzimmermann@suse.de
2 years agodrm/ast: Fix black screen when getting out of suspend
Jocelyn Falempe [Wed, 22 Jun 2022 12:48:15 +0000 (14:48 +0200)]
drm/ast: Fix black screen when getting out of suspend

With an AST2600, the screen is garbage when going out of suspend.
This is because color settings are lost, and not restored on resume.
Force the color settings on DPMS_ON, to make sure the settings are correct.

I didn't write this code, it comes from the out-of-tree aspeed driver v1.13
https://www.aspeedtech.com/support_driver/

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Venkat Tadikonda <venkateswara.rao@intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220622124815.356035-1-jfalempe@redhat.com
2 years agodrm/mcde: Fix refcount leak in mcde_dsi_bind
Miaoqian Lin [Wed, 25 May 2022 11:54:11 +0000 (15:54 +0400)]
drm/mcde: Fix refcount leak in mcde_dsi_bind

Every iteration of for_each_available_child_of_node() decrements
the reference counter of the previous node. There is no decrement
when break out from the loop and results in refcount leak.
Add missing of_node_put() to fix this.

Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220525115411.65455-1-linmq006@gmail.com
2 years agodrm/connector: Remove usage of the deprecated ida_simple_xxx API
Bo Liu [Fri, 17 Jun 2022 08:23:19 +0000 (04:23 -0400)]
drm/connector: Remove usage of the deprecated ida_simple_xxx API

Use ida_alloc_xxx()/ida_free() instead of
ida_simple_get()/ida_simple_remove().
The latter is deprecated and more verbose.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220617082319.7599-1-liubo03@inspur.com
Link: https://patchwork.freedesktop.org/patch/msgid/20220621190055.8323-1-jiangjian@cdjrlc.com
2 years agodrm/panel: introduce ebbg,ft8719 panel
Joel Selvaraj [Wed, 1 Jun 2022 08:24:10 +0000 (13:54 +0530)]
drm/panel: introduce ebbg,ft8719 panel

Add DRM panel driver for EBBG FT8719 6.18" 2246x1080 DSI video mode
panel, which can be found on some Xiaomi Poco F1 phones. The panel's
backlight is managed through QCOM WLED driver.

Signed-off-by: Joel Selvaraj <jo@jsfamily.in>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/BY5PR02MB7009B6FA7F17A3DA36DDA44CD9DF9@BY5PR02MB7009.namprd02.prod.outlook.com
2 years agodrm/mipi-dsi: Introduce mipi_dsi_dcs_write_seq macro
Joel Selvaraj [Wed, 1 Jun 2022 08:24:09 +0000 (13:54 +0530)]
drm/mipi-dsi: Introduce mipi_dsi_dcs_write_seq macro

A helper macro that can be used to simplify sending DCS commands.
It is useful in scenarios like panel initialization which can sometimes
involve sending lot of DCS commands.

Signed-off-by: Joel Selvaraj <jo@jsfamily.in>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/BY5PR02MB700952493EEB6F0E77DC8416D9DF9@BY5PR02MB7009.namprd02.prod.outlook.com
2 years agodt-bindings: display: Add bindings for EBBG FT8719
Joel Selvaraj [Wed, 1 Jun 2022 08:24:08 +0000 (13:54 +0530)]
dt-bindings: display: Add bindings for EBBG FT8719

Add bindings for the EBBG FT8719 6.18" 2246x1080 DSI video mode panel,
which can be found on some Xiaomi Poco F1 phones. The backlight is
managed through the QCOM WLED driver.

Signed-off-by: Joel Selvaraj <jo@jsfamily.in>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/BY5PR02MB7009E821B0D4AC20E11F8F13D9DF9@BY5PR02MB7009.namprd02.prod.outlook.com
2 years agodt-bindings: vendor-prefixes: Add prefix for EBBG
Joel Selvaraj [Wed, 1 Jun 2022 08:24:07 +0000 (13:54 +0530)]
dt-bindings: vendor-prefixes: Add prefix for EBBG

Add a prefix for EBBG. They manufacture displays which are used in some
Xiaomi phones, but I could not find much details about the company.

Signed-off-by: Joel Selvaraj <jo@jsfamily.in>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/BY5PR02MB7009387E1E6C060864C03F87D9DF9@BY5PR02MB7009.namprd02.prod.outlook.com
2 years agodrm: bridge: adv7511: Add check for mipi_dsi_driver_register
Jiasheng Jiang [Thu, 2 Jun 2022 10:34:01 +0000 (18:34 +0800)]
drm: bridge: adv7511: Add check for mipi_dsi_driver_register

As mipi_dsi_driver_register could return error if fails,
it should be better to check the return value and return error
if fails.
Moreover, if i2c_add_driver fails,  mipi_dsi_driver_register
should be reverted.

Fixes: 1e4d58cd7f88 ("drm/bridge: adv7533: Create a MIPI DSI device")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220602103401.2980938-1-jiasheng@iscas.ac.cn
2 years agodrm/bridge: parade-ps8622: Use backlight helper
Stephen Kitt [Tue, 7 Jun 2022 18:10:22 +0000 (20:10 +0200)]
drm/bridge: parade-ps8622: Use backlight helper

backlight_properties.fb_blank is deprecated. The states it represents
are handled by other properties; but instead of accessing those
properties directly, drivers should use the helpers provided by
backlight.h.

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220607181022.1119546-1-steve@sk2.org
2 years agodrm/panel-edp: Add LQ140M1JW48 edp panel entry
Bjorn Andersson [Wed, 8 Jun 2022 02:06:14 +0000 (19:06 -0700)]
drm/panel-edp: Add LQ140M1JW48 edp panel entry

Add panel identification entry for the Sharp LQ140M1JW48 eDP panel.

Due to lacking documentation, a delay similar to those for the
LQ140M1JW46 numbers are picked for now.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220608020614.4098292-1-bjorn.andersson@linaro.org
2 years agodrm/panel: simple: add AM-800600P5TMQW-TB8H
Bastian Krause [Fri, 10 Jun 2022 11:15:11 +0000 (13:15 +0200)]
drm/panel: simple: add AM-800600P5TMQW-TB8H

Add support for the Ampire AM-800600P5TMQW-TB8H 800x600 panel. Data
sheet is currently not publicly available, unfortunately.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220610111511.1421067-2-bst@pengutronix.de
2 years agodt-bindings: display: simple: add Ampire AM-800600P5TMQW-TB8H panel
Bastian Krause [Fri, 10 Jun 2022 11:15:10 +0000 (13:15 +0200)]
dt-bindings: display: simple: add Ampire AM-800600P5TMQW-TB8H panel

Add Ampire AM-800600P5TMQW-TB8H 8" TFT LCD panel compatible string.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220610111511.1421067-1-bst@pengutronix.de
2 years agodrm: shmobile: Use backlight helper
Stephen Kitt [Thu, 16 Jun 2022 17:08:21 +0000 (19:08 +0200)]
drm: shmobile: Use backlight helper

This started with work on the removal of backlight_properties'
deprecated fb_blank field, much of which can be taken care of by using
helper functions provided by backlight.h instead of directly accessing
fields in backlight_properties. This patch series doesn't involve
fb_blank, but it still seems useful to use helper functions where
appropriate.

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220616170821.1348169-1-steve@sk2.org
2 years agodrm/panel: panel-asus-z00t-tm5p5-n35596: Use backlight helper
Stephen Kitt [Thu, 16 Jun 2022 17:23:13 +0000 (19:23 +0200)]
drm/panel: panel-asus-z00t-tm5p5-n35596: Use backlight helper

backlight_properties.fb_blank is deprecated. The states it represents
are handled by other properties; but instead of accessing those
properties directly, drivers should use the helpers provided by
backlight.h.

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220616172316.1355133-2-steve@sk2.org
2 years agodrm/panel: panel-dsi-cm: Use backlight helpers
Stephen Kitt [Thu, 16 Jun 2022 17:23:14 +0000 (19:23 +0200)]
drm/panel: panel-dsi-cm: Use backlight helpers

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Instead of setting the power state by manually updating fields in
struct backlight_properties, use backlight_enable() and
backlight_disable(). These also call backlight_update_status() so the
separate call is no longer needed.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220616172316.1355133-3-steve@sk2.org
2 years agodrm/panel: sony-acx565akm: Use backlight helpers
Stephen Kitt [Thu, 16 Jun 2022 17:23:15 +0000 (19:23 +0200)]
drm/panel: sony-acx565akm: Use backlight helpers

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Instead of manually checking the power state in struct
backlight_properties, use backlight_is_blank().

While we're at it, drop .fb_blank from the initialisation function; it
is deprecated, and this helps make progress towards enabling its
removal. This change makes no functional difference since
FB_BLANK_UNBLANK is the default value.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220616172316.1355133-4-steve@sk2.org
2 years agodrm/panel: panel-simple: Add dev_err_probe if backlight could not be found
Alexander Stein [Tue, 21 Jun 2022 07:21:18 +0000 (09:21 +0200)]
drm/panel: panel-simple: Add dev_err_probe if backlight could not be found

If the backlight node is not enabled, this (silently) returns with
-EPROBE_DEFER. /sys/kernel/debug/devices_deferred also shows nothing
helpful:
$ cat /sys/kernel/debug/devices_deferred
display

With this patch, there is a helpful hint:
$ cat /sys/kernel/debug/devices_deferred
display panel-simple: Could not find backlight

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621072118.513346-1-alexander.stein@ew.tq-group.com
2 years agodrm/pl111: drop unexpected word "the" in the comments
Jiang Jian [Tue, 21 Jun 2022 13:31:07 +0000 (21:31 +0800)]
drm/pl111: drop unexpected word "the" in the comments

there is an unexpected word "the" in the comments that need to be dropped

file: drivers/gpu/drm/pl111/pl111_display.c
line: 251
* Note that the the ARM hardware's format reader takes 'r' from
changed to
* Note that the the ARM hardware's format reader takes 'r' from

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621133107.3752-1-jiangjian@cdjrlc.com
2 years agodrm/panel: nt35510: Remove duplicate 'the' in two places.
Jiang Jian [Tue, 21 Jun 2022 14:01:51 +0000 (22:01 +0800)]
drm/panel: nt35510: Remove duplicate 'the' in two places.

file: ./drivers/gpu/drm/panel/panel-novatek-nt35510.c
line: 193,214,253
* amplification for the the step-up circuit:
changed to
* amplification for the step-up circuit:

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621140151.14404-1-jiangjian@cdjrlc.com
2 years agodrm/panel: simple: Add DataImage FG1001L0DSSWMG01 panel support
Philip Oberfichtner [Thu, 23 Jun 2022 11:22:58 +0000 (13:22 +0200)]
drm/panel: simple: Add DataImage FG1001L0DSSWMG01 panel support

Add DataImage FG1001L0DSSWMG01 10.1" 1280x800 TFT LCD panel support.

Signed-off-by: Philip Oberfichtner <pro@denx.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220623112257.4178461-2-pro@denx.de
2 years agodt-bindings: display: simple: Add DataImage FG1001L0DSSWMG01 compatible string
Philip Oberfichtner [Thu, 23 Jun 2022 11:22:56 +0000 (13:22 +0200)]
dt-bindings: display: simple: Add DataImage FG1001L0DSSWMG01 compatible string

Add DataImage FG1001L0DSSWMG01 10.1" 1280x800 TFT LCD panel compatible
string.

Signed-off-by: Philip Oberfichtner <pro@denx.de>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220623112257.4178461-1-pro@denx.de
2 years agodrm/logicvc: add missing of_node_put() in logicvc_layers_init()
Yang Yingliang [Tue, 14 Jun 2022 11:21:12 +0000 (19:21 +0800)]
drm/logicvc: add missing of_node_put() in logicvc_layers_init()

The of_node_put() need be called in error path in logicvc_layers_init().

Fixes: efeeaefe9be5 ("drm: Add support for the LogiCVC display controller")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220614112112.1537319-1-yangyingliang@huawei.com
2 years agodrm: fix device_node_continue.cocci warnings
Julia Lawall [Sun, 12 Jun 2022 11:02:31 +0000 (13:02 +0200)]
drm: fix device_node_continue.cocci warnings

drivers/gpu/drm/logicvc/logicvc_layer.c:616:2-13: ERROR: probable double put.

 Device node iterators put the previous value of the index variable, so an
 explicit put causes a double put.

Generated by: scripts/coccinelle/iterators/device_node_continue.cocci

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/alpine.DEB.2.22.394.2206121300120.3447@hadrien
2 years agodrm: Remove unnecessary print function dev_err()
Yang Li [Mon, 13 Jun 2022 01:26:58 +0000 (09:26 +0800)]
drm: Remove unnecessary print function dev_err()

The print function dev_err() is redundant because platform_get_irq()
already prints an error.

Eliminate the follow coccicheck warning:
./drivers/gpu/drm/logicvc/logicvc_drm.c:352:2-9: line 352 is redundant
because platform_get_irq() already prints an error

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220613012658.85814-1-yang.lee@linux.alibaba.com
2 years agodrm: logicvc: fix error code in logicvc_layer_init()
Dan Carpenter [Tue, 14 Jun 2022 12:08:53 +0000 (15:08 +0300)]
drm: logicvc: fix error code in logicvc_layer_init()

Return -EINVAL if logicvc_layer_formats_lookup() fails.  Don't return
success.

Fixes: efeeaefe9be5 ("drm: Add support for the LogiCVC display controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Yqh6VdNiDvJYMOQ+@kili
2 years agodrm: logicvc: Fix uninitialized variable in probe
Dan Carpenter [Tue, 14 Jun 2022 12:08:25 +0000 (15:08 +0300)]
drm: logicvc: Fix uninitialized variable in probe

The "regmap" is supposed to be initialized to NULL but it's used
without being initialized.

Fixes: efeeaefe9be5 ("drm: Add support for the LogiCVC display controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Yqh6OfSiPFuVrGo4@kili
2 years agodrm/ast: Fixed the casting issue reported by sparse
KuoHsiang Chou [Thu, 23 Jun 2022 08:31:16 +0000 (16:31 +0800)]
drm/ast: Fixed the casting issue reported by sparse

V1:
1.Fixed sparse:cast truncates bits form constant value ()cast
  truncates bits from constant value (ffffffffffffff00 becomes 0)

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: KuoHsiang Chou <kuohsiang_chou@aspeedtech.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220623083116.35365-1-kuohsiang_chou@aspeedtech.com
2 years agodrm/display: Fix build error without CONFIG_OF
YueHaibing [Sat, 11 Jun 2022 04:16:12 +0000 (12:16 +0800)]
drm/display: Fix build error without CONFIG_OF

While CONFIG_OF is n but COMPILE_TEST is y, we got this:

WARNING: unmet direct dependencies detected for DRM_DP_AUX_BUS
  Depends on [n]: HAS_IOMEM [=y] && DRM [=y] && OF [=n]
  Selected by [y]:
  - DRM_MSM [=y] && HAS_IOMEM [=y] && DRM [=y] && (ARCH_QCOM || SOC_IMX5 || COMPILE_TEST [=y]) && COMMON_CLK [=y] && IOMMU_SUPPORT [=y] && (QCOM_OCMEM [=n] || QCOM_OCMEM [=n]=n) && (QCOM_LLCC [=y] || QCOM_LLCC [=y]=n) && (QCOM_COMMAND_DB [=n] || QCOM_COMMAND_DB [=n]=n)

Make DRM_DP_AUX_BUS depends on OF || COMPILE_TEST to fix this warning.

Fixes: 1e0f66420b13 ("drm/display: Introduce a DRM display-helper module")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220611041612.1976-1-yuehaibing@huawei.com
2 years agodrm/nouveau/Kconfig: Drop duplicate "select ACPI_VIDEO"
Hans de Goede [Mon, 20 Jun 2022 09:46:27 +0000 (11:46 +0200)]
drm/nouveau/Kconfig: Drop duplicate "select ACPI_VIDEO"

Before this change nouveau's Kconfig section had 2 "select ACPI_VIDEO"
statements:

select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && INPUT
select ACPI_VIDEO if ACPI && X86

Drop the one with the extra conditions, if the conditions for that
one are true then the second statement will always select ACPI_VIDEO
already.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220620094627.9730-1-hdegoede@redhat.com
2 years agodma-buf: deprecate DMABUF_SYSFS_STATS
Christian König [Fri, 17 Jun 2022 08:35:25 +0000 (10:35 +0200)]
dma-buf: deprecate DMABUF_SYSFS_STATS

Add a warning that this UAPI wasn't such a good idea and shouldn't be
used by anybody.

That should give us a better chance to remove it at some point and
prevents others from running into the same issues.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: T.J. Mercier <tjmercier@google.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220617085702.4298-1-christian.koenig@amd.com
2 years agodrm/hyperv-drm: Include framebuffer and EDID headers
Thomas Zimmermann [Wed, 22 Jun 2022 08:34:13 +0000 (10:34 +0200)]
drm/hyperv-drm: Include framebuffer and EDID headers

Fix a number of compile errors by including the correct header
files. Examples are shown below.

  ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_blit_to_vram_rect':
  ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:48: error: invalid use of undefined type 'struct drm_framebuffer'
   25 |         struct hyperv_drm_device *hv = to_hv(fb->dev);
      |                                                ^~

  ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_connector_get_modes':
  ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:59:17: error: implicit declaration of function 'drm_add_modes_noedid' [-Werror=implicit-function-declaration]
   59 |         count = drm_add_modes_noedid(connector,
      |                 ^~~~~~~~~~~~~~~~~~~~

  ../drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:62:9: error: implicit declaration of function 'drm_set_preferred_mode'; did you mean 'drm_mm_reserve_node'? [-Werror=implicit-function-declaration]
   62 |         drm_set_preferred_mode(connector, hv->preferred_width,
      |         ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
Fixes: 720cf96d8fec ("drm: Drop drm_framebuffer.h from drm_crtc.h")
Fixes: 255490f9150d ("drm: Drop drm_edid.h from drm_crtc.h")
Cc: Deepak Rawat <drawat.floss@gmail.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: linux-hyperv@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v5.14+
Acked-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220622083413.12573-1-tzimmermann@suse.de
2 years agoGPU: drm: drop unexpected word "the" in the comments
Jiang Jian [Tue, 21 Jun 2022 13:51:40 +0000 (21:51 +0800)]
GPU: drm: drop unexpected word "the" in the comments

there is an unexpected word "the" in the comments that need to be dropped

file: drivers/gpu/drm/drm_ioctl.c
line: 86
*    means the the unique name for the master node just opening is _not_ filled
changed to
*    means the unique name for the master node just opening is _not_ filled

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621135140.12200-1-jiangjian@cdjrlc.com
2 years agodrm: panel-orientation-quirks: drop unexpected word "the" in the comments
Jiang Jian [Tue, 21 Jun 2022 13:44:01 +0000 (21:44 +0800)]
drm: panel-orientation-quirks: drop unexpected word "the" in the comments

there is an unexpected word "the" in the comments that need to be dropped

file: drivers/gpu/drm/drm_panel_orientation_quirks.c
line: 196
* GPD Pocket, note that the the DMI data is less generic then
changed to
* GPD Pocket, note that the DMI data is less generic then

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621134401.10290-1-jiangjian@cdjrlc.com
2 years agodrm/vc4: drop unexpected word "the" in the comments
Jiang Jian [Tue, 21 Jun 2022 13:05:50 +0000 (21:05 +0800)]
drm/vc4: drop unexpected word "the" in the comments

there is an unexpected word "the" in the comments that need to be dropped

file: drivers/gpu/drm/vc4/vc4_regs.h
line: 267
/* Set when the the downstream tries to read from the display FIFO
changed to
/* Set when the downstream tries to read from the display FIFO

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621130550.126915-1-jiangjian@cdjrlc.com
2 years agodrm/prime: drop unexpected word "the" in the comments
Jiang Jian [Tue, 21 Jun 2022 13:02:10 +0000 (21:02 +0800)]
drm/prime: drop unexpected word "the" in the comments

there is an unexpected word "the" in the comments that need to be dropped

file: drivers/gpu/drm/drm_prime.c
line: 842
* of the the buffer described by the provided sg_table.
changed to
* of the buffer described by the provided sg_table.

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621130210.125461-1-jiangjian@cdjrlc.com
2 years agodrm/nouveau/mmu: drop unexpected word "the" in the comments
Jiang Jian [Tue, 21 Jun 2022 13:39:20 +0000 (21:39 +0800)]
drm/nouveau/mmu: drop unexpected word "the" in the comments

there is an unexpected word "the" in the comments that need to be dropped

file: drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
line: 1051
 * have the the deepest nesting of page tables.
changed to
 * have the deepest nesting of page tables.

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621133920.8112-1-jiangjian@cdjrlc.com
2 years agodrm/dp_mst: Get rid of old comment in drm_atomic_get_mst_topology_state docs
Lyude Paul [Thu, 2 Jun 2022 20:17:57 +0000 (16:17 -0400)]
drm/dp_mst: Get rid of old comment in drm_atomic_get_mst_topology_state docs

We don't actually care about connection_mutex here anymore, so let's get
rid of the comment mentioning it in this function's kdocs.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Wayne Lin <Wayne.Lin@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220602201757.30431-4-lyude@redhat.com
2 years agodrm/display/dp_mst: Don't validate port refs in drm_dp_check_and_send_link_address()
Lyude Paul [Thu, 2 Jun 2022 20:17:55 +0000 (16:17 -0400)]
drm/display/dp_mst: Don't validate port refs in drm_dp_check_and_send_link_address()

Drive-by cleanup, we don't need to validate the port references here as we
already previously went through the effort of refactoring things such that
we're guaranteed to be able to access ->mstb and ->port safely from
drm_dp_check_and_send_link_address(), since the only two places in the
codebase that drop an MST reference in such a way that it would remove it
from the topology are both protected under probe_lock.

Thanks for that, past Lyude!

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Wayne Lin <Wayne.Lin@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220602201757.30431-2-lyude@redhat.com
2 years agodrm/display: Remove duplicate 'the' in two places.
Jiang Jian [Tue, 21 Jun 2022 19:00:55 +0000 (03:00 +0800)]
drm/display: Remove duplicate 'the' in two places.

there is an unexpected word "the" in the comments that need to be dropped
file: drivers/gpu/drm/display/drm_dp_helper.c
line: 1600
  * Doesn't account the the "MOT" bit, and instead assumes each
changed to
  * Doesn't account the "MOT" bit, and instead assumes eac

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220621190055.8323-1-jiangjian@cdjrlc.com
2 years agodrm/bridge: parade-ps8640: Provide wait_hpd_asserted() in struct drm_dp_aux
Douglas Anderson [Tue, 14 Jun 2022 21:54:18 +0000 (14:54 -0700)]
drm/bridge: parade-ps8640: Provide wait_hpd_asserted() in struct drm_dp_aux

This implements the callback added by the patch ("drm/dp: Add
wait_hpd_asserted() callback to struct drm_dp_aux").

With this change and all the two "DP AUX Endpoint" drivers changed to
use wait_hpd_asserted(), we no longer need to have an long delay in
the AUX transfer function. It's up to the panel code to make sure that
the panel is powered now. If someone tried to call the aux transfer
function without making sure the panel is powered we'll just get a
normal transfer failure.

We'll still keep the wait for HPD in the pre_enable() function. Though
it's probably not actually needed there, this driver is used in the
old mode (pre-DP AUX Endpoints) and it may be important for those
cases. If nothing else, it shouldn't cause any big problems.

NOTE: When handling the timeout for HPD we start the timer _after_
we've runtime resumed the device. This is definitely important for the
panel on my homestar which comes up 170 ms after we start timing (the
panel specifies 200 ms max). It's a little unclear how much of this
extra time is due to some internal state machine in the parade
firmware vs. debouncing but it seems to work for the two test cases I
have to do it this way.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220614145327.v4.4.Ie827321ce263be52fdb8c1276f6f8cc00d78029f@changeid
2 years agodrm/panel: atna33xc20: Take advantage of wait_hpd_asserted() in struct drm_dp_aux
Douglas Anderson [Tue, 14 Jun 2022 21:54:17 +0000 (14:54 -0700)]
drm/panel: atna33xc20: Take advantage of wait_hpd_asserted() in struct drm_dp_aux

Let's add support for being able to read the HPD pin even if it's
hooked directly to the controller. This will let us take away the
waiting in the AUX transfer functions of the eDP controller drivers.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220614145327.v4.3.I9ee239f6b95b944c8fa030f300ad222a7af9899d@changeid
2 years agodrm/panel-edp: Take advantage of wait_hpd_asserted() in struct drm_dp_aux
Douglas Anderson [Tue, 14 Jun 2022 21:54:16 +0000 (14:54 -0700)]
drm/panel-edp: Take advantage of wait_hpd_asserted() in struct drm_dp_aux

Let's add support for being able to read the HPD pin even if it's
hooked directly to the controller. This will allow us to get more
accurate delays also lets us take away the waiting in the AUX transfer
functions of the eDP controller drivers.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220614145327.v4.2.Icea616f57331fbaa3d48c529f300c9a8ebd37fb5@changeid
2 years agodrm/dp: Add wait_hpd_asserted() callback to struct drm_dp_aux
Douglas Anderson [Tue, 14 Jun 2022 21:54:15 +0000 (14:54 -0700)]
drm/dp: Add wait_hpd_asserted() callback to struct drm_dp_aux

Sometimes it's useful for users of the DP AUX bus (like panels) to be
able to poll HPD. Let's add a callback that allows DP AUX busses
drivers to provide this.

Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220614145327.v4.1.Icf57bb12233a47727013c6ab69eebf803e22ebc1@changeid
2 years agodrm: Config orientation property if panel provides it
Hsin-Yi Wang [Thu, 9 Jun 2022 07:27:23 +0000 (15:27 +0800)]
drm: Config orientation property if panel provides it

Panel orientation property should be set before drm_dev_register().
Some drm driver calls drm_dev_register() in .bind(). However, most
panels sets orientation property relatively late, mostly in .get_modes()
callback, since this is when they are able to get the connector and
binds the orientation property to it, though the value should be known
when the panel is probed.

In drm_bridge_connector_init(), if a bridge is a panel bridge, use it to
set the connector's panel orientation property.

Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
[dianders: fixed space vs. tab indentation]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220609072722.3488207-9-hsinyi@chromium.org
2 years agodrm/panel: elida-kd35t133: Implement .get_orientation callback
Hsin-Yi Wang [Thu, 9 Jun 2022 07:27:21 +0000 (15:27 +0800)]
drm/panel: elida-kd35t133: Implement .get_orientation callback

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
[dianders: fixed space vs. tab indentation]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220609072722.3488207-8-hsinyi@chromium.org