linux-2.6-microblaze.git
2 years agodrm/mgag200: Remove struct mga_connector
Thomas Zimmermann [Mon, 16 May 2022 13:43:41 +0000 (15:43 +0200)]
drm/mgag200: Remove struct mga_connector

struct mga_connector has outlived its purpose. Inline the rsp init
helper into the mode-config code and remove the data structure. No
functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220516134343.6085-6-tzimmermann@suse.de
2 years agodrm/mgag200: Switch I2C code to managed cleanup
Thomas Zimmermann [Mon, 16 May 2022 13:43:40 +0000 (15:43 +0200)]
drm/mgag200: Switch I2C code to managed cleanup

Store the I2C state within struct mga_device and switch I2C to
managed release. Simplifies the related code and lets us remove
mga_connector_destroy().

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220516134343.6085-5-tzimmermann@suse.de
2 years agodrm/mgag200: Implement connector's get_modes with helper
Thomas Zimmermann [Mon, 16 May 2022 13:43:39 +0000 (15:43 +0200)]
drm/mgag200: Implement connector's get_modes with helper

Provide drm_connector_helper_get_modes_from_ddc() to implement the
connector's get_modes callback. The new helper updates the connector
from DDC-provided EDID data.

v2:
* clear property if EDID is NULL in helper

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220516134343.6085-4-tzimmermann@suse.de
2 years agodrm/mgag200: Fail on I2C initialization errors
Thomas Zimmermann [Mon, 16 May 2022 13:43:38 +0000 (15:43 +0200)]
drm/mgag200: Fail on I2C initialization errors

Initialization of the I2C adapter was allowed to fail. The mgag200
driver would have continued without DDC support. Had this happened in
practice, it would have led to segmentation faults in the connector
code. Resolve this problem by failing driver initialization on I2C-
related errors.

v2:
* initialize 'ret' before drm_err() (kernel test robot)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220516134343.6085-3-tzimmermann@suse.de
2 years agodrm/mgag200: Acquire I/O lock while reading EDID
Thomas Zimmermann [Mon, 16 May 2022 13:43:37 +0000 (15:43 +0200)]
drm/mgag200: Acquire I/O lock while reading EDID

DDC operation conflicts with concurrent mode setting. Acquire the
driver's I/O lock in get_modes to prevent this. This change should
have been part of commit 931e3f3a0e99 ("drm/mgag200: Protect
concurrent access to I/O registers with lock"), but apparently got
lost somewhere.

v3:
* fix commit message to say 'drm/mgag200' (Jocelyn)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 931e3f3a0e99 ("drm/mgag200: Protect concurrent access to I/O registers with lock")
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jocelyn Falempe <jfalempe@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220516134343.6085-2-tzimmermann@suse.de
2 years agodrm/bridge: anx7625: Use DPI bus type
Xin Ji [Fri, 22 Apr 2022 08:47:18 +0000 (16:47 +0800)]
drm/bridge: anx7625: Use DPI bus type

As V4L2_FWNODE_BUS_TYPE_PARALLEL not properly descript for DPI
interface, this patch use new defined V4L2_FWNODE_BUS_TYPE_DPI for it.

Fixes: fd0310b6fe7d ("drm/bridge: anx7625: add MIPI DPI input feature")
Signed-off-by: Xin Ji <xji@analogixsemi.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Acked-by: Robert Foss <robert.foss@linaro.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/20220422084720.959271-4-xji@analogixsemi.com
2 years agodt-bindings:drm/bridge:anx7625: add port@0 property
Xin Ji [Fri, 22 Apr 2022 08:47:17 +0000 (16:47 +0800)]
dt-bindings:drm/bridge:anx7625: add port@0 property

Add 'bus-type' and 'data-lanes' define, bus-type 7 for MIPI DPI
input, others for DSI input.

Signed-off-by: Xin Ji <xji@analogixsemi.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Acked-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220422084720.959271-3-xji@analogixsemi.com
2 years agodrm/scheduler: Don't kill jobs in interrupt context
Dmitry Osipenko [Mon, 11 Apr 2022 22:15:36 +0000 (01:15 +0300)]
drm/scheduler: Don't kill jobs in interrupt context

Interrupt context can't sleep. Drivers like Panfrost and MSM are taking
mutex when job is released, and thus, that code can sleep. This results
into "BUG: scheduling while atomic" if locks are contented while job is
freed. There is no good reason for releasing scheduler's jobs in IRQ
context, hence use normal context to fix the trouble.

Cc: stable@vger.kernel.org
Fixes: 542cff7893a3 ("drm/sched: Avoid lockdep spalt on killing a processes")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220411221536.283312-1-dmitry.osipenko@collabora.com
2 years agodrm: bridge: DRM_FSL_LDB should depend on ARCH_MXC
Geert Uytterhoeven [Mon, 9 May 2022 13:52:02 +0000 (15:52 +0200)]
drm: bridge: DRM_FSL_LDB should depend on ARCH_MXC

The Freescale i.MX8MP LDB bridge is only present on Freescale i.MX8MP
SoCs.  Hence add a dependency on ARCH_MXC, to prevent asking the user
about this driver when configuring a kernel without i.MX SoC support.

Fixes: 463db5c2ed4aed01 ("drm: bridge: ldb: Implement simple Freescale i.MX8MP LDB bridge")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/449e08ca791a3ca308de5477c1bdc1f6eb1b34e7.1652104211.git.geert+renesas@glider.be
2 years agodrm: bridge: icn6211: Register macro clean up
Marek Vasut [Sat, 30 Apr 2022 02:50:20 +0000 (04:50 +0200)]
drm: bridge: icn6211: Register macro clean up

Drop two unused register macros, ICN6211_MAX_REGISTER and MIPI_ATE_STATUS_1,
neither of which is used and where the later should be specified using macro
MIPI_ATE_STATUS(1) instead. Drop the _(n) underscore and keep only the (n)
part of register macros. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220430025020.640277-1-marex@denx.de
2 years agodrm/mgag200: Enable atomic gamma lut update
Jocelyn Falempe [Fri, 13 May 2022 08:49:00 +0000 (10:49 +0200)]
drm/mgag200: Enable atomic gamma lut update

Add support for atomic update of gamma lut.
With this patch the "Night light" feature of gnome3
is working properly on mgag200.

v2:
 - Add a default linear gamma function
 - renamed functions with mgag200 prefix
 - use format's 4cc code instead of bit depth
 - use better interpolation for 16bits gamma
 - remove legacy function mga_crtc_load_lut()
 - can't remove the call to drm_mode_crtc_set_gamma_size()
    because it doesn't work with userspace.
 - other small refactors

v3:
 - change mgag200_crtc_set_gamma*() argument
    to struct drm_format_info *format
 - fix printk format to %p4cc for 4cc and %zu for size_t
 - rebased to drm-misc-next.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220513084900.1832381-1-jfalempe@redhat.com
2 years agodrm/client: Don't add new command-line mode
Thomas Zimmermann [Wed, 11 May 2022 18:31:25 +0000 (20:31 +0200)]
drm/client: Don't add new command-line mode

Don't add a mode for the kernel's command-line parameters from
within the DRM client code. Doing so can result in an unusable
display. If there's no compatible command-line mode, the client
will use one of the connector's preferred modes.

All mode creation and validation has to be performed by the
connector. When clients run, the connector's fill_modes callback
has already processed the kernel parameters and validated each
mode before adding it. The connector's mode list does not contain
invalid modes.

v2:
* grammar in commit message (Javier)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511183125.14294-4-tzimmermann@suse.de
2 years agodrm/client: Look for command-line modes first
Thomas Zimmermann [Wed, 11 May 2022 18:31:24 +0000 (20:31 +0200)]
drm/client: Look for command-line modes first

When picking a mode, first look for modes that have been specified
by the user on the kernel's command line. Only if that fails, use
the existing heuristic of picking a nearby mode from it's various
parameters.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511183125.14294-3-tzimmermann@suse.de
2 years agodrm: Always warn if user-defined modes are not supported
Thomas Zimmermann [Wed, 11 May 2022 18:31:23 +0000 (20:31 +0200)]
drm: Always warn if user-defined modes are not supported

Print a warning if a user-specifed display mode is not supported by
the display pipeline. Users specified the display mode on the kernel
command line with the use of the video= parameter. Setting an
unsupported mode will leave the console blank, so we should at least
let the user know why.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511183125.14294-2-tzimmermann@suse.de
2 years agodrm/rockchip: vop2: unlock on error path in vop2_crtc_atomic_enable()
Dan Carpenter [Mon, 9 May 2022 09:05:05 +0000 (12:05 +0300)]
drm/rockchip: vop2: unlock on error path in vop2_crtc_atomic_enable()

This error path needs an unlock before returning.

Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/YnjZQRV9lpub2ET8@kili
2 years agodrm/panel: feiyang-fy07024di26a30d: make reset gpio optional
Peter Geis [Wed, 11 May 2022 11:35:15 +0000 (07:35 -0400)]
drm/panel: feiyang-fy07024di26a30d: make reset gpio optional

Some implementations do not use the reset signal, instead tying it to dvdd.
Make the reset gpio optional to permit this.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511113517.4172962-3-pgwipeout@gmail.com
2 years agodt-bindings: display: panel: feiyang, fy07024di26a30d: make reset gpio optional
Peter Geis [Wed, 11 May 2022 11:35:14 +0000 (07:35 -0400)]
dt-bindings: display: panel: feiyang, fy07024di26a30d: make reset gpio optional

Some implementations do not use the reset signal, instead tying it to dvdd.
Make the reset gpio optional to permit this.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511113517.4172962-2-pgwipeout@gmail.com
2 years agodrm/edid: convert version_greater() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:24 +0000 (15:03 +0300)]
drm/edid: convert version_greater() to drm_edid

