platform/kernel/linux-starfive.git
2 years agodrm/stm: ltdc: switch to regmap
Yannick Fertre [Wed, 15 Dec 2021 21:47:38 +0000 (22:47 +0100)]
drm/stm: ltdc: switch to regmap

Replace the legacy register access by regmap API.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>
Reviewed-by: Philippe Cornu <philippe.cornu@foss.st.com>
Reviewed-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Tested-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/20211215214738.19946-1-yannick.fertre@foss.st.com
2 years agodrm/panfrost: Merge some feature lists
Alyssa Rosenzweig [Sun, 9 Jan 2022 17:09:19 +0000 (12:09 -0500)]
drm/panfrost: Merge some feature lists

Now that we only list features of interest to kernel space, lots of GPUs
have the same feature bits. To cut down on the repetition in the file,
merge feature lists that are identical between similar GPUs.

Note that this leaves some unmerged identical Bifrost feature lists, as
there are more features affecting Bifrost kernel space that we do not
yet handle.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
[Steve: fix typo in commit message]
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220109170920.2921-3-alyssa.rosenzweig@collabora.com
2 years agodrm/panfrost: Remove features meant for userspace
Alyssa Rosenzweig [Sun, 9 Jan 2022 17:09:18 +0000 (12:09 -0500)]
drm/panfrost: Remove features meant for userspace

Early versions of the legacy kernel driver included comprehensive
feature lists for every GPU, even though most of the enumerated features
only matter to userspace. For example, HW_FEATURE_INTERPIPE_REG_ALIASING
was a feature bit indicating that a GPU had "interpipe register
aliasing": arithmetic, load/store, and texture instruction all use
common general-purpose registers. GPUs without this feature bit have
dedicated load/store and texture "registers". Whether a GPU has this
feature or not is irrelevant to the kernel; it only matters in the
userspace compiler's register allocator. It's silly to enumerate it in
kernel space, and the information is understandably unused. To
underscore the point, this feature only makes sense in the context of
the Midgard instruction set. Bifrost never had dedicated load/store or
texture registers, so the feature bit was vacuously set for all Bifrost
hardware, even though this conveys no useful information.

To clean up the feature list, delete feature bits which could not
possibly matter to the kernel, leaving only those which do affect the
register-level operation of the chip.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220109170920.2921-2-alyssa.rosenzweig@collabora.com
2 years agodrm/panfrost: Check for error num after setting mask
Jiasheng Jiang [Thu, 6 Jan 2022 03:03:26 +0000 (11:03 +0800)]
drm/panfrost: Check for error num after setting mask

Because of the possible failure of the dma_supported(), the
dma_set_mask_and_coherent() may return error num.
Therefore, it should be better to check it and return the error if
fails.

Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
[Steve: fix Fixes: line]
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220106030326.2620942-1-jiasheng@iscas.ac.cn
2 years agovideo: vga16fb: Fix logic that checks for the display standard
Javier Martinez Canillas [Mon, 10 Jan 2022 09:56:24 +0000 (10:56 +0100)]
video: vga16fb: Fix logic that checks for the display standard

The vga16fb framebuffer driver supports both Enhanced Graphics Adapter
(EGA) and Video Graphics Array (VGA) 16 color graphic cards.

But the logic to check whether the EGA or VGA standard are used is not
correct. It just checks if screen_info.orig_video_isVGA is set, but it
should check if is set to VIDEO_TYPE_VGAC instead.

This means that it assumes to be VGA even if is set to VIDEO_TYPE_EGAC.

All non-x86 architectures though treat orig_video_isVGA as a boolean so
only do the change for x86 and keep the old logic for the other arches.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Kris Karas <bugs-a21@moonlit-rail.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220110095625.278836-2-javierm@redhat.com
2 years agodrm: bridge: nwl-dsi: Drop panel_bridge from nwl_dsi
Jagan Teki [Mon, 10 Jan 2022 17:25:33 +0000 (22:55 +0530)]
drm: bridge: nwl-dsi: Drop panel_bridge from nwl_dsi

panel_bridge pointer never used anywhere except the one it
looked up at nwl_dsi_bridge_attach.

Drop it from the nwl_dsi structure.

Reviewed-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220110172533.66614-1-jagan@amarulasolutions.com
2 years agodrm/bridge: adv7533: make array clock_div_by_lanes static const
Colin Ian King [Sun, 9 Jan 2022 20:41:05 +0000 (20:41 +0000)]
drm/bridge: adv7533: make array clock_div_by_lanes static const

Don't populate the read-only array clock_div_by_lanes on the stack but
instead it static const. Also makes the object code a little smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220109204105.51878-1-colin.i.king@gmail.com
2 years agoRevert "drm: exynos: dsi: Convert to bridge driver"
Jagan Teki [Tue, 11 Jan 2022 18:43:47 +0000 (00:13 +0530)]
Revert "drm: exynos: dsi: Convert to bridge driver"

This reverts commit 92e794fab87af0793403d5e4a547f0be94a0e656.

It is merged by accident, the actual patch series on this bridge
conversion is still under review.

Revert this as it breaks the exynos DSI.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220111184347.502471-1-jagan@amarulasolutions.com
Reviewed-by: Robert Foss <robert.foss@linaro.org>
2 years agodrm/mipi-dbi: Fix source-buffer address in mipi_dbi_buf_copy
Thomas Zimmermann [Tue, 11 Jan 2022 13:26:34 +0000 (14:26 +0100)]
drm/mipi-dbi: Fix source-buffer address in mipi_dbi_buf_copy

Set the source-buffer address after mapping the buffer into the
kernel's address space. Makes MIPI DBI helpers work again.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: c47160d8edcd ("drm/mipi-dbi: Remove dependency on GEM CMA helper library")
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Reported-by: Noralf Trønnes <noralf@tronnes.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220111132634.18302-1-tzimmermann@suse.de
2 years agodrm/gma500: remove redundant ret variable
Minghao Chi [Wed, 12 Jan 2022 08:25:24 +0000 (08:25 +0000)]
drm/gma500: remove redundant ret variable

Return value directly instead of taking this in another redundant
variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220112082524.667552-1-chi.minghao@zte.com.cn
2 years agodrm/doc: overview before functions for drm_writeback.c
Daniel Vetter [Tue, 11 Jan 2022 20:27:14 +0000 (21:27 +0100)]
drm/doc: overview before functions for drm_writeback.c

Otherwise it's really hard to link to that, which I realized when I
wanted to link to the property definitions for a question on irc.

Fix it.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Fixes: e2d7fc20b3e2 ("drm/writeback: wire drm_writeback.h to kernel-doc")
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Brian Starkey <brian.starkey@arm.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220111202714.1128406-1-daniel.vetter@ffwll.ch
2 years agodrm/v3d/v3d_drv: Check for error num after setting mask
Jiasheng Jiang [Mon, 10 Jan 2022 01:38:07 +0000 (09:38 +0800)]
drm/v3d/v3d_drv: Check for error num after setting mask

Because of the possible failure of the dma_supported(), the
dma_set_mask_and_coherent() may return error num.
Therefore, it should be better to check it and return the error if
fails.
Also, we can create a variable for the mask to solve the
alignment issue.

