aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-08-01drm/panel: sitronix-st7789v: Use 9 bits per spi word by defaultMiquel Raynal1-1/+5
The Sitronix controller expects 9-bit words, provide this as default at probe time rather than specifying this in each and every access. Signed-off-by: Miquel Raynal <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Maxime Ripard <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Tested-by: Sebastian Reichel <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01dt-bindings: display: st7789v: bound the number of Rx data linesMiquel Raynal1-0/+4
The ST7789V LCD controller supports regular SPI wiring, as well as no Rx data line at all. The operating system needs to know whether it can read registers from the device or not. Let's detail this specific design possibility by bounding the spi-rx-bus-width property. Signed-off-by: Miquel Raynal <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Tested-by: Sebastian Reichel <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01dt-bindings: display: st7789v: Add the edt,et028013dma panel compatibleMiquel Raynal1-0/+1
The ST7789V LCD controller is also embedded in the ET028013DMA panel. Add a compatible string to describe this other panel. Signed-off-by: Miquel Raynal <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Acked-by: Maxime Ripard <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: add Inanbo T28CP45TN89 supportSebastian Reichel1-0/+25
UNI-T UTi260b has a Inanbo T28CP45TN89 v17 panel. I could not find proper documentation for the panel apart from a technical drawing, but according to the vendor U-Boot it is based on a Sitronix st7789v chip. I generated the init sequence by modifying the default one until proper graphics output has been seen on the device. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: avoid hardcoding polarity infoSebastian Reichel1-4/+18
Add polarity information via mode and bus flags, so that they are no longer hardcoded and forward the information to the DRM stack. This is required for adding panels with different settings. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: avoid hardcoding invert modeSebastian Reichel1-1/+9
While the default panel uses invert mode, some panels require non-invert mode instead. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: add media bus formatSebastian Reichel1-3/+23
Add support for describing the media bus format in the panel configuration and expose that to userspace. Since both supported formats (RGB565 and RGB666) are using 6 bits per color also hardcode that information. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: avoid hardcoding panel sizeSebastian Reichel1-2/+4
Move the panel size information to the mode struct, so that different panel sizes can be specified depending on the panel type. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: avoid hardcoding mode infoSebastian Reichel1-6/+18
Avoid hard-coding the default_mode and supply it from match data. One additional layer of abstraction has been introduced, which will be needed for specifying other panel information (e.g. bus flags) in the next steps. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: improve error handlingSebastian Reichel1-11/+12
Improve error handling in the probe routine, so that probe defer errors are captured in /sys/kernel/debug/devices_deferred Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: simplify st7789v_spi_writeSebastian Reichel1-5/+1
st7789v_spi_write initializes a message with just a single transfer, spi_sync_transfer can be used for that. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: make reset GPIO optionalSebastian Reichel1-1/+1
The reset pin might not be software controllable from the SoC, so make it optional. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: remove unused constantsSebastian Reichel1-3/+0
ST7789V_COLMOD_RGB_FMT_18BITS and ST7789V_COLMOD_CTRL_FMT_18BITS are unused in favour of MIPI_DCS_PIXEL_FMT_18BIT, remove them. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/panel: sitronix-st7789v: add SPI ID tableSebastian Reichel1-0/+7
SPI device drivers should also have a SPI ID table. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01dt-bindings: display: st7789v: add Inanbo T28CP45TN89Sebastian Reichel1-2/+3
Add compatible value for Inanbo t28cp45tn89 and make reset GPIO non mandatory, since it might not be connected to the CPU. Reviewed-by: Michael Riesch <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01dt-bindings: vendor-prefixes: add InanboSebastian Reichel1-0/+2
Shenzhen INANBO Electronic Technology Co., Ltd. manufacturers TFT/OLED LCD panels. Reviewed-by: Michael Riesch <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/tests: Alloc drm_device on drm_exec testsArthur Grillo1-7/+37
The drm_exec tests where crashing[0] because of a null dereference. This is caused by a new access of the `driver` attribute of `struct drm_driver` on drm_gem_private_object_init(). Alloc the drm_device to fix that. [0] [15:05:24] ================== drm_exec (6 subtests) =================== [15:05:24] [PASSED] sanitycheck ^CERROR:root:Build interruption occurred. Cleaning console. [15:05:50] [ERROR] Test: drm_exec: missing expected subtest! [15:05:50] BUG: kernel NULL pointer dereference, address: 00000000000000b0 [15:05:50] #PF: supervisor read access in kernel mode [15:05:50] #PF: error_code(0x0000) - not-present page [15:05:50] PGD 0 P4D 0 [15:05:50] Oops: 0000 [#1] PREEMPT NOPTI [15:05:50] CPU: 0 PID: 23 Comm: kunit_try_catch Tainted: G N 6.4.0-rc7-02032-ge6303f323b1a #69 [15:05:50] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc37 04/01/2014 [15:05:50] RIP: 0010:drm_gem_private_object_init+0x60/0xc0 Fixes: e6303f323b1a ("drm: manager to keep track of GPUs VA mappings") Signed-off-by: Arthur Grillo <[email protected]> Tested-by: Danilo Krummrich <[email protected]> Acked-by: Danilo Krummrich <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/i915: Add function to clear scanout flag for vmasJouni Högander3-7/+23
Currently frontbuffer tracking code is directly iterating over object vmas and clearing scanout flags for them. Add function to clear scanout flag for vmas and use it from frontbuffer tracking code. v2: describe function parameter. Signed-off-by: Jouni Högander <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/i915/display: Remove i915_gem_object_types.h from intel_frontbuffer.hJouni Högander1-1/+0
Now as we have removed all the references to internals of i915_gem_object from the frontbuffer header we can also remove including i915_gem_object_types.h. Signed-off-by: Jouni Högander <[email protected]> Reviewed-by: Jeevan B <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/i915: Add getter/setter for i915_gem_object->frontbufferJouni Högander5-43/+77
Add getter/setter for i915_gem_object->frontbuffer and use it instead of directly touching i915_gem_object->frontbuffer frontbuffer pointer. v3: - Fix intel_frontbuffer_get return value - s/front_ret/cur/ v2: Move getter/setter into i915_gem_object.h Signed-off-by: Jouni Högander <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/i915: Add macros to get i915 device from i915_gem_objectJouni Högander2-9/+12
We want to stop touching directly i915_gem_object struct members in intel_frontbuffer code. As a part of this we add helper macro to get i915 device from i915_gem_object. v2: operate on and return pointer in defined macros Signed-off-by: Jouni Högander <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-08-01drm/virtio: Support sync objectsDmitry Osipenko3-2/+241
Add sync object DRM UAPI support to VirtIO-GPU driver. Sync objects support is needed by native context VirtIO-GPU Mesa drivers, it also will be used by Venus and Virgl contexts. Reviewed-by; Emil Velikov <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Tested-by: Pierre-Eric Pelloux-Prayer <[email protected]> # amdgpu nctx Tested-by: Rob Clark <[email protected]> # freedreno nctx Reviewed-by: Rob Clark <[email protected]> Acked-by: Gurchetan Singh <[email protected]> Acked-by: Gerd Hoffmann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm/i915/huc: fix intel_huc.c doc bulleted list format errorDavid Reaver1-0/+2
Fix the following make htmldocs errors/warnings: ./drivers/gpu/drm/i915/gt/uc/intel_huc.c:29: ERROR: Unexpected indentation. ./drivers/gpu/drm/i915/gt/uc/intel_huc.c:30: WARNING: Block quote ends without a blank line; unexpected unindent. ./drivers/gpu/drm/i915/gt/uc/intel_huc.c:35: WARNING: Bullet list ends without a blank line; unexpected unindent. This output is a bit misleading. The real issue here is we need a blank line before and after the bulleted list. Link: https://www.kernel.org/doc/html/latest/gpu/i915.html#huc Link: https://lore.kernel.org/dri-devel/[email protected]/ Signed-off-by: David Reaver <[email protected]> Reviewed-by: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31fbdev: Align deferred I/O with naming of helpersThomas Zimmermann9-26/+26
Deferred-I/O generator macros generate callbacks for struct fb_ops that operate on memory ranges in I/O address space or system address space. Rename the macros to use the _IOMEM_ and _SYSMEM_ infixes of their underlying helpers. Adapt all users. No functional changes. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31fbdev: Use _DMAMEM_ infix for DMA-memory helpersThomas Zimmermann10-15/+15
Change the infix for fbdev's DMA-memory helpers from _DMA_ to _DMAMEM_. The helpers perform operations within DMA-able memory, but they don't perform DMA operations. Naming should make this clear. Adapt all users. No functional changes. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31fbdev: Use _SYSMEM_ infix for system-memory helpersThomas Zimmermann5-12/+12
Change the infix for fbdev's system-memory helpers from _SYS_ to _SYSMEM_. The helpers perform operations within system memory, but not on the state of the operating system itself. Naming should make this clear. Adapt all users. No functional changes. Suggested-by: Helge Deller <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31fbdev: Use _IOMEM_ infix for I/O-memory helpersThomas Zimmermann9-16/+16
Change the infix for fbdev's I/O-memory helpers from _IO_ to _IOMEM_ to distiguish them from other types of I/O, such as file operations. The helpers operate on memory ranges in the I/O address space and the naming should make this clear. Adapt all users. No functional changes. Suggested-by: Helge Deller <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm/panel: simple: Add missing connector type and pixel format for AUO T215HVN01Marek Vasut1-1/+3
The connector type and pixel format are missing for this panel, add them to prevent various drivers from failing to determine either of those parameters. Fixes: 7ee933a1d5c4 ("drm/panel: simple: Add support for AUO T215HVN01") Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm/panel: Support for startek-kd070fhfid015 MIPI-DSI panelGuillaume La Roque3-0/+418
This driver support the Startek KD070FHFID015, which is a 7-inch TFT LCD display using MIPI DSI interface. Signed-off-by: Guillaume La Roque <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Alexandre Mergnat <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31dt-bindings: display: panel: add startek kd070fhfid015 supportAlexandre Mergnat1-0/+69
The Startek KD070FHFID015 is a 7-inch TFT LCD display with a resolution of 1024 x 600 pixels. Reviewed-by: Conor Dooley <[email protected]> Signed-off-by: Alexandre Mergnat <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm/panel: ilitek-ili9881c: Add TDO TL050HDV35 LCD panelMatus Gajdos1-0/+194
Add support for TDO TL050HDV35-H1311A LCD panel. Signed-off-by: Matus Gajdos <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31dt-bindings: ili9881c: Add TDO TL050HDV35 LCD panelMatus Gajdos1-0/+1
Add support for TDO TL050HDV35-H1311A LCD panel. Signed-off-by: Matus Gajdos <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm: panel: simple: specify bpc for powertip_ph800480t013_idf02Dmitry Baryshkov1-0/+1
Specify bpc value for the powertip_ph800480t013_idf02 panel to stop drm code from complaining about unexpected bpc value (0). Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm/panel: r66451: select CONFIG_DRM_DISPLAY_DP_HELPERArnd Bergmann1-0/+2
The newly added driver only builds when DRM_DISPLAY_DP_HELPER is enabled: x86_64-linux-ld: drivers/gpu/drm/panel/panel-visionox-r66451.o: in function `visionox_r66451_enable': panel-visionox-r66451.c:(.text+0x105): undefined reference to `drm_dsc_pps_payload_pack' Select both CONFIG_DRM_DISPLAY_DP_HELPER and CONFIG_DRM_DISPLAY_HELPER to ensure the helper function is always available. Fixes: a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Jessica Zhang <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm/vc4: tests: pv-muxing: Document test scenarioMaxime Ripard1-0/+22
We've had a couple of tests that weren't really obvious, nor did they document what they were supposed to test. Document that to make it hopefully more obvious. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/vc4: tests: Switch to atomic state allocation helperMaxime Ripard1-47/+8
Now that we have a helper that takes care of an atomic state allocation and cleanup, we can migrate to it to simplify our tests. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/vc4: tests: pv-muxing: Switch to managed locking initMaxime Ripard1-23/+19
The new helper to init the locking context allows to remove some boilerplate. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/vc4: tests: mock: Use a kunit action to unregister DRM deviceMaxime Ripard2-6/+12
The *_mock_device functions allocate a DRM device that needs to be released using drm_dev_unregister. Now that we have a kunit release action API, we can switch to it and don't require any kind of garbage collection from the caller. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/vc4: tests: pv-muxing: Remove call to drm_kunit_helper_free_device()Maxime Ripard1-4/+0
Calling drm_kunit_helper_free_device() to clean up the resources allocated by drm_kunit_helper_alloc_device() is now optional and not needed in most cases. Remove it. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/tests: helpers: Create a helper to allocate an atomic stateMaxime Ripard2-0/+51
As we gain more tests, boilerplate to allocate an atomic state and free it starts to be there more and more as well. In order to reduce the allocation boilerplate, we can create a helper to create that atomic state, and call an action when the test is done. This will also clean up the exit path. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/tests: helpers: Create a helper to allocate a locking ctxMaxime Ripard2-0/+43
As we get more and more tests, the locking context initialisation creates more and more boilerplate, both at creation and destruction. Let's create a helper that will allocate, initialise a context, and register kunit actions to clean up once the test is done. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/tests: probe-helper: Remove call to drm_kunit_helper_free_device()Maxime Ripard1-8/+0
Calling drm_kunit_helper_free_device() to clean up the resources allocated by drm_kunit_helper_alloc_device() is now optional and not needed in most cases. Remove it. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/tests: modes: Remove call to drm_kunit_helper_free_device()Maxime Ripard1-8/+0
Calling drm_kunit_helper_free_device() to clean up the resources allocated by drm_kunit_helper_alloc_device() is now optional and not needed in most cases. Remove it. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/tests: client-modeset: Remove call to drm_kunit_helper_free_device()Maxime Ripard1-8/+0
Calling drm_kunit_helper_free_device() to clean up the resources allocated by drm_kunit_helper_alloc_device() is now optional and not needed in most cases. Remove it. Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/tests: helpers: Switch to kunit actionsMaxime Ripard1-4/+50
Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2023-07-31drm/i915: Fix premature release of request's reusable memoryJanusz Krzysztofik2-29/+81
Infinite waits for completion of GPU activity have been observed in CI, mostly inside __i915_active_wait(), triggered by igt@gem_barrier_race or igt@perf@stress-open-close. Root cause analysis, based of ftrace dumps generated with a lot of extra trace_printk() calls added to the code, revealed loops of request dependencies being accidentally built, preventing the requests from being processed, each waiting for completion of another one's activity. After we substitute a new request for a last active one tracked on a timeline, we set up a dependency of our new request to wait on completion of current activity of that previous one. While doing that, we must take care of keeping the old request still in memory until we use its attributes for setting up that await dependency, or we can happen to set up the await dependency on an unrelated request that already reuses the memory previously allocated to the old one, already released. Combined with perf adding consecutive kernel context remote requests to different user context timelines, unresolvable loops of await dependencies can be built, leading do infinite waits. We obtain a pointer to the previous request to wait upon when we substitute it with a pointer to our new request in an active tracker, e.g. in intel_timeline.last_request. In some processing paths we protect that old request from being freed before we use it by getting a reference to it under RCU protection, but in others, e.g. __i915_request_commit() -> __i915_request_add_to_timeline() -> __i915_request_ensure_ordering(), we don't. But anyway, since the requests' memory is SLAB_FAILSAFE_BY_RCU, that RCU protection is not sufficient against reuse of memory. We could protect i915_request's memory from being prematurely reused by calling its release function via call_rcu() and using rcu_read_lock() consequently, as proposed in v1. However, that approach leads to significant (up to 10 times) increase of SLAB utilization by i915_request SLAB cache. Another potential approach is to take a reference to the previous active fence. When updating an active fence tracker, we first lock the new fence, substitute a pointer of the current active fence with the new one, then we lock the substituted fence. With this approach, there is a time window after the substitution and before the lock when the request can be concurrently released by an interrupt handler and its memory reused, then we may happen to lock and return a new, unrelated request. Always get a reference to the current active fence first, before replacing it with a new one. Having it protected from premature release and reuse, lock it and then replace with the new one but only if not yet signalled via a potential concurrent interrupt nor replaced with another one by a potential concurrent thread, otherwise retry, starting from getting a reference to the new current one. Adjust users to not get a reference to the previous active fence themselves and always put the reference got by __i915_active_fence_set() when no longer needed. v3: Fix lockdep splat reports and other issues caused by incorrect use of try_cmpxchg() (use (cmpxchg() != prev) instead) v2: Protect request's memory by getting a reference to it in favor of delegating its release to call_rcu() (Chris) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8211 Fixes: df9f85d8582e ("drm/i915: Serialise i915_active_fence_set() with itself") Suggested-by: Chris Wilson <[email protected]> Signed-off-by: Janusz Krzysztofik <[email protected]> Cc: <[email protected]> # v5.6+ Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm/bridge: fix -Wunused-const-variable= warningZhu Wang6-8/+6
When building with W=1, the following warning occurs. drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:48:17: warning: ‘anx781x_i2c_addresses’ defined but not used [-Wunused-const-variable=] static const u8 anx781x_i2c_addresses[] = { ^~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:40:17: warning: ‘anx7808_i2c_addresses’ defined but not used [-Wunused-const-variable=] static const u8 anx7808_i2c_addresses[] = { When CONFIG_IO is disabled, above two variables are not used, since the place where it is used is inclueded in the macro CONFIG_OF. Even for drivers that do not depend on CONFIG_OF, it's almost always better to leave out the of_match_ptr(), since the only thing it can possibly do is to save a few bytes of .text if a driver can be used both with and without it. Hence we remove all of_match_ptr() used in other places. Fixes: 0647e7dd3f7a ("drm/bridge: Add Analogix anx78xx support") Signed-off-by: Zhu Wang <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Robert Foss <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2023-07-31drm/ssd130x: clean up some inconsistent indentingJiapeng Chong1-1/+1
No functional modification involved. drivers/gpu/drm/solomon/ssd130x.c:715 ssd130x_primary_plane_duplicate_state() warn: inconsistent indenting. Reported-by: Abaci Robot <[email protected]> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6034 Signed-off-by: Jiapeng Chong <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> 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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ad4a2f1f9fa7da083132f6c35469c77a3f9e2f0e.1689779916.git.geert+renesas@glider.be