We'll need to propagate drm_edid everywhere. Also make version_greater()
a function for type safety.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/f1835a86294b392d075570001ed9009a48352670.1652097712.git.jani.nikula@intel.com
2 years agodrm/displayid: convert to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:23 +0000 (15:03 +0300)]
drm/displayid: convert to drm_edid

We'll need to propagate drm_edid everywhere.

v2: Rebase

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a52a6882e87a4bb6b1670918f3aba13f9b52f6de.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: add drm_edid helper for drm_update_tile_info()
Jani Nikula [Mon, 9 May 2022 12:03:22 +0000 (15:03 +0300)]
drm/edid: add drm_edid helper for drm_update_tile_info()

We'll need to propagate drm_edid everywhere.

v2: Handle NULL EDID pointer (Ville, CI)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5b36683b656446a4d9a172d4dca1cf9aca08a48b.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_edid_iter_begin() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:21 +0000 (15:03 +0300)]
drm/edid: convert drm_edid_iter_begin() to drm_edid

We'll need to propagate drm_edid everywhere.

v2: Rebase

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/24dfb5fd9026ebef573bb55b368b94e56cae5cec.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert cea_db_iter_edid_begin() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:20 +0000 (15:03 +0300)]
drm/edid: convert cea_db_iter_edid_begin() to drm_edid

We'll need to propagate drm_edid everywhere.

v2: Handle NULL drm_edid

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/7d9f060815086e1e4ea037dbfb9fd8ad54d1f25e.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: add drm_edid helper for drm_detect_monitor_audio()
Jani Nikula [Mon, 9 May 2022 12:03:19 +0000 (15:03 +0300)]
drm/edid: add drm_edid helper for drm_detect_monitor_audio()

We'll need to propagate drm_edid everywhere.

v2: Handle NULL EDID pointer (Ville, CI)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ea33244c473ace1bc72a7e87f97580f00705a683.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: add drm_edid helper for drm_detect_hdmi_monitor()
Jani Nikula [Mon, 9 May 2022 12:03:18 +0000 (15:03 +0300)]
drm/edid: add drm_edid helper for drm_detect_hdmi_monitor()

We'll need to propagate drm_edid everywhere.

v2: Handle NULL EDID pointer (Ville, CI)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2fbee0d7b544b44ef0866bb154beefac5d260bec.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: add drm_edid helper for drm_edid_to_speaker_allocation()
Jani Nikula [Mon, 9 May 2022 12:03:17 +0000 (15:03 +0300)]
drm/edid: add drm_edid helper for drm_edid_to_speaker_allocation()

We'll need to propagate drm_edid everywhere.'

v2: Handle NULL EDID pointer (Ville, CI)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/770d095c93274969c4b86480e07044e16a7b5760.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: add drm_edid helper for drm_edid_to_sad()
Jani Nikula [Mon, 9 May 2022 12:03:16 +0000 (15:03 +0300)]
drm/edid: add drm_edid helper for drm_edid_to_sad()