Fixes: 334dd38a3878 ("drm/v3d: Set dma_mask as well as coherent_dma_mask")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220110013807.4105270-1-jiasheng@iscas.ac.cn
2 years agodrm/mst: use DP_GET_SINK_COUNT() for sink count in ESI
Jani Nikula [Tue, 4 Jan 2022 18:48:57 +0000 (20:48 +0200)]
drm/mst: use DP_GET_SINK_COUNT() for sink count in ESI

Take bit 7 into account when reading sink count from
DP_DEVICE_SERVICE_IRQ_VECTOR_ESI0.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220104184857.784563-2-jani.nikula@intel.com
2 years agodrm/dp: note that DPCD 0x2002-0x2003 match 0x200-0x201
Jani Nikula [Tue, 4 Jan 2022 18:48:56 +0000 (20:48 +0200)]
drm/dp: note that DPCD 0x2002-0x2003 match 0x200-0x201

DP_SINK_COUNT_ESI and DP_DEVICE_SERVICE_IRQ_VECTOR_ESI0 have the same
contents as DP_SINK_COUNT and DP_DEVICE_SERVICE_IRQ_VECTOR,
respectively.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220104184857.784563-1-jani.nikula@intel.com
2 years agodrm/vc4: Notify the firmware when DRM is in charge
Maxime Ripard [Wed, 15 Dec 2021 09:51:17 +0000 (10:51 +0100)]
drm/vc4: Notify the firmware when DRM is in charge

Once the call to drm_fb_helper_remove_conflicting_framebuffers() has
been made, simplefb has been unregistered and the KMS driver is entirely
in charge of the display.

Thus, we can notify the firmware it can free whatever resource it was
using to maintain simplefb functional.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-5-maxime@cerno.tech
2 years agodrm/vc4: Remove conflicting framebuffers before callind bind_all
Maxime Ripard [Wed, 15 Dec 2021 09:51:16 +0000 (10:51 +0100)]
drm/vc4: Remove conflicting framebuffers before callind bind_all

The bind hooks will modify their controller registers, so simplefb is
going to be unusable anyway. Let's avoid any transient state where it
could still be in the system but no longer functionnal.

Acked-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-4-maxime@cerno.tech
2 years agodrm/vc4: Support nomodeset
Maxime Ripard [Wed, 15 Dec 2021 09:51:15 +0000 (10:51 +0100)]
drm/vc4: Support nomodeset

If we have nomodeset on the kernel command line we should have the
firmware framebuffer driver kept as is and not try to load the
full-blown KMS driver.

In this case, let's just register the v3d driver.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-3-maxime@cerno.tech
2 years agofirmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE
Maxime Ripard [Wed, 15 Dec 2021 09:51:14 +0000 (10:51 +0100)]
firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE

The RPI_FIRMWARE_NOTIFY_DISPLAY_DONE firmware call allows to tell the
firmware the kernel is in charge of the display now and the firmware can
free whatever resources it was using.

Acked-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-2-maxime@cerno.tech
2 years agodma-buf-map: Fix dot vs comma in example
Lucas De Marchi [Tue, 11 Jan 2022 00:33:05 +0000 (16:33 -0800)]
dma-buf-map: Fix dot vs comma in example

Fix typo: separate arguments with comma rather than dot.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220111003305.1214667-1-lucas.demarchi@intel.com
2 years agodrm/panfrost: Update create_bo flags comment
Alyssa Rosenzweig [Sun, 9 Jan 2022 16:37:04 +0000 (11:37 -0500)]
drm/panfrost: Update create_bo flags comment

Update a comment stating create_bo took no flags, since it now takes a
bit mask of optional flags NOEXEC and HEAP.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220109163704.2564-1-alyssa.rosenzweig@collabora.com
2 years agodrm/privacy_screen_x86: Add entry for ChromeOS privacy-screen
Rajat Jain [Fri, 7 Jan 2022 19:02:08 +0000 (11:02 -0800)]
drm/privacy_screen_x86: Add entry for ChromeOS privacy-screen

Add a static entry in the x86 table, to detect and wait for
privacy-screen on some ChromeOS platforms.

Please note that this means that if CONFIG_CHROMEOS_PRIVACY_SCREEN is
enabled, and if "GOOG0010" device is found in ACPI, then the i915 probe
shall return EPROBE_DEFER until a platform driver actually registers the
privacy-screen: https://hansdegoede.livejournal.com/25948.html

Signed-off-by: Rajat Jain <rajatja@google.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220107190208.95479-3-rajatja@google.com
2 years agoplatform/chrome: Add driver for ChromeOS privacy-screen
Rajat Jain [Fri, 7 Jan 2022 19:02:07 +0000 (11:02 -0800)]
platform/chrome: Add driver for ChromeOS privacy-screen

This adds the ACPI driver for the ChromeOS privacy screen that is
present on some chromeos devices.

Note that ideally, we'd want this privacy screen driver to be probed
BEFORE the drm probe in order to avoid a drm probe deferral:
https://hansdegoede.livejournal.com/25948.html

In practise, I found that ACPI drivers are bound to their devices AFTER
the drm probe on chromebooks. So on chromebooks with privacy-screen,
this patch along with the other one in this series results in a probe
deferral of about 250ms for i915 driver. However, it did not result in
any user noticeable delay of splash screen in my personal experience.

In future if this probe deferral turns out to be an issue, we can
consider turning this ACPI driver into something that is probed
earlier than the drm drivers.

Signed-off-by: Rajat Jain <rajatja@google.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220107190208.95479-2-rajatja@google.com
2 years agodrm/privacy_screen: Add drvdata in drm_privacy_screen
Rajat Jain [Fri, 7 Jan 2022 19:02:06 +0000 (11:02 -0800)]
drm/privacy_screen: Add drvdata in drm_privacy_screen

Allow a privacy screen provider to stash its private data pointer in the
drm_privacy_screen, and update the drm_privacy_screen_register() call to
accept that. Also introduce a *_get_drvdata() so that it can retrieved
back when needed.

This also touches the IBM Thinkpad platform driver, the only user of
privacy screen today, to pass NULL for now to the updated API.

Signed-off-by: Rajat Jain <rajatja@google.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220107190208.95479-1-rajatja@google.com
2 years agodrm: bridge: adv7511: Fix ADV7535 HPD enablement
Jagan Teki [Sun, 9 Jan 2022 17:29:49 +0000 (22:59 +0530)]
drm: bridge: adv7511: Fix ADV7535 HPD enablement

Existing HPD enablement logic is not compatible with ADV7535
bridge, thus any runtime plug-in of HDMI cable is not working
on these bridge designs.

Unlike other ADV7511 family of bridges, the ADV7535 require
HPD_OVERRIDE bit to set and reset for proper handling of HPD
functionality.

Fix it.

Fixes: 8501fe4b14a3 ("drm: bridge: adv7511: Add support for ADV7535")
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220109172949.168167-1-jagan@amarulasolutions.com
Reviewed-by: Robert Foss <robert.foss@linaro.org>
2 years agodrm/bridge: anx7625: add audio codec .get_eld support
Xin Ji [Thu, 6 Jan 2022 10:01:26 +0000 (18:01 +0800)]
drm/bridge: anx7625: add audio codec .get_eld support

Provide .get_eld interface in hdmi_codec_ops for hdmi-codec driver.

Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Xin Ji <xji@analogixsemi.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220106100127.1862702-3-xji@analogixsemi.com
2 years agodrm/bridge: anx7625: add HDCP support
Xin Ji [Thu, 6 Jan 2022 10:01:25 +0000 (18:01 +0800)]
drm/bridge: anx7625: add HDCP support

