summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-07-29drm: Fix references to drm_plane_helper_check_state()Geert Uytterhoeven2-2/+4
As of commit a01cb8ba3f628293 ("drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c"), drm_plane_helper_check_state() no longer exists, but is part of drm_atomic_helper_check_plane_state(). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/8bb42a92fc20e3d11e5847e7f15a47c687b73104.1689779916.git.geert+renesas@glider.be
2023-07-29drm: Remove references to removed transitional helpersGeert Uytterhoeven3-42/+23
The transitional helpers were removed a long time ago, but some references stuck. Remove them. Fixes: 21ebe615c16994f3 ("drm: Remove transitional helpers") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/ad4a2f1f9fa7da083132f6c35469c77a3f9e2f0e.1689779916.git.geert+renesas@glider.be
2023-07-29drm/todo: Convert list of fbconv links to footnotesGeert Uytterhoeven1-6/+6
Convert the references to fbconv links to footnotes, so they can be navigated. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/0761f98d3b6f8df9eea977eae063e35b450fda9e.1689779916.git.geert+renesas@glider.be
2023-07-29drm/todo: Add atomic modesetting referencesGeert Uytterhoeven1-3/+7
The section about converting existing KMS drivers to atomic modesetting mentions the existence of a conversion guide, but does not reference it. While the guide is old and rusty, it still contains useful information, so add a link to it. Also link to the LWN.net articles that give an overview about the atomic mode setting design. While at it, remove the reference to unconverted virtual HW drivers, as they've been converted. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/6809d0fda0716892cbccf0ee272481032251026d.1689779916.git.geert+renesas@glider.be
2023-07-29drm/repaper: Reduce temporary buffer size in repaper_fb_dirty()Geert Uytterhoeven1-1/+1
As the temporary buffer is no longer used to store 8-bit grayscale data, its size can be reduced to the size needed to store the monochrome bitmap data. Fixes: 24c6bedefbe71de9 ("drm/repaper: Use format helper for xrgb8888 to monochrome conversion") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220317081830.1211400-6-geert@linux-m68k.org
2023-07-29drm/armada: Fix off-by-one error in armada_overlay_get_property()Geert Uytterhoeven1-2/+4
As ffs() returns one more than the index of the first bit set (zero means no bits set), the color key mode value is shifted one position too much. Fix this by using FIELD_GET() instead. Fixes: c96103b6c49ff9a8 ("drm/armada: move colorkey properties into overlay plane state") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/a4d779d954a7515ddbbf31cb0f0d8184c0e7c879.1689600265.git.geert+renesas@glider.be
2023-07-29drm: Spelling s/randevouz/rendez-vous/Geert Uytterhoeven1-1/+1
Fix a misspelling of "rendez-vous". Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/084bf178dd676a4f07933eb9fcd04d3e30a779ba.1689600209.git.geert+renesas@glider.be
2023-07-29drm: Spelling s/sempahore/semaphore/Geert Uytterhoeven4-4/+4
Fix misspellings of "semaphore". Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/8b0542c12a2427f34a792c41ac2d2a2922874bfa.1689600102.git.geert+renesas@glider.be
2023-07-29drm/udl: Convert to drm_crtc_helper_atomic_check()Geert Uytterhoeven1-11/+2
Use the drm_crtc_helper_atomic_check() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/dcb09c0c7bed1baee39a72caba098a399ce7f063.1689599767.git.geert+renesas@glider.be
2023-07-29drm/bridge_connector: Handle drm_connector_init_with_ddc() failuresGeert Uytterhoeven1-2/+9
drm_connector_init_with_ddc() can fail, but the call in drm_bridge_connector_init() does not check that. Fix this by adding the missing error handling. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/3a7e9540d8dc94298d021aa2fb046ae8616ca4dd.1689599701.git.geert+renesas@glider.be
2023-07-29drm/nouveau/nvkm/dp: Add workaround to fix DP 1.3+ DPCD issuesLyude Paul1-1/+47
Currently we use the drm_dp_dpcd_read_caps() helper in the DRM side of nouveau in order to read the DPCD of a DP connector, which makes sure we do the right thing and also check for extended DPCD caps. However, it turns out we're not currently doing this on the nvkm side since we don't have access to the drm_dp_aux structure there - which means that the DRM side of the driver and the NVKM side can end up with different DPCD capabilities for the same connector. Ideally in order to fix this, we just want to use the drm_dp_read_dpcd_caps() helper in nouveau. That's not currently possible though, and is going to depend on having a bunch of the DP code moved out of nvkm and into the DRM side of things as part of the GSP enablement work. Until then however, let's workaround this problem by porting a copy of drm_dp_read_dpcd_caps() into NVKM - which should fix this issue. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/211 Link: https://patchwork.freedesktop.org/patch/msgid/20230728225858.350581-1-lyude@redhat.com
2023-07-28gpu: ipu-v3: prg: Convert to devm_platform_ioremap_resource()Yangtao Li1-4/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.kernel.org/r/20230710032355.72914-8-frank.li@vivo.com Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230710032355.72914-8-frank.li@vivo.com
2023-07-28gpu: ipu-v3: pre: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.kernel.org/r/20230710032355.72914-2-frank.li@vivo.com Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230710032355.72914-2-frank.li@vivo.com
2023-07-28drm/imx/ipuv3: ipuv3-plane: reuse local variable height in atomic_updatePhilipp Zabel1-6/+5
Use the already existing local variable height = drm_rect_height() >> 16 to replace other occurrences of the same value. Suggested-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Link: https://lore.kernel.org/r/20221220094430.3469811-1-p.zabel@pengutronix.de Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/20221220094430.3469811-1-p.zabel@pengutronix.de
2023-07-28drm/ast: report connection status on Display Port.Jocelyn Falempe4-14/+66
Aspeed always report the display port as "connected", because it doesn't set a .detect_ctx callback. Fix this by providing the proper detect callback for astdp and dp501. This also fixes the following regression: Since commit fae7d186403e ("drm/probe-helper: Default to 640x480 if no EDID on DP") The default resolution is now 640x480 when no monitor is connected. But Aspeed graphics is mostly used in servers, where no monitor is attached. This also affects the remote BMC resolution to 640x480, which is inconvenient, and breaks the anaconda installer. v2: Add .detect callback to the dp/dp501 connector (Jani Nikula) v3: Use .detect_ctx callback, and refactors (Thomas Zimmermann) Add a BMC virtual connector v4: Better indent detect_ctx() functions (Thomas Zimmermann) v5: Enable polling of the dp and dp501 connector status (Thomas Zimmermann) v6: Change check order in ast_astdp_is_connected (Jammy Huang) Fixes: fae7d186403e ("drm/probe-helper: Default to 640x480 if no EDID on DP") Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230713134316.332502-2-jfalempe@redhat.com
2023-07-28drm/ast: Add BMC virtual connectorJocelyn Falempe2-0/+61
Most aspeed devices have a BMC, which allows to remotely see the screen. Also in the common use case, those servers don't have a display connected. So add a Virtual connector, to reflect that even if no display is connected, the framebuffer can still be seen remotely. This prepares the work to implement a detect_ctx() for the Display port connector. v4: call drm_add_modes_noedid() with 4096x4096 (Thomas Zimmermann) remove useless struct field init to 0 (Thomas Zimmermann) don't use drm_simple_encoder_init() (Thomas Zimmermann) inline ast_bmc_connector_init() (Thomas Zimmermann) Fixes: fae7d186403e ("drm/probe-helper: Default to 640x480 if no EDID on DP") Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230713134316.332502-1-jfalempe@redhat.com
2023-07-28drm/imx/dcss: Use dev_err_probeAlexander Stein1-0/+1
This helps identifying problems with downstream pipeline devices, like HDMI/DP output. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230717092950.448823-1-alexander.stein@ew.tq-group.com
2023-07-28drm/panel: simple: Simplify matching using of_device_get_match_data()Geert Uytterhoeven1-9/+6
Both the patform_driver and mipi_dsi_driver structures contain pointers to the match table used, so the custom code to obtain match and match data can be replaced by calls to of_device_get_match_data(). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/64ded5b7e809e4c6e915b2c4d8b82e02319cd206.1690535800.git.geert+renesas@glider.be
2023-07-28video: logo: LOGO should depend on FB_CORE i.s.o. FBGeert Uytterhoeven2-2/+2
If CONFIG_FB_CORE=y and CONFIG_FB=n, the frame buffer bootup logos can no longer be enabled. Fix this by making CONFIG_LOGO depend on CONFIG_FB_CORE instead of CONFIG_FB, as there is no good reason for the logo code to depend on the presence of real frame buffer device drivers. Fixes: 55bffc8170bb ("fbdev: Split frame buffer support in FB and FB_CORE symbols") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/e4142b7cc9aad9975de1bc6b1c7d86ccee487e4c.1690535997.git.geert+renesas@glider.be
2023-07-28Revert "fbcon: Use kzalloc() in fbcon_prepare_logo()"Geert Uytterhoeven1-1/+1
This reverts commit a6a00d7e8ffd78d1cdb7a43f1278f081038c638f. This commit is redundant, as the root cause that resulted in a false positive was fixed by commit 27f644dc5a77f8d9 ("x86: kmsan: use C versions of memset16/memset32/memset64"). Closes: https://lore.kernel.org/r/CAMuHMdUH4CU9EfoirSxjivg08FDimtstn7hizemzyQzYeq6b6g@mail.gmail.com/ Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/bd8b71bb13af21cc48af40349db440f794336d3a.1690535849.git.geert+renesas@glider.be
2023-07-28drm/gem-fb-helper: Consistenly use drm_dbg_kms()Geert Uytterhoeven1-2/+2
All debug messages in drm_gem_framebuffer_helper.c use drm_dbg_kms(), except for one, which uses drm_dbg(). Replace the outlier by drm_dbg_kms() to restore consistency. Fixes: c91acda3a380 ("drm/gem: Check for valid formats") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Maíra Canal <mcanal@igalia.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/7d56615fbef2d4d0e5f4c4a23f57269bf8bdb71f.1690535176.git.geert+renesas@glider.be
2023-07-28drm/atomic-helper: Update reference to drm_crtc_force_disable_all()Geert Uytterhoeven1-1/+1
drm_crtc_force_disable_all() was renamed to drm_helper_force_disable_all(), but one reference was not updated. Fixes: c2d88e06bcb9 ("drm: Move the legacy kms disable_all helper to crtc helpers") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/b8c9c1a8a05dbf0be8e8be98cfdeafa9cecd8cef.1690535002.git.geert+renesas@glider.be
2023-07-28drm/vkms: Fix race-condition between the hrtimer and the atomic commitMaíra Canal3-7/+15
Currently, it is possible for the composer to be set as enabled and then as disabled without a proper call for the vkms_vblank_simulate(). This is problematic, because the driver would skip one CRC output, causing CRC tests to fail. Therefore, we need to make sure that, for each time the composer is set as enabled, a composer job is added to the queue. In order to provide this guarantee, add a mutex that will lock before the composer is set as enabled and will unlock only after the composer job is added to the queue. This way, we can have a guarantee that the driver won't skip a CRC entry. This race-condition is affecting the IGT test "writeback-check-output", making the test fail and also, leaking writeback framebuffers, as the writeback job is queued, but it is not signaled. This patch avoids both problems. [v2]: * Create a new mutex and keep the spinlock across the atomic commit in order to avoid interrupts that could result in deadlocks. Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Arthur Grillo <arthurgrillo@riseup.net> Signed-off-by: Maíra Canal <mairacanal@riseup.net> Link: https://patchwork.freedesktop.org/patch/msgid/20230523123207.173976-1-mcanal@igalia.com
2023-07-28drm/vkms: Add support to 1D gamma LUTArthur Grillo4-1/+117
Support a 1D gamma LUT with interpolation for each color channel on the VKMS driver. Add a check for the LUT length by creating vkms_atomic_check(). Enable VKMS to run the test igt@kms_plane@pixel-format. Tested with: igt@kms_color@gamma igt@kms_color@legacy-gamma igt@kms_color@invalid-gamma-lut-sizes v2: - Add interpolation between the values of the LUT (Simon Ser) v3: - s/ratio/delta (Pekka) - s/color_channel/channel_value (Pekka) - s/lut_area/lut_channel - Store the `drm_color_lut`, `lut_length`, and `channel_value2index_ratio` inside a struct called `vkms_lut` (Pekka) - Pre-compute some constants values used through the LUT procedure (Pekka) - Change the switch statement to a cast to __u16* (Pekka) - Make the apply_lut_to_channel_value return the computation result (Pekka) v4: - Add a comment explaining that `enum lut_area` depends on the layout of `struct drm_color_lut` (Pekka) - Remove unused variable (kernel test robot) v5: - Mention that this will make it possible to run the test igt@kms_plane@pixel-format (Maíra) - s/had/has (Maíra) Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Maíra Canal <mairacanal@riseup.net> Signed-off-by: Maíra Canal <mairacanal@riseup.net> Link: https://patchwork.freedesktop.org/patch/msgid/20230709013835.161004-1-arthurgrillo@riseup.net
2023-07-27drm/tegra: sor: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230710032355.72914-16-frank.li@vivo.com
2023-07-27drm/tegra: hdmi: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230710032355.72914-5-frank.li@vivo.com
2023-07-27drm/tegra: dpaux: Fix incorrect return value of platform_get_irqYangtao Li1-1/+1
When platform_get_irq fails, we should return dpaux->irq instead of -ENXIO. Fixes: 6b6b604215c6 ("drm/tegra: Add eDP support") Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230710032355.72914-13-frank.li@vivo.com
2023-07-27drm/tegra: output: hdmi: Support bridge/connectorMaxim Schwalm1-11/+33
Some Tegra device-trees may specify a video output graph, which involves MHL bridge/simple bridge and/or connector framework. This patch adds support for the bridge/connector attached to the HDMI output, allowing us to model the hardware properly. Inspired by: 29efdc2 ("drm/tegra: output: rgb: Support LVDS encoder bridge") Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com> # ASUS TF T30 Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com> # ASUS P1801-T T30 Tested-by: Robert Eckelmann <longnoserob@gmail.com> # ASUS TF101 T20 Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # ASUS TF201 T30 Signed-off-by: Maxim Schwalm <maxim.schwalm@gmail.com> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230618085046.10081-2-clamor95@gmail.com
2023-07-27drm/tegra: Enable runtime PM during probeMikko Perttunen4-38/+28
Currently, engine drivers only enable runtime PM during the host1x init callback. This can happen slightly later than the probe, which can cause the power domain to intermittently not be turned off after probe. My hypothesis is that there is a race condition between the post-probe power domain poweroff that is done from a queued work, and the pm_runtime_enable call happening in the host1x init callback. If the pm_runtime_enable call happens first, everything is OK and the power off work can disable the power domain as PM runtime is enabled and the device is runtime suspended. If power off work runs first, PM runtime is still disabled for the device and the domain must be kept powered. Resolve the issue by moving the runtime PM enablement to the probe function. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230613095215.2497004-1-cyndis@kapsi.fi
2023-07-27drm/tegra: dpaux: Use devm_platform_ioremap_resource()Yang Li1-3/+1
Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230421084952.45275-1-yang.lee@linux.alibaba.com
2023-07-27gpu: host1x: Return error when context device not attached to IOMMUMikko Perttunen1-0/+8
If a context device was not attached to IOMMU, we kept the old success err value causing context devices to be unregistered but success to be returned. This would mean that things would go on but with context isolation disabled. To decide on an explicit behavior, let's return an error code here instead. If someone wants to go without IOMMU on a platform modern enough to support context isolation, they can remove the context devices from device tree. Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230413082202.114721-2-cyndis@kapsi.fi
2023-07-27drm/tegra: Add error check for NVDEC firmware memory allocationMikko Perttunen1-0/+2
The return value for tegra_drm_alloc was missing an error check. Add one. Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230413082202.114721-1-cyndis@kapsi.fi
2023-07-27drm/i915: Avoid -Wconstant-logical-operand in nsecs_to_jiffies_timeout()Nathan Chancellor1-1/+1
A proposed update to clang's -Wconstant-logical-operand to warn when the left hand side is a constant shows the following instance in nsecs_to_jiffies_timeout() when NSEC_PER_SEC is not a multiple of HZ, such as CONFIG_HZ=300: drivers/gpu/drm/i915/gem/i915_gem_wait.c:189:24: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] 189 | if (NSEC_PER_SEC % HZ && | ~~~~~~~~~~~~~~~~~ ^ drivers/gpu/drm/i915/gem/i915_gem_wait.c:189:24: note: use '&' for a bitwise operation 189 | if (NSEC_PER_SEC % HZ && | ^~ | & drivers/gpu/drm/i915/gem/i915_gem_wait.c:189:24: note: remove constant to silence this warning 1 warning generated. Turn this into an explicit comparison against zero to make the expression a boolean to make it clear this should be a logical check, not a bitwise one. Link: https://reviews.llvm.org/D142609 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Maíra Canal <mairacanal@riseup.net> Link: https://patchwork.freedesktop.org/patch/msgid/20230718-nsecs_to_jiffies_timeout-constant-logical-operand-v1-2-36ed8fc8faea@kernel.org
2023-07-27drm/v3d: Avoid -Wconstant-logical-operand in nsecs_to_jiffies_timeout()Nathan Chancellor1-1/+1
A proposed update to clang's -Wconstant-logical-operand to warn when the left hand side is a constant shows the following instance in nsecs_to_jiffies_timeout() when NSEC_PER_SEC is not a multiple of HZ, such as CONFIG_HZ=300: In file included from drivers/gpu/drm/v3d/v3d_debugfs.c:12: drivers/gpu/drm/v3d/v3d_drv.h:343:24: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] 343 | if (NSEC_PER_SEC % HZ && | ~~~~~~~~~~~~~~~~~ ^ drivers/gpu/drm/v3d/v3d_drv.h:343:24: note: use '&' for a bitwise operation 343 | if (NSEC_PER_SEC % HZ && | ^~ | & drivers/gpu/drm/v3d/v3d_drv.h:343:24: note: remove constant to silence this warning 1 warning generated. Turn this into an explicit comparison against zero to make the expression a boolean to make it clear this should be a logical check, not a bitwise one. Link: https://reviews.llvm.org/D142609 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Maíra Canal <mairacanal@riseup.net> Link: https://patchwork.freedesktop.org/patch/msgid/20230718-nsecs_to_jiffies_timeout-constant-logical-operand-v1-1-36ed8fc8faea@kernel.org
2023-07-27dt-bindings: display: panel: Document Hydis HV070WX2-1E0Thierry Reding1-0/+2
The Hydis HV070WX2-1E0 is a 7" WXGA (800x1280) TFT LCD LVDS panel that is one of the variants used on Google Nexus 7. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230726185010.2294709-2-thierry.reding@gmail.com
2023-07-27dt-bindings: display: panel: Move Chunghwa CLAA070WP03XG to LVDSThierry Reding2-2/+2
The Chunghwa CLAA070WP03XG is an LVDS panel, so move it to the correct bindings file. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230726185010.2294709-1-thierry.reding@gmail.com
2023-07-27dt-bindings: display: panel: Move HannStar HSD101PWW2 to LVDSThierry Reding2-2/+2
The HannStar HSD101PWW2 is an LVDS panel, so move it to the correct bindings file. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230726184857.2294570-1-thierry.reding@gmail.com
2023-07-27drm/ssd130x: Use shadow-buffer helpers when managing plane's stateJavier Martinez Canillas1-7/+9
The commit 45b58669e532 ("drm/ssd130x: Allocate buffer in the plane's .atomic_check() callback") moved the buffers allocation to be done in the primary plane's .atomic_check() callback. But it missed that since the driver uses a shadow-buffered plane, the __drm_gem_{reset,duplicate,destroy}_shadow_plane() helper functions must be used in the struct drm_plane_funcs handlers. This was missed because the mentioned commit did not remove the macro DRM_GEM_SHADOW_PLANE_FUNCS, which leads to the custom plane's atomic state management handlers to not be used. Fixes: 45b58669e532 ("drm/ssd130x: Allocate buffer in the plane's .atomic_check() callback") Reported-by: Arnd Bergmann <arnd@arndb.de> Closes: https://lore.kernel.org/dri-devel/20230727122412.2464210-1-arnd@kernel.org Suggested-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230727140453.577445-1-javierm@redhat.com
2023-07-27dma-buf: Fix the typo in DMA-BUF statistics docLuc Ma1-1/+1
The kernel-doc for DMA-BUF statistics mentions /sys/kernel/dma-buf/buffers but the correct path is /sys/kernel/dmabuf/buffers instead. Signed-off-by: Luc Ma <luc@sietium.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/64b6749a.170a0220.3acab.2af9@mx.google.com Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com>
2023-07-26drm/ssd130x: Allocate buffer in the plane's .atomic_check() callbackJavier Martinez Canillas2-40/+121
Drivers are not allowed to fail after drm_atomic_helper_swap_state() has been called and the new atomic state is stored into the current sw state. Since the struct ssd130x_device .data_array is allocated in the encoder's .atomic_enable callback, the operation can fail and this is after the new state has been stored. So it can break an atomic mode settings assumption. Fix this by having custom helpers to allocate, duplicate and destroy the plane state, that will take care of allocating and freeing these buffers. Suggested-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Maxime Ripard <mripard@kernel.org> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230726105433.389740-2-javierm@redhat.com
2023-07-26drm/ssd130x: Inline the ssd130x_buf_{alloc, free}() function helpersJavier Martinez Canillas1-35/+20
There is only a single caller for both helper functions and these don't do much other than allocate and free two buffers, so let's just inline them. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230726105433.389740-1-javierm@redhat.com
2023-07-25drm/ast: Do not enable PCI resources multiple timesThomas Zimmermann1-21/+0
Remove ast_init_pci_config() as the ast driver already enables the PCI resources by calling pcim_enable_device(). Suggested-by: Sui Jingfeng <suijingfeng@loongson.cn> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Tested-by: Sui Jingfeng <suijingfeng@loongson.cn> Link: https://patchwork.freedesktop.org/patch/msgid/20230712130826.3318-1-tzimmermann@suse.de
2023-07-24drm/panel: ld9040: add backlight Kconfig dependencyArnd Bergmann1-0/+1
The driver now uses the backlight interface, which breaks when that is disabled: ld.lld: error: undefined symbol: devm_backlight_device_register Enforce the necessary Kconfig dependency to avoid this. Fixes: c2268daa65fb ("drm/panel: ld9040: Register a backlight device") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://patchwork.freedesktop.org/patch/msgid/20230724121736.1293270-1-arnd@kernel.org
2023-07-24fbdev: Harmonize some comments in <linux/fb.h>Thomas Zimmermann1-10/+2
Make the comments for I/O, system and DMA memory say the same. Makes the header file's structure more obvious. Suggested-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-13-tzimmermann@suse.de
2023-07-24fbdev: Remove FB_DEFAULT_SYS_OPSThomas Zimmermann1-8/+0
Remove the initializer macro FB_DEFAULT_SYS_OPS and its helper macro __FB_DEFAULT_SYS_OPS_MMAP. There are no users. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Maxime Ripard <mripard@kernel.org> Cc: Helge Deller <deller@gmx.de> (maintainer:FRAMEBUFFER LAYER) Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-12-tzimmermann@suse.de
2023-07-24drm/omapdrm: Set fbdev FBINFO_VIRTFB flagThomas Zimmermann1-0/+1
Mark the framebuffer with FBINFO_VIRTFB. The framebuffer range is in DMA-able memory and should be accessed with the CPU's regular memory ops. v2: * drop FBINFO_DEFAULT Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Maxime Ripard <mripard@kernel.org> Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-11-tzimmermann@suse.de
2023-07-24drm/omapdrm: Use GEM mmap for fbdev emulationThomas Zimmermann2-3/+14
The fbdev emulation currently uses fbdev's default mmap code, which has been written for I/O memory. Provide an mmap that uses GEM's mmap infrastructure. Utilize fine-grained fbdev macros to initialize struct fb_ops. The macros set the read/write and the draw callbacks for DMA memory. Set the fb_mmap callback to omapdrm's new mmap helper. Also select the correct Kconfig token for fbdev's DMA helpers. Note that the DMA helpers are the same as for system memory. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Maxime Ripard <mripard@kernel.org> Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-10-tzimmermann@suse.de
2023-07-24drm/omapdrm: Set VM flags in GEM-object mmap functionThomas Zimmermann4-38/+8
Use the mmap callback in struct drm_gem_object_funcs to set the VM flags. Replace a number of mmap helpers in omapdrm with their GEM helper counterparts. Generate DRM's file-operations instance with GEM's DEFINE_DRM_GEM_FOPS. The omapdrm driver uses DRM's drm_gem_mmap() helper to prepare the VMA structure. It then modifies the resulting VMA state in its own helper omap_gem_mmap_obj(). The patch improves this by setting up the VMA in the mmap callback in drm_gem_object_funcs, which is called from within drm_gem_mmap(). Omapdrm's omap_gem_mmap() and omap_gem_mmap() can then be removed from the driver. A call to drm_gem_mmap() is sufficient for the mmap operation. Finally, with the omap functions gone, the drivers file_ops in omapdriver_fops can be generated with DEFINE_DRM_GEM_FOPS, which sets DRM's default helpers. v2: * detailed commit message (Javier) * do not set VM_PFNMAP Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Maxime Ripard <mripard@kernel.org> Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-9-tzimmermann@suse.de
2023-07-24drm/exynos: Set fbdev FBINFO_VIRTFB flagThomas Zimmermann1-0/+1
Mark the framebuffer with FBINFO_VIRTFB. The framebuffer range is in DMA-able memory and should be accessed with the CPU's regular memory ops. v2: * drop FBINFO_FLAG_DEFAULT Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by : Inki Dae <inki.dae@samsung.com> Acked-by: Maxime Ripard <mripard@kernel.org> Cc: Inki Dae <inki.dae@samsung.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Cc: Alim Akhtar <alim.akhtar@samsung.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-8-tzimmermann@suse.de
2023-07-24drm/exynos: Use fbdev DMA helpersThomas Zimmermann2-3/+3
Use fbdev's DMA helpers for fbdev emulation. The driver previously used the I/O-memory helpers, while allocating DMA-able system memory. This could (in theory) result in bus errors from accessing the memory range. This bug has been present since the exynos driver was first added. v2: * drop the pointless Fixes tag (Javier) * fix typo in commit message Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Maxime Ripard <mripard@kernel.org> Cc: Inki Dae <inki.dae@samsung.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Cc: Alim Akhtar <alim.akhtar@samsung.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-7-tzimmermann@suse.de