We'll need to propagate drm_edid everywhere.

v2: Handle NULL EDID pointer (Ville, CI)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/14aa1e44caa2e9c1b54c2f2a471d2fd7d3f62d5d.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_for_each_detailed_block() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:15 +0000 (15:03 +0300)]
drm/edid: convert drm_for_each_detailed_block() to drm_edid

We'll need to propagate drm_edid everywhere.

v2: Fix checkpatch warning on superfluous parens

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/bfd06d64235393012b2f3626d5764350de5f5321.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert get_monitor_name() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:14 +0000 (15:03 +0300)]
drm/edid: convert get_monitor_name() to drm_edid

We'll need to propagate drm_edid everywhere.

v2: Drop incorrect NULL name check (Dan Carpenter)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c940aad14f323ef3a7907a0fb534011deb1589a9.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert mode_in_range() and drm_monitor_supports_rb() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:13 +0000 (15:03 +0300)]
drm/edid: convert mode_in_range() and drm_monitor_supports_rb() to drm_edid

We'll need to propagate drm_edid everywhere.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/aac7dd14ce8c266491e9dfae12cad00fecdcd2e3.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_mode_std() and children to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:12 +0000 (15:03 +0300)]
drm/edid: convert drm_mode_std() and children to drm_edid

We'll need to propagate drm_edid everywhere.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9fb970d108a8bb666b87a590c74f480e0fd81cc8.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_cvt_modes_for_range() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:11 +0000 (15:03 +0300)]
drm/edid: convert drm_cvt_modes_for_range() to drm_edid

We'll need to propagate drm_edid everywhere.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c2c251a504933debacf78e1382ae665ae490ed40.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_gtf_modes_for_range() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:10 +0000 (15:03 +0300)]
drm/edid: convert drm_gtf_modes_for_range() to drm_edid

We'll need to propagate drm_edid everywhere.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/b50377ce67fd3cee6628ea5865c80fa0fa7da990.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_dmt_modes_for_range() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:09 +0000 (15:03 +0300)]
drm/edid: convert drm_dmt_modes_for_range() to drm_edid

We'll need to propagate drm_edid everywhere.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a8f393263225321e74f1e2884e81b3346d1adf20.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_mode_detailed() to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:08 +0000 (15:03 +0300)]
drm/edid: convert drm_mode_detailed() to drm_edid

We'll need to propagate drm_edid everywhere.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/6e4625d529ee4bfb2f6ebbfef5fb707d65a0554d.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert struct detailed_mode_closure to drm_edid
Jani Nikula [Mon, 9 May 2022 12:03:07 +0000 (15:03 +0300)]
drm/edid: convert struct detailed_mode_closure to drm_edid

We'll need to propagate drm_edid everywhere.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/da4c927cd973766568a79ef044254fff20317e7f.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_edid_connector_update() to drm_edid fully
Jani Nikula [Wed, 11 May 2022 09:26:50 +0000 (12:26 +0300)]
drm/edid: convert drm_edid_connector_update() to drm_edid fully

We'll need to propagate drm_edid everywhere.

v3: s/edid/drm_edid/ in comment too (Ankit)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511092650.4193330-1-jani.nikula@intel.com
2 years agodrm/edid: propagate drm_edid to drm_edid_to_eld()
Jani Nikula [Wed, 11 May 2022 09:23:49 +0000 (12:23 +0300)]
drm/edid: propagate drm_edid to drm_edid_to_eld()

We'll need to propagate drm_edid everywhere.

v3: Rebase

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511092349.4186498-1-jani.nikula@intel.com
2 years agodrm/edid: keep propagating drm_edid to display info
Jani Nikula [Wed, 11 May 2022 09:21:04 +0000 (12:21 +0300)]
drm/edid: keep propagating drm_edid to display info

We'll need to propagate drm_edid everywhere.

v3: Update comment to refer to update_display_info() (Ankit)

v2: Use drm_edid_legacy_init()

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511092104.4179637-1-jani.nikula@intel.com
2 years agodrm/edid: start propagating drm_edid to lower levels
Jani Nikula [Mon, 9 May 2022 12:03:03 +0000 (15:03 +0300)]
drm/edid: start propagating drm_edid to lower levels

We'll need to propagate drm_edid everywhere. This is a clunky start, but
a start nonetheless. We'll eventually convert all of the EDID parsing to
struct drm_edid.

Initially, we'll just create the struct drm_edid in stack. This will be
the compat layer for legacy struct edid code. In the future, we'll have
EDID read return drm_edid objects.

v2: Add legacy init helper.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/000452fddedbaf7f473ac25d4dde2502e60b8e39.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: add struct drm_edid container
Jani Nikula [Mon, 9 May 2022 12:03:02 +0000 (15:03 +0300)]
drm/edid: add struct drm_edid container

Introduce new opaque type struct drm_edid to encapsulate the EDID data
and the size allocated for it. The contents will be private to
drm_edid.c.

There are a number of reasons for adding a container around struct edid:

* struct edid is a raw blob pointer to data that usually originates
  outside of the kernel. Its size is contained within the structure.

* There's no way to attach meta information (such as allocated memory
  size) to struct edid.

* Validation of the EDID blob and its size become crucial, and it's
  spread all over the subsystem, with varying levels of accuracy.

* HDMI Forum has introduced an HF-EEODB extension that defines an
  override EDID size within an EDID extension. The size allocated for an
  EDID depends on whether the allocator understands the HF-EEODB
  extension. Given a struct edid *, it's impossible to know how much
  memory was actually allocated for it.

There are also some reasons for making the container type struct
drm_edid opaque and private to drm_edid.c:

* Have only one place for creating and parsing the EDID, to avoid
  duplicating bugs.

* Prepare for reading a pure DisplayID 2.0 from its own DDC address, and
  adding it within the same struct drm_edid container, transparently,
  and for all drivers.

* With the idea that the drm_edid objects are immutable during their
  lifetimes, it will be possible to refcount them and reduce EDID
  copying everywhere (this is left for future work).

Initially, just add the type. In follow-up, we'll start converting the
guts of drm_edid.c to use it, and finally add interfaces around it.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/f3ecabd8a219aea678ad00f7bcdecf77b27b3c78.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_for_each_detailed_block() to edid iter
Jani Nikula [Mon, 9 May 2022 12:03:01 +0000 (15:03 +0300)]
drm/edid: convert drm_for_each_detailed_block() to edid iter