This patch provides HDCP setting interface for userspace to dynamic
enable/disable HDCP function.

Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Xin Ji <xji@analogixsemi.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220106100127.1862702-2-xji@analogixsemi.com
2 years agodrm/bridge: anx7625: Add bridge helper atomic conversion
Xin Ji [Thu, 6 Jan 2022 10:01:24 +0000 (18:01 +0800)]
drm/bridge: anx7625: Add bridge helper atomic conversion

Add bridge helper atomic conversion.

Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Xin Ji <xji@analogixsemi.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220106100127.1862702-1-xji@analogixsemi.com
2 years agodrm/vkms: drop "Multiple overlay planes" TODO
José Expósito [Fri, 7 Jan 2022 18:28:09 +0000 (19:28 +0100)]
drm/vkms: drop "Multiple overlay planes" TODO

Remove the task from the TODO list.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220107182809.141003-3-jose.exposito89@gmail.com
2 years agodrm/vkms: add support for multiple overlay planes
José Expósito [Fri, 7 Jan 2022 18:28:08 +0000 (19:28 +0100)]
drm/vkms: add support for multiple overlay planes

Create 8 overlay planes instead of 1 when the "enable_overlay" module
parameter is set.

The following igt-gpu-tools tests were executed without finding
regressions. Notice than the numbers are identical:

                    |     master branch     |      this  patch      |
                    | SUCCESS | SKIP | FAIL | SUCCESS | SKIP | FAIL |
 kms_atomic         |      10 |   02 |   00 |      10 |   02 |   00 |
 kms_plane_cursor   |      09 |   45 |   00 |      09 |   45 |   00 |
 kms_plane_multiple |      01 |   23 |   00 |      01 |   23 |   00 |
 kms_writeback      |      04 |   00 |   00 |      04 |   00 |   00 |

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220107182809.141003-2-jose.exposito89@gmail.com
2 years agodrm/vkms: refactor overlay plane creation
José Expósito [Fri, 7 Jan 2022 18:28:07 +0000 (19:28 +0100)]
drm/vkms: refactor overlay plane creation

Move the logic to create an overlay plane to its own function.
Refactor, no functional changes.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220107182809.141003-1-jose.exposito89@gmail.com
2 years agodrm/bridge/tc358775: Fix for dual-link LVDS
Jiri Vanek [Thu, 6 Jan 2022 19:00:27 +0000 (20:00 +0100)]
drm/bridge/tc358775: Fix for dual-link LVDS

Fixed wrong register shift for single/dual link LVDS output.

Tested-by: Jiri Vanek <jirivanek1@gmail.com>
Signed-off-by: Jiri Vanek <jirivanek1@gmail.com>
Reviewed-by: Vinay Simha BN <simhavcs@gmail.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220106190027.1498-1-jirivanek1@gmail.com
2 years agodrm: omapdrm: Fix implicit dma_buf fencing
Ivaylo Dimitrov [Wed, 5 Jan 2022 15:36:58 +0000 (17:36 +0200)]
drm: omapdrm: Fix implicit dma_buf fencing

Currently omapdrm driver does not initialize dma_buf_export_info resv
member, which leads to a new dma_resv being allocated and attached to
the exported dma_buf. This leads to the issue that fences created on
dma_buf objects imported by other drivers are ignored by omapdrm, as only
fences in gem object resv are waited on. This leads to various issues like
displaying incomplete frames.

Fix that by initializing dma_buf resv to the resv of the gem object being
exported.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Tested-by: Merlijn Wajer <merlijn@wizzup.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1641397018-29872-1-git-send-email-ivo.g.dimitrov.75@gmail.com
2 years agodrm/ast: Enable the supporting of wide screen on AST2600
KuoHsiang Chou [Wed, 29 Dec 2021 08:27:49 +0000 (16:27 +0800)]
drm/ast: Enable the supporting of wide screen on AST2600

Enable the supporting of wide sscreen on AST2600, so that the resolution
of 16:9 and 16:10 are able to be selected on Display Settings.

Signed-off-by: KuoHsiang Chou <kuohsiang_chou@aspeedtech.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211229082749.5415-1-kuohsiang_chou@aspeedtech.com
2 years agodrm/panel: Update Boe-tv110c9m initial code
yangcong [Fri, 31 Dec 2021 04:50:56 +0000 (12:50 +0800)]
drm/panel: Update Boe-tv110c9m initial code

Optimize two problems

a)Turn off low voltage detection register.During the esd test,
the low-voltage detection ic may be triggered to enter the slpin state,
so a black screen occurs on the panel.
b)Optimize CMD2 page1 gamma.

Signed-off-by: yangcong <yangcong5@huaqin.corp-partner.google.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211231045056.118640-1-yangcong5@huaqin.corp-partner.google.com
2 years agodrm/plane: Fix typo in format_mod_supported documentation
José Expósito [Sun, 26 Dec 2021 11:24:59 +0000 (12:24 +0100)]
drm/plane: Fix typo in format_mod_supported documentation

Fix minor typo: "valdiate" -> "validate".

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/20211226112503.31771-3-jose.exposito89@gmail.com
2 years agodrm/plane: Make format_mod_supported truly optional
José Expósito [Sun, 26 Dec 2021 11:24:58 +0000 (12:24 +0100)]
drm/plane: Make format_mod_supported truly optional

The documentation for "drm_plane_funcs.format_mod_supported" reads:

  This *optional* hook is used for the DRM to determine if the given
  format/modifier combination is valid for the plane. This allows the
  DRM to generate the correct format bitmask (which formats apply to
  which modifier), and to validate modifiers at atomic_check time.

  *If not present*, then any modifier in the plane's modifier
  list is allowed with any of the plane's formats.

However, where the function is not present, an invalid IN_FORMATS blob
property with modifiers but no formats is exposed to user-space.

This breaks the latest Weston [1]. For testing purposes, I extracted the
affected code to a standalone program [2].

Make "create_in_format_blob" behave as documented.

[1] https://gitlab.freedesktop.org/wayland/weston/-/blob/9.0/libweston/backend-drm/kms.c#L431
[2] https://github.com/JoseExposito/drm-sandbox/blob/main/in_formats.c

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/20211226112503.31771-2-jose.exposito89@gmail.com
2 years agodrm/bridge: nwl-dsi: Fix PM disable depth imbalance in nwl_dsi_probe
Miaoqian Lin [Wed, 5 Jan 2022 10:48:26 +0000 (10:48 +0000)]
drm/bridge: nwl-dsi: Fix PM disable depth imbalance in nwl_dsi_probe

The pm_runtime_enable will increase power disable depth.
Thus a pairing decrement is needed on the error handling
path to keep it balanced according to context.