We have an iterator for this, use it. It does include the base block,
but its tag is 0 and will be skipped.

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/a68718819a3dbfbdaaaddca7f73afa5ac6b33d07.1652097712.git.jani.nikula@intel.com
2 years agodrm/edid: use else-if in CTA extension parsing
Jani Nikula [Mon, 9 May 2022 12:03:00 +0000 (15:03 +0300)]
drm/edid: use else-if in CTA extension parsing

Only one of the conditions can be true.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/3a7ba2217134b0ab4c4c72e4333231a4e0616e88.1652097712.git.jani.nikula@intel.com
2 years agofbdev: vesafb: Allow to be built if COMPILE_TEST is enabled
Javier Martinez Canillas [Thu, 5 May 2022 12:04:18 +0000 (14:04 +0200)]
fbdev: vesafb: Allow to be built if COMPILE_TEST is enabled

The driver has runtime but no build time dependency with X86, so it can
be built for testing purposes if the COMPILE_TEST option is enabled.

This is useful to have more build coverage and make sure that the driver
is not affected by changes that could cause build regressions.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220505120419.314136-1-javierm@redhat.com
2 years agofbdev: Restart conflicting fb removal loop when unregistering devices
Javier Martinez Canillas [Wed, 11 May 2022 11:30:39 +0000 (13:30 +0200)]
fbdev: Restart conflicting fb removal loop when unregistering devices

Drivers that want to remove registered conflicting framebuffers prior to
register their own framebuffer, call to remove_conflicting_framebuffers().

This function takes the registration_lock mutex, to prevent a race when
drivers register framebuffer devices. But if a conflicting framebuffer
device is found, the underlaying platform device is unregistered and this
will lead to the platform driver .remove callback to be called. Which in
turn will call to unregister_framebuffer() that takes the same lock.

To prevent this, a struct fb_info.forced_out field was used as indication
to unregister_framebuffer() whether the mutex has to be grabbed or not.

But this could be unsafe, since the fbdev core is making assumptions about
what drivers may or may not do in their .remove callbacks. Allowing to run
these callbacks with the registration_lock held can cause deadlocks, since
the fbdev core has no control over what drivers do in their removal path.

A better solution is to drop the lock before platform_device_unregister(),
so unregister_framebuffer() can take it when called from the fbdev driver.
The lock is acquired again after the device has been unregistered and at
this point the removal loop can be restarted.

Since the conflicting framebuffer device has already been removed, the
loop would just finish when no more conflicting framebuffers are found.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511113039.1252432-1-javierm@redhat.com
2 years agodrm/bridge: tc358767: Add DSI-to-(e)DP mode support
Marek Vasut [Fri, 29 Apr 2022 20:56:44 +0000 (22:56 +0200)]
drm/bridge: tc358767: Add DSI-to-(e)DP mode support

Implement DSI-to-e(DP) mode, which is a mix of currently supported
DSI-to-DPI and DPI-to-(e)DP modes. The input side is configured as
either DSI or DPI, the DP AUX channel is registered for both input
side options, and the DSI host is attached for both DPI and (e)DP
output side options.

One notable detail is that the DSI-to-(e)DP mode requires the Pixel
PLL to be always enabled, which is not needed for DPI-to-(e)DP mode
which gets the matching clock direct from DPI Pixel Clock instead.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429205644.245480-2-marex@denx.de
2 years agodrm/bridge: tc358767: Factor out DSI and DPI RX enablement
Marek Vasut [Fri, 29 Apr 2022 20:56:43 +0000 (22:56 +0200)]
drm/bridge: tc358767: Factor out DSI and DPI RX enablement

Factor out register programming to configure the chip video RX side for
reception of video data from DSI or DPI. This is particularly useful in
the (e)DP output mode, where the video data can be received from either
DPI or DSI. While only the former is supported in (e)DP output mode so
far, this patch is added in preparation for addition of the later.

There is a change in the order or register programming in case of the
DSI-to-DPI mode. The DSI RX side is now programmed and enabled all in
one place after the output mode has been configured. Before this change,
the DSI RX has been programmed before the output mode has been set and
only enabled afterward. The order makes no difference however, since the
DSI RX is only enabled at the end either way.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429205644.245480-1-marex@denx.de
2 years agodrm/mgag200: Warn once if trying to set start address on broken hardware.
Jocelyn Falempe [Wed, 4 May 2022 13:40:26 +0000 (15:40 +0200)]
drm/mgag200: Warn once if trying to set start address on broken hardware.

Some MGA200 hardware is broken and can't use a start address > 0.

v2: Warn if startaddr is not 0, and hw doesn't support it.
  (instead of removing MGAG200_FLAG_HW_BUG_NO_STARTADD)

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504134026.283417-4-jfalempe@redhat.com
2 years agodrm/mgag200: Optimize damage clips
Jocelyn Falempe [Wed, 4 May 2022 13:40:25 +0000 (15:40 +0200)]
drm/mgag200: Optimize damage clips

When there are multiple damage clips, previous code merged them into one
big rectangle. As the Matrox memory is very slow, it's faster to copy each
damage clip.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504134026.283417-2-jfalempe@redhat.com
2 years agodrm/mgag200: Add FB_DAMAGE_CLIPS support
Jocelyn Falempe [Wed, 4 May 2022 13:40:24 +0000 (15:40 +0200)]
drm/mgag200: Add FB_DAMAGE_CLIPS support

The driver does support damage clips, but doesn't advertise it.
So when running gnome/wayland on Matrox hardware, the full frame is
copied to the slow Matrox memory, which leads to very poor performances.

Add drm_plane_enable_fb_damage_clips() to advertise this capability to
userspace.

With this patch, gnome/wayland becomes usable on Matrox GPU.

Suggested-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504134026.283417-2-jfalempe@redhat.com
2 years agoMAINTAINERS: add Melissa to V3D maintainers
Melissa Wen [Fri, 29 Apr 2022 19:33:30 +0000 (18:33 -0100)]
MAINTAINERS: add Melissa to V3D maintainers

I've been contributing to v3d through improvements, reviews, testing,
debugging, etc. So, I'm adding myself as a co-maintainer of the V3D
driver.

Signed-off-by: Melissa Wen <mwen@igalia.com>
Acked-by: Juan A. Suarez <jasuarez@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429193317.ol3u4e5jpt5jucox@mail.igalia.com
2 years agodrm/bridge: cdns-dsi: Add support for pre_enable and post_enable control functions.
Jayshri Pawar [Mon, 11 Apr 2022 14:06:06 +0000 (16:06 +0200)]
drm/bridge: cdns-dsi: Add support for pre_enable and post_enable control functions.

Add support for pre_enable and post_enable drm bridge control functions.
Making sure that host to be prepared before panel is powered up,
for the panels like TC358762.

Signed-off-by: Jayshri Pawar <jpawar@cadence.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/20220411140606.15654-1-jpawar@cadence.com
2 years agodrm/todo: Add entry for converting kselftests to kunit
Javier Martinez Canillas [Mon, 9 May 2022 13:08:46 +0000 (15:08 +0200)]
drm/todo: Add entry for converting kselftests to kunit

Many of the kselftests in DRM can be converted to kunit tests instead,
since that framework is more suitable for unit testing.

Suggested-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220509130846.694397-1-javierm@redhat.com
2 years agoMAINTAINERS: Add simpledrm driver co-maintainer
Javier Martinez Canillas [Thu, 5 May 2022 17:26:10 +0000 (19:26 +0200)]
MAINTAINERS: Add simpledrm driver co-maintainer

Thomas asked me to serve as co-maintainer for the simpledrm driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220505172610.338299-1-javierm@redhat.com
2 years agodrm/amdgpu: move internal vram_mgr function into the C file
Christian König [Tue, 10 May 2022 11:26:46 +0000 (13:26 +0200)]
drm/amdgpu: move internal vram_mgr function into the C file

No need to have those in the header.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220510113649.879821-2-christian.koenig@amd.com
2 years agodrm/amdgpu: fix start calculation in amdgpu_vram_mgr_new
Christian König [Tue, 10 May 2022 10:52:05 +0000 (12:52 +0200)]
drm/amdgpu: fix start calculation in amdgpu_vram_mgr_new

We still need to calculate a virtual start address for the resource to
aid checking of it is visible or not. Only matters on small BAR systems,
but better save than sorry.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220510113649.879821-1-christian.koenig@amd.com
2 years agodrm/amdgpu: switch DM to atomic fence helpers v2
Christian König [Mon, 9 May 2022 07:47:12 +0000 (09:47 +0200)]
drm/amdgpu: switch DM to atomic fence helpers v2

This gives us the standard atomic implicit and explicit fencing rules.

v2: move the wait to amdgpu_dm_atomic_commit_tail

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: Roman Li <Roman.Li@amd.com>
Cc: Qingqing Zhuo <qingqing.zhuo@amd.com>
Cc: Jude Shih <shenshih@amd.com>
Cc: Wayne Lin <Wayne.Lin@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220509074712.163899-1-christian.koenig@amd.com
2 years agodrm/bridge: simplify the return expression of ps8640_bridge_host_attach
Minghao Chi [Fri, 29 Apr 2022 05:51:45 +0000 (05:51 +0000)]
drm/bridge: simplify the return expression of ps8640_bridge_host_attach

Simplify the return expression.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429055145.3852271-1-chi.minghao@zte.com.cn
2 years agodma-buf: add the name field to the table header
Yuanzheng Song [Thu, 28 Apr 2022 06:39:24 +0000 (06:39 +0000)]
dma-buf: add the name field to the table header

'cat /sys/kernel/debug/dma_buf/bufinfo' will print the Dma-buf
Objects' information when the CONFIG_DEBUG_FS=y.
However, the printed table header information does not contain
the name field. So we need to add the name field to the table
header and use the '<none>' to replace the empty buf_obj->name.

Signed-off-by: Yuanzheng Song <songyuanzheng@huawei.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220428063924.3570409-1-songyuanzheng@huawei.com
2 years agodrm/ttm: move default BO destructor into VMWGFX v2
Christian König [Fri, 18 Feb 2022 09:05:40 +0000 (10:05 +0100)]
drm/ttm: move default BO destructor into VMWGFX v2

It's the only driver using this.

v2: use BUG_ON() in vmw_bo_create() as suggested by Zack

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220329110243.6335-5-christian.koenig@amd.com
2 years agodrm/rockchip: Fix spelling mistake "aligened" -> "aligned"
Colin Ian King [Thu, 5 May 2022 11:10:44 +0000 (12:10 +0100)]
drm/rockchip: Fix spelling mistake "aligened" -> "aligned"

There is a spelling mistake in a drm_err message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220505111044.374174-1-colin.i.king@gmail.com
2 years agodrm/rockchip: remove unneeded semicolon from vop2 driver
Yang Li [Thu, 5 May 2022 23:26:59 +0000 (07:26 +0800)]
drm/rockchip: remove unneeded semicolon from vop2 driver

Eliminate the following coccicheck warning:
./drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:1476:2-3: Unneeded
semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220505232659.4405-1-yang.lee@linux.alibaba.com
2 years agodrm/rockchip: Fix Kconfig dependencies for display-port encoders
Ren Zhijie [Sat, 7 May 2022 10:09:10 +0000 (18:09 +0800)]
drm/rockchip: Fix Kconfig dependencies for display-port encoders

The DP-helper module has been replaced by the display-helper module.
So the driver have to select it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 1e0f66420b13("drm/display: Introduce a DRM display-helper module")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
Reviewed-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220507100910.93705-1-renzhijie2@huawei.com
2 years agodt-bindings: display: bridge: ldb: Fill in reg property
Marek Vasut [Wed, 4 May 2022 01:26:01 +0000 (03:26 +0200)]
dt-bindings: display: bridge: ldb: Fill in reg property

Add missing reg and reg-names properties for both 'LDB_CTRL'
and 'LVDS_CTRL' registers.

Fixes: 463db5c2ed4ae ("drm: bridge: ldb: Implement simple Freescale i.MX8MP LDB bridge")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Robby Cai <robby.cai@nxp.com>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: devicetree@vger.kernel.org
To: dri-devel@lists.freedesktop.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504012601.423644-1-marex@denx.de
2 years agodrm/bridge: nwl-dsi: Set PHY mode in nwl_dsi_mode_set()
Liu Ying [Tue, 19 Apr 2022 01:08:48 +0000 (09:08 +0800)]
drm/bridge: nwl-dsi: Set PHY mode in nwl_dsi_mode_set()