Fixes: 44cfc6233447 ("drm/bridge: Add NWL MIPI DSI host controller support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220105104826.1418-1-linmq006@gmail.com
Reviewed-by: Robert Foss <robert.foss@linaro.org>
2 years agodrm/bridge: Add missing pm_runtime_disable() in __dw_mipi_dsi_probe
Miaoqian Lin [Wed, 5 Jan 2022 10:41:09 +0000 (10:41 +0000)]
drm/bridge: Add missing pm_runtime_disable() in __dw_mipi_dsi_probe

If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().
Add missing pm_runtime_disable() for __dw_mipi_dsi_probe.

Fixes: 46fc51546d44 ("drm/bridge/synopsys: Add MIPI DSI host controller bridge")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220105104113.31415-1-linmq006@gmail.com
Reviewed-by: Robert Foss <robert.foss@linaro.org>
2 years agodrm/bridge: parade-ps8640: Link device to ensure suspend/resume order
AngeloGioacchino Del Regno [Wed, 5 Jan 2022 09:08:02 +0000 (10:08 +0100)]
drm/bridge: parade-ps8640: Link device to ensure suspend/resume order

Entering suspend while the display attached to this bridge is still on
makes the resume sequence to resume the bridge first, display last:
when this happens, we get a timeout while resuming the bridge, as its
MCU will get stuck due to the display being unpowered.

On the other hand, on mt8173-elm, closing the lid makes the display to
get powered off first, bridge last, so at resume time the sequence is
swapped (compared to the first example) and everything just works
as expected.

Add a stateless device link to the DRM device that this bridge belongs
to, ensuring a correct resume sequence and solving the unability to
correctly resume bridge operation in the first mentioned example.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220105090802.73564-1-angelogioacchino.delregno@collabora.com
Reviewed-by: Robert Foss <robert.foss@linaro.org>
2 years agodrm: exynos: dsi: Add mode_set function
Jagan Teki [Mon, 22 Nov 2021 07:06:33 +0000 (12:36 +0530)]
drm: exynos: dsi: Add mode_set function

Get the display mode settings via mode_set bridge function
instead of explicitly de-reference.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211122070633.89219-3-jagan@amarulasolutions.com
2 years agodrm: exynos: dsi: Convert to bridge driver
Jagan Teki [Mon, 22 Nov 2021 07:06:32 +0000 (12:36 +0530)]
drm: exynos: dsi: Convert to bridge driver

Some display panels would come up with a non-DSI output, those
can have an option to connect the DSI host by means of interface
bridge converter.

This DSI to non-DSI interface bridge converter would requires
DSI Host to handle drm bridge functionalities in order to DSI
Host to Interface bridge.

This patch convert the existing to a drm bridge driver with a
built-in encoder support for compatibility with existing
component drivers.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211122070633.89219-2-jagan@amarulasolutions.com
2 years agodrm/bridge: anx7625: Fix null vs IS_ERR() checking in anx7625_register_i2c_dummy_clients
Miaoqian Lin [Wed, 22 Dec 2021 08:33:48 +0000 (08:33 +0000)]
drm/bridge: anx7625: Fix null vs IS_ERR() checking in anx7625_register_i2c_dummy_clients

Since i2c_new_client_device() function return error pointers.
The i2c_new_dummy_device() function does not return NULL, It returns error
pointers too. Using IS_ERR() to check the return value to fix this.

Fixes: 8bdfc5dae4e3("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211222083350.18514-1-linmq006@gmail.com
Reviewed-by: Robert Foss <robert.foss@linaro.org>
2 years agodrm/bridge: anx7625: Check GPIO description to avoid crash
Xin Ji [Fri, 19 Nov 2021 01:58:04 +0000 (09:58 +0800)]
drm/bridge: anx7625: Check GPIO description to avoid crash

As GPIO probe function "devm_gpiod_get_optional()" may return error
code, driver should identify GPIO desc as NULL to avoid crash.

Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Xin Ji <xji@analogixsemi.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211119015804.3824027-1-xji@analogixsemi.com
Reviewed-by: Robert Foss <robert.foss@linaro.org>
2 years agodrm/stm: ltdc: support of new hardware version
Yannick Fertre [Fri, 3 Dec 2021 08:56:18 +0000 (09:56 +0100)]
drm/stm: ltdc: support of new hardware version

Add support of new hardware version 0x40100.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Reviewed-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Tested-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211203085618.11314-1-yannick.fertre@foss.st.com
2 years agodrm/stm: remove conflicting framebuffers
Yannick Fertre [Mon, 6 Dec 2021 13:47:35 +0000 (14:47 +0100)]
drm/stm: remove conflicting framebuffers

In case of using simplefb or another conflicting framebuffer,
call drm_aperture_remove_framebuffers() to remove memory allocated.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211206134735.13537-1-yannick.fertre@foss.st.com
2 years agodrm/bridge: Fix free wrong object in sii8620_init_rcp_input_dev
Miaoqian Lin [Mon, 27 Dec 2021 09:25:22 +0000 (09:25 +0000)]
drm/bridge: Fix free wrong object in sii8620_init_rcp_input_dev

rc_dev is allocated by rc_allocate_device(), and doesn't assigned to
ctx->rc_dev before calling  rc_free_device(ctx->rc_dev).
So it should call rc_free_device(rc_dev);

Fixes: e25f1f7c94e1 ("drm/bridge/sii8620: add remote control support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211227092522.21755-1-linmq006@gmail.com
2 years agodrm/bridge: chipone-icn6211: Add mode_set API
Jagan Teki [Fri, 19 Nov 2021 14:53:25 +0000 (20:23 +0530)]
drm/bridge: chipone-icn6211: Add mode_set API

Get the display mode settings via mode_set bridge
function instead of explicitly de-reference.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211119145325.1775046-2-jagan@amarulasolutions.com
Reviewed-by: Robert Foss <robert.foss@linaro.org>
2 years agodrm/bridge: chipone-icn6211: Switch to atomic operations
Jagan Teki [Fri, 19 Nov 2021 14:53:24 +0000 (20:23 +0530)]
drm/bridge: chipone-icn6211: Switch to atomic operations

Replace atomic version of the pre_enable/enable/post_disable
operations to continue the transition to the atomic API.

Also added default drm atomic operations for duplicate, destroy
and reset state API's in order to have smooth transition on
atomic API's.

Tested on Allwinner R16/R40 DSI.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211119145325.1775046-1-jagan@amarulasolutions.com
2 years agodrm/stm: dsi: provide the implementation of mode_valid()
Antonio Borneo [Sat, 18 Dec 2021 21:50:54 +0000 (22:50 +0100)]
drm/stm: dsi: provide the implementation of mode_valid()

The dsi has several constraints on the video modes it can support,
mainly due to the frequencies that can be generated by the PLL
integrated in the DSI device.

Verify that the required HS clock can be generated by the PLL.

The dsi clock from the dsi PLL and the ltdc pixel clock are
asynchronous. The dsi needs to return in LP mode during HFP or HBP
to re-synchronize at each video line.

Verify that the duration of HFP and HBP allows the dsi to enter in
LP mode.

Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>
Reviewed-by: Philippe Cornu <philippe.cornu@foss.st.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211218215055.212421-3-antonio.borneo@foss.st.com
2 years agodrm/bridge/synopsys: dsi: extend the prototype of mode_valid()
Antonio Borneo [Sat, 18 Dec 2021 21:50:53 +0000 (22:50 +0100)]
drm/bridge/synopsys: dsi: extend the prototype of mode_valid()

To evaluate the validity of a video mode, some additional internal
value has to be passed to the platform implementation.

Extend the prototype of mode_valid().

Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Reviewed-by: Philippe Cornu <philippe.cornu@foss.st.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211218215055.212421-2-antonio.borneo@foss.st.com
2 years agodrm/stm: dsi: move lane capability detection in probe()
Antonio Borneo [Sat, 18 Dec 2021 21:50:52 +0000 (22:50 +0100)]
drm/stm: dsi: move lane capability detection in probe()

There is no need to re-compute the dsi lane capability because it
only depends on dsi hw version.
Since dsi hw version is detected at probe(), move there also the
assignment of dsi lane capability.

Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>
Reviewed-by: Philippe Cornu <philippe.cornu@foss.st.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211218215055.212421-1-antonio.borneo@foss.st.com
2 years agodrm/meson: Fix error handling when afbcd.ops->init fails
Martin Blumenstingl [Thu, 30 Dec 2021 23:55:15 +0000 (00:55 +0100)]
drm/meson: Fix error handling when afbcd.ops->init fails

When afbcd.ops->init fails we need to free the struct drm_device. Also
all errors which come after afbcd.ops->init was successful need to exit
the AFBCD, just like meson_drv_unbind() does.

Fixes: d1b5e41e13a7e9 ("drm/meson: Add AFBCD module driver")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211230235515.1627522-3-martin.blumenstingl@googlemail.com
2 years agodrm/meson: osd_afbcd: Add an exit callback to struct meson_afbcd_ops
Martin Blumenstingl [Thu, 30 Dec 2021 23:55:14 +0000 (00:55 +0100)]
drm/meson: osd_afbcd: Add an exit callback to struct meson_afbcd_ops

Use this to simplify the driver shutdown. It will also come handy when
fixing the error handling in meson_drv_bind_master().

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Fixes: d1b5e41e13a7e9 ("drm/meson: Add AFBCD module driver")
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211230235515.1627522-2-martin.blumenstingl@googlemail.com
2 years agodrm/bridge: sn65dsi83: Fix an error handling path in sn65dsi83_probe()
Christophe JAILLET [Wed, 29 Dec 2021 08:58:44 +0000 (09:58 +0100)]
drm/bridge: sn65dsi83: Fix an error handling path in sn65dsi83_probe()

sn65dsi83_parse_dt() takes a reference on 'ctx->host_node' that must be
released in the error handling path of this function and of the probe.
This is only done in the remove function up to now.

Fixes: ceb515ba29ba ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/4bc21aed4b60d3d5ac4b28d8b07a6fdd8da6a536.1640768126.git.christophe.jaillet@wanadoo.fr
2 years agodrm/dbi: Use a static inline stub for mipi_dbi_debugfs_init()
Ville Syrjälä [Tue, 21 Dec 2021 19:37:54 +0000 (21:37 +0200)]
drm/dbi: Use a static inline stub for mipi_dbi_debugfs_init()

Replace the slightly odd "#define <function> NULL" thing with
a standard static inline stub.

Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211221193754.12287-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
2 years agodrm/bridge: ti-sn65dsi83: Add vcc supply regulator support
Alexander Stein [Mon, 13 Dec 2021 13:36:26 +0000 (14:36 +0100)]
drm/bridge: ti-sn65dsi83: Add vcc supply regulator support

VCC needs to be enabled before releasing the enable GPIO.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211213133626.2498056-5-alexander.stein@ew.tq-group.com
2 years agodt-bindings: drm/bridge: ti-sn65dsi83: Add vcc supply bindings
Alexander Stein [Mon, 13 Dec 2021 13:36:25 +0000 (14:36 +0100)]
dt-bindings: drm/bridge: ti-sn65dsi83: Add vcc supply bindings

Add a VCC regulator which needs to be enabled before the EN pin is
released.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211213133626.2498056-4-alexander.stein@ew.tq-group.com
2 years agodrm/bridge: ti-sn65dsi83: Make enable GPIO optional
Alexander Stein [Mon, 13 Dec 2021 13:36:24 +0000 (14:36 +0100)]
drm/bridge: ti-sn65dsi83: Make enable GPIO optional

The enable signal may not be controllable by the kernel. Make it
optional.
This is a similar to commit bbda1704fc15 ("drm/bridge: ti-sn65dsi86: Make
enable GPIO optional")

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211213133626.2498056-3-alexander.stein@ew.tq-group.com
2 years agodt-bindings: display: bridge: sn65dsi83: Make enable GPIO optional
Laurent Pinchart [Mon, 13 Dec 2021 13:36:23 +0000 (14:36 +0100)]
dt-bindings: display: bridge: sn65dsi83: Make enable GPIO optional

The SN65DSI8x EN signal may be tied to VCC, or otherwise controlled by
means not available to the kernel. Make the GPIO optional.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211213133626.2498056-2-alexander.stein@ew.tq-group.com
2 years agodrm: fix error found in some cases after the patch d1af5cd86997
Claudio Suarez [Thu, 2 Dec 2021 09:51:12 +0000 (10:51 +0100)]
drm: fix error found in some cases after the patch d1af5cd86997

The patch d1af5cd86997 ("drm: get rid of DRM_DEBUG_* log
calls in drm core, files drm_a*.c") fails when the drm_device
cannot be found in the parameter plane_state->crtc.
Fix it using plane_state->plane.

Reported-by: kernel test robot <oliver.sang@intel.com>
Fixes: 6e22dc358377 ("drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c")
Signed-off-by: Claudio Suarez <cssk@net-c.es>
[danvet: fix Fixes: line]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/YaiXEARd8z2C463h@gineta.localdomain
2 years agomock a drm_plane in igt_check_plane_state to make the test more robust
Claudio Suarez [Thu, 2 Dec 2021 09:49:49 +0000 (10:49 +0100)]
mock a drm_plane in igt_check_plane_state to make the test more robust

igt_check_plane_state test crashes in drm_atomic_helper_check_plane_state
when trying to de-reference drm_plane_state->plane->dev
due to the lack of a struct drm_plane in the mock struct drm_plane_state.
Since drm_plane_state always should contain a plane, the mock also
needs a plane to be the test more robust and realistic. Add it.

Signed-off-by: Claudio Suarez <cssk@net-c.es>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/YaiWvQESctDMipjh@gineta.localdomain
2 years agodrm/nouveau/disp/dp: add support for eDP link rates
Ben Skeggs [Tue, 23 Nov 2021 08:18:06 +0000 (18:18 +1000)]
drm/nouveau/disp/dp: add support for eDP link rates

eDP 1.4 adds a table of link rates supported by the sink to DPCD, as
well as a LINK_RATE_SET register to select between the entries in it.

If present, we will use this data to generate our internal link rate
table rather than using the standard list based on MAX_LINK_RATE.

Some recent laptops report MAX_LINK_RATE=0, and require this support.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/17
2 years agodrm/nouveau/disp/dp: add support for hbr3
Ben Skeggs [Tue, 23 Nov 2021 08:18:03 +0000 (18:18 +1000)]
drm/nouveau/disp/dp: add support for hbr3

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/17
2 years agodrm/nouveau/disp/dp: add support for lttprs
Ben Skeggs [Tue, 23 Nov 2021 08:18:00 +0000 (18:18 +1000)]
drm/nouveau/disp/dp: add support for lttprs

Add support for Link-Training Tunable PHY Repeaters, required to support
higher bit rates on longer cables, as well as USB-C on certain docks and
laptops.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/17
2 years agodrm/nouveau/disp/dp: fixup cr/eq delays for 1.4
Ben Skeggs [Tue, 23 Nov 2021 08:17:56 +0000 (18:17 +1000)]
drm/nouveau/disp/dp: fixup cr/eq delays for 1.4

Also use usleep_range() instead of [um]delay() to be a bit nicer.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/17
2 years agodrm/nouveau/disp/dp: add support for tps4
Ben Skeggs [Tue, 23 Nov 2021 08:17:54 +0000 (18:17 +1000)]
drm/nouveau/disp/dp: add support for tps4

Required for HBR3 and LTTPR.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/17
2 years agodrm/nouveau/disp/dp: generate supported link rates table at detect time
Ben Skeggs [Tue, 23 Nov 2021 08:17:52 +0000 (18:17 +1000)]
drm/nouveau/disp/dp: generate supported link rates table at detect time

Replaces the static list used during link training with a table built
dynamically from the union of source and sink capabilities.

Preparation for adding support for HBR3, LTTPR and eDP 1.4 link rates.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/17
2 years agodrm/nouveau/disp/dp: explicitly control scrambling when setting pattern
Ben Skeggs [Tue, 23 Nov 2021 08:17:49 +0000 (18:17 +1000)]
drm/nouveau/disp/dp: explicitly control scrambling when setting pattern

TPS1/2/3 require scrambling to be disabled.  The IED scripts on earlier
boards used to handle this, but appear not to anymore.

TPS4 support will also require scrambling to remain enabled.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/17
2 years agodrm/nouveau/disp: remove some remnant of a rework
Ben Skeggs [Tue, 23 Nov 2021 08:17:43 +0000 (18:17 +1000)]
drm/nouveau/disp: remove some remnant of a rework

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/17
2 years agodrm/vmwgfx: Fix possible usage of an uninitialized variable
Zack Rusin [Wed, 15 Dec 2021 20:02:24 +0000 (15:02 -0500)]
drm/vmwgfx: Fix possible usage of an uninitialized variable

vmw_user_bo_lookup can fail to lookup user buffers, especially because
the buffer handles come from the userspace. The return value has
to be checked before the buffers are put back.

This was spotted by Dan's Smatch statick checker:
    drivers/gpu/drm/vmwgfx/vmwgfx_bo.c:574 vmw_user_bo_synccpu_release()
error: uninitialized symbol 'vmw_bo'.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM")
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215200224.3693345-1-zack@kde.org
2 years agodrm/vmwgfx: Remove unused compile options
Zack Rusin [Wed, 15 Dec 2021 18:41:47 +0000 (13:41 -0500)]
drm/vmwgfx: Remove unused compile options

Before the driver had screen targets support we had to disable explicit
bringup of its infrastructure because it was breaking screen objects
support.
Since the implementation of screen targets landed there hasn't been a
reason to explicitly disable it and the options were never used.
Remove of all that unused code.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support")
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215184147.3688785-3-zack@kde.org
2 years agodrm/vmwgfx: Remove explicit transparent hugepages support
Zack Rusin [Wed, 15 Dec 2021 18:41:46 +0000 (13:41 -0500)]
drm/vmwgfx: Remove explicit transparent hugepages support

Old versions of the svga device used to export virtual vram, handling of
which was optimized on top of transparent hugepages support. Only very
old devices (OpenGL 2.1 support and earlier) used this code and at this
point performance differences are negligible.

Because the code requires very old hardware versions to run it has
been largely untested and unused for a long time.

Furthermore removal of the ttm hugepages support in:
commit 0d979509539e ("drm/ttm: remove ttm_bo_vm_insert_huge()")
broke the coherency mode in vmwgfx when running with hugepages.

Fixes: 0d979509539e ("drm/ttm: remove ttm_bo_vm_insert_huge()")
Signed-off-by: Zack Rusin <zackr@vmware.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Maaz Mombasawala <mombasawalam@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215184147.3688785-2-zack@kde.org
2 years agodrm/vmwgfx: Fix a size_t/long int format specifier mismatch
Zack Rusin [Wed, 15 Dec 2021 18:41:45 +0000 (13:41 -0500)]
drm/vmwgfx: Fix a size_t/long int format specifier mismatch

On i386 size_t is of course 32bits and using long int throws warnings,
trivially fix it by using the dedicated size_t format.

This is enough to fix the following warning found by the kernel test
robot:
   drivers/gpu/drm/vmwgfx/vmwgfx_gem.c: In function 'vmw_bo_print_info':
>> drivers/gpu/drm/vmwgfx/vmwgfx_gem.c:230:33: warning: format '%ld'
expects argument of type 'long int', but argument 4 has type 'size_t'
{aka 'unsigned int'} [-Wformat=]
     230 |  seq_printf(m, "\t\t0x%08x: %12ld bytes %s, type = %s",
         |                             ~~~~^
         |                                 |
         |                                 long int
         |                             %12d
     231 |      id, bo->base.base.size, placement, type);
         |          ~~~~~~~~~~~~~~~~~~
         |                       |

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Zack Rusin <zackr@vmware.com>
Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM")
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Maaz Mombasawala <mombasawalam@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215184147.3688785-1-zack@kde.org
2 years agodrm/ingenic: Add support for JZ4780 and HDMI output
Paul Boddie [Thu, 2 Dec 2021 18:39:47 +0000 (19:39 +0100)]
drm/ingenic: Add support for JZ4780 and HDMI output

Add support for the LCD controller present on JZ4780 SoCs.
This SoC uses 8-byte descriptors which extend the current
4-byte descriptors used for other Ingenic SoCs.

Tested on MIPS Creator CI20 board.

Signed-off-by: Paul Boddie <paul@boddie.org.uk>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/caf9e56b64b0717563e03172b30fa03736e92e15.1638470392.git.hns@goldelico.com
2 years agodrm/ingenic: prepare ingenic drm for later addition of JZ4780
H. Nikolaus Schaller [Thu, 2 Dec 2021 18:39:46 +0000 (19:39 +0100)]
drm/ingenic: prepare ingenic drm for later addition of JZ4780

This changes the way the regmap is allocated to prepare for the
later addition of the JZ4780 which has more registers and bits
than the others.

Therefore we make the regmap as big as the reg property in
the device tree tells.

Suggested-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://patchwork.freedesktop.org/patch/msgid/ee65e70e91268b3963f8a6581c8aa6c3b643c53e.1638470392.git.hns@goldelico.com
2 years agodrm/tilcdc: add const to of_device_id
Xiang wangx [Thu, 16 Dec 2021 09:55:36 +0000 (17:55 +0800)]
drm/tilcdc: add const to of_device_id

struct of_device_id should normally be const.

Signed-off-by: Xiang wangx <wangxiang@cdjrlc.com>
Reviewed-by: Jyri Sarha <jyri.sarha@iki.fi>
Signed-off-by: Jyri Sarha <jyri.sarha@iki.fi>
Link: https://patchwork.freedesktop.org/patch/msgid/20211216095536.58577-1-wangxiang@cdjrlc.com
2 years agoMerge drm/drm-next into drm-misc-next
Thomas Zimmermann [Thu, 16 Dec 2021 13:47:38 +0000 (14:47 +0100)]
Merge drm/drm-next into drm-misc-next

Backmerging for v5.16-rc5. Resolves a conflict between drm-misc-next
and drm-misc-fixes in the vc4 driver.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2 years agodrm/bridge: ti-sn65dsi86: Set max register for regmap
Stephen Boyd [Wed, 15 Dec 2021 00:25:29 +0000 (16:25 -0800)]
drm/bridge: ti-sn65dsi86: Set max register for regmap

Set the maximum register to 0xff so we can dump the registers for this
device in debugfs.

Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver")
Cc: Rob Clark <robdclark@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211215002529.382383-1-swboyd@chromium.org
2 years agodrm/ast: Move I2C code into separate source file
Thomas Zimmermann [Mon, 6 Dec 2021 09:11:25 +0000 (10:11 +0100)]
drm/ast: Move I2C code into separate source file

Move I2C code into its own source file. Makes the mode-setting
code a little less convoluted.

v3:
* fix SPDX tag to say 'SPDX-License-Identifier'

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20211206091125.29501-4-tzimmermann@suse.de
2 years agodrm/ast: Convert I2C code to managed cleanup
Thomas Zimmermann [Mon, 6 Dec 2021 09:11:24 +0000 (10:11 +0100)]
drm/ast: Convert I2C code to managed cleanup

Release the I2C adapter as part of the DRM device cleanup. Remove
ast's dedicated helper for struct drm_connector_funcs.destroy.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20211206091125.29501-3-tzimmermann@suse.de
2 years agodrm/ast: Handle failed I2C initialization gracefully
Thomas Zimmermann [Mon, 6 Dec 2021 09:11:23 +0000 (10:11 +0100)]
drm/ast: Handle failed I2C initialization gracefully

I2C initialization is allowed to fail. In this case, create a connector
without DDC adapter. The current code would dereference a NULL pointer.

Reading the modes from the connector is supposed to work without I2C
adapter. Add the respective test.

v2:
* init edid to NULL to avoid uninitialized read (Dan)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20211206091125.29501-2-tzimmermann@suse.de
2 years agodrm/vc4: plane: Add support for YUV color encodings and ranges
Dave Stevenson [Wed, 15 Dec 2021 09:17:39 +0000 (10:17 +0100)]
drm/vc4: plane: Add support for YUV color encodings and ranges

The BT601/BT709 color encoding and limited vs full
range properties were not being exposed, defaulting
always to BT601 limited range.

Expose the parameters and set the registers appropriately.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech
2 years agodrm/vc4: plane: Add support for DRM_FORMAT_P030
Dave Stevenson [Wed, 15 Dec 2021 09:17:38 +0000 (10:17 +0100)]
drm/vc4: plane: Add support for DRM_FORMAT_P030

The P030 format, used with the DRM_FORMAT_MOD_BROADCOM_SAND128 modifier,
is a format output by the video decoder on the BCM2711.

Add native support to the KMS planes for that format.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech
2 years agodrm/fourcc: Add packed 10bit YUV 4:2:0 format
Dave Stevenson [Wed, 15 Dec 2021 09:17:37 +0000 (10:17 +0100)]
drm/fourcc: Add packed 10bit YUV 4:2:0 format

Adds a format that is 3 10bit YUV 4:2:0 samples packed into
a 32bit word (with 2 spare bits).

Supported on Broadcom BCM2711 chips.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20211215091739.135042-2-maxime@cerno.tech
2 years agodrm/simpledrm: Add [AX]RGB2101010 formats
Hector Martin [Sun, 12 Dec 2021 06:24:07 +0000 (15:24 +0900)]
drm/simpledrm: Add [AX]RGB2101010 formats

This is the format used by the bootloader framebuffer on Apple ARM64
platforms.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211212062407.138309-4-marcan@marcan.st
2 years agodrm/format-helper: Add drm_fb_xrgb8888_to_xrgb2101010_toio()
Hector Martin [Sun, 12 Dec 2021 06:24:06 +0000 (15:24 +0900)]
drm/format-helper: Add drm_fb_xrgb8888_to_xrgb2101010_toio()

Add XRGB8888 emulation support for devices that can only do XRGB2101010.

This is chiefly useful for simpledrm on Apple devices where the
bootloader-provided framebuffer is 10-bit.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211212062407.138309-3-marcan@marcan.st
2 years agoof: Move simple-framebuffer device handling from simplefb to of
Hector Martin [Sun, 12 Dec 2021 06:24:05 +0000 (15:24 +0900)]
of: Move simple-framebuffer device handling from simplefb to of

This code is required for both simplefb and simpledrm, so let's move it
into the OF core instead of having it as an ad-hoc initcall in the
drivers.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211212062407.138309-2-marcan@marcan.st
2 years agodrm/panel: simple: Add Team Source Display TST043015CMHX panel
Marek Vasut [Sat, 27 Nov 2021 03:19:09 +0000 (04:19 +0100)]
drm/panel: simple: Add Team Source Display TST043015CMHX panel

Add Team Source Display TST043015CMHX 4.3" 480x272 DPI panel support.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
To: dri-devel@lists.freedesktop.org
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211127031909.283383-3-marex@denx.de
2 years agodt-bindings: display: simple: Add Team Source Display TST043015CMHX panel
Marek Vasut [Sat, 27 Nov 2021 03:19:08 +0000 (04:19 +0100)]
dt-bindings: display: simple: Add Team Source Display TST043015CMHX panel

Add Team Source Display TST043015CMHX 4.3" 480x272 DPI panel
compatible string.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
To: dri-devel@lists.freedesktop.org
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211127031909.283383-2-marex@denx.de
2 years agodt-bindings: Add Team Source Display Technology vendor prefix
Marek Vasut [Sat, 27 Nov 2021 03:19:07 +0000 (04:19 +0100)]
dt-bindings: Add Team Source Display Technology vendor prefix

Add vendor prefix for Team Source Display Technology Co., Ltd.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
To: dri-devel@lists.freedesktop.org
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211127031909.283383-1-marex@denx.de
2 years agodrm/bridge: lvds-codec: Add support for pixel data sampling edge select
Marek Vasut [Sun, 17 Oct 2021 00:12:04 +0000 (02:12 +0200)]
drm/bridge: lvds-codec: Add support for pixel data sampling edge select

The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to
select input pixel data sampling edge. Add DT property "pclk-sample", not
the same as the one used by display timings but rather the same as used by
media, and configure bus flags based on this DT property.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
To: dri-devel@lists.freedesktop.org
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211017001204.299940-2-marex@denx.de
2 years agodt-bindings: display: bridge: lvds-codec: Document pixel data sampling edge select
Marek Vasut [Sun, 17 Oct 2021 00:12:03 +0000 (02:12 +0200)]
dt-bindings: display: bridge: lvds-codec: Document pixel data sampling edge select

The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to
select input pixel data sampling edge. Add DT property "pclk-sample", not
the same as the one used by display timings but rather the same as used by
media, to define the pixel data sampling edge.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: devicetree@vger.kernel.org
To: dri-devel@lists.freedesktop.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20211017001204.299940-1-marex@denx.de
2 years agodrm/vc4: kms: Wait for the commit before increasing our clock rate
Maxime Ripard [Wed, 17 Nov 2021 09:45:22 +0000 (10:45 +0100)]
drm/vc4: kms: Wait for the commit before increasing our clock rate

Several DRM/KMS atomic commits can run in parallel if they affect
different CRTC. These commits share the global HVS state, so we have
some code to make sure we run commits in sequence. This synchronization
code is one of the first thing that runs in vc4_atomic_commit_tail().

Another constraints we have is that we need to make sure the HVS clock
gets a boost during the commit. That code relies on clk_set_min_rate and
will remove the old minimum and set a new one. We also need another,
temporary, minimum for the duration of the commit.

The algorithm is thus to set a temporary minimum, drop the previous
one, do the commit, and finally set the minimum for the current mode.

However, the part that sets the temporary minimum and drops the older
one runs before the commit synchronization code.

Thus, under the proper conditions, we can end up mixing up the minimums
and ending up with the wrong one for our current step.

To avoid it, let's move the clock setup in the protected section.

Fixes: d7d96c00e585 ("drm/vc4: hvs: Boost the core clock during modeset")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Tested-by: Jian-Hong Pan <jhp@endlessos.org>
[danvet: re-apply this from 0c980a006d3f ("drm/vc4: kms: Wait for the
commit before increasing our clock rate") because I lost that part in
my merge resolution in 99b03ca651f1 ("Merge v5.16-rc5 into drm-next")]
Fixes: 99b03ca651f1 ("Merge v5.16-rc5 into drm-next")
Acked-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://lore.kernel.org/r/20211117094527.146275-2-maxime@cerno.tech
2 years agodrm: document DRM_IOCTL_MODE_GETFB2
Simon Ser [Tue, 23 Nov 2021 11:24:04 +0000 (11:24 +0000)]
drm: document DRM_IOCTL_MODE_GETFB2

There are a few details specific to the GETFB2 IOCTL.

It's not immediately clear how user-space should check for the
number of planes. Suggest using the handles field or the pitches
field.

The modifier array is filled with zeroes, ie. DRM_FORMAT_MOD_LINEAR.
So explicitly tell user-space to not look at it unless the flag is
set.

Changes in v2 (Daniel):
- Mention that handles should be used to compute the number of planes,
  and only refer to pitches as a fallback.
- Reword bit about undefined modifier.

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211123112400.22245-1-contact@emersion.fr
2 years agoMerge v5.16-rc5 into drm-next
Daniel Vetter [Tue, 14 Dec 2021 08:43:25 +0000 (09:43 +0100)]
Merge v5.16-rc5 into drm-next

Thomas Zimmermann requested a fixes backmerge, specifically also for
96c5f82ef0a1 ("drm/vc4: fix error code in vc4_create_object()")

Just a bunch of adjacent changes conflicts, even the big pile of them
in vc4.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2 years agoLinux 5.16-rc5
Linus Torvalds [Sun, 12 Dec 2021 22:53:01 +0000 (14:53 -0800)]
Linux 5.16-rc5

2 years agoMerge tag 'usb-5.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 12 Dec 2021 18:20:57 +0000 (10:20 -0800)]
Merge tag 'usb-5.16-rc5' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are some small USB fixes for 5.16-rc5.  They include:

   - gadget driver fixes for reported issues

   - xhci fixes for reported problems.

   - config endpoint parsing fixes for where we got bitfields wrong

  Most of these have been in linux-next, the remaining few were not, but
  got lots of local testing in my systems and in some cloud testing
  infrastructures"

* tag 'usb-5.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: core: config: using bit mask instead of individual bits
  usb: core: config: fix validation of wMaxPacketValue entries
  USB: gadget: zero allocate endpoint 0 buffers
  USB: gadget: detect too-big endpoint 0 requests
  xhci: avoid race between disable slot command and host runtime suspend
  xhci: Remove CONFIG_USB_DEFAULT_PERSIST to prevent xHCI from runtime suspending
  Revert "usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default"

2 years agoMerge tag 'char-misc-5.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
Linus Torvalds [Sun, 12 Dec 2021 18:16:34 +0000 (10:16 -0800)]
Merge tag 'char-misc-5.16-rc5' of git://git./linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here are a bunch of small char/misc and other driver subsystem fixes.

  Included in here are:

   - iio driver fixes for reported problems

   - phy driver fixes for a number of reported problems

   - mhi resume bugfix for broken hardware

   - nvmem driver fix

   - rtsx driver fix for irq issues

   - fastrpc packet parsing fix

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'char-misc-5.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (33 commits)
  bus: mhi: core: Add support for forced PM resume
  iio: trigger: stm32-timer: fix MODULE_ALIAS
  misc: rtsx: Avoid mangling IRQ during runtime PM
  nvmem: eeprom: at25: fix FRAM byte_len
  misc: fastrpc: fix improper packet size calculation
  MAINTAINERS: add maintainer for Qualcomm FastRPC driver
  bus: mhi: pci_generic: Fix device recovery failed issue
  iio: adc: stm32: fix null pointer on defer_probe error
  phy: HiSilicon: Fix copy and paste bug in error handling
  dt-bindings: phy: zynqmp-psgtr: fix USB phy name
  phy: ti: omap-usb2: Fix the kernel-doc style
  phy: qualcomm: ipq806x-usb: Fix kernel-doc style
  iio: at91-sama5d2: Fix incorrect sign extension
  iio: adc: axp20x_adc: fix charging current reporting on AXP22x
  iio: gyro: adxrs290: fix data signedness
  phy: ti: tusb1210: Fix the kernel-doc warn
  phy: qualcomm: usb-hsic: Fix the kernel-doc warn
  phy: qualcomm: qmp: Add missing struct documentation
  phy: mvebu-cp110-utmi: Fix kernel-doc warns
  iio: ad7768-1: Call iio_trigger_notify_done() on error
  ...

2 years agoMerge tag 'timers-urgent-2021-12-12' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 12 Dec 2021 18:07:50 +0000 (10:07 -0800)]
Merge tag 'timers-urgent-2021-12-12' of git://git./linux/kernel/git/tip/tip

Pull timer fixes from Thomas Gleixner:
 "Two fixes for clock chip drivers:

   - A regression fix for the Designware APB timer. A recent change to
     the error checking code transformed the error condition wrongly so
     it turned into a fail if good condition.

   - Fix a clang build fail of the ARM architected timer driver"

* tag 'timers-urgent-2021-12-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource/drivers/arm_arch_timer: Force inlining of erratum_set_next_event_generic()
  clocksource/drivers/dw_apb_timer_of: Fix probe failure

2 years agoMerge tag 'irq-urgent-2021-12-12' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 12 Dec 2021 17:53:12 +0000 (09:53 -0800)]
Merge tag 'irq-urgent-2021-12-12' of git://git./linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:
 "A set of interrupt chip driver fixes:

   - Fix the multi vector MSI allocation on Armada 370XP

   - Do interrupt acknowledgement correctly in the aspeed-scu driver

   - Make the IPR register offset correct in the NVIC driver

   - Make redistribution table flushing correct by issueing a SYNC
     command to ensure that the invalidation command has been executed

   - Plug a device tree node reference leak in the bcm7210-l2 driver

   - Trivial fixes in the MIPS GIC and the Apple AIC drivers"

* tag 'irq-urgent-2021-12-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqchip/irq-bcm7120-l2: Add put_device() after of_find_device_by_node()
  irqchip/irq-gic-v3-its.c: Force synchronisation when issuing INVALL
  irqchip/apple-aic: Mark aic_init_smp() as __init
  irqchip: nvic: Fix offset for Interrupt Priority Offsets
  irqchip/mips-gic: Use bitfield helpers
  irqchip/aspeed-scu: Replace update_bits with write_bits.
  irqchip/armada-370-xp: Fix support for Multi-MSI interrupts
  irqchip/armada-370-xp: Fix return value of armada_370_xp_msi_alloc()