The Northwest Logic MIPI DSI host controller embedded in i.MX8qxp
works with a Mixel MIPI DPHY + LVDS PHY combo to support either
a MIPI DSI display or a LVDS display.  So, this patch calls
phy_set_mode() from nwl_dsi_mode_set() to set PHY mode to MIPI DPHY
explicitly.

Cc: Guido Günther <agx@sigxcpu.org>
Cc: Robert Chiras <robert.chiras@nxp.com>
Cc: Martin Kepplinger <martin.kepplinger@puri.sm>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
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: NXP Linux Team <linux-imx@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220419010852.452169-2-victor.liu@nxp.com
2 years agodrm/nouveau/gr/gf100-: Clean up some inconsistent indenting
Jiapeng Chong [Thu, 5 May 2022 08:13:45 +0000 (16:13 +0800)]
drm/nouveau/gr/gf100-: Clean up some inconsistent indenting

Eliminate the follow smatch warning:

drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:1925
gf100_gr_oneinit_tiles() warn: inconsistent indenting.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220505081345.89762-1-jiapeng.chong@linux.alibaba.com
2 years agodrm/edid: sunset drm_find_cea_extension()
Jani Nikula [Tue, 3 May 2022 09:24:05 +0000 (12:24 +0300)]
drm/edid: sunset drm_find_cea_extension()

Convert drm_find_cea_extension() to a predicate function to check if the
EDID has a CTA extension or a DisplayID CTA data block. This is mainly
to avoid adding new users that only find the first CTA extension.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/a5bf228942e6bd0fc70d5cf7a14c249a14a7afcd.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: skip CTA extension scan in drm_edid_to_eld() just for CTA rev
Jani Nikula [Tue, 3 May 2022 09:24:04 +0000 (12:24 +0300)]
drm/edid: skip CTA extension scan in drm_edid_to_eld() just for CTA rev

The DisplayID CTA data block version does not necessarily match the CTA
revision. Simplify by postponing drm_edid_to_eld() slightly, and reusing
the CTA revision extracted by drm_parse_cea_ext().

By not bailing out early in drm_edid_to_eld() we may end up filling
meaningless data to the ELD. However, the main decision for audio is not
the ELD, but rather drm_detect_monitor_audio() called by drivers.

(Arguably a future cleanup could do that in drm_add_edid_modes() and
cache the result in the connector.)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/163ebbfd765066acbfc267256fb3b67fc711a78d.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: detect color formats and CTA revision in all CTA extensions
Jani Nikula [Thu, 5 May 2022 10:52:42 +0000 (13:52 +0300)]
drm/edid: detect color formats and CTA revision in all CTA extensions

Convert drm_find_cea_extension() to EDID block iterator in color format
and CTA revision detection. Detect them in all CTA extensions.

Also parse CTA Data Blocks in DisplayID even if there's no CTA EDID
extension.

v2:
- Don't assume DRM_COLOR_FORMAT_RGB444 support if there's only DisplayID
  CTA Data Blocks (Ville)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/20220505105242.1198521-1-jani.nikula@intel.com
2 years agodrm/edid: detect basic audio in all CEA extensions
Jani Nikula [Tue, 3 May 2022 09:24:02 +0000 (12:24 +0300)]
drm/edid: detect basic audio in all CEA extensions

Convert drm_find_cea_extension() to EDID block iterator in basic audio
detection. Detect basic audio in all CEA extensions.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/59481d0397de4b91b3e6ea665882334e92538f40.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: restore some type safety to cea_db_*() functions
Jani Nikula [Tue, 3 May 2022 09:24:01 +0000 (12:24 +0300)]
drm/edid: restore some type safety to cea_db_*() functions

During the transition, we accepted a void pointer for a poor C
programmer's version of polymorphism. Switch the functions to use struct
cea_db * to regain some more type safety.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/c6ad496cdadea1bb598711a65ef536f4a43b74a7.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: sunset the old unused cea data block iterators
Jani Nikula [Tue, 3 May 2022 09:24:00 +0000 (12:24 +0300)]
drm/edid: sunset the old unused cea data block iterators

All CTA data block iteration has now been converted to the new cea db
iterators.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/a5b35ed0e711bd874f76ae87ee0b70150d0a77c4.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_edid_to_eld() to use cea db iter
Jani Nikula [Tue, 3 May 2022 09:23:59 +0000 (12:23 +0300)]
drm/edid: convert drm_edid_to_eld() to use cea db iter

Iterate through all CTA data blocks across all CTA extensions and
DisplayID data blocks. This may gather more data than before, and if
there's duplicated data, some is overwritten by whichever comes last.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/8bdc67aa731857111eddd08a9c192d41d40b5f5a.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_parse_cea_ext() to use cea db iter
Jani Nikula [Tue, 3 May 2022 09:23:58 +0000 (12:23 +0300)]
drm/edid: convert drm_parse_cea_ext() to use cea db iter

Iterate through all CTA data blocks across all CTA Extensions and
DisplayID data blocks.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/7400792525c13f58652f288b891d6057637ed4c8.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_detect_monitor_audio() to use cea db iter
Jani Nikula [Tue, 3 May 2022 09:23:57 +0000 (12:23 +0300)]
drm/edid: convert drm_detect_monitor_audio() to use cea db iter

Iterate through all CEA data blocks.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/a7f0c380da9526f8dd6f758d7a748bca7b4da6ce.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_detect_hdmi_monitor() to use cea db iter
Jani Nikula [Tue, 3 May 2022 09:23:56 +0000 (12:23 +0300)]
drm/edid: convert drm_detect_hdmi_monitor() to use cea db iter

Iterate through all CTA data blocks, not just the first CTA extension.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/b867e7b628189d2f8fa7eac5b9aa701892724711.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_edid_to_sad() to use cea db iter
Jani Nikula [Tue, 3 May 2022 09:23:55 +0000 (12:23 +0300)]
drm/edid: convert drm_edid_to_sad() to use cea db iter

Use the cea db iterator for short audio descriptors. We'll still stop at
the first audio data block, but not at the first CTA Extension if that
doesn't have the info.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/237e4b1de1567903d37ce1d1bb830020b8fd6690.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: convert drm_edid_to_speaker_allocation() to use cea db iter
Jani Nikula [Tue, 3 May 2022 09:23:54 +0000 (12:23 +0300)]
drm/edid: convert drm_edid_to_speaker_allocation() to use cea db iter

Use the cea db iterator for speaker allocation. We'll still stop at the
first speaker data block, but not at the first CTA extension if that
doesn't have the info.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/0b9e7f136854055a14b826097160fe0b43b9f3d1.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: convert add_cea_modes() to use cea db iter
Jani Nikula [Tue, 3 May 2022 09:23:53 +0000 (12:23 +0300)]
drm/edid: convert add_cea_modes() to use cea db iter

Iterate through all CTA EDID extension blocks and DisplayID CTA data
blocks to add CEA modes.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/dfa2d79db61d5eea543bef7aca7d80da3e71f99d.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: clean up cea_db_is_*() functions
Jani Nikula [Tue, 3 May 2022 09:23:52 +0000 (12:23 +0300)]
drm/edid: clean up cea_db_is_*() functions

Abstract helpers for matching vendor data blocks and extended tags, and
use them to simplify all the cea_db_is_*() functions.

Take void pointer as parameter to allow transitional use for both u8 *
and struct cea_db *.

v2: Remove superfluous parens (Ville)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/b6bb813afc35c763e744c6cdb4a787da3adf910b.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: add iterator for CTA data blocks
Jani Nikula [Tue, 3 May 2022 09:23:51 +0000 (12:23 +0300)]
drm/edid: add iterator for CTA data blocks

Add an iterator for CTA Data Blocks across EDID CTA Extensions and
DisplayID CTA Data Blocks.

v2: Update references, note why we can trust displayid ranges (Ville)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/37fdd2d9eabc73aaa9f95c56246dc47aea0e8e4e.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: add iterator for EDID base and extension blocks
Jani Nikula [Tue, 3 May 2022 09:23:50 +0000 (12:23 +0300)]
drm/edid: add iterator for EDID base and extension blocks

Add an iterator abstraction for going through all the EDID blocks.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/ce02778b353b906c928268de9d7569d493a9be5d.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: clean up CTA data block tag definitions
Jani Nikula [Tue, 3 May 2022 09:23:49 +0000 (12:23 +0300)]
drm/edid: clean up CTA data block tag definitions

Add prefixed names, group, sort, add references.

v2:
- Updated references to CTA-861-H
- s/CEA/CTA/ in data block macros

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/c66cc3adeb375f5e60d1a8f91b41580d8ab67442.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: rename HDMI Forum VSDB to SCDS
Jani Nikula [Tue, 3 May 2022 09:23:48 +0000 (12:23 +0300)]
drm/edid: rename HDMI Forum VSDB to SCDS

The HDMI spec talks about SCDS, Sink Capability Data Structure, exposed
via HF-VSDB or HF-SCDB. Rename VSDB to SCDS.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/f8230e1893400e9a9c5829041a8ab36349182a54.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: check for HF-SCDB block
Lee Shawn C [Tue, 3 May 2022 09:23:47 +0000 (12:23 +0300)]
drm/edid: check for HF-SCDB block

Find HF-SCDB information in CEA extensions block. And retrieve
Max_TMDS_Character_Rate that support by sink device.

v2: HF-SCDB and HF-VSDBS carry the same SCDS data. Reuse
    drm_parse_hdmi_forum_vsdb() to parse this packet.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
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/2bf7110cdb56d5dda311480787faf472c9802de4.1651569697.git.jani.nikula@intel.com
2 years agodrm/edid: reset display info in drm_add_edid_modes() for NULL edid
Jani Nikula [Tue, 3 May 2022 09:23:46 +0000 (12:23 +0300)]
drm/edid: reset display info in drm_add_edid_modes() for NULL edid

If a NULL edid gets passed to drm_add_edid_modes(), we should probably
also reset the display info.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
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/2ac1c55f94a08d5e72c0b518d956a11002ec85c1.1651569697.git.jani.nikula@intel.com
2 years agodrm/qxl: add drm_gem_plane_helper_prepare_fb
Christian König [Fri, 29 Apr 2022 13:29:08 +0000 (15:29 +0200)]
drm/qxl: add drm_gem_plane_helper_prepare_fb

We could need to wait for the pin to complete here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Cc: spice-devel@lists.freedesktop.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429134230.24334-4-christian.koenig@amd.com
2 years agodrm/todo: Add entry for using kunit in the subsystem
Javier Martinez Canillas [Wed, 4 May 2022 08:02:12 +0000 (10:02 +0200)]
drm/todo: Add entry for using kunit in the subsystem

The Kernel Unit Testing (KUnit) framework provides a common framework for
unit tests within the Linux kernel. Having a test suite would allow to
identify regressions earlier.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504080212.713275-1-javierm@redhat.com
2 years agodrm: simplify the return expression of ast_drm_resume()
Minghao Chi [Thu, 5 May 2022 02:22:08 +0000 (02:22 +0000)]
drm: simplify the return expression of ast_drm_resume()

Simplify the return expression.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220505022208.57157-1-chi.minghao@zte.com.cn
2 years agodrm/mgag200: Protect concurrent access to I/O registers with lock
Thomas Zimmermann [Mon, 2 May 2022 14:25:14 +0000 (16:25 +0200)]
drm/mgag200: Protect concurrent access to I/O registers with lock

Add a mutex lock to protect concurrent access to I/O registers
against each other. This happens between invocation of commit-
tail functions and get-mode operations. Both with use the CRTC
index registers MGA1064_GEN_IO_DATA and MGA1064_GEN_IO_CTL.
Concurrent access can lead to failed mode-setting operations.

v2:
* fix typo in commit description (Jocelyn)
* add comment to explain rmmio_lock

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-4-tzimmermann@suse.de
2 years agodrm/ast: Protect concurrent access to I/O registers with lock
Thomas Zimmermann [Mon, 2 May 2022 14:25:13 +0000 (16:25 +0200)]
drm/ast: Protect concurrent access to I/O registers with lock

Add a mutex lock to protect concurrent access to I/O registers
against each other. This happens between invocation of commit-
tail functions and get-mode operations. Both with use the CRTC
index register AST_IO_CRTC_PORT. Concurrent access can lead to
failed mode-setting operations.

v2:
* fix typo in commit description (Jocelyn)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reported-by: KuoHsiang Chou <kuohsiang_chou@aspeedtech.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-3-tzimmermann@suse.de
2 years agodrm: Add DRM-managed mutex_init()
Thomas Zimmermann [Mon, 2 May 2022 14:25:12 +0000 (16:25 +0200)]
drm: Add DRM-managed mutex_init()

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

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-2-tzimmermann@suse.de
2 years agodrm/format-helper: Share implementation among conversion helpers
Thomas Zimmermann [Wed, 27 Apr 2022 14:14:09 +0000 (16:14 +0200)]
drm/format-helper: Share implementation among conversion helpers

Provide format-independent conversion helpers for system and I/O
memory. Implement most existing helpers on top of it. The source and
destination formats of each conversion is handled by a per-line
helper that is given to the generic implementation.

v2:
* remove a blank line

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220427141409.22842-5-tzimmermann@suse.de
2 years agodrm/format-helper: Unify the parameters of all per-line conversion helpers
Thomas Zimmermann [Wed, 27 Apr 2022 14:14:08 +0000 (16:14 +0200)]
drm/format-helper: Unify the parameters of all per-line conversion helpers

Give each per-line conversion helper pointers of type void and the
number of pixels in the line. Remove the unused swab parameters.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220427141409.22842-4-tzimmermann@suse.de
2 years agodrm/format-helper: Remove optional byte-swap from line convertion
Thomas Zimmermann [Wed, 27 Apr 2022 14:14:07 +0000 (16:14 +0200)]
drm/format-helper: Remove optional byte-swap from line convertion

Implement per-pixel byte swapping in a separate conversion helper
for the single function that requires it. Select the correct helper
for each conversion.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220427141409.22842-3-tzimmermann@suse.de
2 years agodrm/format-helper: Implement drm_fb_swab() with per-line helpers
Thomas Zimmermann [Wed, 27 Apr 2022 14:14:06 +0000 (16:14 +0200)]
drm/format-helper: Implement drm_fb_swab() with per-line helpers

Replace the inner loop of drm_fb_swab() with helper functions that
swap the bytes in each pixel. This will allow to share the outer
loop with other conversion helpers.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220427141409.22842-2-tzimmermann@suse.de
2 years agodrm/bridge: tc358767: Fix DP bridge mode detection from DT endpoints
Marek Vasut [Fri, 29 Apr 2022 20:46:25 +0000 (22:46 +0200)]
drm/bridge: tc358767: Fix DP bridge mode detection from DT endpoints

Per toshiba,tc358767.yaml DT binding document, port@2 the output (e)DP
port is optional. In case this port is not described in DT, the bridge
driver operates in DPI-to-DP mode. Make sure the driver treats this as
a valid mode of operation instead of reporting invalid mode.

Fixes: 71f7d9c03118 ("drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429204625.241591-1-marex@denx.de
2 years agodrm: mxsfb: Implement LCDIF scanout CRC32 support
Marek Vasut [Fri, 29 Apr 2022 21:23:13 +0000 (23:23 +0200)]
drm: mxsfb: Implement LCDIF scanout CRC32 support

The LCDIF controller as present in i.MX28/i.MX6SX/i.MX8M Mini/Nano has
CRC_STAT register, which contains CRC32 of the frame as it was clocked
out of the DPI interface of the LCDIF. This is most likely meant as a
functional safety feature.

Unfortunately, there is zero documentation on how the CRC32 is calculated,
there is no documentation of the polynomial, the init value, nor on which
data is the checksum applied.

By applying brute-force on 8 pixel / 2 line frame, which is the minimum
size LCDIF would work with, it turns out the polynomial is CRC32_POLY_LE
0xedb88320 , init value is 0xffffffff , the input data are bitrev32()
of the entire frame and the resulting CRC has to be also bitrev32()ed.

Doing this calculation in kernel for each frame is unrealistic due to the
CPU demand, so attach the CRC collected from hardware to a frame instead.
The DRM subsystem already has an interface for this purpose and the CRC
can be accessed e.g. via debugfs:
"
$ echo auto > /sys/kernel/debug/dri/1/crtc-0/crc/control
$ cat /sys/kernel/debug/dri/1/crtc-0/crc/data
0x0000408c 0xa4e5cdd8
0x0000408d 0x72f537b4
"
The per-frame CRC can be used by userspace e.g. during automated testing,
to verify that whatever buffer was sent to be scanned out was actually
scanned out of the LCDIF correctly.

Acked-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Stefan Agner <stefan@agner.ch>
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>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429212313.305556-1-marex@denx.de
2 years agodrm/nouveau: remove trace_dma_fence_emit
Christian König [Tue, 3 May 2022 08:59:35 +0000 (10:59 +0200)]
drm/nouveau: remove trace_dma_fence_emit

Hardware drivers which don't have much difference between emit and init
shouldn't use this trace point.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Karol Herbst <kherbst@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: nouveau@lists.freedesktop.org
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220503085935.11023-1-christian.koenig@amd.com
2 years agodrm/nouveau/subdev/bus: Ratelimit logging for fault errors
Lyude Paul [Fri, 29 Apr 2022 19:53:47 +0000 (15:53 -0400)]
drm/nouveau/subdev/bus: Ratelimit logging for fault errors

There's plenty of ways to fudge the GPU when developing on nouveau by
mistake, some of which can result in nouveau seriously spamming dmesg with
fault errors. This can be somewhat annoying, as it can quickly overrun the
message buffer (or your terminal emulator's buffer) and get rid of actually
useful feedback from the driver. While working on my new atomic only MST
branch, I ran into this issue a couple of times.

So, let's fix this by adding nvkm_error_ratelimited(), and using it to
ratelimit errors from faults. This should be fine for developers, since
it's nearly always only the first few faults that we care about seeing.
Plus, you can turn off rate limiting in the kernel if you really need to.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220429195350.85620-1-lyude@redhat.com
2 years agodrm/nouveau/devinit: fix returnvar.cocci warnings
Guo Zhengkui [Wed, 4 May 2022 16:09:29 +0000 (00:09 +0800)]
drm/nouveau/devinit: fix returnvar.cocci warnings

Fix the following coccicheck warnings:

drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c:71:5-12:
Unneeded variable: "disable". Return "0ULL" on line 90.
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c:35:5-12:
Unneeded variable: "disable". Return "0ULL" on line 44.
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c:35:5-12:
Unneeded variable: "disable". Return "0ULL" on line 50.

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504161003.9245-1-guozhengkui@vivo.com